
var gbIncCommonAPILoaded=false;var gIsCSS,gIsW3C,gIsIE4,gIsNN4;function initDHTMLAPI(){if(document.images){gIsCSS=(document.body&&document.body.style)?true:false;gIsW3C=(gIsCSS&&document.getElementById)?true:false;gIsIE4=(gIsCSS&&document.all)?true:false;gIsNN4=(document.layers)?true:false;isIE6CSS=(document.compatMode&&document.compatMode.indexOf("CSS1")>=0)?true:false;}
gbIncCommonAPILoaded=true;}
window.onload=initDHTMLAPI;function seekLayer(doc,name){var theObj;for(var i=0;i<doc.layers.length;i++){if(doc.layers[i].name==name){theObj=doc.layers[i];break;}
if(doc.layers[i].document.layers.length>0){theObj=seekLayer(document.layers[i].document,name);}}
return theObj;}
function g_getRawObject(obj){if(!gbIncCommonAPILoaded)initDHTMLAPI();var theObj;if(typeof obj=="string"&&obj!=""&&obj!=null){if(gIsW3C){theObj=document.getElementById(obj);}
else if(gIsIE4){theObj=document.all(obj);}
else if(gIsNN4){theObj=seekLayer(document,obj);}
if(theObj==null){try{theObj=eval("document."+obj);}
catch(e){theObj=null;}}}
else{theObj=obj;}
return theObj;}
function g_getObject(obj){var theObj=g_getRawObject(obj);if(theObj&&gIsCSS){if(theObj.style)theObj=theObj.style;}
return theObj;}
function gObjCollection(){this.objcollection=new Object();this.count=0;this.error=false;this.add=colAdd;this.item=colItem;this.exists=colExists;this.keys=colGetKeys;this.removeAll=colRemoveAll;this.remove=colRemove;function colAdd(sKey,sValue){this.error=false;if(!this.exists(sKey)){this.count++;this.objcollection[sKey]=sValue;}
else
this.error=true;}
function colItem(sKey,sValue){this.error=false;if(this.exists(sKey)){if(sValue!=null)this.objcollection[sKey]=sValue;return this.objcollection[sKey];}
else
this.error=true;}
function colExists(sKey){return(typeof(this.objcollection[sKey])!='undefined');}
function colRemoveAll(){this.objcollection=new Object();this.count=0;}
function colRemove(sKey){if(this.exists(sKey)){delete this.objcollection[sKey];this.count--;}}
function colGetKeys(){var aryKeys=new Array();var i=0;for(var k in this.objcollection){aryKeys[i]=k;i++;}
return aryKeys;}}
var gAryStyleProperties=new Array("background","color","font","border","padding","cursor","textDecoration");function g_getStyle(obj){var theObj=g_getRawObject(obj);if(window.getComputedStyle)return window.getComputedStyle(theObj,null);else if(theObj.currentStyle)return theObj.currentStyle;else if(theObj.style)return theObj.style;return obj;}
function g_saveStyle(obj){var objStyle=g_getStyle(obj);var objSavedStyle=new gObjCollection();if(objStyle){for(var i=0;i<gAryStyleProperties.length;i++){objSavedStyle.add(gAryStyleProperties[i],g_getStyleValueFromStyle(objStyle,gAryStyleProperties[i]));}}
return objSavedStyle;}
function g_setStyle(obj,objStyle){var obj=g_getRawObject(obj);var bSuccess=false;if(obj.style&&objStyle.cssText){try{obj.style.cssText=objStyle.cssText;bSuccess=true;}
catch(e){if(obj.setAttribute)obj.setAttribute("style",objStyle.cssText);bSuccess=false;}}
if(!bSuccess){if(objStyle.keys){for(var i=0;i<gAryStyleProperties.length;i++){g_setStyleValue(obj,gAryStyleProperties[i],objStyle.item(gAryStyleProperties[i]));}}
else{for(var i=0;i<gAryStyleProperties.length;i++){g_setStyleValue(obj,gAryStyleProperties[i],g_getStyleValueFromStyle(objStyle,gAryStyleProperties[i]));}}}}
function g_getStyleValue(obj,sProperty){var objStyle=g_getStyle(obj);var sValue;if(objStyle){sValue=(objStyle.getPropertyValue)?objStyle.getPropertyValue(sProperty):objStyle[sProperty];}
return sValue;}
function g_getStyleValueFromStyle(objStyle,sProperty){var sValue;if(objStyle){sValue=(objStyle.getPropertyValue)?objStyle.getPropertyValue(sProperty):objStyle[sProperty];}
return sValue;}
function g_setStyleValue(obj,sProperty,sValue){var theObj=g_getObject(obj);if(theObj){if(theObj.setProperty)theObj.setProperty(sProperty,sValue,null);else if(typeof(theObj[sProperty])!="undefined"){try{theObj[sProperty]=sValue;}
catch(e){if(sValue==""||sValue=="undefined")sValue="auto";}}}}
function toCamelCase(s){for(var exp=toCamelCase.exp;exp.test(s);s=s.replace(exp,RegExp.$1.toUpperCase()));return s;}
toCamelCase.exp=/-([a-z])/;function gfunClassDefStyle(sStyleSheetID,sClassName){var objStylesheet=g_getRawObject(objStylesheet);objStylesheet=(objStylesheet.sheet)?objStylesheet.sheet:objStylesheet.styleSheet;if(!objStylesheet){var sID;for(var i=0;i<document.styleSheets.length;i++){sID=(document.styleSheets[i].ownerNode)?document.styleSheets[i].ownerNode.id:document.styleSheets[i].owningElement.id;if(sID==sStyleSheetID){objStylesheet=document.styleSheets[i];break;}}}
var objRules=(objStylesheet.cssRules)?objStylesheet.cssRules:objStylesheet.rules;for(var i=0;i<objRules.length;i++){if(objRules[i].selectorText.toLowerCase()==sClassName.toLowerCase()){return objRules[i].style;break;}}}
function gfunAddElement(obj,sType,sID,sName,sClass,aryAttributes,aryValues){var theObj=g_getRawObject(obj);var objNode;if(document.createElement){var objNode=document.createElement(sType);if(sID!=null)objNode.setAttribute("id",sID);if(aryAttributes)if(aryAttributes.length){for(var i=0;i<aryAttributes.length;i++){if(objNode.setAttribute)objNode.setAttribute(aryAttributes[i],aryValues[i]);else if(objNode[aryAttributes[i]])objNode[aryAttributes[i]]=aryValues[i];}}
theObj.appendChild(objNode);objNode=(sID!=null)?g_getRawObject(sID):theObj.lastChild;if(sName!=null){objNode.setAttribute("name",sName);objNode.name=sName;}
if(sClass!=null)gfunSetClass(objNode,sClass);}
else if(theObj.innerHTML){var sHTML="<"+sType;if(sID!=null)sHTML+=" id=\""+sID+"\"";if(sName!=null)sHTML+=" name=\""+sName+"\"";if(sClass!=null)sHTML+=" class=\""+sClass+"\"";for(var i=0;i<aryAttributes.length;i++){sHTML+=" "+aryAttributes[i]+"=\""+aryValues[i]+"\"";}
sHTML+=" />";theObj.innerHTML+=sHTML;if(sID!=null)objNode=g_getRawObject(sID);else if(theObj.hasChildren)objNode=theObj.lastChild;else objNode=null;}
return objNode;}
function gfunCreateElement(sType,sID,sName,sClass,aryAttributes,aryValues){var objNode;if(document.createElement){var objNode=document.createElement(sType);if(sID!=null)objNode.setAttribute("id",sID);if(aryAttributes)if(aryAttributes.length){for(var i=0;i<aryAttributes.length;i++){if(objNode.setAttribute)objNode.setAttribute(aryAttributes[i],aryValues[i]);else if(objNode[aryAttributes[i]])objNode[aryAttributes[i]]=aryValues[i];}}
document.appendChild(objNode);objNode=(sID!=null)?g_getRawObject(sID):document.lastChild;if(sName!=null){objNode.setAttribute("name",sName);objNode.name=sName;}
if(sClass!=null)gfunSetClass(objNode,sClass);objNode=document.removeChild(document.lastChild);return objNode;}
else if(theObj.innerHTML){var sHTML="<"+sType;if(sID!=null)sHTML+=" id=\""+sID+"\"";if(sName!=null)sHTML+=" name=\""+sName+"\"";if(sClass!=null)sHTML+=" class=\""+sClass+"\"";for(var i=0;i<aryAttributes.length;i++){sHTML+=" "+aryAttributes[i]+"=\""+aryValues[i]+"\"";}
sHTML+=" />";document.innerHTML+=sHTML;objNode=(document.hasChildren)?document.removeChild(document.lastChild):null;return objNode;}}
function gfunSetClass(obj,sClass){var theObj=g_getRawObject(obj);if(theObj!=null){if(theObj.setAttribute!=null)theObj.setAttribute("class",sClass);if(theObj.className!=null)theObj.className=sClass;}
return null;}
function gfunGetClass(obj){var theObj=g_getRawObject(obj);var sClass="";if(theObj!=null){if(theObj.className!=null)sClass=theObj.className;else sClass=gfunGetAttribute(theObj,"class");}
return sClass;}
function gfunAppendClass(obj,sClass){var theObj=g_getRawObject(obj);var sNewClass=gfunGetClass(theObj);if(sNewClass==""||sNewClass==null)sNewClass=sClass;else if(sNewClass.indexOf(sClass)==-1)sNewClass=sNewClass+" "+sClass;gfunSetClass(theObj,sNewClass);}
function gfunRemoveClass(obj,sClass){var theObj=g_getRawObject(obj);var sNewClass=gfunGetClass(theObj);if(sNewClass!=null&&sNewClass!=""){if(sNewClass.indexOf(sClass)>=0){var re=new RegExp("(\s*"+sClass+"\s+)|(\s*"+sClass+"$)","gi");sNewClass=sNewClass.replace(re,"");}
gfunSetClass(theObj,sNewClass);}}
function gfunGetAttribute(obj,sAttribute){var theObj=g_getRawObject(obj);if(theObj!=null){if(theObj.getAttribute)if(theObj.getAttribute(sAttribute)!=null)return theObj.getAttribute(sAttribute);if(theObj.getAttributeNode)if(theObj.getAttributeNode(sAttribute)!=null)return theObj.getAttributeNode(sAttribute).value;if(theObj.attributes)if(theObj.attributes.getNamedItem)if(theObj.attributes.getNamedItem(sAttribute))return theObj.attributes.getNamedItem(sAttribute).value;if(theObj[sAttribute]!=null)return theObj[sAttribute];}
return null;}
function gfunGetKeyCode(evt){var iKeyCode;if(!evt)evt=window.event;if(evt.keyCode)iKeyCode=evt.keyCode;else if(evt.which)iKeyCode=evt.which;return iKeyCode;}
function gfunOpenWindow(sURL,sWindowName,sParameters){if(sWindowName==null)sWindowName="NewWindow";if(sParameters==null)sParameters="";var objNewWin=window.open(sURL,sWindowName,sParameters);if(objNewWin.focus)objNewWin.focus();return objNewWin;}
function gfunSwapImage(ImgageID,NewImage){var objImage=g_getRawObject(ImgageID);if(objImage.src)objImage.src=(NewImage.src)?NewImage.src:NewImage;}
function gfunCancelEvent(evt){if(!evt&&window.event)evt=window.event;if(evt.stopPropagation!=null)evt.stopPropagation();if(evt.cancelable!=null)evt.preventDefault();evt.cancelBubble=true;return false;}
function gfunDynamicTextUpdate(obj,sInnerText){var theObj=g_getRawObject(obj);if(theObj){if(theObj.replaceChild){var objTextNode=document.createTextNode(sInnerText);if(theObj.childNodes.length>0)theObj.replaceChild(objTextNode,theObj.firstChild);else theObj.appendChild(objTextNode);}
else if(theObj.innerText!=null)theObj.innerText=sInnerText;}}
function gfunGetInnerText(obj){var theObj=g_getRawObject(obj);if(theObj){if(theObj.innerText!=null)return theObj.innerText;else if(theObj.contentText!=null)return theObj.contentText;else if(theObj.childNodes.length>0){var s="";for(var i=0;i<theObj.childNodes.length;i++){if(theObj.childNodes[i].data!=null)s+=theObj.childNodes[i].data;else if(theObj.childNodes[i].childNodes.length>0)s+=gfunGetInnerText(theObj.childNodes[i]);}
return s;}}}
function gfunDoNothing(){}
var gnFlashVersion=0;var gbFlashAsked=false;var gbFlashEnabled=false;function funTestFlashPlugin(nRequiredVersion,bAskDownload){if(bAskDownload==null)bAskDownload=true;if(!bAskDownload)gbFlashAsked=true;var appNm=navigator.appName;var appVr=navigator.appVersion;var isIE=(appNm.indexOf("Explorer")>0)?true:false;var isNS=(appVr=="Netscape")?true:false;var bVer=(isIE)?(parseFloat(appVr.substring(appVr.indexOf("MSIE ")+5))):(parseFloat(appVr));var windows=((appVr.indexOf("Windows NT")!=-1)||(appVr.indexOf("Windows 95")!=-1)||(appVr.indexOf("Windows 98")!=-1));var mac=appVr.indexOf("Mac")!=-1?true:false;if(!((isIE&&windows&&(bVer<5))||(isNS&&(bVer==4.7)))){if(gnFlashVersion==0){if(appNm.indexOf("Webtv")!=-1)gbFlashEnabled=true;else if(mac&&bVer<4)gbFlashEnabled=false;else if(isIE&&(!mac||bVer<5)){if(appVr.indexOf("3.1")!=-1){gbFlashEnabled=false;}
else if(windows){document.writeln('<sc'+'ript language="vbscript">');document.writeln('on error resume next');document.writeln('gbFlashEnabled = false');document.writeln('call subVBGetFlashVersion()');document.writeln('sub subVBGetFlashVersion()');document.writeln(' dim i');document.writeln(' For i = 3 to 10');document.writeln('  gbFlashEnabled = IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & i))');document.writeln('  if gbFlashEnabled then');document.writeln('   gnFlashVersion = i');document.writeln('  else');document.writeln('   exit for');document.writeln('  end if');document.writeln(' Next');document.writeln('end sub');document.writeln('</sc'+'ript>');if(nRequiredVersion>gnFlashVersion)gbFlashEnabled=false;}
else if(appVr.indexOf("Mac")!=-1){gbFlashEnabled=true;}}
else if(navigator.plugins!=null){for(var i=0;i<navigator.plugins.length;i++){if(navigator.plugins[i].name=="Shockwave Flash"){gnFlashVersion=navigator.plugins[i].description.substring(navigator.plugins[i].description.indexOf(".")-2);if(isNaN(gnFlashVersion.charAt(0)))gnFlashVersion=gnFlashVersion.substring(1,1);gnFlashVersion=parseInt(gnFlashVersion);if(nRequiredVersion>gnFlashVersion)gbFlashEnabled=false;else gbFlashEnabled=true;break;}}}}
if(!gbFlashEnabled||nRequiredVersion>gnFlashVersion){if(funPromptForFlash(nRequiredVersion))window.top.location.href="/goout.asp?u=http://macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash";}}}
function funPromptForFlash(nRequiredVersion){if(gbFlashAsked)return false;else{gbFlashAsked=true;return confirm("This site uses the Flash Plug-in (Version "+nRequiredVersion+").\n\rWould you like to download it now?");}}
var gHTTP_Request;var gsResponseFunction;var gsErrorResponseFunction;var gbDebugAJAX=false;function gfunSendRequest(sURL,sMethod,sPostData,aryHeaderData,sFunctionName,bDebug,sErrorFunctionName,bIsAsynchronous){if(sMethod==null)sMethod="get";if(bDebug==null)bDebug=false;if(bIsAsynchronous==null)bIsAsynchronous=true;var sTemp="";if(gHTTP_Request!=null){if(aryHeaderData){if(typeof aryHeaderData=="string"){sTemp=aryHeaderData;}
else{for(var i=0;i<aryHeaderData.length;i++){sTemp=aryHeaderData[i][0]+"="+aryHeaderData[i][1]+"&";}
sTemp=sTemp.substring(0,sTemp.length-2);}}
if(bIsAsynchronous)setTimeout("gfunSendRequest('"+sURL+"', '"+sMethod+"', '"+sPostData+"', '"+sTemp+"', '"+sFunctionName+"', "+bDebug+", '"+sErrorFunctionName+"', "+bIsAsynchronous+");",100);return;}
if(document.all){var dDate=new Date();sURL=sURL+((sURL.indexOf("?")<=0)?"?":"&")+"random="+dDate.getTime();}
if(window.XMLHttpRequest){gHTTP_Request=new XMLHttpRequest();}
else if(window.ActiveXObject){try{gHTTP_Request=new ActiveXObject("Microsoft.XMLHTTP");}
catch(e){return false;}}
if(bIsAsynchronous)gHTTP_Request.onreadystatechange=gfunLoadExternalData;gHTTP_Request.open(sMethod,sURL,bIsAsynchronous);if(sMethod.toLowerCase()=="post")gHTTP_Request.setRequestHeader('Content-Type','application/x-www-form-urlencoded');if(typeof aryHeaderData=="string"){if(aryHeaderData.length>0){sTemp=aryHeaderData;aryHeaderData=new Array();var i=0;while(sTemp.length>0){aryHeaderData[i]=new Array();aryHeaderData[i][0]=sTemp.substring(0,sTemp.indexOf("="));if(sTemp.indexOf("&")>0){aryHeaderData[i][1]=sTemp.substring(sTemp.indexOf("=")+1,sTemp.indexOf("&"));sTemp=sTemp.substr(sTemp.indexOf("&")+1);}
else{aryHeaderData[i][1]=sTemp.substr(sTemp.indexOf("=")+1);sTemp="";}
i++;}}
else{aryHeaderData=null;}}
if(aryHeaderData){for(var i=0;i<aryHeaderData.length;i++){gHTTP_Request.setRequestHeader(aryHeaderData[i][0],aryHeaderData[i][1])}}
gsResponseFunction=sFunctionName;gsErrorResponseFunction=sErrorFunctionName;if(bDebug!=null)gbDebugAJAX=bDebug;gHTTP_Request.send(sPostData);if(bIsAsynchronous)return true;else{var sReturnString=(window.location.href.indexOf("http")==-1||gHTTP_Request.status==200)?gHTTP_Request.responseText:gHTTP_Request.status;gHTTP_Request=null;return sReturnString;}}
function gfunLoadExternalData(){if(gHTTP_Request.readyState==4){var sText=gHTTP_Request.responseText;if(gHTTP_Request.status==200&&gsResponseFunction!=null){eval(gsResponseFunction+"(gHTTP_Request.responseText);");}
else if(gsErrorResponseFunction!=null&&gsErrorResponseFunction.length>0){eval(gsErrorResponseFunction+"(gHTTP_Request.status, gHTTP_Request.responseText);");}
if(gbDebugAJAX){alert("gHTTP_Request.status: "+gHTTP_Request.status);alert("gHTTP_Request.responseText:\r\n");while(sText.length>0){alert(sText.substr(0,500));sText=sText.substr(500);}
gbDebugAJAX=false;}
gHTTP_Request=null;}}
function gfunParseAjaxValue(sData,sVarName,sDelimiter){if(sDelimiter==null)sDelimiter="|var|";var sSearchString=sDelimiter+sVarName+sDelimiter;var sValue="";var nPos=sData.indexOf(sSearchString);var nNextPos;if(nPos>=0){nPos=nPos+sSearchString.length;nNextPos=sData.indexOf(sDelimiter,nPos);if(nNextPos==-1)nNextPos=sData.length;sValue=sData.substring(nPos,nNextPos);}
return sValue;}
function gfunSetCookie(name,value,expires,path,domain,secure){var curCookie=name+"="+escape(value)+
((expires)?"; expires="+expires.toGMTString():"")+
((path)?"; path="+path:"")+
((domain)?"; domain="+domain:"")+
((secure)?"; secure":"");document.cookie=curCookie;}
function gfunGetCookie(name){var dc=document.cookie;var prefix=name+"=";var begin=dc.indexOf("; "+prefix);if(begin==-1){begin=dc.indexOf(prefix);if(begin!=0)return null;}
else{begin+=2;}
var end=document.cookie.indexOf(";",begin);if(end==-1)end=dc.length;return unescape(dc.substring(begin+prefix.length,end));}
function gfunGetSubCookie(sCookieName,sKeyName){var sValue=gfunGetCookie(sCookieName);if(sValue==null)return null;var nKeyPos=sValue.indexOf(sKeyName+"=");if(nKeyPos==-1)return null;else{nKeyPos=nKeyPos+sKeyName.length+1;sValue=sValue.substr(nKeyPos);var nNextAmp=sValue.indexOf("&");var nNextEqual=(nNextAmp>-1)?sValue.indexOf("=",nNextAmp):-1;if(nNextAmp>-1&&nNextEqual>nNextAmp){sValue=sValue.substr(0,nNextEqual);var nAmpPos=sValue.lastIndexOf("&");sValue=sValue.substr(0,nAmpPos);}
return sValue;}}
function gfunSetSubCookie(sCookieName,sKeyName,value,expires,path,domain,secure){var sSubValue="&"+sKeyName+"="+value;var sCurValue=gfunGetCookie(sCookieName);if(sCurValue==null||sCurValue=="")sCurValue=sSubValue;else if(sCurValue.indexOf("&"+sKeyName+"=")==-1)sCurValue+=sSubValue;else sCurValue=gfunReplaceBetween(sCurValue,"&"+sKeyName+"=","&",value,false,true,null);var curCookie=sCookieName+"="+escape(sCurValue)+
((expires)?"; expires="+expires.toGMTString():"")+
((path)?"; path="+path:"")+
((domain)?"; domain="+domain:"")+
((secure)?"; secure":"");document.cookie=curCookie;}
function gfunDeleteCookie(name,path,domain){if(gfunGetCookie(name)){document.cookie=name+"="+
((path)?"; path="+path:"")+
((domain)?"; domain="+domain:"")+"; expires=Thu, 01-Jan-70 00:00:01 GMT";}}
function gfunSelectRadio(objForm,sRadioName,sValue){objForm=g_getRawObject(objForm);if(objForm[sRadioName]==null)return;var objRadio=objForm[sRadioName];for(var i=0;i<objRadio.length;i++){if(objRadio[i].value==sValue.toString()){objRadio[i].checked=true;break;}}}
function gfunGetSelectedRadioValue(objForm,sRadioName){objForm=g_getRawObject(objForm);if(objForm[sRadioName]==null)return;var objRadio=objForm[sRadioName];for(var i=0;i<objRadio.length;i++){if(objRadio[i].checked){return objRadio[i].value;break;}}}
function gfunGetSelectedCheckboxValue(objForm,sCheckboxName){objForm=g_getRawObject(objForm);if(objForm[sCheckboxName]==null)return;var sValue="";var objCheckbox=objForm[sCheckboxName];for(var i=0;i<objCheckbox.length;i++){if(objCheckbox[i].checked){sValue+=objCheckbox[i].value+",";}}
if(sValue.length>2)sValue.substring(0,sValue.length-2);return sValue;}
function gfunSelectedOption(objSelect){objSelect=g_getRawObject(objSelect);if(objSelect==null)return;if(objSelect.options==null)return;return objSelect.options[objSelect.selectedIndex];}
function gfunHasMultipleSelected(objSelect){objSelect=g_getRawObject(objSelect);if(objSelect==null)return false;if(objSelect.options==null)return false;if(objSelect.selectedIndex==-1)return false;if(!objSelect.multiple)return false;for(var i=objSelect.selectedIndex+1;i<objSelect.options.length;i++){if(objSelect[i].selected)return true;}
return false;}
function gfunSelectOption(objSelect,sValue){objSelect=g_getRawObject(objSelect);if(objSelect==null)return;if(objSelect.multiple)objSelect.selectedIndex=-1;for(var i=0;i<objSelect.options.length;i++){if(objSelect.options[i].value==sValue){objSelect.selectedIndex=i;break;}}
if(objSelect.selectedIndex==-1&&!objSelect.multiple){objSelect.selectedIndex=0;}}
var gbOptionMoveContinuous=false;var gnOptionMovedTimes=new Array();gnOptionMovedTimes[0]=0;var gOptionMovingTimer=new Array();function gfunMoveSelectOption(sSelectID,dir,nMoveIndex,nThreadID){objSelect=g_getRawObject(sSelectID);if(objSelect==null){return;}
if(!gfunHasOptions(objSelect)){return;}
var nNewIndex;if(nMoveIndex==null){for(var i=0;i<gOptionMovingTimer.length;i++)window.clearTimeout(gOptionMovingTimer[i]);if(objSelect.selectedIndex==-1)return;var nNumMoved=0;if(dir=="up"||dir=="top"){if(objSelect.options[0].selected)return!gfunStopMoveSelectOption();for(var i=1;i<objSelect.options.length;i++){if(objSelect.options[i].selected){nNewIndex=(dir=="up")?i-1:nNumMoved;gfunChangeSelectOptionIndex(objSelect,i,nNewIndex);nNumMoved++;}}}
else{if(objSelect.options[objSelect.options.length-1].selected)return!gfunStopMoveSelectOption();for(var i=objSelect.options.length-2;i>=0;i--){if(objSelect.options[i].selected){nNewIndex=(dir=="down")?i+1:objSelect.options.length-nNumMoved-1;gfunChangeSelectOptionIndex(objSelect,i,nNewIndex);nNumMoved++;}}}}
else{if(nThreadID==null)nThreadID=nMoveIndex;window.clearTimeout(gOptionMovingTimer[nThreadID]);if(dir=="up"||dir=="top"){if(nMoveIndex==0)return!gfunStopMoveSelectOption();else nNewIndex=(dir=="up")?nMoveIndex-1:0;}
else{if(nMoveIndex==objSelect.options.length-1)return!gfunStopMoveSelectOption();else nNewIndex=(dir=="down")?nMoveIndex+1:objSelect.options.length-1;}
gfunChangeSelectOptionIndex(objSelect,nMoveIndex,nNewIndex);}
if((dir=="up"||dir=="down")&&gbOptionMoveContinuous){var nDelay;if(nMoveIndex==null){if((dir=="up"&&objSelect.selectedIndex==0)||(dir=="down"&&objSelect.options[objSelect.options.length-1].selected)){gfunStopMoveSelectOption();}
else{nDelay=(gnOptionMovedTimes[0]==0)?750:200;gOptionMovingTimer[0]=setTimeout("gfunMoveSelectOption('"+sSelectID+"','"+dir+"');",nDelay);gnOptionMovedTimes[0]++;}}
else{if((dir=="up"&&nNewIndex==0)||(dir=="down"&&nNewIndex==objSelect.options.length-1)){gfunStopMoveSelectOption();}
else{nDelay=(gnOptionMovedTimes[nThreadID]==0||gnOptionMovedTimes[nThreadID]==null)?750:200;gOptionMovingTimer[nThreadID]=setTimeout("gfunMoveSelectOption('"+sSelectID+"','"+dir+"',"+nNewIndex+","+nThreadID+");",nDelay);gnOptionMovedTimes[nThreadID]++;}}}}
function gfunMoveSelectOptionContinuously(sSelectID,dir,nMoveIndex,nThreadID){gbOptionMoveContinuous=true;gfunMoveSelectOption(sSelectID,dir,nMoveIndex,nThreadID);}
function gfunStopMoveSelectOption(){gbOptionMoveContinuous=false;for(var i=0;i<gOptionMovingTimer.length;i++)window.clearTimeout(gOptionMovingTimer[i]);for(var i=0;i<gnOptionMovedTimes.length;i++)gnOptionMovedTimes[i]=0;return true;}
function gfunChangeSelectOptionIndex(SelectObj,nIndex,nNewIndex){var objSelect=g_getRawObject(SelectObj);with(objSelect){var bSelected=(options[nIndex].selected);var newOption=gfunCreateOption(options[nIndex].text,options[nIndex].value);options[nIndex].selected=false;g_setStyle(newOption,g_getStyle(options[nIndex]));if(options[nIndex].attributes){var attrValue;for(var i=0;i<options[nIndex].attributes.length;i++){attrValue=options[nIndex].attributes[i].value;if(attrValue!=""&attrValue!=null&attrValue!="null"){attrValue=(attrValue=="true")?true:((attrValue=="false")?false:attrValue);newOption.setAttribute(options[nIndex].attributes[i].name,attrValue);}}}
if(options[nIndex].className!=null)newOption.className=options[nIndex].className;}
gfunRemoveOption(objSelect,nIndex);gfunAddOption(objSelect,newOption,nNewIndex);objSelect.options[nNewIndex].selected=bSelected;}
function gfunCreateOption(sText,sValue,defaultSelected,selected){var objOption;try{objOption=new Option(sText,sValue,defaultSelected,selected);}
catch(e){if(document.createElement){objOption=document.createElement("option");var txtNode=document.createTextNode(sText);objOption.appendChild(txtNode);objOption.setAttribute("value",sValue);}}
return objOption;}
function gfunRemoveOption(objSelect,nIndex){objSelect=g_getRawObject(objSelect);if(objSelect.options){if(nIndex==null){while(objSelect.selectedIndex>-1){gfunRemoveOption(objSelect,objSelect.selectedIndex);}}
else{if(nIndex<0||nIndex>=objSelect.options.length)return false;if(objSelect.options.remove){objSelect.options.remove(nIndex);return true;}
else if(objSelect.removeChild){objSelect.removeChild(objSelect.childNodes[nIndex]);return true;}
else{objSelect.options[nIndex]=null;return true;}}}
return false;}
function gfunRemoveAllOptions(objSelect){objSelect=g_getRawObject(objSelect);var nNumRemoved=0;if(objSelect.options){for(var i=objSelect.options.length;i>0;i--){gfunRemoveOption(objSelect,(i-1));nNumRemoved++;}}
return nNumRemoved;}
function gfunAddOption(objSelect,objOption,nIndex){objSelect=g_getRawObject(objSelect);if(gfunHasOptions(objSelect)){if(objSelect.options.add){if(nIndex==null||nIndex<0||nIndex>=objSelect.options.length)objSelect.options.add(objOption);else objSelect.options.add(objOption,nIndex);return true;}
else if(objSelect.insertBefore){if(nIndex==null||nIndex<0||nIndex>=objSelect.options.length)objSelect.appendChild(objOption);else objSelect.insertBefore(objOption,objSelect.childNodes[nIndex]);return true;}}
return false;}
function gfunTransferSelectOption(objSource,objDestination,Position,RemoveFromSource){if(RemoveFromSource==null)RemoveFromSource=true;objSource=g_getRawObject(objSource);objDestination=g_getRawObject(objDestination);var sText,nNewIndex,newOption;for(var i=0;i<objSource.options.length;i++){if(objSource.options[i].selected){if(isNaN(Position)){sText=objSource.options[i].text;nNewIndex=-1;for(var j=0;j<objDestination.options.length;j++){if(sText.toLowerCase()<objDestination.options[j].text.toLowerCase()){nNewIndex=j;break;}}
if(nNewIndex==-1)nNewIndex=objDestination.options.length;}
else{nNewIndex=(Position>=0&&Position<=objDestination.options.length)?Position:objDestination.options.length;}
with(objSource){newOption=gfunCreateOption(options[i].text,options[i].value);options[i].selected=false;g_setStyle(newOption,g_getStyle(options[i]));if(options[i].attributes){for(var k=0;k<options[i].attributes.length;k++){newOption.setAttribute(options[i].attributes[k].name,options[i].attributes[k].value);}}}
if(RemoveFromSource){gfunRemoveOption(objSource,i);i--;}
gfunAddOption(objDestination,newOption,nNewIndex);}}}
function gfunSelectAllSelectOptions(objSelect,sFunctionReference){var obj=g_getRawObject(objSelect);if(!obj.multiple){obj.multiple=true;if(sFunctionReference!=null)setTimeout("gfunSelectAllSelectOptions('"+objSelect+"', '"+sFunctionReference+"')",50);else setTimeout("gfunSelectAllSelectOptions('"+objSelect+"')",50);}
else if(obj.options){for(var i=0;i<obj.options.length;i++){obj.options[i].selected=true;}
if(sFunctionReference!=null)setTimeout(sFunctionReference,10);}}
var gObjKeyTimer;var gsEnteredText="";function gfunSelectKeyPress(objSelect,e,EnterFunction){if(!e&&window.event)e=window.event;if(objSelect==null&&e!=null){objSelect=(e.target)?e.target:e.srcElement;}
objSelect=g_getRawObject(objSelect);var whichKey=gfunGetKeyCode(e);if(objSelect!=null&&whichKey!=null){clearTimeout(gObjKeyTimer);var sName;if(whichKey>=97)whichKey-=32;if((whichKey>=48&&whichKey<=57)||(whichKey>=65&&whichKey<=90)){gsEnteredText+=String.fromCharCode(whichKey).toUpperCase();for(var i=0;i<objSelect.options.length;i++){sName=objSelect.options[i].text;if(gsEnteredText==sName.substr(0,gsEnteredText.length).toUpperCase()){objSelect.options[i].selected=true;break;}}
gObjKeyTimer=setTimeout("gsEnteredText = \"\";",800);return false;}
if(whichKey==13&&EnterFunction!=null){return eval(EnterFunction);}}}
function gfunHasOptions(objSelect){objSelect=g_getRawObject(objSelect);if(objSelect!=null&&objSelect.options!=null){return true;}
return false;}
function gfunSortSelect(objSelect){objSelect=g_getRawObject(objSelect);if(!gfunHasOptions(objSelect)){return;}
var o=new Array();with(objSelect){for(var i=0;i<options.length;i++){o[i]=gfunCreateOption(options[i].text,options[i].value,options[i].defaultSelected,options[i].selected);options[i].selected=false;g_setStyle(o[i],g_getStyle(options[i]));if(options[i].attributes){for(var j=0;j<options[i].attributes.length;j++){o[i].setAttribute(options[i].attributes[j].name,options[i].attributes[j].value);}}}}
if(o.length==0){return;}
o=o.sort(function(a,b){if((a.text+"")<(b.text+"")){return-1;}
if((a.text+"")>(b.text+"")){return 1;}
return 0;});for(var i=0;i<o.length;i++){objSelect.options[i]=o[i];}}
function gfunNumOptionsSelected(objSelect){var obj=g_getRawObject(objSelect);if(!gfunHasOptions(obj)){return 0;}
if(!obj.multiple){return(obj.selectedIndex==-1)?0:1;}
else if(obj.selectedIndex==-1){return 0;}
else{var nNum=0;for(var i=0;i<obj.options.length;i++){if(obj.options[i].selected)nNum++;}
return nNum;}}
function gfunHideSelects(sExcludeForms){if(sExcludeForms==null)sExcludeForms="";var objForm;for(j=0;j<document.forms.length;j++){objForm=document.forms[j];if(sExcludeForms.indexOf(objForm.name)==-1&&sExcludeForms.indexOf(objForm.id)==-1){for(var i=0;i<objForm.length;i++){if(objForm[i].type=="select-one"||objForm[i].type=="select-multiple"){objForm[i].style.visibility="hidden";}}}}}
function gfunShowSelects(sExcludeForms){if(sExcludeForms==null)sExcludeForms="";var objForm;for(j=0;j<document.forms.length;j++){objForm=document.forms[j];if(sExcludeForms.indexOf(objForm.name)==-1&&sExcludeForms.indexOf(objForm.id)==-1){for(var i=0;i<objForm.length;i++){if(objForm[i].type=="select-one"||objForm[i].type=="select-multiple"){objForm[i].style.visibility="";}}}}}
function gfunShiftTo(obj,x,y){var theObj=g_getObject(obj);if(theObj){if(gIsCSS){var units=(typeof theObj.left=="string")?"px":0;if(x!=null)theObj.left=x+units;if(y!=null)theObj.top=y+units;}
else if(gIsNN4){if(x==null)x=gfunGetObjectLeft(obj);if(y==null)y=gfunGetObjectTop(obj);theObj.moveTo(x,y);}}}
function gfunShiftBy(obj,deltaX,deltaY){var theObj=g_getObject(obj);if(theObj){if(gIsCSS){var units=(typeof theObj.left=="string")?"px":0
theObj.left=gfunGetObjectLeft(obj)+deltaX+units;theObj.top=gfunGetObjectTop(obj)+deltaY+units;}
else if(gIsNN4){theObj.moveBy(deltaX,deltaY);}}}
function gfunSetZIndex(obj,zOrder){var theObj=g_getObject(obj);if(theObj){theObj.zIndex=zOrder;}}
function gfunSetBGColor(obj,color){var theObj=g_getObject(obj);if(theObj){if(gIsNN4){theObj.bgColor=color;}else if(gIsCSS){theObj.backgroundColor=color;}}}
function gfunIsVisible(obj){var theObj=g_getObject(obj);if(theObj){if(theObj.visibility!="hidden"&&theObj.display!="none"){return true;}
else{return false;}}}
function gfunShow(obj){var theObj=g_getObject(obj);if(theObj){theObj.visibility="visible";}}
function gfunHide(obj){var theObj=g_getObject(obj);if(theObj){theObj.visibility="hidden";}}
function gfunDisplay(obj){var theObj=g_getObject(obj);if(theObj){theObj.display="block";}}
function gfunCollapse(obj){var theObj=g_getObject(obj);if(theObj){theObj.display="none";}}
function gfunToggleDisplay(obj){var theObj=g_getObject(obj);if(theObj){if(theObj.display=="none")theObj.display="block";else theObj.display="none";}}
function gfunGetScrollValueY(){if(document.documentElement)if(document.documentElement.scrollTop)return document.documentElement.scrollTop;if(document.body)return document.body.scrollTop;else return null;}
function gfunGetScrollValue(){return gfunGetScrollValueY();}
function gfunGetScrollValueX(){if(document.documentElement)if(document.documentElement.scrollLeft)return document.documentElement.scrollLeft;if(document.body)return document.body.scrollLeft;else return null;}
function gfunGetObjectLeft(obj){var elem=g_getRawObject(obj);var result=0;if(document.defaultView){var style=document.defaultView;var cssDecl=style.getComputedStyle(elem,"");result=cssDecl.getPropertyValue("left");}
else if(elem.currentStyle){result=elem.currentStyle.left;}
else if(elem.style){result=elem.style.left;}
else if(gIsNN4){result=elem.left;}
return parseInt(result);}
function gfunGetObjectTop(obj){var elem=g_getRawObject(obj);var result=0;if(document.defaultView){var style=document.defaultView;var cssDecl=style.getComputedStyle(elem,"");result=cssDecl.getPropertyValue("top");}
else if(elem.currentStyle){result=elem.currentStyle.top;}
else if(elem.style){result=elem.style.top;}
else if(gIsNN4){result=elem.top;}
return parseInt(result);}
function gfunGetRealLeft(obj){var elem=g_getRawObject(obj);var xPos=elem.offsetLeft;var tempEl=elem.offsetParent;while(tempEl!=null){xPos+=tempEl.offsetLeft;tempEl=tempEl.offsetParent;}
return xPos;}
function gfunGetRealTop(obj){var elem=g_getRawObject(obj);var yPos=elem.offsetTop;var tempEl=elem.offsetParent;while(tempEl!=null){yPos+=tempEl.offsetTop;tempEl=tempEl.offsetParent;}
return yPos;}
function gfunGetObjectWidth(obj){var elem=g_getRawObject(obj);var result=0;if(elem!=null){if(elem.offsetWidth){result=elem.offsetWidth;}
else if(elem.clip&&elem.clip.width){result=elem.clip.width;}
else if(elem.style&&elem.style.pixelWidth){result=elem.style.pixelWidth;}}
return parseInt(result);}
function gfunGetObjectParentContainerWidth(obj){var elem=g_getRawObject(obj);if(elem.parentNode)elem=elem.parentNode;else if(elem.parentElement)elem=elem.parentElement;var nWidth=gfunGetObjectWidth(elem);var result=nWidth;if(result>0&&elem.style&&elem.style.paddingLeft!=null){var sTempPad=elem.style.paddingLeft;var nTempSize=parseInt(sTempPad);if(!isNaN(nTempSize)){if(sTempPad.indexOf("px")>0){result-=parseInt(sTempPad);}
else if(sTempPad.indexOf("%")>0){result-=nWidth*(parseInt(sTempPad)/100);}}
sTempPad=elem.style.paddingRight;nTempSize=parseInt(sTempPad);if(!isNaN(nTempSize)){if(sTempPad.indexOf("px")>0){result-=parseInt(sTempPad);}
else if(sTempPad.indexOf("%")>0){result-=nWidth*(parseInt(sTempPad)/100);}}}
return parseInt(result);}
function gfunGetObjectHeight(obj){var elem=g_getRawObject(obj);var result=0;if(elem!=null){if(elem.offsetHeight){result=elem.offsetHeight;}
else if(elem.clip&&elem.clip.height){result=elem.clip.height;}
else if(elem.style&&elem.style.pixelHeight){result=elem.style.pixelHeight;}}
return parseInt(result);}
function gfunGetObjectParentContainerHeight(obj){var elem=g_getRawObject(obj);if(elem.parentNode)elem=elem.parentNode;else if(elem.parentElement)elem=elem.parentElement;var nHeight=gfunGetObjectHeight(elem);var result=nHeight;if(result>0&&elem.style&&elem.style.paddingLeft!=null){var sTempPad=elem.style.paddingTop;var nTempSize=parseInt(sTempPad);if(!isNaN(nTempSize)){if(sTempPad.indexOf("px")>0){result-=parseInt(sTempPad);}
else if(sTempPad.indexOf("%")>0){result-=nHeight*(parseInt(sTempPad)/100);}}
sTempPad=elem.style.paddingBottom;nTempSize=parseInt(sTempPad);if(!isNaN(nTempSize)){if(sTempPad.indexOf("px")>0){result-=parseInt(sTempPad);}
else if(sTempPad.indexOf("%")>0){result-=nHeight*(parseInt(sTempPad)/100);}}}
return parseInt(result);}
function gfunGetInsideWindowWidth(){if(window.innerWidth){return window.innerWidth;}
else if(isIE6CSS){return document.body.parentElement.clientWidth}
else if(document.body&&document.body.clientWidth){return document.body.clientWidth;}
return 0;}
function gfunGetInsideWindowHeight(){if(window.innerHeight){return window.innerHeight;}
else if(isIE6CSS){return document.body.parentElement.clientHeight}
else if(document.body&&document.body.clientHeight){return document.body.clientHeight;}
return 0;}
function gfunGetCellWidth(objTable,objCell){objTable=g_getRawObject(objTable);objCell=g_getRawObject(objCell);if(objTable&&objCell){var objRow=(objCell.parentNode)?objCell.parentNode:objCell.parentElement;nCellIndex=objCell.cellIndex;var sAgent=navigator.userAgent;if(sAgent.indexOf("Safari")>1){for(var i=0;i<objRow.cells.length;i++){if(objRow.cells[i]==objCell){nCellIndex=i;break;}}}
var nCellWidth,nTableLeft,nTableWidth,nCellLeft,nCellIndex,objNextCell;nCellLeft=parseInt(objCell);if(nCellIndex<objRow.cells.length-1){objNextCell=objRow.cells[nCellIndex+1];nCellWidth=parseInt(objNextCell)-nCellLeft;}
else{nTableLeft=parseInt(objTable);nCellWidth=nTableLeft+parseInt(objTable.width)-nCellLeft;}
return nCellWidth;}
return 0;}
function gfunSetSelectionRange(input,selectionStart,selectionEnd){if(input.setSelectionRange){input.focus();input.setSelectionRange(selectionStart,selectionEnd);}
else if(input.createTextRange){var range=input.createTextRange();range.collapse(true);range.moveEnd('character',selectionEnd);range.moveStart('character',selectionStart);range.select();}}
function gfunReplaceSelection(input,replaceString){if(input.setSelectionRange){var selectionStart=input.selectionStart;var selectionEnd=input.selectionEnd;input.value=input.value.substring(0,selectionStart)+replaceString+input.value.substring(selectionEnd);if(selectionStart!=selectionEnd){gfunSetSelectionRange(input,selectionStart,selectionStart+replaceString.length);}
else{gfunSetSelectionRange(input,selectionStart+replaceString.length,selectionStart+replaceString.length);}}
else if(document.selection){var range=document.selection.createRange();if(range.parentElement()==input){var isCollapsed=(range.text=='');range.text=replaceString;if(!isCollapsed){range.moveStart('character',-replaceString.length);range.select();}}}}
function gfunTrimString(sText){var sTemp=sText;if(sTemp.length>0){while(sTemp.substring(0,1).match(/\s/))sTemp=sTemp.substring(1,sTemp.length);while(sTemp.charAt(sTemp.length-1).match(/\s/))sTemp=sTemp.substr(0,sTemp.length-1);}
return sTemp;}
function gfunStripTags(sText){var i,j;var sHTML=sText;var arySplit=new Array();arySplit=sHTML.split("<");var j=(arySplit[0].length>0)?1:0;for(i=j;i<arySplit.length;i++){if(arySplit[i].indexOf(">")!=-1)arySplit[i]=arySplit[i].substring(arySplit[i].indexOf(">")+1);else arySplit[i]="<"+arySplit[i];}
sHTML=arySplit.join("");sHTML=sHTML.substring(1-j);sHTML=sHTML.replace(/&amp;/gi,"&");sHTML=sHTML.replace(/&nbsp;/gi," ");return sHTML;}
function gfunURLEncode(sText){var sTemp=sText;if(sTemp.length>0){sTemp=sTemp.replace(/%/g,"%25");sTemp=sTemp.replace(/\+/g,"%2B");sTemp=sTemp.replace(/\s/g,"+");sTemp=sTemp.replace(/&/g,"%26");sTemp=sTemp.replace(/'/g,"%27");sTemp=sTemp.replace(/"/g,"%22");sTemp=sTemp.replace(/\./g,"%2E");sTemp=sTemp.replace(/\?/g,"%3F");sTemp=sTemp.replace(/\!/g,"%21");sTemp=sTemp.replace(/-/g,"%2D");}
return sTemp;}
function gfunURLDecode(sText){var sTemp=sText;if(sTemp.length>0){sTemp=sTemp.replace(/\%26/g,"&");sTemp=sTemp.replace(/\%27/g,"'");sTemp=sTemp.replace(/\%22/g,"\"");sTemp=sTemp.replace(/\%2E/g,".");sTemp=sTemp.replace(/\%3F/g,"?");sTemp=sTemp.replace(/\%21/g,"!");sTemp=sTemp.replace(/\%2D/,"-");sTemp=sTemp.replace(/\+/g," ");sTemp=sTemp.replace(/\%2B/g,"+");sTemp=sTemp.replace(/\%25/g,"%");}
return sTemp;}
function gfunMakeLength(sText,nSize,bPlaceAtEnd){if(bPlaceAtEnd==null)bPlaceAtEnd=true;var sTemp=sText;if(sTemp.length>nSize)sTemp=sTemp.substr(0,nSize);if(sTemp.length<nSize){if(bPlaceAtEnd)sTemp=sTemp+gfunCreateString((nSize-sTemp.length),"^");else sTemp=gfunCreateString((nSize-sTemp.length),"^")+sTemp;}
sTemp=sTemp.replace(/\^/g," ");return sTemp;}
function gfunCreateString(nLength,sChar){var sTemp="";for(var i=0;i<nLength;i++)sTemp+=sChar;return sTemp;}
function gfunReplaceBetween(sText,sStart,sEnd,sNewMiddle,bGlobal,bIgnoreCase,nStartPos){if(sNewMiddle==null)sNewMiddle="";if(bGlobal==null)bGlobal=true;if(bIgnoreCase==null)bIgnoreCase=false;if(nStartPos==null)nStartPos=0;var sTemp=sText;var nEndPos;if(bIgnoreCase){sStart=sStart.toLowerCase();sEnd=sEnd.toLowerCase();}
var sSearchValue=(bIgnoreCase)?sTemp.toLowerCase():sTemp;while(sSearchValue.indexOf(sStart,nStartPos)>-1&&sSearchValue.indexOf(sEnd,nStartPos)>(sSearchValue.indexOf(sStart,nStartPos)+sStart.length-1)){nStartPos=sSearchValue.indexOf(sStart,nStartPos)+sStart.length;nEndPos=sSearchValue.indexOf(sEnd,nStartPos);sTemp=sTemp.substring(0,nStartPos)+sNewMiddle+sTemp.substring(nEndPos,sTemp.length);nStartPos+=sNewMiddle.length+sEnd.length;if(!bGlobal){nStartPos=sTemp.length;}
else{sSearchValue=(bIgnoreCase)?sTemp.toLowerCase():sTemp;}}
return sTemp;}
function gfunToTitleCase(sText)
{return str.replace(/\w+/g,function(sText){return sText.charAt(0).toUpperCase()+sText.substr(1).toLowerCase();});}
function gfunAddRow(objTable,nIndex){objTable=g_getRawObject(objTable);if(objTable.tBodies)objTable=objTable.tBodies[0];if(objTable.insertRow){return(nIndex==null)?objTable.insertRow():objTable.insertRow(nIndex);}
else if(objTable.appendChild){var objNode=document.createElement("tr");if(nIndex==null)objTable.appendChild(objNode);else{var objCurChild=(objTable.hasChildNodes)?objTable.rows[nIndex]:null;if(objCurChild)objTable.insertBefore(objNode,objCurChild);else objTable.appendChild(objNode);}
return objNode;}}
function gfunAddCell(Row,nIndex,sInnerHTML){objRow=g_getRawObject(Row);if(objRow.cells){if(nIndex==null)nIndex=objRow.cells.length;if(objRow.appendChild){var objNode=document.createElement("td");if(sInnerHTML!=null)objNode.appendChild(document.createTextNode(sInnerHTML));if(nIndex==null)objRow.appendChild(objNode);else{var objCurChild=(objRow.hasChildNodes)?objRow.cells[nIndex]:null;if(objCurChild)objRow.insertBefore(objNode,objCurChild);else objRow.appendChild(objNode);}
return objNode;}
else if(objRow.insertCell){var objCell=objRow.insertCell(nIndex);if(sInnerHTML!=null){if(objCell.appendChild){objCell.appendChild(document.createTextNode(sInnerHTML));}
else if(objCell.innerHTML){objCell.innerHTML=sInnerHTML;}}
return objCell;}}
return null;}
function gfunRemoveRow(objTable,nIndex){objTable=g_getRawObject(objTable);if(objTable.tBodies)objTable=objTable.tBodies[0];if(objTable.deleteRow){objTable.deleteRow(nIndex);}
else if(objTable.removeChild){var objCurChild=(objTable.hasChildNodes)?objTable.rows[nIndex]:null;if(objCurChild)objTable.removeChild(objCurChild);}}
function gfunIsValidEmailAddress(sText,bAllowMultiple){var isOK=true;if(bAllowMultiple==null)bAllowMultiple=false;if(bAllowMultiple){var aryEmails=sText.split(";");for(var i=0;i<aryEmails.length;i++){if(isOK){isOK=(aryEmails[i].search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/)!=-1);}
else{break;}}}
else{isOK=(sText.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/)!=-1);}
return isOK;}
function gfunAjaxIncludeFile(sUrl){var objRequest=false;var dRandDate=new Date();if(sUrl.indexOf("http://")==0){sUrl="/ExternalHtml.asp?rand="+dRandDate.getTime()+"&url="+((encodeURI!=null)?encodeURI(sUrl):escape(sUrl));}
else{sUrl+=(sUrl.lastIndexOf("?")<sUrl.indexOf("."))?("?rand="+dRandDate.getTime()):("&rand="+dRandDate.getTime());}
if(window.XMLHttpRequest)
objRequest=new XMLHttpRequest()
else if(window.ActiveXObject){try{objRequest=new ActiveXObject("Msxml2.XMLHTTP")}
catch(e){try{objRequest=new ActiveXObject("Microsoft.XMLHTTP")}
catch(e){}}}
else
return false;objRequest.open('GET',sUrl,false);objRequest.send(null);if(window.location.href.indexOf("http")==-1||objRequest.status==200)document.write(objRequest.responseText);}
var g_aryRotateInstances=new Array();function gfunRotateEntry_Init(sModuleID,nNumStories,nSeconds,bAutoPlay){if(nSeconds==null)nSeconds=8;if(bAutoPlay==null)bAutoPlay=true;var nInstanceIndex=g_aryRotateInstances.length;g_aryRotateInstances[nInstanceIndex]=new Array(sModuleID,nNumStories,0,nSeconds,null);gfunRotateEntry_SetHeight(sModuleID,nNumStories);if(bAutoPlay)g_aryRotateInstances[nInstanceIndex][4]=setTimeout("gfunRotateEntry_Play('"+sModuleID+"');",nSeconds*1000);}
function gfunRotateEntry_Show(sModuleID,nIndex,nCurrentIndex){var nInstanceIndex=gfunRotateEntry_GetInstance(sModuleID);var nNumStories=g_aryRotateInstances[nInstanceIndex][1];if(nIndex>=0&&nIndex<=nNumStories){if(nCurrentIndex==null)nCurrentIndex=g_aryRotateInstances[nInstanceIndex][2];var sOldStoryID=sModuleID+"_entry"+nCurrentIndex;gfunHide(sOldStoryID);var sOldStoryIndex=sModuleID+"_rotatorIndex"+nCurrentIndex;gfunRemoveClass(sOldStoryIndex,"rotatorIndexCurrent");var sNewStoryID=sModuleID+"_entry"+nIndex;gfunShow(sNewStoryID);var sNewStoryIndex=sModuleID+"_rotatorIndex"+nIndex;gfunAppendClass(sNewStoryIndex,"rotatorIndexCurrent");g_aryRotateInstances[nInstanceIndex][2]=nIndex;}}
function gfunRotateEntry_Play(sModuleID){gfunRotateEntry_Next(sModuleID,false);gfunHide(sModuleID+"_rotatorPlay");gfunShow(sModuleID+"_rotatorPause");var nInstanceIndex=gfunRotateEntry_GetInstance(sModuleID);var nSeconds=g_aryRotateInstances[nInstanceIndex][3];g_aryRotateInstances[nInstanceIndex][4]=setTimeout("gfunRotateEntry_Play('"+sModuleID+"');",nSeconds*1000);}
function gfunRotateEntry_Pause(sModuleID){var nInstanceIndex=gfunRotateEntry_GetInstance(sModuleID);if(g_aryRotateInstances[nInstanceIndex][4]!=null)window.clearTimeout(g_aryRotateInstances[nInstanceIndex][4]);gfunShow(sModuleID+"_rotatorPlay");gfunHide(sModuleID+"_rotatorPause");}
function gfunRotateEntry_Next(sModuleID,bPauseRotation){if(bPauseRotation==null)bPauseRotation=true;var nInstanceIndex=gfunRotateEntry_GetInstance(sModuleID);var nCurrentStoryIndex=g_aryRotateInstances[nInstanceIndex][2];var nNumStories=g_aryRotateInstances[nInstanceIndex][1];var nNextStoryIndex=nCurrentStoryIndex+1;if(nNextStoryIndex>nNumStories)nNextStoryIndex=0;if(nNextStoryIndex!=nCurrentStoryIndex)gfunRotateEntry_Show(sModuleID,nNextStoryIndex,nCurrentStoryIndex);if(bPauseRotation)gfunRotateEntry_Pause(sModuleID);}
function gfunRotateEntry_Previous(sModuleID,bPauseRotation){if(bPauseRotation==null)bPauseRotation=true;var nInstanceIndex=gfunRotateEntry_GetInstance(sModuleID);var nCurrentStoryIndex=g_aryRotateInstances[nInstanceIndex][2];var nNumStories=g_aryRotateInstances[nInstanceIndex][1];var nPrevStoryIndex=nCurrentStoryIndex-1;if(nPrevStoryIndex<0)nPrevStoryIndex=nNumStories;if(nPrevStoryIndex!=nCurrentStoryIndex)gfunRotateEntry_Show(sModuleID,nPrevStoryIndex,nCurrentStoryIndex);if(bPauseRotation)gfunRotateEntry_Pause(sModuleID);}
function gfunRotateEntry_GetInstance(sModuleID){for(var i=0;i<g_aryRotateInstances.length;i++){if(g_aryRotateInstances[i][0]==sModuleID){return i;break;}}
return 0;}
function gfunRotateEntry_SetHeight(sModuleID,nNumStories){var objStoryContainer=g_getRawObject(sModuleID+"_rotatorEntries");if(objStoryContainer.getElementsByTagName){var aryImages=objStoryContainer.getElementsByTagName("img");for(var i=0;i<aryImages.length;i++){if(!aryImages[i].complete){window.setTimeout("gfunRotateEntry_SetHeight('"+sModuleID+"', "+nNumStories+");",100);return;}}}
var nHeight=0;var nTempHeight;for(var i=0;i<=nNumStories;i++){nTempHeight=gfunGetObjectHeight(sModuleID+"_entry"+i);if(nHeight<nTempHeight)nHeight=nTempHeight;}
g_getObject(objStoryContainer).height=nHeight+"px";}