/*
 * JSMin
 * Javascript Compressor
 * http://www.crockford.com/
 * http://www.smallsharptools.com/Projects/Packer/
*/

// wwwroot\Scripts\Survey.js

function ToggleValue(sFormName,sValueName,sSetValue)
{var oForm;var nFieldIndex;var oField;var sValueId;var oValue;oForm=document.forms[sFormName];for(nFieldIndex=0;nFieldIndex<oForm.elements.length;nFieldIndex++)
{oField=oForm.elements[nFieldIndex];if(oField.name==sValueName)
{if(oField.type=='checkbox')
{if(oField.value==sSetValue)
{ToggleEntry(oField.id);}}
else
{SetEntry(oField.id,oField.value==sSetValue);}}}}
function ToggleEntry(sValueId)
{SetEntry(sValueId,!document.getElementById(sValueId).checked);}
function SetEntry(sValueId,bNewValue)
{document.getElementById(sValueId).checked=bNewValue;if(bNewValue)
{document.getElementById(sValueId+'up').style.display='none';document.getElementById(sValueId+'down').style.display='';}
else
{document.getElementById(sValueId+'down').style.display='none';document.getElementById(sValueId+'up').style.display='';}}
// wwwroot\Scripts\Common.Js

var pendingUpdates=false;function SafeAttachEvent(oElement,sEvent,pResult){if(oElement.addEventListener){oElement.addEventListener(sEvent,pResult,false);}else if(oElement.attachEvent){oElement.attachEvent('on'+sEvent,pResult);}}
function SafeDetachEvent(oElement,sEvent,pResult){if(oElement.removeEventListener){oElement.removeEventListener(sEvent,pResult,false);}else if(oElement.detachEvent){oElement.detachEvent('on'+sEvent,pResult);}}
function ResizePlayer(iWidth,iHeight){var oVideoContainer;oVideoContainer=document.getElementById('videoContainer');if(oVideoContainer){oVideoContainer.style.width=iWidth+'px';oVideoContainer.style.height=iHeight+'px';oVideoContainer.style.display='block';}}
function ExpandSelection(oOldSelection){var oSelection=oOldSelection.duplicate();var oFoundElement=null;var oElement;var iIndex=0;oElement=oSelection.parentElement();while(iIndex<25&&oElement!=null){iIndex++;switch(oElement.tagName.toLowerCase()){case'div':case'span':case'p':oElement=null;break;default:oFoundElement=oElement;oElement=oElement.parentElement;oSelection.moveToElementText(oFoundElement);break;}}
if(oFoundElement!=null){return(oSelection);}
return(oOldSelection);}
function ApplyStyle(tagName,sClassName){var oSelection;var oWasFocused;oSelection=document.selection.createRange();oWasFocused=document.getElementById(document.getElementById('FocusedElement').value);if(oSelection){var snewText;oSelection=ExpandSelection(oSelection);if(0<sClassName.length){snewText='<'+tagName+' class="'+sClassName+'">'+oSelection.text+'</'+tagName+'>';}
else{snewText='<'+tagName+'>'+oSelection.text+'</'+tagName+'>';}
oSelection.select();document.execCommand('Delete');oSelection.pasteHTML(snewText);}
if(oWasFocused){oWasFocused.fireEvent('onkeyup');}}
function UnloadTrigger(stopPop){if(pendingUpdates){window.event.returnValue=confirm('Your changes will be lost if you navigate away.\\r\\nClick Cancel, then the save button to prevent this.');}}
function ShowSave(){var saveActive=document.getElementById('SaveChangesActive');var saveInactive=document.getElementById('SaveChanges');if(saveActive&&saveInactive&&saveActive.style.display=='none'){saveActive.style.display='inline';saveInactive.style.display='none';pendingUpdates=true;}}
function ToggleStyle(sAction){if(document.execCommand!=undefined&&document.queryCommandEnabled!=undefined&&document.queryCommandEnabled(sAction)){document.execCommand(sAction);UpdateFocused();}}
function ToggleStyle(sAction,sParameter){if(document.execCommand!=undefined&&document.queryCommandEnabled!=undefined&&document.queryCommandEnabled(sAction)){document.execCommand(sAction,false,sParameter);UpdateFocused();}}
function UpdateFocused(){if(document.getElementById('FocusedElement')){var oWasFocused;oWasFocused=document.getElementById(document.getElementById('FocusedElement').value);if(oWasFocused){oWasFocused.fireEvent("onkeyup");}}}
function FocusedElement(sElementId){document.getElementById('FocusedElement').value=sElementId;}
function UpdateButton(iFeaturesAvailable,sButtonId,iFeaturesSupported){var buttonActive=document.getElementById(sButtonId+'Active');var buttonInactive=document.getElementById(sButtonId);if(buttonActive){if(iFeaturesSupported==0||0<(iFeaturesAvailable&iFeaturesSupported)){buttonActive.style.display='inline';if(buttonInactive){buttonInactive.style.display='none';}}
else{buttonActive.style.display='none';if(buttonInactive){buttonInactive.style.display='inline';}}}}
function ValidateDayMonth(prefix){var curDays;curDays=Number(document.getElementById(prefix+'day').value);if(28<curDays){var maxDays;switch(document.getElementById(prefix+'month').value){case'4':case'6':case'9':case'11':maxDays=30;break;case'2':var year;year=Number(document.getElementById(prefix+'year').value);maxDays=year%4==0?29:28;break;default:maxDays=31;break;}
if(maxDays<curDays){var maxDays;document.getElementById(prefix+'day').value=maxDays;}}
return true;}
function ClearDefault(elementId,defaultValue){var element=document.getElementById(elementId);if(element.value==defaultValue){element.value=''}}
function StandardPopup(sWindowName,sUrl){CustomPopup(sWindowName,sUrl,520,500);}
function CustomPopup(sWindowName,sUrl,iWidth,iHeight){oPopup=window.open(EscapeURL(sUrl),sWindowName,'width='+iWidth+',height='+iHeight+',scrollbars');if(oPopup){oPopup.opener=window;oPopup.window.focus();}}
function NewWindow(sWindowName,sUrl){oPopup=window.open(EscapeURL(sUrl),sWindowName,'location=yes,directories=yes,menubar=yes,resizable=yes,status=yes,toolbar=yes,scrollbars=yes');if(oPopup){oPopup.opener=window;oPopup.window.focus();}}
function EscapeURL(sUrl){var iQuestPos=sUrl.indexOf('?');if(0<=iQuestPos){var sAnswer;var sRemainder;var sSeparator;var iAmpPos;sAnswer=sUrl.substr(0,iQuestPos+1);sRemainder=sUrl.substr(iQuestPos+1);sSeparator='';iAmpPos=sRemainder.indexOf('&');while(0<=iAmpPos){sAnswer=sAnswer+sSeparator+EscapeParameter(sRemainder.substr(0,iAmpPos));sRemainder=sRemainder.substr(iAmpPos+1);iAmpPos=sRemainder.indexOf('&');sSeparator='&';}
sAnswer=sAnswer+sSeparator+EscapeParameter(sRemainder);return sAnswer;}
return sUrl;}
function EscapeParameter(sParameter){var iEqPos=sParameter.indexOf('=');if(0<=iEqPos){return sParameter.substr(0,iEqPos+1)+encodeURIComponent(sParameter.substr(iEqPos+1));}
return sParameter;}
function UpdateImage(imageId){var oImage;oImage=document.getElementById(imageId);if(oImage){oImage.src=document.getElementById('txt'+imageId+'path').value;oImage.width=document.getElementById('lng'+imageId+'width').value;oImage.height=document.getElementById('lng'+imageId+'height').value;}}
function SelectImage(url,controlId,category,maxWidth,maxHeight){StandardPopup('SelectImage',url+'?controlId='+controlId+'&cat='+category+'&width='+maxWidth+'&height='+maxHeight);}
// wwwroot\Scripts\Login.Js

