
var DEBUG_ENABLED=false;var __special__shift=false;var __special__alt=false;var __special__ctrl=false;var __special__arrow_up=false;var __special__arrow_down=false;var __special__arrow_left=false;var __special__arrow_right=false;var __special__pause=false;var __special__space=false;var MAX_DUMP_DEPTH=10;function dumpObj(obj,name,indent,depth){if(depth>MAX_DUMP_DEPTH){return indent+name+": <Maximum Depth Reached>\n";}
if(typeof obj=="object"){var child=null;var output=indent+name+"\n";indent+="\t";for(var item in obj){try{child=obj[item];}catch(e){child="<Unable to Evaluate>";}
if(typeof child=="object"){output+=dumpObj(child,item,indent,depth+1);}else{output+=indent+item+": "+child+"\n";}}
return output;}else{return obj;}}
document.onkeyup=KeyUp;var _ua=new Object();_ua.str=navigator.userAgent.toUpperCase();_ua.os={};_ua.browser={};if(_ua.str.indexOf("MACINTOSH")>=0){_ua.os.name="Mac";if(_ua.str.indexOf("MAC OS X ")>=0){_ua.os.ver=_ua.str.match(/MAC OS X [0-9_.]*/).toString().substr(9,4).replace(/_/g,".");}}
else if(_ua.str.indexOf("IPHONE")>=0){_ua.os.name="iPhone";if(_ua.str.indexOf("IPHONE OS ")>=0){_ua.os.ver=_ua.str.match(/IPHONE OS [0-9_.]*/).toString().substr(10,3).replace(/_/g,".");}}
else if(_ua.str.indexOf("IPOD")>=0){_ua.os.name="iPod touch";if(_ua.str.indexOf("IPHONE OS ")>=0){_ua.os.ver=_ua.str.match(/IPHONE OS [0-9_.]*/).toString().substr(10,3).replace(/_/g,".");}}
else if(_ua.str.indexOf("WINDOWS")>=0){_ua.os.name="Windows";if(_ua.str.indexOf("WINDOWS NT 5.1")>=0)_ua.os.ver="XP";if(_ua.str.indexOf("WINDOWS NT 6.0")>=0)_ua.os.ver="Vista";if(_ua.str.indexOf("WINDOWS NT 6.1")>=0)_ua.os.ver="7";}
if(_ua.str.indexOf("CHROME")>=0){_ua.browser.name="Chrome";_ua.browser.ver=_ua.str.match(/CHROME\/[0-9_.]*/).toString().substr(7,3);}
else if(_ua.str.indexOf("IPHONE")>=0&&_ua.str.indexOf("SAFARI")>=0){_ua.browser.name="Mobile Safari";_ua.browser.ver=_ua.str.match(/VERSION\/[0-9_.]*/).toString().substr(8);}
else if(_ua.str.indexOf("IPOD")>=0&&_ua.str.indexOf("SAFARI")>=0){_ua.browser.name="Mobile Safari";_ua.browser.ver=_ua.str.match(/VERSION\/[0-9_.]*/).toString().substr(8);}
else if(_ua.str.indexOf("SAFARI")>=0){_ua.browser.name="Safari";_ua.browser.ver=_ua.str.match(/VERSION\/[0-9_.]*/).toString().substr(8);}
else if(_ua.str.indexOf("FIREFOX")>=0){_ua.browser.name="Firefox";_ua.browser.ver=_ua.str.match(/FIREFOX\/[0-9_.]*/).toString().substr(8,3);}
else if(_ua.str.indexOf("OPERA")>=0){_ua.browser.name="Opera";_ua.browser.ver=_ua.str.match(/VERSION\/[0-9_.]*/).toString().substr(8);}
else if(_ua.str.indexOf("MSIE")>=0){_ua.browser.name="IE";if(_ua.str.indexOf("MSIE 5.0")>=0)_ua.browser.ver="5.0";if(_ua.str.indexOf("MSIE 5.5")>=0)_ua.browser.ver="5.5";if(_ua.str.indexOf("MSIE 6.0")>=0)_ua.browser.ver="6.0";if(_ua.str.indexOf("MSIE 7.0")>=0)_ua.browser.ver="7.0";if(_ua.str.indexOf("MSIE 8.0")>=0)_ua.browser.ver="8.0";}
function CreateXmlHttp(){return new XMLHttpRequest;}
var _GetXmlDocCounter=0;function GetXmlDoc(pXmlString){_GetXmlDocCounter++;var oDomDoc=(new DOMParser()).parseFromString(pXmlString,"text/xml");return oDomDoc;}
function SelectSingleNode(pParentNode,pNodePath){if(!pParentNode)return null;var ownerDocument=(pParentNode.ownerDocument?pParentNode.ownerDocument:pParentNode)
ownerDocument.setProperty("SelectionLanguage","XPath");return pParentNode.selectSingleNode(pNodePath);}
function GetNodeText(pNode,pPath){return getInnerText(SelectSingleNode(pNode,pPath));}
function GetAttributeValue(pNode,pAttributeName){return pNode.attributes.getNamedItem(pAttributeName).value;}
function getElapsedTime(pDateStartInMs){return(new Date().getTime()-pDateStartInMs);}
function getHoursMinutesSeconds(pSeconds){var secs=parseInt(pSeconds,10);var mins=0;var hours=0;if(secs>0){if(secs>59){mins=parseInt(Math.floor(secs/60.0),10);secs=secs%60;if(mins>59){hours=parseInt(Math.floor(mins/60.0),10);mins=mins%60;}}
secs=parseInt(secs,10);}
var lblTimeValue="";if(hours>0)
lblTimeValue+=String.format("{0:00}:",hours);lblTimeValue+=String.format("{0:00}:{1:00}",mins,secs);return lblTimeValue;}
function isEnterKeyPress(pCharCode,pTarget){return((pCharCode==13)&&(pTarget.nodeName!='TEXTAREA'));}
function AttachEvent(pObject,pEventName,pEventHandler){if(!pObject){dalert("Null pObject in AttachEvent");return;}
if(!IsValidInstance(pEventHandler)){dalert("Empty pEventHandler in AttachEvent");return;}
if(pObject.addEventListener){pObject.addEventListener(pEventName,pEventHandler,true);return true;}
else if(pObject.attachEvent){return pObject.attachEvent("on"+pEventName,pEventHandler);}
else if(pObject[evnt]){var origHandler=pObject[pEventName];pObject[pEventName]=function(evt){origHandler(evt);handler(evt);}}else{pObject[pEventName]=function(evt){handler(evt);}}}
function DetachEvent(pObject,pEventName,pEventHandler){if(pObject.removeEventListener){pObject.removeEventListener(pEventName,pEventHandler,false);return true;}
else if(pObject.detachEvent){return pObject.detachEvent("on"+pEventName,pEventHandler);}
else{return false;}}
function goTo(link){location.href=link;}
function ReloadPage(pMsDelay){if(!IsValidInstance(pMsDelay)||pMsDelay==""||pMsDelay<1){window.location.reload(false);}else{setTimeout("ReloadPage(0)",pMsDelay);}}
function getQueryStringValue(pKey,pDefaultIfNoMatch){var query=window.location.search.substring(1).toLowerCase();pKey=pKey.toLowerCase();var vars=query.split('&');var varslength=vars.length;for(var i=0;i<varslength;i++){var pair=vars[i].split('=');if(pair[0]==pKey){return pair[1];}}
return pDefaultIfNoMatch;}
function ge(id){if(typeof(id)=='string')
return document.getElementById(id);return id;}
function GetId(pElement){if(IsValidInstance(pElement)){if(typeof pElement=="string"){return pElement;}else{return pElement.id;}}else{return"";}}
function setGlobal(pName,pValue){window[pName]=pValue;}
function defaultGlobal(pName,pValue){if(!IsValidInstance(window[pName])){setGlobal(pName,pValue);}else{}}
function openStrippedWindow(href,h,w){thewin=window.open(href,'_blank','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width='+w+',height='+h+',left='+(window.screen.width-w)/2+',top='+(window.screen.height-h)/2);}
function openStrippedWindowRelative(href,h,w){openStrippedWindow(window.location.protocol+"//"+window.location.host+"/"+href,h,w);}
function openWindow(href,pTarget){thewin=window.open(href,pTarget,'');}
function buildCallback(pFormName,pFieldNames,pResultValues){var lLength=pFieldNames.length;var lCallback="";for(i=0;i<lLength;i++){var lField=document.forms[pFormName].elements[pFieldNames[i]];lCallback+=((lField!=null)?("opener.setValue(opener.document.forms['"+pFormName+"'].elements['"+pFieldNames[i]+"'],"+pResultValues[i]+"); "):"");}
return lCallback;}
function buildUrl(pUrl,pFormName,pFieldNames,pIncludeEmpty){if(!IsValidInstance(pIncludeEmpty)||pIncludeEmpty!=true)
pIncludeEmpty=false;var lLength=pFieldNames.length;var lArgs="";for(i=0;i<lLength;i++){var lField=document.forms[pFormName].elements[pFieldNames[i]];var lValue=getValue(lField);if(!pIncludeEmpty)
lArgs+=((lValue.length>0)?(((lArgs.length>0)?'&':'')+(pFieldNames[i]+'='+escape(lValue))):'');else
lArgs+=(((lArgs.length>0)?'&':'')+(pFieldNames[i]+'='+escape(lValue)));}
var lNewUrl=pUrl.replace(/replace=me/,lArgs);return lNewUrl;}
var maxOpacity=99.999;function showIt(pElementId,pIsInline){var element=ge(pElementId);if(element==null){dalert("showIt Can't find element by id: "+pElementId);}else{if(typeof pIsInline=="undefined")
pIsInline=false;if(getElementAttribute(pElementId,"oldStyleDisplay")!=null)
element.style.display=getElementAttribute(pElementId,"oldStyleDisplay");else
element.style.display=(pIsInline?"inline":"block");}}
function hideIt(pElementId,pIgnoreMissingElement){if(!IsValidInstance(pIgnoreMissingElement))
pIgnoreMissingElement=false;var element=ge(pElementId);if(element==null){if(!pIgnoreMissingElement)
dalert("hideIt can't find element by id: "+pElementId);}else{if(isVisible(pElementId)&&(element.style.display!=""&&element.style.display!="none"&&element.style.display!="NONE"))
setElementAttribute(pElementId,"oldStyleDisplay",element.style.display);element.style.display="none";}}
function hideThem(pObjArray){var listlength=pObjArray.length;for(var i=0;i<listlength;i++){hideIt(pObjArray[i],true);}}
function showThem(pObjArray){var listlength=pObjArray.length;for(var i=0;i<listlength;i++){showIt(pObjArray[i],true);}}
function showHideIt(pElementId,pIsInline){if(isVisible(pElementId))
hideIt(pElementId);else
showIt(pElementId,pIsInline);}
function isVisible(pElementId){var element=ge(pElementId);if(element==null)
dalert("isVisible can't find element by id: "+pElementId);else{if((typeof element.style.display=='undefined')||(element.style.display==""))
return false;if(element.style.display.toUpperCase()=="NONE")
return false;return true;}}
function focusIt(objID){var el=ge(objID);if(el!=null)
el.focus();}
function setOpacity(pObject,pOpacity){if(!IsValidInstance(pObject)){dalert("setOpacity given a null object");return;}
pObject=ge(pObject);pOpacity=(pOpacity>=100)?maxOpacity:pOpacity;pObject.style.filter="alpha(opacity:"+pOpacity+")";pObject.style.KHTMLOpacity=pOpacity/100;pObject.style.MozOpacity=pOpacity/100;pObject.style.opacity=pOpacity/100;}
function setOpacityToReadOnly(pObjId){lObj=ge(pObjId);if(lObj){setOpacity(lObj,50);lObj.style.filter+="gray alpha(opacity:50)";}}
function fadeIn(pObjId,pOpacity){lObj=ge(pObjId);if(lObj){if(pOpacity<=100){setOpacity(lObj,pOpacity);pOpacity+=1;window.setTimeout("fadeIn('"+pObjId+"',"+pOpacity+")",100);}}}
function fadeOut(pObjId,pOpacity,pHideMeTF){lObj=ge(pObjId);if(lObj){if(pOpacity>0){setOpacity(lObj,pOpacity);pOpacity-=1;window.setTimeout("fadeOut('"+pObjId+"',"+pOpacity+", "+pHideMeTF+")",100);}else{if(pHideMeTF==true)
hideIt(pObjId);}}}
function makeTaller(pObjId,pPixels,pMax){var el=ge(pObjId);if(IsValidInstance(el)){if(!IsValidInstance(pMax))
pMax=99999;else
pMax=parseInt(pMax,10);pPixels=parseInt(pPixels,10);var desired=parseInt(el.style.height,10)+pPixels;if(desired>pMax)
desired=pMax;if(desired>GetWindowHeight())
desired=GetWindowHeight();if(desired>0)
el.style.height=desired+"px";}}
function makeShorter(pObjId,pPixels,pMin){var el=ge(pObjId);if(IsValidInstance(el)){if(!IsValidInstance(pMin))
pMin=0;else
pMin=parseInt(pMin,10);pPixels=parseInt(pPixels,10);var desired=parseInt(el.style.height,10)-pPixels;if(desired<pMin)
desired=pMin;if(desired>0)
el.style.height=desired+"px";}}
function setCssClass(pObj,pClass){pObj=ge(pObj);if(!IsValidInstance(pObj))
return;saveCssClass(pObj);pObj.className=pClass;}
function revertCssClass(pObj){pObj=ge(pObj);if(!IsValidInstance(pObj))
return;saveCssClass(pObj);if(pObj.originalClassName)
pObj.className=pObj.originalClassName;}
function saveCssClass(pObj){pObj=ge(pObj);if(!IsValidInstance(pObj))
return;if(IsEmptyNullOrInvalid(pObj.originalClassName)){setOriginalCssClass(pObj,pObj.className);}
if(IsEmptyNullOrInvalid(pObj.lastClassName)){setLastCssClass(pObj,pObj.originalClassName);}}
function setLastCssClass(pObj,pClass){pObj.lastClassName=pClass;}
function setOriginalCssClass(pObj,pClass){pObj.originalClassName=pClass;}
function addCssClass(pObj,pClassName){if(pObj){removeCssClass(pObj,pClassName);setCssClass(pObj,pObj.className+" "+pClassName);}}
function removeCssClass(pObj,pClassName){if(pObj&&pObj.className){var re=new RegExp(pClassName,'g');pObj.className=pObj.className.replace(re,'');}}
function removeElement(pId,pDelay){var el=ge(pId);if(el!=null){el.parentNode.removeChild(el);}}
function CreateDiv(pId,pPixelsFromTop,pPixelsFromLeft,pHeight,pWidth,pInnerHtml,pCssClass,pCloseable,pDisplayNone,pOnCloseJs){if(!IsValidInstance(pCloseable))
pCloseable=false;else{if(typeof pCloseable=="string"){if(pCloseable.toUpperCase()=="YES"||pCloseable.toUpperCase()=="TRUE"||pCloseable.toUpperCase()=="T"||pCloseable.toUpperCase()=="Y")
pCloseable=true;}}
if(!IsValidInstance(pId))
pId=generateGuid();dv=document.createElement('div');dv.setAttribute('id',pId);dv.className=pCssClass;if(typeof pDisplayNone=="string"){if(pDisplayNone.toUpperCase()=="YES"||pDisplayNone.toUpperCase()=="TRUE"||pDisplayNone.toUpperCase()=="T"||pDisplayNone.toUpperCase()=="Y")
pDisplayNone=true;}
if(pDisplayNone)
dv.style.display="NONE";dv.style.position="absolute";dv.style.pixelLeft=pPixelsFromLeft;dv.style.pixelTop=pPixelsFromTop;dv.style.left=pPixelsFromLeft;dv.style.top=pPixelsFromTop;if(IsValidInstance(pWidth))
dv.style.pixelWidth=pWidth;if(IsValidInstance(pHeight))
dv.style.pixelHeight=pHeight;if(pCloseable)
dv.innerHTML="<img src='http://media.aliensandrobots.com/clear.gif' alt='close' class='img-button_close clickable' style='float:right;margin:1px;' onmousedown=\"removeElement('"+pId+"', 50); "+pOnCloseJs+";\"/>";dv.innerHTML+=pInnerHtml;document.forms[0].appendChild(dv);}
function CreatePopupNote(pId,pInnerHtml,pAssociatedElementId,pHeight,pWidth,pClass,pCloseable){if(!IsValidInstance(pClass))
pClass="";CreateDiv(pId,GetY(ge(pAssociatedElementId),false)-10,GetX(ge(pAssociatedElementId),true)+10,pHeight,pWidth,pInnerHtml,"popupNote "+pClass,pCloseable);}
function appendRowToTable(pTableId,pParams_ColContent1){var tbl=document.getElementById(pTableId);if(typeof(tbl)=="undefined"||tbl==null)
return false;var row=tbl.insertRow(-1);var paramCount=arguments.length;var cell;for(var i=1;i<paramCount;i++){cell=row.insertCell(i-1);if(typeof(arguments[i])!="undefined")
cell.appendChild(document.createTextNode(arguments[i]));}
return row;}
function MoveIt(pObject,pX,pY,pDuration){dalert('why is MoveIt empty');}
function addListItem(pListId,pHtml,pMaxItems,pItemId,pBoolAddToTop,pClassForLi,pSetDisplayNone){var ul=ge(pListId);if(ul==null){DInfo("addListItem couldn't find a list using Id: "+pListId);}
if(!IsValidInstance(pBoolAddToTop))
pBoolAddToTop=false;if(!IsValidInstance(pSetDisplayNone))
pSetDisplayNone=false;if(IsValidInstance(pMaxItems)&&pMaxItems>0&&ul.childNodes.length>(pMaxItems-1)){if(pBoolAddToTop){while(ul.childNodes.length>(pMaxItems-1))
ul.removeChild(ul.childNodes[ul.childNodes.length-1]);}else{while(ul.childNodes.length>(pMaxItems-1))
ul.removeChild(ul.childNodes[0]);}}
var li=document.createElement('li');if(IsValidInstance(pItemId)&&pItemId!=-187){li.id=pItemId;}
if(IsValidInstance(pClassForLi)&&pItemId!=""){li.className=pClassForLi;}
if(pSetDisplayNone){li.style.display="none";}
setInnerHtml(li,pHtml);if(pBoolAddToTop&&IsValidInstance(ul.childNodes[0]))
ul.insertBefore(li,ul.childNodes[0]);else
ul.appendChild(li);}
function setElementAttribute(pField,pAttribute,pValue){var el=typeof(pField)=="string"?ge(pField):pField;if(IsValidInstance(el))
el.setAttribute(pAttribute,pValue);else
dalert("common.setElementAttribute: Unable to set attribute value on null field: ["+pField+"]");}
function getElementAttribute(pField,pAttribute){var el=typeof(pField)=="string"?ge(pField):pField;if(IsValidInstance(el)){if(el.getAttribute)
return el.getAttribute(pAttribute);else
return null;}
else
dalert("common.getElementAttribute: Unable to get attribute value on null field: ["+pField+"]");return null;}
var _cookieToday=new Date();var _cookieNextMonth=new Date(_cookieToday.getYear(),_cookieToday.getMonth()+1,_cookieToday.getDate());var _cookieNextYear=new Date(_cookieToday.getYear()+1,_cookieToday.getMonth(),_cookieToday.getDate());function setCookie(Name,Value,Expires,Path,Domain,bSecure){if(Expires==null||Expires=="")
Expires=_cookieNextYear;var CookieText=escape(Name)+'='+escape(Value);CookieText+=(Expires?'; EXPIRES='+Expires.toGMTString():'');CookieText+=(Path?'; PATH='+Path:'');CookieText+=(Domain?'; DOMAIN='+Domain:'');CookieText+=(bSecure?'; SECURE':'');document.cookie=CookieText;}
function getCookie(Name){var Value=null;if(document.cookie)
{var arr=document.cookie.split((escape(Name)+'='));if(2<=arr.length){var arr2=arr[1].split(';');Value=unescape(arr2[0]);}}
return Value;}
function deleteCookie(Name){var tmp=getCookie(Name);if(tmp)
{setCookie(Name,tmp,(new Date(1)));}}
function isArray(testObject){return testObject&&!(testObject.propertyIsEnumerable('length'))&&typeof testObject==='object'&&typeof testObject.length==='number';}
function toArray(coll){var a=[];for(var i=0,len=coll.length;i<len;i++){a[i]=coll[i];}
return a;}
function splitAsInt(pString,pSplitterOrRegex){if(typeof(pString)=="undefined"||pString==""){return[];}
if(typeof(pSplitterOrRegex)=="undefined")
pSplitterOrRegex="";a=pString.split(pSplitterOrRegex);if(a==""||a.length==0){return[];}
for(var i=0;i<a.length;i++){if(a[i]=="")
a[i]=0;else
a[i]=parseInt(a[i],10);}
return a;}
function splitSafe(pString,pSplitterOrRegex,pRemoveEmptyStrings){if(typeof(pString)=="undefined"||pString==null||pString==""){return[];}
if(typeof(pSplitterOrRegex)=="undefined")
pSplitterOrRegex="";if(typeof(pRemoveEmptyStrings)=="undefined")
pRemoveEmptyStrings=false;a=pString.split(pSplitterOrRegex);if(a==""||(typeof(a)!="object")){return[];}
if(!pRemoveEmptyStrings)
return a;var b=[];for(var i=0;i<a.length;i++){if(a[i]!="")
b.push(a[i]);}
return b;}
function Pad(pTextToPad,pTargetLength,pPadString){pTextToPad=pTextToPad.toString();if(!IsValidInstance(pPadString))
pPadString=" ";while(pTextToPad.length<pTargetLength){pTextToPad=pPadString+pTextToPad;}
return pTextToPad;}
function validateEmail(elementValue){var emailPattern=/^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/;return emailPattern.test(elementValue);}
function getBool(){return Math.floor(Math.random()*1.9999)==0;}
function generateGuid(){var guid,i,j;guid='';for(j=0;j<32;j++){if(j==8||j==12||j==16||j==20)
guid=guid+'-';i=Math.floor(Math.random()*16).toString(16).toUpperCase();guid=guid+i;}
return guid;}
function ValidateAlphaNumeric(evt){if(!e)var e=window.event;if(e.keyCode)code=e.keyCode;else if(e.which)code=e.which;return(code>=48&&code<=57)||(code>=65&&code<=90)||(code>=97&&code<=122)||(code==0)||(code==8)||(code==13)||(code==32)||(code==44);}
function addCommas(nStr){nStr+='';x=nStr.split('.');x1=x[0];x2=x.length>1?'.'+x[1]:'';var rgx=/(\d+)(\d{3})/;while(rgx.test(x1)){x1=x1.replace(rgx,'$1'+','+'$2');}
return x1+x2;}
function replaceThisWithThat(pString,pThis,pThat){var newString=pString;while(newString.indexOf(pThis)!=-1){newString=newString.replace(pThis,pThat);}
return newString;}
function upperCase(pField){if(typeof pField.type=="undefined")
pField=ge(pField);pField.value=pField.value.toUpperCase();}
function isWhitespace(charToCheck){var whitespaceChars=" \t\n\r\f";return(whitespaceChars.indexOf(charToCheck)!=-1);}
function IsCharNumber(pCharacter){var acceptable="1234567890";return acceptable.indexOf(pCharacter,0)>=0;}
function IsLetterOrNumber(pCharacter){var acceptable="1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";return acceptable.indexOf(pCharacter,0)>=0;}
function IsLetterOrNumberOrSpace(pCharacter){var acceptable="1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ ";return acceptable.indexOf(pCharacter,0)>=0;}
function IsNumber(pText){for(i=0;i<pText.length;i++){if(!IsCharNumber(pText.charAt(i)))
return false;}
return true;}
function toYesNo(pBool){if(pBool==null||pBool==undefined||!pBool||pBool=="N")
return"No"
return"Yes"}
function getInnerText(pNode){if(!IsValidInstance(pNode)){return"";}else{if(IsEmptyNullOrInvalid(pNode.textContent)&&IsEmptyNullOrInvalid(pNode.innerText)&&IsEmptyNullOrInvalid(pNode.text)&&IsEmptyNullOrInvalid(pNode.nodeValue)){return"";}else{return(pNode.textContent||pNode.innerText||pNode.text||pNode.nodeValue);}}}
function setInnerHtml(pNode,pValue){if(typeof pNode=="string")
pNode=ge(pNode);if(!IsValidInstance(pNode)||!IsValidInstance(pValue)){dstatus("setInnerHtml could not find the target element");return false;}else{try{if(pNode.type=="select-one"){SetSelectInnerHtml(pNode,pValue);}else{pNode.innerHTML=pValue;}}catch(err){dalert(err.description);pNode.innerHTML="";var dv=document.createElement('div');dv.innerHTML=pValue;pNode.appendChild(dv);}}}
function setValue(pField,pValue,pValueProperty){var origField=pField;var field=((typeof pField=='string')?ge(pField):pField);if(!IsValidInstance(field)){DInfo("common.setValue: Unable to set value on null field: ["+pField+"]");return;}
if(IsValidInstance(pValueProperty)&&pValueProperty!=""){eval("field."+pValueProperty+" = (pValue == null ? '' : pValue)");return;}else{pValueProperty="";}
extendedType=getElementAttribute(field,"ExtendedType");if(!extendedType){if(typeof field.ComboBox!='undefined'){var box=eval(field.id);if(box)
box.SetValue(pValue==null?"":pValue);}
else{switch(field.type){case"text":field.value=(pValue==null?"":pValue);break;case"select-one":if(pValue==null){field.selectedIndex=0;}
else{var fieldoptionslength=field.options.length;for(i=0;i<fieldoptionslength;i++){if(field.options[i].value==pValue){field.selectedIndex=i;break;}}}
break;case"checkbox":field.checked=(pValue==true||pValue=="Y"||pValue=="True"||pValue=="true"||pValue==1||pValue=="1")
break;case"radio":setCheckedRadioValue(field,pValue==null?"":pValue);break;case"button":pField.value=(pValue==null?"":pValue);break;default:switch(field.tagName){case"DIV":setInnerHtml(field,(pValue==null?"":pValue));break;case"SPAN":setInnerHtml(field,(pValue==null?"":pValue));break;case"LABEL":field.innerText=(pValue==null?"":pValue);break;case"FIELDSET":field.lastChild.nodeValue=(pValue==null?"":pValue);break;case"LEGEND":field.innerText=(pValue==null?"":pValue);break;case"LI":field.innerText=(pValue==null?"":pValue);break;case"UL":setInnerHtml(field,(pValue==null?"":pValue));break;case"TD":setInnerHtml(field,(pValue==null?"":pValue));break;case"TR":setInnerHtml(field,(pValue==null?"":pValue));break;case"TABLE":setInnerHtml(field,(pValue==null?"":pValue));break;default:field.value=(pValue==null?"":pValue);}}}}}
function appendValue(pField,pValue,pValueProperty){var str=getValue(pField,pValueProperty)+''+pValue;setValue(pField,str,pValueProperty);}
function getValueForUri(pElementId){return encodeURIComponent(getValue(pElementId));}
function gv(pField,pValueProperty){return getValue(pField,pValueProperty);}
function getValue(pField,pValueProperty){var field=((typeof pField=='string')?ge(pField):pField);if(!IsValidInstance(field)){dalert("common.getValue: Unable to get value on null field: ["+pField+"]");return"";}
if(IsValidInstance(pValueProperty)&&pValueProperty!=""){return eval("field."+pValueProperty);}
extendedType=getElementAttribute(field,"ExtendedType");if(!extendedType){if(typeof field.ComboBox!='undefined')
lValue=field.Value;else{switch(field.type){case"checkbox":lValue=field.checked?true:false;break;case"text":case"hidden":case"image":case"password":case"textarea":lValue=field.value;break;case"radio":lValue=getCheckedRadioValue(field);break;case"reset":case"select-multiple":case"file":case"button":lValue='';break;case"select-one":if(field.selectedIndex>=0)
lValue=field.options[field.selectedIndex].value;else
lValue='';break;break;default:if(field.tagName=="DIV"||field.tagName=="SPAN")
lValue=field.innerHTML;else
lValue="";break;}}}else{switch(extendedType){case"TandemKeyValueTextBox":lValue=field.keyOfPair;break;case"TandemDropDown":var dropDownObject=eval(field.id);if(dropDownObject)
lValue=dropDownObject.GetValue();break;}}
if(lValue==null||lValue=='null')
lValue='';return lValue;}
function clearValue(pField,pValueProperty){var field=((typeof pField=='string')?ge(pField):pField);if(!IsValidInstance(field)){dalert("common.clearValue: Unable to clear value on null field: ["+pField+"]");return;}
if(IsValidInstance(pValueProperty)&&pValueProperty!="")
setValue(pField,null,pValueProperty);else
setValue(pField,null);}
function isElementEmpty(pField,pEmptyValue,pValueProperty){var isEmpty;var extendedType;var field=((typeof pField=='string')?ge(pField):pField);if(!IsValidInstance(field)){dalert("common.isElementEmpty: Unable to evaluate value on null field: ["+pField+"]");return true;}
if(!IsValidInstance(pEmptyValue))pEmptyValue="";if(IsValidInstance(pValueProperty)&&pValueProperty!="")
return eval("field."+pValueProperty+" == pEmptyValue");isEmpty=true;extendedType=field.ExtendedType;if(!extendedType){switch(field.type){case"checkbox":isEmpty=!field.checked;break;case"text":case"hidden":case"password":case"textarea":isEmpty=(field.value==pEmptyValue);break;case"radio":isEmpty=(getCheckedRadioValue(field)=="");break;case"select-multiple":alert("common.isElementEmpty: select-multiple not implemented.");break;case"select-one":isEmpty=(field.options[field.selectedIndex].value==pEmptyValue);break;default:if((field.tagName=="DIV")||(field.tagName=="SPAN"))
isEmpty=(field.innerHTML==pEmptyValue);else
isEmpty=false;break;}}
return isEmpty;}
function getCheckedRadioValue(pField){var field=((typeof pField=='string')?ge(pField):pField);if(!field){dalert("common.getCheckedRadioValue: Attempt to get value on null field: '"+pField+"'.");return"";}
if(field.type!="radio"){dalert("common.getCheckedRadioValue: Attempt to get value on non-radio field: '"+field.id+"'.");return"";}
var radioLength=field.length;if(typeof radioLength=="undefined"||radioLength==0)
return field.checked?field.value:"";else
for(var i=0;i<radioLength;i++)
if(field[i].checked)
return field[i].value;return"";}
function setCheckedRadioValue(pField,newValue){if(!IsValidInstance(pField))
return;if(typeof pField.length=="undefined"){pField.checked=(pField.value==newValue.toString());}else{var pFieldlength=pField.length;for(var i=0;i<pFieldlength;i++){pField[i].checked=false;if(pField[i].value==newValue.toString()){pField[i].checked=true;}}}}
function SetSelectInnerHtml(obj,innerHTML){obj.innerHTML=""
var selTemp=document.createElement("micoxselect")
var opt;selTemp.id="micoxselect1"
document.body.appendChild(selTemp)
selTemp=document.getElementById("micoxselect1")
selTemp.style.display="none"
if(innerHTML.toLowerCase().indexOf("<option")<0){innerHTML="<option>"+innerHTML+"</option>"}
innerHTML=innerHTML.replace(/<option/g,"<span").replace(/<\/option/g,"</span")
selTemp.innerHTML=innerHTML
var selTempchildNodeslength=selTemp.childNodes.length;for(var i=0;i<selTempchildNodeslength;i++){var spantemp=selTemp.childNodes[i];if(spantemp.tagName){opt=document.createElement("OPTION")
if(document.all){obj.add(opt)}else{obj.appendChild(opt)}
var spantempattributeslength=spantemp.attributes.length;for(var j=0;j<spantempattributeslength;j++){var attrName=spantemp.attributes[j].nodeName;var attrVal=spantemp.attributes[j].nodeValue;if(attrVal){try{opt.setAttribute(attrName,attrVal);opt.setAttributeNode(spantemp.attributes[j].cloneNode(true));}catch(e){}}}
if(spantemp.style){for(var y in spantemp.style){if(opt.style[y]!=null&&y!="length"){try{opt.style[y]=spantemp.style[y];}catch(e){var f=1;}}}}
opt.value=spantemp.getAttribute("value")
opt.text=spantemp.innerHTML
opt.selected=spantemp.getAttribute('selected');opt.className=spantemp.className;}}
document.body.removeChild(selTemp)
selTemp=null}
function deleteOptionByValue(pSelectId,pOptionValue){var sel=ge(pSelectId);var optionToDelete=null;var sellength=sel.length;for(var i=0;i<sellength;i++){if(sel.options[i].value==pOptionValue){optionToDelete=sel.options[i];break;}}
if(optionToDelete!=null)
sel.removeChild(optionToDelete);}
function deleteSelectedOption(pSelectId){var sel=ge(pSelectId);var optionToDelete=null;var sellength=sel.length;for(var i=0;i<sellength;i++){if(sel.options[i].selected){optionToDelete=sel.options[i];break;}}
if(optionToDelete!=null)
sel.removeChild(optionToDelete);}
function IsValidInstance(pItem){return!((typeof pItem=="undefined")||(pItem==null));}
function IsEmptyNullOrInvalid(pItem){var valid=IsValidInstance(pItem);if(valid){if(typeof pItem=="string"){if(pItem=="")
return true;else
return false;}else{var v=getValue(pItem);if(v==null||v=="")
return true;}}else{return true;}
return false;}
function formatCurrency(num){num=num.toString().replace(/\$|\,/g,'');if(isNaN(num))
num="0";sign=(num==(num=Math.abs(num)));num=Math.floor(num*100+0.50000000001);cents=num%100;num=Math.floor(num/100).toString();if(cents<10)
cents="0"+cents;for(var i=0;i<Math.floor((num.length-(1+i))/3);i++)
num=num.substring(0,num.length-(4*i+3))+','+
num.substring(num.length-(4*i+3));return(((sign)?'':'-')+'$'+num+'.'+cents);}
function deleteOption(theSel,index){theSel.options[index]=null;}
function addOption(theSel,text,value){var defaultSelected=false;var selected=false;var optionName=new Option(text,value,defaultSelected,selected)
theSel.options[theSel.length]=optionName;theSel.options[theSel.length-1].selected=false;}
function moveOptions(theSelFrom,theSelTo){var selLength=theSelFrom.length;var selectedText=[];var selectedValues=[];var selectedCount=0;var i;for(i=selLength-1;i>=0;i--){if(theSelFrom.options[i].selected){selectedText[selectedCount]=theSelFrom.options[i].text;selectedValues[selectedCount]=theSelFrom.options[i].value;deleteOption(theSelFrom,i);selectedCount++;}}
for(i=selectedCount-1;i>=0;i--){addOption(theSelTo,selectedText[i],selectedValues[i]);}}
function getOptionValues(theSel,pGetOnlySelected,pSeperator){var selLength=theSel.length;var selectedValues=[];var foundCount=0;var returnStr="";for(var i=0;i<selLength;i++){if(!pGetOnlySelected||(pGetOnlySelected&&theSel.options[i].selected)){returnStr+=theSel.options[i].value;if(foundCount<(selLength-1))
returnStr+=pSeperator;foundCount++;}}
return returnStr;}
function compareOptionText(a,b){return a.text!=b.text?a.text<b.text?-1:1:0;}
function sortOptions(list){list=ge(list);var items=list.options.length;var tmpArray=new Array(items);for(var i=0;i<items;i++)
tmpArray[i]=new Option(list.options[i].text,list.options[i].value);tmpArray.sort(compareOptionText);for(var i=0;i<items;i++)
list.options[i]=new Option(tmpArray[i].text,tmpArray[i].value);}
function rand(pMin,pMax){return Math.floor(Math.random()*(pMax-pMin+1)+pMin);}
function GetX(pDomElement,pAddWidth){var offsetLeft=0;if(IsValidInstance(pAddWidth)&&pAddWidth==true){if(pDomElement.offsetWidth)
offsetLeft+=pDomElement.offsetWidth;}
if(pDomElement.offsetParent){while(pDomElement.offsetParent){offsetLeft+=pDomElement.offsetLeft;pDomElement=pDomElement.offsetParent;}}
else if(pDomElement.x){offsetLeft+=pDomElement.x;}
return offsetLeft;}
function GetY(pDomElement,pAddHeight){var offsetTop=0;if(IsValidInstance(pAddHeight)&&pAddHeight==true){if(pDomElement.offsetHeight)
offsetTop+=pDomElement.offsetHeight;}
if(pDomElement.offsetParent){while(pDomElement.offsetParent){offsetTop+=pDomElement.offsetTop;pDomElement=pDomElement.offsetParent;}}
else if(pDomElement.y){offsetTop+=pDomElement.y;}
return offsetTop;}
function dalert(pString){if(DEBUG_ENABLED)
alert(pString);}
function dstatus(pString){if(DEBUG_ENABLED)
window.status=pString;}
function KeyUp(e){if(!e)var e=window.event;if(e.keyCode)code=e.keyCode;else if(e.which)code=e.which;switch(code){case 16:__special__shift=true;break;case 17:__special__ctrl=true;break;case 18:__special__alt=true;break;case 19:__special__pause=true;break;case 32:__special__space=true;break;case 37:__special__arrow_left=true;break;case 38:__special__arrow_up=true;break;case 39:__special__arrow_right=true;break;case 40:__special__arrow_down=true;break;}
specialKeyComboCheck();window.setTimeout("clearSpecialCommandKeys()",2000);}
function specialKeyComboCheck(){jsDebugFlagKeyCheck();if(DEBUG_ENABLED){openDebugWindowKeyCheck();traceKeyCheck();jsAjaxDebugFlagKeyCheck();goToAdminPageCheck();}}
function jsDebugFlagKeyCheck(){if(__special__shift&&__special__alt&&__special__ctrl&&__special__arrow_up){DEBUG_ENABLED=!DEBUG_ENABLED;}
if(DEBUG_ENABLED){window.status="Javascript debugging has been turned ON.";}else{}}
function openDebugWindowKeyCheck(){if(__special__shift&&__special__alt&&__special__ctrl&&__special__arrow_right){ShowClientCacheReport();}}
function jsAjaxDebugFlagKeyCheck(){if(__special__shift&&__special__alt&&__special__ctrl&&__special__arrow_left){ShowAjaxHistory();}}
function traceKeyCheck(){if(__special__shift&&__special__alt&&__special__ctrl&&__special__arrow_down){var currentUrl=window.location.href;if(currentUrl.indexOf("trace=true")!=-1){window.location.href=window.location.href;}else{if(currentUrl.indexOf("?")!=-1){window.location.href=window.location.href+"&trace=true";}else{window.location.href=window.location.href+"?trace=true";}}}}
function goToAdminPageCheck(){if(__special__shift&&__special__alt&&__special__ctrl&&__special__space){goTo("AdminDefault.aspx");}}
function clearSpecialCommandKeys(){__special__shift=false;__special__alt=false;__special__ctrl=false;__special__arrow_up=false;__special__arrow_down=false;__special__arrow_left=false;__special__arrow_right=false;__special__pause=false;__special__space=false;}
function GetWindowHeight(){var h;if(window.innerHeight)
h=window.innerHeight;else if(document.documentElement&&document.documentElement.clientHeight)
h=document.documentElement.clientHeight;else if(document.body)
h=document.body.clientHeight;return h;}
function GetWindowWidth(){var w,theHeight;if(window.innerWidth)
w=window.innerWidth;else if(document.documentElement&&document.documentElement.clientWidth)
w=document.documentElement.clientWidth;else if(document.body)
w=document.body.clientWidth;return w;}
function blinkTitle(){if(!window.oldtitle)window.oldtitle=document.title;if(document.title=='*'){document.title=window.oldtitle;}else{document.title='*';}}
function startBlinkTitle(pIntervalMs,pDurationMs){window.blinkinterval=setInterval(blinkTitle,pIntervalMs);setTimeout(stopBlinkTitle,pDurationMs);}
function stopBlinkTitle(){clearInterval(window.blinkinterval);document.title=window.oldtitle;}
function getFunctionName(theFunction){if(theFunction.name){return theFunction.name;}
var definition=theFunction.toString();var name=definition.substring(definition.indexOf('function')+8,definition.indexOf('('));if(name)
return name;return"anonymous";}
function getSignature(theFunction){var signature=getFunctionName(theFunction);signature+="(";if(theFunction.arguments!==undefined&&theFunction.arguments.length!==undefined){for(var x=0;x<theFunction.arguments.length;x++){var nextArgument=theFunction.arguments[x];if(nextArgument==null||(!nextArgument.substring))
continue;if(nextArgument.length>30)
nextArgument=nextArgument.substring(0,30)+"...";signature+="'"+nextArgument+"'";if(x<theFunction.arguments.length-1)
signature+=", ";}}
signature+=")";return signature;}
function getStackTrace(startingPoint,pIgnoreFirstLevel){var stackTraceMessage="";var nextCaller=startingPoint;if(pIgnoreFirstLevel)
nextCaller=nextCaller.caller;while(nextCaller){stackTraceMessage+=getSignature(nextCaller)+"<br>";nextCaller=nextCaller.caller;}
stackTraceMessage+="<br>";return stackTraceMessage;}
AttachEvent(document,"mousedown",commonMouseDown);AttachEvent(document,"keydown",commonKeyDown);var _lastKeyDown=null;var _lastMouseDown=null;function getMsSinceLastHumanInput(){var lastInput=getLastHumanInput();if(lastInput==null)
return 86400000;return((new Date())-lastInput);}
function hasHumanActed(){return(getLastHumanInput()!=null);}
function getLastHumanInput(){if(_lastKeyDown==null&&_lastMouseDown==null)
return null;if(_lastMouseDown>_lastKeyDown)
return _lastMouseDown;return _lastKeyDown;}
function commonMouseDown(){_lastMouseDown=new Date();}
function commonKeyDown(){_lastKeyDown=new Date();}
function w(pHtml){document.write(pHtml);}
function wbr(pHtml){w("<br>"+pHtml);}
function say(pText){var e=document.createElement("SPAN");e.innerHTML=pText;if(document.body)
document.body.appendChild(e);}
var _playedSounds=[];var _playedSoundIndex=-1;function playSound(pUrl){var el=null;if(_ua.browser.name=="IE"){el=document.createElement("bgsound");el.id="sound_"+pUrl;el.src=pUrl;el.loop=0;el.autostart=true;el.hidden=true;el.style.height=0;}else if(browserHasPlugin('QuickTime')){el=document.createElement("object");el.id="sound_"+pUrl;el.data=pUrl;el.type="audio/mpeg";el.style.height=0;el.style.width=0;}else if(browserHasPlugin('Windows Media')){el=document.createElement("object");el.id="sound_"+pUrl;el.data=pUrl;el.type="application/x-mplayer2";}else if(browserHasPlugin('RealPlayer')){el=document.createElement("embed");el.id="sound_"+pUrl;el.type="audio/x-pn-realaudio-plugin";el.src=pUrl;el.loop=false;el.autostart=true;el.hidden=true;el.style.height=0;}
if(el!=null){_playedSoundIndex++;document.body.appendChild(el);_playedSounds[_playedSoundIndex]=el;}else{dalert("playSound fail: "+pUrl);}}
function removePlayedSounds(){for(var i=0;i<=_playedSoundIndex;i++){document.body.removeChild(_playedSounds[i]);_playedSounds[i]=null;}
_playedSounds=[];_playedSoundIndex=-1;}
function browserHasPlugin(pPluginName){if(!navigator.plugins)
return false;pPluginName=pPluginName.toLowerCase();for(var i=0;i<navigator.plugins.length;i++)
if(navigator.plugins[i].name.toLowerCase().indexOf(pPluginName)>-1)
return true;return false;}
function changecss(theClass,element,value){var cssRules;var added=false;for(var S=0;S<document.styleSheets.length;S++){if(document.styleSheets[S]['rules']){cssRules='rules';}else if(document.styleSheets[S]['cssRules']){cssRules='cssRules';}else{}
for(var R=0;R<document.styleSheets[S][cssRules].length;R++){if(document.styleSheets[S][cssRules][R].selectorText==theClass){if(document.styleSheets[S][cssRules][R].style[element]){document.styleSheets[S][cssRules][R].style[element]=value;added=true;break;}}}
if(!added){if(document.styleSheets[S].insertRule){document.styleSheets[S].insertRule(theClass+' { '+element+': '+value+'; }',document.styleSheets[S][cssRules].length);added=true;}else if(document.styleSheets[S].addRule){document.styleSheets[S].addRule(theClass,element+': '+value+';');added=true;}}}
return added;}
function getCssValue(theClass,element){var cssRules;for(var S=0;S<document.styleSheets.length;S++){if(document.styleSheets[S]['rules']){cssRules='rules';}else if(document.styleSheets[S]['cssRules']){cssRules='cssRules';}else{}
for(var R=0;R<document.styleSheets[S][cssRules].length;R++){if(document.styleSheets[S][cssRules][R].selectorText==theClass){if(document.styleSheets[S][cssRules][R].style[element]){return document.styleSheets[S][cssRules][R].style[element];}}}}
return"";}
function getProperties(obj,parent,seperator){if(typeof(obj)===String)
return obj;var proptext="";for(var i in obj){if(parent){proptext+=parent+"."+i+seperator+obj[i];}else{proptext+=i+seperator+obj[i];}
if(typeof obj[i]=="object"){if(parent){getProperties(obj[i],parent+"."+i,seperator);}else{getProperties(obj[i],i,seperator);}}}}
function copyToClipboard(text,pShowSuccessAlertMessage)
{var success=false;if(window.clipboardData)
{window.clipboardData.setData('text',text);success=true;}
else
{success=false;}
if(success&&IsValidInstance(pShowSuccessAlertMessage)&&pShowSuccessAlertMessage!="")
alert(pShowSuccessAlertMessage);return success;}