var oForm;var oTimeout;var oThankYou;var oTooManyLogins;var vTimeoutID;var dStartDate;var iTimeLimit;var iInterval;$(document).ready(function(){LoginFormLoad();});function LoginFormLoad()
{oForm=document.getElementById('LoginFormContainer');if(oForm!=null){oTimeout=document.getElementById('LoginTimeoutContainer');oThankYou=document.getElementById('LoginThankYouContainer');oTooManyLogins=document.getElementById('LoginTooManyContainer');dStartDate=new Date();iTimeLimit=Number(document.getElementById('TimeLimit').value)*1000;iInterval=Number(document.getElementById('CountInterval').value)*1000;document.forms.LoginForm.LoginUserName.focus();UpdateCountdown(dStartDate);}}
function LoginCountdown()
{var dNow=new Date();if((dNow-dStartDate)<iTimeLimit)
{UpdateCountdown(dNow);}
else
{if(oForm!=null)
{oForm.style.display='none';}
if(oTimeout!=null)
{oTimeout.style.display='';}
if(oThankYou!=null)
{oThankYou.style.display='none';}
if(oTooManyLogins!=null)
{oTooManyLogins.style.display='none';}}}
function UpdateCountdown(dNow)
{var oCountdown=document.getElementById('LoginCountDown');if(oCountdown!=null)
{oCountdown.value=Math.round(((dStartDate-dNow)+iTimeLimit)/1000);}
vTimeoutID=window.setTimeout('LoginCountdown();',iInterval);}
function PreLogin()
{var dNow=new Date();if((dNow-dStartDate)<iTimeLimit)
{var sPartResponse;document.forms.LoginForm.LoginResponse.value=b64_sha1(document.forms.LoginForm.LoginChallenge.value+':'+b64_sha1(document.forms.LoginForm.LoginUserName.value.toLowerCase()+':'+document.forms.LoginForm.LoginPassword.value.toLowerCase()));document.forms.LoginForm.LoginUserName.value='';document.forms.LoginForm.LoginPassword.value='';document.forms.LoginForm.LoginChallenge.value='';if(oForm!=null)
{oForm.style.display='none';}
if(oTimeout!=null)
{oTimeout.style.display='none';}
if(oThankYou!=null)
{oThankYou.style.display='';}
if(oTooManyLogins!=null)
{oTooManyLogins.style.display='none';}
return document.forms.LoginForm.LoginPassword.value.length==0;}
else
{return false;}}
// wwwroot\Scripts\sha1.Js

var hexcase=0;var b64pad="";var chrsz=8;function hex_sha1(s){return binb2hex(core_sha1(str2binb(s),s.length*chrsz));}
function b64_sha1(s){return binb2b64(core_sha1(str2binb(s),s.length*chrsz));}
function str_sha1(s){return binb2str(core_sha1(str2binb(s),s.length*chrsz));}
function hex_hmac_sha1(key,data){return binb2hex(core_hmac_sha1(key,data));}
function b64_hmac_sha1(key,data){return binb2b64(core_hmac_sha1(key,data));}
function str_hmac_sha1(key,data){return binb2str(core_hmac_sha1(key,data));}
function sha1_vm_test()
{return hex_sha1("abc")=="a9993e364706816aba3e25717850c26c9cd0d89d";}
function core_sha1(x,len)
{x[len>>5]|=0x80<<(24-len%32);x[((len+64>>9)<<4)+15]=len;var w=Array(80);var a=1732584193;var b=-271733879;var c=-1732584194;var d=271733878;var e=-1009589776;for(var i=0;i<x.length;i+=16)
{var olda=a;var oldb=b;var oldc=c;var oldd=d;var olde=e;for(var j=0;j<80;j++)
{if(j<16)w[j]=x[i+j];else w[j]=rol(w[j-3]^w[j-8]^w[j-14]^w[j-16],1);var t=safe_add(safe_add(rol(a,5),sha1_ft(j,b,c,d)),safe_add(safe_add(e,w[j]),sha1_kt(j)));e=d;d=c;c=rol(b,30);b=a;a=t;}
a=safe_add(a,olda);b=safe_add(b,oldb);c=safe_add(c,oldc);d=safe_add(d,oldd);e=safe_add(e,olde);}
return Array(a,b,c,d,e);}
function sha1_ft(t,b,c,d)
{if(t<20)return(b&c)|((~b)&d);if(t<40)return b^c^d;if(t<60)return(b&c)|(b&d)|(c&d);return b^c^d;}
function sha1_kt(t)
{return(t<20)?1518500249:(t<40)?1859775393:(t<60)?-1894007588:-899497514;}
function core_hmac_sha1(key,data)
{var bkey=str2binb(key);if(bkey.length>16)bkey=core_sha1(bkey,key.length*chrsz);var ipad=Array(16),opad=Array(16);for(var i=0;i<16;i++)
{ipad[i]=bkey[i]^0x36363636;opad[i]=bkey[i]^0x5C5C5C5C;}
var hash=core_sha1(ipad.concat(str2binb(data)),512+data.length*chrsz);return core_sha1(opad.concat(hash),512+160);}
function safe_add(x,y)
{var lsw=(x&0xFFFF)+(y&0xFFFF);var msw=(x>>16)+(y>>16)+(lsw>>16);return(msw<<16)|(lsw&0xFFFF);}
function rol(num,cnt)
{return(num<<cnt)|(num>>>(32-cnt));}
function str2binb(str)
{var bin=Array();var mask=(1<<chrsz)-1;for(var i=0;i<str.length*chrsz;i+=chrsz)
bin[i>>5]|=(str.charCodeAt(i/chrsz)&mask)<<(24-i%32);return bin;}
function binb2str(bin)
{var str="";var mask=(1<<chrsz)-1;for(var i=0;i<bin.length*32;i+=chrsz)
str+=String.fromCharCode((bin[i>>5]>>>(24-i%32))&mask);return str;}
function binb2hex(binarray)
{var hex_tab=hexcase?"0123456789ABCDEF":"0123456789abcdef";var str="";for(var i=0;i<binarray.length*4;i++)
{str+=hex_tab.charAt((binarray[i>>2]>>((3-i%4)*8+4))&0xF)+
hex_tab.charAt((binarray[i>>2]>>((3-i%4)*8))&0xF);}
return str;}
function binb2b64(binarray)
{var i;var j;var tab="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";var str="";for(i=0;i<binarray.length*4;i+=3)
{var triplet=(((binarray[i>>2]>>8*(3-i%4))&0xFF)<<16)|(((binarray[i+1>>2]>>8*(3-(i+1)%4))&0xFF)<<8)|((binarray[i+2>>2]>>8*(3-(i+2)%4))&0xFF);for(j=0;j<4;j++)
{if(i*8+j*6>binarray.length*32)str+=b64pad;else str+=tab.charAt((triplet>>6*(3-j))&0x3F);}}
for(j=(binarray.length*4);j<i;j++)
{str+="="}
return str;}
// wwwroot\Scripts\ToolbarPosition.js

var oToolbar;var oDocBody;var iOffsetX=0;var iOffsetY=10;var iDragStartX=0;var iDragStartY=0;var iOffsetStartX=0;var iOffsetStartY=0;SafeAttachEvent(window,'load',ToolbarLoad);SafeAttachEvent(window,'resize',PageSize);function ToolbarLoad(){oToolbar=document.getElementById('toolbar')
if(oToolbar){var sOffsetX;var sOffsetY;sOffsetX=getCookie('PublisToolBOffX');sOffsetY=getCookie('PublisToolBOffY');iOffsetX=sOffsetX==''?iOffsetX:Number(sOffsetX);iOffsetY=sOffsetY==''?iOffsetY:Number(sOffsetY);setCookie('PublisToolBOffX',iOffsetX);setCookie('PublisToolBOffY',iOffsetY);oDocBody=(document.compatMode&&document.compatMode!='BackCompat')?document.documentElement:document.body;PageSize();oToolbar.style.display='block';SafeAttachEvent(window,'scroll',PositionToolbar);SafeAttachEvent(oToolbar,'mousedown',ToolbarDragStart);SafeAttachEvent(oToolbar,'mouseup',ToolbarDragEnd);SafeAttachEvent(document,'mousemove',ToolbarDrag);}}
function PageSize(){if(oToolbar){if(iOffsetX==0||document.documentElement.clientWidth-120<iOffsetX){iOffsetX=document.documentElement.clientWidth-120;setCookie('PublisToolBOffX',iOffsetX)}
oToolbar.style.left=iOffsetX+'px';PositionToolbar();}}
function PositionToolbar()
{if(document.all){oToolbar.style.top=document.documentElement.scrollTop+iOffsetY+'px';}
else
{if(document.getElementById)
{oToolbar.style.top=document.body.scrollTop+40+iOffsetY+'px';}}}
function ToolbarDragStart(e){e=e==null?window.event:e;iDragStartX=e.clientX;iDragStartY=e.clientY;iOffsetStartX=iOffsetX;iOffsetStartY=iOffsetY;SafeAttachEvent(document,'selectstart',StopSelection);return false;}
function ToolbarDragEnd(e){e=e==null?window.event:e;iDragStartX=0;iDragStartY=0;setCookie('PublisToolBOffX',iOffsetX)
setCookie('PublisToolBOffY',iOffsetY)
SafeDetachEvent(document,'selectstart',StopSelection);return false;}
function ToolbarDrag(e){if(iDragStartX!=0){e=e==null?window.event:e;iOffsetX=iOffsetStartX+e.clientX-iDragStartX;iOffsetY=iOffsetStartY+e.clientY-iDragStartY;oToolbar.style.left=iOffsetX+'px';PositionToolbar();e.cancelBubble=true;return false;}
return true;}
function StopSelection(){return iDragStartX!=0;}
function setCookie(c_name,value)
{document.cookie=c_name+'='+escape(value)+';path=';}
function getCookie(c_name)
{if(document.cookie.length>0){c_start=document.cookie.indexOf(c_name+'=');if(c_start!=-1){c_start=c_start+c_name.length+1;c_end=document.cookie.indexOf(';',c_start);if(c_end==-1)c_end=document.cookie.length;return unescape(document.cookie.substring(c_start,c_end));}}
return'';}
// wwwroot\Scripts\ValidatePicture.js

function ValidatePicture(sId,sPicture,bCompletePicture)
{var sValue;var sOutValue;var iValueIndex;var cValueChar;var iPictureIndex;var cPictureChar;var cNextPictureChar;var cNewChar;var bStick;var bFail;sValue=document.all[sId].value;if(0<sValue.length&&0<sPicture.length)
{sOutValue="";iValueIndex=0;cValueChar=sValue.charAt(iValueIndex);iPictureIndex=0;cPictureChar=sPicture.charAt(iPictureIndex);cNextPictureChar=iPictureIndex<sPicture.length?sPicture.charAt(iPictureIndex+1):'\0';bFail=false;while(iValueIndex<sValue.length&&iPictureIndex<sPicture.length)
{bStick=false;switch(cPictureChar)
{case'a':case'A':case'x':case'X':case'0':case'?':cNewChar=TestCharacter(cValueChar,cPictureChar);if(cNewChar!='\0')
{iValueIndex++;cValueChar=iValueIndex<sValue.length?sValue.charAt(iValueIndex):'\0';sOutValue+=cNewChar;bStick=cNextPictureChar=='+'||cNextPictureChar=='@';}
else
{if(cNextPictureChar=='+'||cNextPictureChar=='@')
{iPictureIndex++;cPictureChar=cNextPictureChar;cNextPictureChar=iPictureIndex<sPicture.length?sPicture.charAt(iPictureIndex+1):'\0';}
else
{iValueIndex++;cValueChar=iValueIndex<sValue.length?sValue.charAt(iValueIndex):'\0';bFail=true;}}
break;case'\\':if(cNextPictureChar=='\0')
{bFail=true;}
else
{if(cValueChar==cNextPictureChar)
{iValueIndex++;sOutValue+=cNextPictureChar;cValueChar=iValueIndex<sValue.length?sValue.charAt(iValueIndex):'\0';iPictureIndex++;cPictureChar=cNextPictureChar;cNextPictureChar=iPictureIndex<sPicture.length?sPicture.charAt(iPictureIndex+1):'\0';}}
break;default:if(cValueChar==cPictureChar)
{iValueIndex++;sOutValue+=cValueChar;cValueChar=iValueIndex<sValue.length?sValue.charAt(iValueIndex):'\0';}}
if(!bStick&&cNextPictureChar!='\0')
{iPictureIndex++;cPictureChar=cNextPictureChar;cNextPictureChar=iPictureIndex<sPicture.length?sPicture.charAt(iPictureIndex+1):'\0';}}
bStick=true;while(bStick&&iPictureIndex<sPicture.length)
{switch(cPictureChar)
{case'a':case'A':case'x':case'X':case'0':case'?':bStick=false;break;case'\\':if(cNextPictureChar=='\0')
{bStick=false;}
else
{iPictureIndex++;cPictureChar=cNextPictureChar;cNextPictureChar=iPictureIndex<sPicture.length?sPicture.charAt(iPictureIndex+1):'\0';sOutValue+=cPictureChar;}
break;default:sOutValue+=cPictureChar;}
if(cNextPictureChar!='\0')
{iPictureIndex++;cPictureChar=cNextPictureChar;cNextPictureChar=iPictureIndex<sPicture.length?sPicture.charAt(iPictureIndex+1):'\0';}}
if(document.all[sId].value!=sOutValue)
{document.all[sId].value=sOutValue;}
return!bFail&&(!bCompletePicture||iValueIndex==sValue.length&&iPictureIndex==sPicture.length);}
else
{return true;}}
function TestCharacter(cValueChar,cPictureChar)
{switch(cPictureChar)
{case'a':return('a'<=cValueChar&&cValueChar<='z')||('A'<=cValueChar&&cValueChar<='Z')?cValueChar:'\0';break;case'A':return('A'<=cValueChar&&cValueChar<='Z')?cValueChar:(('a'<=cValueChar&&cValueChar<='z')?cValueChar.toUpperCase():'\0');break;case'x':return('a'<=cValueChar&&cValueChar<='z')||('A'<=cValueChar&&cValueChar<='Z')||('0'<=cValueChar&&cValueChar<='9')?cValueChar:'\0';break;case'X':return('A'<=cValueChar&&cValueChar<='Z')||('0'<=cValueChar&&cValueChar<='9')?cValueChar:('a'<=cValueChar&&cValueChar<='z')?cValueChar.toUpperCase():'\0';break;case'0':return('0'<=cValueChar&&cValueChar<='9')?cValueChar:'\0';break;case'?':return cValueChar;break;}
return'\0';}
