
function handleError(message,url,lineNumber){var queryString='common/includes/logJSerror.php?onerror_message='+escape(message)
+'&onerror_url='+escape(url)
+'&onerror_lineNumber='+lineNumber;var onerrorImage=new Image();onerrorImage.src=queryString;return true;}
window.onerror=handleError;function logMessageOld(message,data){if(typeof data=='undefined'){var queryString='common/includes/logJSerror.php?message='+escape(message)+'&loc='+encodeURIComponent(window.location.href);}else{var queryString='common/includes/logJSerror.php?message='+escape(message)
+'&data='+escape(data)+'&loc='+encodeURIComponent(window.location.href);}
var onerrorImage=new Image();onerrorImage.src=queryString;return true;}
function logMessage(message,data){if(typeof data=='undefined'){ajaxpost('common/includes/logJSerror.php','message='+encodeURIComponent(message)+'&loc='+encodeURIComponent(window.location.href),'',logMessageCallback);}else{ajaxpost('common/includes/logJSerror.php','message='+encodeURIComponent(message)+'&data='+encodeURIComponent(data)+'&loc='+encodeURIComponent(window.location.href),'',logMessageCallback);}}
function logMessageCallback(){}
dbug={firebug:false,log:function(msg){logMessage(msg);alert("debug: "+msg);}}
function popSource(){var popup=window.open();popup.document.open('text/plain').write(document.documentElement.outerHTML);}
function which(e){return window.event?window.event.srcElement:e?e.target:null;}
function $$(id,doParent){if(typeof(id)!='string')return id;try{if(isnull(doParent)||!doParent){if(document.getElementById){return document.getElementById(id);}
else if(document.all){return window.document.all[id];}
else if(document.layers){return window.document.layers[id];}}else{if(document.getElementById){return parent.document.getElementById(id);}
else if(document.all){return parent.document.all[id];}
else if(document.layers){return parent.document.layers[id];}}}
catch(e){return false;}}
function isnull(val){return((typeof val=='undefined')||(typeof val===null)||(val=='')||(val===null));}
String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"");}
String.prototype.ltrim=function(){return this.replace(/^\s+/,"");}
String.prototype.rtrim=function(){return this.replace(/\s+$/,"");}
String.prototype.pad=function(length){var str=''+this;while(str.length<length){str='0'+str;}
return str;}
Array.prototype.indexAt=function(value){var L=this.length;for(var i=0;i<L;i++){if(this[i]===value)return i;}
return-1;}
Array.prototype.inArray=function(value,caseInsensitive){if((typeof caseInsensitive=='undefined')||(typeof caseInsensitive===null)||(caseInsensitive=='')||(caseInsensitive===null))caseInsensitive=false;var L=this.length;for(var i=0;i<L;i++){if(caseInsensitive){if(this[i].toLowerCase()===value.toLowerCase())
return true;}else{if(this[i]===value)
return true;}}
return false;}
Array.prototype.inAssocArray=function(value,caseInsensitive){if((typeof caseInsensitive=='undefined')||(typeof caseInsensitive===null)||(caseInsensitive=='')||(caseInsensitive===null))caseInsensitive=false;for(var i in this){if(caseInsensitive){if(this[i].toLowerCase()===value.toLowerCase())
return true;}else{if(this[i]===value)
return true;}}
return false;}
Number.prototype.roundNumber=function(precision){var power=Math.pow(10,precision||0);return String(Math.round(this*power)/power);}
function roundNumber(num,dec){var result=Math.round(num*Math.pow(10,dec))/Math.pow(10,dec);return result;}
function getUniqueNumber(){var d=new Date();var t=d.getTime();return t;}
function getRandomNumber(){return Math.floor(Math.random()*99999);}
function registerOnLoad(func){var origOnLoad=window.onload
if(typeof origOnLoad!='function'){window.onload=func;}else{window.onload=function(){origOnLoad();func();}}}
function addFunctionBefore(el,action,func){var origFunc=el[action];if(typeof origFunc!='function'){el[action]=func;}else{el[action]=function(){func();return origFunc();}}}
function confirmMsg(message){return confirm(message);}
function confirmAction(message,form){if(confirm(message)){document.form.submit()}}
function bubblestop(e){if(!e)var e=window.event;e.cancelBubble=true;if(e.stopPropagation)e.stopPropagation();}
function redirect(uri,wname,target){if(isnull(target)){if(isIframe()){if(isnull(wname)){wname='iCrizo';}
uri=appendquerystring(uri,'w='+wname);}
window.location.replace(prependBaseHref(uri));}else if(target=='parent'&&!isnull(window.opener)){window.opener.location.href=prependBaseHref(uri);}else{top.location.replace(prependBaseHref(uri));}
return false;}
function reloadPage(){var d=new Date();var t=d.getTime();window.location.href=appendquerystring(window.location.href,t);}
function prependBaseHref(uri){if(uri.substring(0,4).toLowerCase()=='http'){return uri;}
var b=document.getElementsByTagName('base');if(b&&b[0]&&b[0].href){if(b[0].href.substring(b[0].href.length-1)=='/'&&uri.charAt(0)=='/')
{uri=uri.substring(1);}
uri=b[0].href+uri;}
return uri;}
function getKey(e){var evt=(window.event)?window.event:e;var key=(evt.keyCode?evt.keyCode:(evt.charCode?evt.charCode:(evt.which?evt.which:'')));return(key);}
function disableEnterKey(e){var evt=(window.event)?window.event:e;var key=(evt.keyCode?evt.keyCode:(evt.charCode?evt.charCode:(evt.which?evt.which:'')));return(key!=13);}
function cookieScreenSize(){setCookie('screensize',screen.width+"x"+screen.height);}
function cookiePageSize(){setCookie('pagesize',pageWidth()+"x"+pageHeight());}
function appendForm(td_id){if(document.createElement){var body=document.body;var table=document.createElement('TABLE');var tbody=document.createElement('TBODY');var tr=document.createElement('TR');var td=document.createElement('TD');if(typeof td_id=='undefined'){td_id='x_appendForm';}
td.setAttribute("id",td_id);body.appendChild(table);table.appendChild(tbody);tbody.appendChild(tr);tr.appendChild(td);return td_id;}else{return false;}}
function appendField(form_id,field_id,field_name,field_type){if(document.createElement){if(isnull(field_name)){field_name=field_id;}
if(isnull(field_type)){field_type='text';}
var form=$$(form_id);var input=document.createElement('INPUT');input.setAttribute('id',field_id);input.setAttribute('name',field_name);input.setAttribute('type',field_type);input.style.display='none';form.appendChild(input);var id=$$(field_id);return id;}else{return false;}}
function submitform(action,field,form){if(isnull(action)){return false;}
if(isnull(field)){field='jsbtnsubmit';}
if(isnull(form)){form='editform';}
var id=appendField(form,field);id.value=action;if((typeof thevalidation!='function')||thevalidation()){document.forms[form].submit();}}
function get2post(uri,target){if(typeof target=='undefined'){target='';}
if(typeof uri=='object'){if(uri.nodeName=='A'){uri=uri.href;}}
var action=uri.substring(0,uri.indexOf('?'));var query=uri.substring(uri.indexOf('?')+1).split('&');var postForm='<form action="'+action+'" method="POST" style="display: none;" target="'+target+'">';var eq;for(var i=0;i<query.length;i++){eq=query[i].indexOf('=');postForm+='<input name="'+escape(query[i].substring(0,eq).toLowerCase())+'" value="'+query[i].substring(eq+1)+'" type="hidden" />';}
postForm+='</form>';var el=appendForm();$$(el).innerHTML=postForm+$$(el).innerHTML;$$(el).firstChild.submit();return false;}
function checkfilesize(el,max){if(typeof max=='undefined'){max=30000;}
var node=el;if(node.files){var check=node.files[0].fileSize;logMessage('File size = '+check);if(check>max){alert('Your file is too big!');return false;}}else{logMessage('size unknown');alert('Size unknown');}
return true;}
function findPos(obj){var posX=obj.offsetLeft;var posY=obj.offsetTop;while(obj.offsetParent){posX=posX+obj.offsetParent.offsetLeft;posY=posY+obj.offsetParent.offsetTop;if(obj==document.getElementsByTagName('body')[0]){break}
else{obj=obj.offsetParent;}}
return[posX,posY]}
function openNewWindow(uri,windowName,theWidth,theHeight,topPos,leftPos){var uri=prependBaseHref(uri);var newwindow=window.open(uri,windowName,"toolbar=0, location=0, directories=0, status=1, menubar=0, scrollbars, resizable=1, width="+theWidth+", height="+theHeight+", top="+topPos+", left="+leftPos);if((typeof focus==='undefined')||(focus!==false)){if((window.focus)&&(typeof newwindow=='object')&&(newwindow!=null)){newwindow.focus();}}
return newwindow;}
function openPrintWindow(uri,windowName){var uri=prependBaseHref(uri);var newwindow=window.open(uri,windowName,"toolbar=0, location=0, directories=0, status=1, menubar=1, left=10, top=10, scrollbars, resizable=1, width=800, height=600")
return newwindow;}
function appendquerystring(url,params){if(url.indexOf('?')==-1){return url+'?'+params;}else{return url+'&'+params;}}
function getHistoryLength(){var agt=navigator.userAgent.toLowerCase();if(agt.indexOf("gecko")!=-1){return window.history.length-1;}else{return window.history.length;}}
function passBack(formTag,passValue,postform,passbackfunction){if((typeof passbackfunction=='undefined')||(passbackfunction=='')){passbackfunction='passBackFunction';}
if(!chkPopup('true')){eval('parent.$$("'+formTag+'").value="'+passValue+'"');hideIframe('',true);hideOverlay(true);if(eval('typeof parent.'+passbackfunction+' != "undefined"')){eval('parent.'+passbackfunction+'();')}
if(!((typeof postform=='undefined')||(postform=='')||(parent.nosubmit==1))){parent.setThrobber();eval('parent.document.'+postform+'.submit();');}}else{eval('window.opener.$$("'+formTag+'").value="'+passValue+'"');if(eval('typeof window.opener.'+passbackfunction+' != "undefined"')){eval('window.opener.'+passbackfunction+'();')}
if(!((typeof postform=='undefined')||(postform=='')||(window.opener.nosubmit==1))){window.opener.setThrobber();eval('window.opener.document.'+postform+'.submit();');}
self.close();}}
function maximise(idiv){if(!isIframe()){window.moveTo(0,0);window.resizeTo(screen.width,screen.height);}else{if((typeof idiv=='undefined')||(idiv=='')){idiv='diviframe';}
resize((pageWidth('parent')*0.9),(pageHeight('parent')*0.9),idiv,true,true);}}
function resize(iwidth,iheight,idiv,iframe,iparent){try{var xoffset=(isIE()?document.body.scrollLeft:window.pageXOffset);var yoffset=(isIE()?document.body.scrollTop:window.pageYOffset);if((typeof iframe!='undefined'&&iframe)||isIframe()){if((typeof idiv=='undefined')||(idiv=='')){idiv='diviframe';}
if(typeof iparent=='undefined'||iparent){xoffset=(isIE()?parent.document.body.scrollLeft:parent.pageXOffset);yoffset=(isIE()?parent.document.body.scrollTop:parent.pageYOffset);var iframe=parent.document.getElementById(idiv);iframe.style.width=iwidth;iframe.style.height=iheight;iframe.style.left=(pageWidth('parent')-iwidth-40)/2+xoffset;iframe.style.top=(pageHeight('parent')-iheight-40)/2+yoffset;}else{var iframe=document.getElementById(idiv);iframe.style.width=iwidth;iframe.style.height=iheight;iframe.style.left=(pageWidth('')-iwidth-40)/2+xoffset;iframe.style.top=(pageHeight('')-iheight-40)/2+yoffset;}}else{window.resizeTo(iwidth,iheight);centrepopuporiframe(iwidth,iheight);}}
catch(err){}}
function resizepopup(el,w,h){if(isnull(el)){el=window;}
if(isnull(w)){w=getElementWidth(el.document)+75;}
if(isnull(h)){h=getElementHeight(el.document)+100;}
el.resizeTo(w,h);}
function centrepopup(el,offsetw,offseth){if(isnull(el)){el=window;}
if(isnull(offsetw)){offsetw=0;}
if(isnull(offseth)){offseth=0;}
var h=getElementHeight(el.document);var w=getElementWidth(el.document);el.moveTo((screen.availWidth-w)/2,(screen.availHeight-h)/2);}
function resizediv(el,w,h){if(isnull(w)){w=el.clientWidth;}
if(isnull(h)){h=el.clientHeight;}
el.style.width=w+(typeof w=='number'?'px':'');el.style.height=h+(typeof h=='number'?'px':'');}
function centrediv(el,offsetw,offseth){if(isnull(offsetw)){offsetw=0;}
if(isnull(offseth)){offseth=0;}
var h=el.offsetHeight;var w=el.offsetWidth;el.style.left=(pageWidth()-w-offsetw)/2+"px";el.style.top=(pageHeight()-h-offseth)/2+"px";}
function resizetextarea(el,min,max){if(isnull(min)){min=0;}
if(isnull(max)){max=1000;}
el.style.height=min;if(el.scrollHeight>el.offsetHeight){el.style.height=Math.min(max,Math.max(min,(el.scrollHeight+5)))+"px";}}
function pageHeight(target){if(target==='parent'){return parent.window.innerHeight!=null?parent.window.innerHeight:parent.document.documentElement&&parent.document.documentElement.clientHeight?parent.document.documentElement.clientHeight:parent.document.body!=null?parent.document.body.clientHeight:null;}else{return window.innerHeight!=null?window.innerHeight:document.documentElement&&document.documentElement.clientHeight?document.documentElement.clientHeight:document.body!=null?document.body.clientHeight:null;}}
function pageWidth(target){if(target==='parent'){return parent.window.innerWidth!=null?parent.window.innerWidth:parent.document.documentElement&&parent.document.documentElement.clientWidth?parent.document.documentElement.clientWidth:parent.document.body!=null?parent.document.body.clientWidth:null;}else{return window.innerWidth!=null?window.innerWidth:document.documentElement&&document.documentElement.clientWidth?document.documentElement.clientWidth:document.body!=null?document.body.clientWidth:null;}}
function getElementHeight(el){if(typeof el=='undefined'){el=document;}
var hbody=hdoc=0;if(el.body)hbody=Math.max(el.body.scrollHeight,el.body.offsetHeight,el.body.clientHeight);if(el.documentElement)hdoc=Math.max(el.documentElement.scrollHeight,el.documentElement.offsetHeight,el.documentElement.clientHeight);return Math.max(hbody,hdoc);}
function getElementWidth(el){if(typeof el=='undefined'){el=document;}
var wbody=wdoc=0;if(el.body)wbody=Math.max(el.body.scrollWidth,el.body.offsetWidth,el.body.clientWidth);if(el.documentElement)wdoc=Math.max(el.documentElement.scrollWidth,el.documentElement.offsetWidth,el.documentElement.clientWidth);return Math.max(wbody,wdoc);}
function isIE(){return/msie/i.test(navigator.userAgent)&&!/opera/i.test(navigator.userAgent);}
function isFrame(){return(window.self!=window.top);}
function isIframe(){try{return(location.href!=top.location.href);}
catch(e){return false;}}
function setStatusBar(msgStr){self.status=msgStr;}
function setCookie(cname,value,expires,path,domain,secure){if(typeof expires=='undefined'){expires='';}
if(typeof path=='undefined'){path='/';}
if(typeof domain=='undefined'){domain='';}
if(typeof secure=='undefined'){secure='';}
var today=new Date();today.setTime(today.getTime());if(expires){expires=expires*60*1000;}
var expires_date=new Date(today.getTime()+(expires));document.cookie=cname+"="+escape(value)+
((expires)?";expires="+expires_date.toGMTString():"")+
((path)?";path="+path:"")+
((domain)?";domain="+domain:"")+
((secure)?";secure":"");}
function getCookie(cname){var nameEQ=cname+"=";var ca=document.cookie.split(';');for(var i=0;i<ca.length;i++){var c=ca[i];while(c.charAt(0)==' ')c=c.substring(1,c.length);if(c.indexOf(nameEQ)==0)return c.substring(nameEQ.length,c.length);}
return null;}
function killCookie(cname){setCookie(cname,"",-1);}
function hasCookies(){setCookie('checkCookie','test',1);if(getCookie('checkCookie')){killCookie('checkCookie');return true;}
return false;}
function makeDiv(dname,html,width,height,leftpos,toppos,seeme){if(isnull(dname)){dname='d'+Math.floor(Math.random()*99999);}
var div=document.getElementById(dname);if(div==null){var newdiv=document.createElement('div');if(isnull(width)){width='400';}
if(isnull(height)){height='400';}
if(isnull(leftpos)){leftpos='200';}
if(isnull(toppos)){toppos='200';}
if(isnull(seeme)){seeme='block';}
if(isnull(html)){html='<table><tr><td id="'+dname+'html"></td></tr></table>';}
newdiv.setAttribute('id',dname);newdiv.setAttribute('name',dname);newdiv.style.width=width+"px";newdiv.style.height=height+"px";newdiv.style.leftpos=leftpos+"px";newdiv.style.toppos=toppos+"px";newdiv.style.position="absolute";newdiv.style.display=seeme;newdiv.innerHTML=html;document.body.appendChild(newdiv);var div=document.getElementById(dname);}
return div;}
function unmakeDiv(dname){var div=document.getElementById(dname);if(div){div.parentNode.removeChild(dname);}}
function makeIframe(iname,div,html,width,height,leftpos,toppos,seeme){if(isnull(iname)){iname='i'+Math.floor(Math.random()*99999);}
var iframe=document.getElementById(iname);if(iframe==null){var newiframe=document.createElement('iframe');if(isnull(width)){width='400';}
if(isnull(height)){height='400';}
if(isnull(leftpos)){leftpos='200';}
if(isnull(toppos)){toppos='200';}
if(isnull(seeme)){seeme='block';}
if(isnull(html)){html='<table><tr><td id="'+iname+'html"></td></tr></table>';}
newiframe.setAttribute('id',iname);newiframe.setAttribute('name',iname);newiframe.style.width=width+"px";newiframe.style.height=height+"px";newiframe.style.leftpos=leftpos+"px";newiframe.style.toppos=toppos+"px";newiframe.style.position="absolute";newiframe.style.background="#fff";newiframe.style.border="2px solid #000";newiframe.style.overflow="auto";newiframe.style.display=seeme;if(isnull(div)){document.body.appendChild(newiframe);}else if(typeof div=='object'){div.appendChild(newiframe);}else{document.getElementById(div).appendChild(newiframe);}
var iframe=document.getElementById(iname);}
return iframe;}
function unmakeIframe(iname){var iframe=document.getElementById(iname);if(iframe){iframe.parentNode.removeChild(iname);}}
x=20;y=70;function setVisible(obj)
{obj=$$(obj);if((typeof obj!='undefined')&&(obj!=null)){obj.style.display='block';}}
function setInvisible(obj)
{obj=$$(obj);if((typeof obj!='undefined')&&(obj!=null)){obj.style.display='none';}}
function placeIt(obj)
{obj=$$(obj);if(document.documentElement)
{theLeft=document.documentElement.scrollLeft;theTop=document.documentElement.scrollTop;}
else if(document.body)
{theLeft=document.body.scrollLeft;theTop=document.body.scrollTop;}
theLeft+=x;theTop+=y;obj.style.left=theLeft+'px';obj.style.top=theTop+'px';setTimeout("placeIt('messagelayer')",500);}
function visibleOffOn(obj1,obj2)
{if($$(obj1)){$$(obj1).style.visibility='hidden';}
if($$(obj2)){$$(obj2).style.visibility='visible';}}
function visibleOff(obj)
{if($$(obj)){$$(obj).style.visibility='hidden';}}
function visibleOn(obj)
{if($$(obj)){$$(obj).style.visibility='visible';}}
function switchOffOn(obj1,obj2)
{if($$(obj1)){var ele=$$(obj1);if((ele.style.display=='inline')||(ele.style.display=='block')){ele.style.display='none';}}
if($$(obj2)){$$(obj2).style.display='block';}}
function switchOff(obj)
{if($$(obj)){$$(obj).style.display='none';}}
function switchOn(obj,mode)
{if(typeof mode=='undefined'){mode='block';}
if($$(obj)){$$(obj).style.display=mode;}}
function switchRowOffOn(obj1,obj2)
{if($$(obj1)){$$(obj1).style.display='none';}
if($$(obj2)){$$(obj2).style.display='';}}
function switchRowOff(obj)
{if($$(obj)){$$(obj).style.display='none';}}
function switchRowOn(obj)
{if($$(obj)){$$(obj).style.display='';}}
function switchRowIf(rowid,selected,testvalue)
{var el=$$(selected);if(el[el.selectedIndex].value==testvalue){switchRowOn($$(rowid));}else{switchRowOff($$(rowid));}}
function toggle(id)
{obj=$$(id);if(obj.style.display=='none'){obj.style.display='inline';}
else if(obj.style.display=='inline'){obj.style.display='none';}}
function setValue(id,text)
{$$(id).value=text;}
function setFormFocus(formEl){var oForm;var i;if(typeof formEl!='undefined'){oForm=$$(formEl);}
if(document.forms.length>0){if(typeof oForm!='object'){for(i=0;i<document.forms.length;i++){if(document.forms[i].length>0){oForm=document.forms[i];break;}}}
if((typeof oForm!='undefined')&&(typeof oForm.tagName!='undefined')&&(oForm.tagName!='FORM')){if(oForm.focus){oForm.focus();elementHasFocus=oForm;}}else{found=0;for(i=0;i<oForm.length;i++){if(oForm.elements[i].getAttribute('tabindex')==1){if(oForm.elements[i].focus){oForm.elements[i].focus();formHasFocus=oForm.name;elementHasFocus=oForm.elements[i].name;}
found=1;break;}}
if(found!=1){for(i=0;i<oForm.length;i++){if((oForm.elements[i].type=="text")||(oForm.elements[i].type=="textarea")){if(oForm.elements[i].focus){oForm.elements[i].focus();formHasFocus=oForm.name;elementHasFocus=oForm.elements[i].name;}
found=1;break;}}}}}}
function getChildren(elid,tag){return $$(elid).getElementsByTagName(tag);}
function activateTab(tab,box){if(typeof box=='undefined'){box='box_tabs';}
var children=getChildren(box,'span');for(var child=0;child<children.length;child++)
{if(hasClassName(children[child],'tabs_active')){replaceClassName(children[child],'tabs_active','tabs');switchOff(box+(parseInt(child)));}}
replaceClassName(children[tab],'tabs','tabs_active');switchOn(box+tab);}
function activateTabs(tab){activateTab(tab,'display_tabs');activateTab(tab,'edit_tabs');}
function getClassName(objId){return $$(objId).className;}
function setClassName(objId,newClassName){$$(objId).className=newClassName;}
function hasClassName(objElement,strClass){if(objElement.className){var arrList=objElement.className.split(' ');var strClassLower=strClass.toLowerCase();for(var i=0;i<arrList.length;i++){if(arrList[i].toLowerCase()==strClassLower){return true;}}}
return false;}
function addClassName(objElement,strClass){if(objElement.className){if(hasClassName(objElement,strClass)==false){var arrList=objElement.className.split(' ');arrList[arrList.length]=strClass;objElement.className=arrList.join(' ');}}else{objElement.className=strClass;}}
function removeClassName(objElement,strClass){if(objElement.className){var arrList=objElement.className.split(' ');var strClassLower=strClass.toLowerCase();for(var i=0;i<arrList.length;i++){if(arrList[i].toLowerCase()==strClassLower){arrList.splice(i,1);i--;}}
objElement.className=arrList.join(' ');}}
function replaceClassName(objElement,strClassRemove,strClassAdd){if(objElement.className){objElement.className=objElement.className.replace(strClassRemove,strClassAdd);}}
function highlightWhenHasFocus(){var target=/INPUT|TEXTAREA|SELECT|OPTION|CHECKBOX|RADIO/;if(document.forms.length>0){for(var i=0;i<document.forms.length;i++){oForm=document.forms[i];for(var j=0;j<oForm.length;j++){if(target.test(oForm.elements[j].tagName)){if(oForm.elements[j].type!="button"&&oForm.elements[j].type!="submit"&&oForm.elements[j].type!="reset"){oForm.elements[j].onfocus=function(){addClassName(this,'highlightinput');}
oForm.elements[j].onblur=function(){removeClassName(this,'highlightinput');}}}}}}}
function high(objId,newClassName){var currClass=getClassName(objId);setClassName(objId,newClassName);var t=setTimeout("setClassName('"+objId+"','"+currClass+"')",3000);return true;}
function highlighttextarea(el,start,chars,el2){var selectedText='';if(el.createTextRange){var range=el.createTextRange();range.collapse(true);range.moveStart('character',start);range.moveEnd('character',chars);range.select();selectedText=range.text;}else if(el.selectionStart!=null){el.removeAttribute('readOnly');el.selectionStart=start;el.selectionEnd=el.selectionStart+chars;el.setAttribute('readOnly','readonly');selectedText=(el.value).substring(el.selectionStart,el.selectionEnd);}}
function gettextarea(obj,start,chars,targetId){var val=obj.value.substring(start,chars);$$(targetId).innerHTML=val;}
function ismaxlength(obj,targetId){var mlength=obj.getAttribute?parseInt(obj.getAttribute("maxlength")):""
if(obj.getAttribute&&obj.value.length>mlength){obj.value=obj.value.substring(0,mlength)}
$$(targetId).innerHTML=mlength-obj.value.length+" characters remaining"}
function loadOptions(sParentBox,sChildBox,sSelect){var sParentValue;if(sParentBox=='init'){sParentValue='0';}else{sParentValue=$$(sParentBox).value;}
var theSel=$$(sChildBox);theSel.options.length=null;if(sParentValue==''){alert("exiting");return;}
if(sChildBox=="box1"){oTargetArray=box1;}else if(sChildBox=="box2"){oTargetArray=box2;}
if(typeof oTargetArray[sParentValue]!='undefined'){var arrList=oTargetArray[sParentValue].split(",");for(x=0;x<arrList.length;x++)
{var arrListOption=arrList[x].split(":");var newOpt=new Option(arrListOption[1],arrListOption[0]);if((typeof sSelect!='undefined')&&(sSelect!='')){if(arrListOption[0]==sSelect){newOpt.setAttribute('selected',true);}}
var selLength=theSel.length;theSel.options[selLength]=newOpt;}
$$(sChildBox+"row").style.display="block";}else{$$(sChildBox+"row").style.display="none";}}
function clearDefault(el){if(el.defaultValue==el.value)el.value=""}
function clearTextarea(el,text){if(el.innerHTML==text)el.innerHTML=""}
function clearForm(oForm){var elements=oForm.elements;oForm.reset();for(var i=0;i<elements.length;i++){field_type=elements[i].type.toLowerCase();switch(field_type){case"text":case"password":case"textarea":case"hidden":elements[i].value="";break;case"radio":case"checkbox":if(elements[i].checked){elements[i].checked=false;}
break;case"select-one":case"select-multi":elements[i].selectedIndex=-1;break;default:break;}}}
function setSelectOption(selectId,val){var x=$$(selectId);x.options[0].selected=true;for(var i=0;i<x.length;i++){if(x.options[i].value.toLowerCase()==val.toLowerCase()){x.options[i].selected=true;}}
return false;}
function getCheckedValue(radioObj){if(!radioObj)
return"";var radioLength=radioObj.length;if(radioLength=='undefined')
if(radioObj.checked)
return radioObj.value;else
return"";for(var i=0;i<radioLength;i++){if(radioObj[i].checked){return radioObj[i].value;}}
return"";}
function setCheckedValue(radioObj,newValue){if(!radioObj)
return;var radioLength=radioObj.length;if(radioLength=='undefined'){radioObj.checked=(radioObj.value==newValue.toString());return;}
for(var i=0;i<radioLength;i++){radioObj[i].checked=false;if(radioObj[i].value==newValue.toString()){radioObj[i].checked=true;}}}
function getSelectedRadio(buttonGroup){if(buttonGroup[0]){for(var i=0;i<buttonGroup.length;i++){if(buttonGroup[i].checked){return i}}}else{if(buttonGroup.checked){return 0;}}
return-1;}
function getSelectedRadioValue(buttonGroup){var i=getSelectedRadio(buttonGroup);if(i==-1){return"";}else{if(buttonGroup[i]){return buttonGroup[i].value;}else{return buttonGroup.value;}}}
function getSelectedCheckbox(buttonGroup){var retArr=new Array();var lastElement=0;if(buttonGroup[0]){for(var i=0;i<buttonGroup.length;i++){if(buttonGroup[i].checked){retArr.length=lastElement;retArr[lastElement]=i;lastElement++;}}}else{if(buttonGroup.checked){retArr.length=lastElement;retArr[lastElement]=0;}}
return retArr;}
function getSelectedCheckboxValue(buttonGroup){var retArr=new Array();var selectedItems=getSelectedCheckbox(buttonGroup);if(selectedItems.length!=0){retArr.length=selectedItems.length;for(var i=0;i<selectedItems.length;i++){if(buttonGroup[selectedItems[i]]){retArr[i]=buttonGroup[selectedItems[i]].value;}else{retArr[i]=buttonGroup.value;}}}
return retArr;}
function getFieldValuesByName(fieldname,formname){var myInputArray=document[formname].getElementsByTagName("INPUT");var myOutputArray=new Array();for(var i=0;i<myInputArray.length;i++){if(myInputArray[i].name==fieldname){myOutputArray.push(myInputArray[i].value);}}
return myOutputArray;}
function getElementsLikeName(prefix,tags){if(typeof tags=='undefined'){tags='*';}
var matches=[];var x=document.getElementsByTagName(tags);var L=x.length
for(var i=0;i<L;i++){if(x[i].name.indexOf(prefix)==0){matches.push(x[i]);}}
return matches}
function getElementsLikeId(prefix,tags){if(typeof tags=='undefined'){tags='*';}
var matches=[];var x=document.getElementsByTagName(tags);var L=x.length
for(var i=0;i<L;i++){if(x[i].id.indexOf(prefix)==0){matches.push(x[i]);}}
return matches}
function setThrobber(id){if(typeof id=='undefined'){id='x_progress';}
if($$(id)!=null){$$(id).style.display="inline";}}
function resetThrobber(id){if(typeof id=='undefined'){id='x_progress';}
if($$(id)!=null){$$(id).style.display="none";}}
function scrollToTop(){window.scrollTo(0,0);}
function scrollToBottom(){if(document.body.scrollHeight){window.scrollTo(0,document.body.scrollHeight);}
else if(screen.height){window.scrollTo(0,screen.height);}}
function executeJS(el){var x=el.getElementsByTagName("script");var L=x.length;for(var i=0;i<L;i++){eval(x[i].text);}}
months=new Array("January","Febuary","March","April","May","June","July","August","September","October","November","December");shortmonths=new Array("Jan.","Feb.","Mar.","Apr.","May","June","July","Aug.","Sep.","Oct.","Nov.","Dec.");calDays=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");function pad(i){if(i<10){i="0"+i;}
return(i);}
function doClock(clockID){if(typeof clockID=='undefined'){clockID='clock';}
clockID=$$(clockID);setTimeout("doClock()",30000);var t=new Date();var m=t.getMonth();var d=t.getDay();var dt=t.getDate();var y=t.getFullYear();var h=t.getHours();var h12=h;if(h<12){ap="am";}else{ap="pm";h12=h-12;}
h=pad(t.getHours());mn=pad(t.getMinutes());s=pad(t.getSeconds());if(h12==0){h12=12}
clockID.innerHTML="&nbsp;"+calDays[d]+", "+dt+" "+shortmonths[m]+" "+y+"<br />&nbsp;&nbsp;"+h12+":"+mn+" "+ap;}
function ajaxObject(url,callbackFunction,layer){var layerID=$$(layer);var urlCall=url;var that=this;this.callback=callbackFunction||function(responseText){if(layerID!=null){layerID.innerHTML=responseText;}};this.updating=false;this.abort=function(){if(that.updating){that.updating=false;that.AJAX.abort();that.AJAX=null;}}
this.update=function(passData,postMethod){if(that.updating){return false;}
that.AJAX=null;if(window.XMLHttpRequest){that.AJAX=new XMLHttpRequest();}else{that.AJAX=new ActiveXObject("Microsoft.XMLHTTP");}
if(that.AJAX==null){logMessageOld("AJAX Error: browser doesn't support AJAX.");return false;}else{that.AJAX.onreadystatechange=function(){if(that.AJAX.readyState==4){that.updating=false;if(that.AJAX.status!=200){logMessageOld('AJAX Error: Status '+that.AJAX.status);}else{that.callback(that.AJAX.responseText,that.AJAX.responseXML,that.AJAX.status);}
that.AJAX=null;}}
that.updating=new Date();if(/POST/i.test(postMethod)){var uri=urlCall+'?'+that.updating.getTime();that.AJAX.open("POST",uri,true);that.AJAX.setRequestHeader("Content-Type","application/x-www-form-urlencoded");that.AJAX.setRequestHeader("Content-Length",passData.length);that.AJAX.send(passData);}else{var uri=urlCall+'?'+passData+'&amp;timestamp='+(that.updating.getTime());that.AJAX.open("GET",uri,true);that.AJAX.send(null);}
return true;}}}
function ajaxpost(uri,get,elid,callbackFunction){if(typeof callbackFunction=='undefined'){callbackFunction=false;}
uri=prependBaseHref(uri);var myRequest=new ajaxObject(uri,callbackFunction,elid);myRequest.update(get,'POST');}
function centrepopuporiframe(theWidth,theHeight){var w=800,h=600;w=screen.availWidth;h=screen.availHeight;if((typeof theWidth=='undefined')||(theWidth=='')){theWidth=Math.round(w*0.8);}
if((typeof theHeight=='undefined')||(theHeight=='')){theHeight=Math.round(h*0.8);}
var leftPos=(w-theWidth)/2,topPos=(h-theHeight)/2;var pos=new Array();pos['top']=topPos;pos['left']=leftPos;pos['width']=theWidth;pos['height']=theHeight;return pos;}
function managepopup(theScript,params,popup,theWidth,theHeight,theName){try{top.managepopuporiframe(theScript,params,popup,theWidth,theHeight,theName,'popup');}
catch(e){managepopuporiframe(theScript,params,popup,theWidth,theHeight,theName,'popup');}
return false;}
function manageiframe(theScript,params,popup,theWidth,theHeight,theName){try{top.managepopuporiframe(theScript,params,popup,theWidth,theHeight,theName,'iframe');}
catch(e){managepopuporiframe(theScript,params,popup,theWidth,theHeight,theName,'iframe');}
return false;}
function managepopuporiframe(theScript,params,popup,theWidth,theHeight,theName,target){if(typeof params=='undefined'){params='';}
if(params==''){var url=theScript;}else{var url=theScript+'?'+params;}
if(popup=='post'){}else{if(!isnull(target)&&(target==='popup')){if(isnull(theName)){theName='Crizo';}
url=appendquerystring(url,'w='+theName);if(typeof theHeight=='undefined'){theHeight=100;}
var pos=centrepopuporiframe(theWidth,theHeight);var thewindow=openNewWindow(url,theName,pos['width'],pos['height'],pos['top'],pos['left']);if(thewindow==null){return redirect(url);}else{}}else{if(isnull(theName)){theName='iCrizo';}
theDiv='div'+theName;theIframe=theName;url=appendquerystring(url,'w='+theName);if(!window.frames[theName]){logMessage('Creating iframe: '+theName+' for '+theScript);var html=htmliframe.replace(/iCrizo2/g,theName);var div=makeDiv(theDiv,html,50,50,100,100);if(div){top.Drag.init($$('handle'+theName),$$(theDiv));var iframe=$$(theIframe);iframe.onload=function(){eval("iframeLoaded('"+theName+"');")};}}
var iframeEl=$$(theName);iframeEl.style.width=(isnull(theWidth)?800:theWidth)+"px";if(!isIframe()){var div=$$(theDiv);iwidth=(isnull(theWidth)?800:theWidth);iheight=(isnull(theHeight)?600:theHeight);div.style.width=iwidth;div.style.height=iheight;div.style.left=(pageWidth()-iwidth-40)/2;div.style.top=(pageHeight()-iheight-40)/2;}
showIframe(theDiv);showOverlay();window.frames[theName].location=url;}}}
function managepoppost(formname,theWidth,theHeight,theName){var formObj=document.forms[formname];if(isnull(theName)){theName='Crizo';}
var pos=centrepopuporiframe(theWidth,theHeight);var thewindow=openNewWindow('#',theName,pos['width'],pos['height'],pos['top'],pos['left']);if(thewindow!=null){formObj.target='Crizo';}
formObj.submit();return false;}
function findData(fieldId,fieldInput,uri,returnUri,postform,forcefind,option,query,method,passbackfunction,addquery,defltsort,pause,fwddata,xtra){if((typeof fieldId=='undefined')||(typeof fieldInput=='undefined')||(typeof uri=='undefined')||(typeof returnUri=='undefined'))
{logMessage('Parameter missing in findData');return false;}
if(typeof postform=='undefined'){postform='';}
if(typeof forcefind=='undefined'){forcefind='';}
if(typeof option=='undefined'){option='';}
if(typeof query=='undefined'){query='';}
if(typeof method=='undefined'){method='';}
if(typeof passbackfunction=='undefined'){passbackfunction='';}
if(typeof addquery=='undefined'){addquery='';}
if(typeof defltsort=='undefined'){defltsort='';}
if(typeof pause=='undefined'){pause='';}
if(typeof fwddata=='undefined'){fwddata='';}
if(typeof xtra=='undefined'){xtra='';}
if(query===''){query=(fieldInput!==''?$$(fieldInput).value:'');}
if(method!='IFRAME'){if((postform!='')&&(query!='')&&(forcefind!='true')){document.forms[postform].submit();return true;}}
if(method=='GET'){}else if(method=='POST'){var target=window.name;var formdata=escape(getFormFields());}else if(method=='IFRAME'){var target='iCrizo';var formdata='';}else{if(window.name=='CrizoFind'){var target='CrizoFind2';}else{var target='CrizoFind';}
var formdata='';var pos=centrepopuporiframe(800,800);var thewindow=openNewWindow('#',target,800,800,pos['top'],pos['left']);if(thewindow==null){target=window.name;formdata=escape(getFormFields());}}
if(fwddata!=''){fwddata=escape(getFwdData(fwddata));}
var theUri=uri+'?query='+escape(query)+'&fieldid='+fieldId+'&fieldInput='+fieldInput+'&script='+returnUri+'&postform='+postform+'&option='+option+'&passbackfunction='+passbackfunction+'&window='+target+'&addquery='+addquery+'&defltsort='+defltsort+'&pause='+pause+'&fwddata='+fwddata+'&xtra='+xtra+'&formdata='+formdata;get2post(theUri,target);return false;}
function getFwdData(arr){var tags='';var firsttags=1;var ssplit;if(arr.length>0){for(var i=0;i<arr.length;i++){ssplit=arr[i].split("=>")
tags+=(firsttags==1?'':';-;')+ssplit[0]+':+:'+ssplit[1];firsttags=0;}}
return tags;}
function getFormFields(form){var tags='';var firsttags=1;var oForm='';var target=/INPUT|TEXTAREA|SELECT|OPTION|CHECKBOX|RADIO/;if(document.forms.length>0){for(var i=0;i<document.forms.length;i++){oForm=document.forms[i];if(((typeof form=='undefined')||(form==null))||((typeof form!='undefined')&&(oForm.name==form))){for(var j=0;j<oForm.length;j++){if(target.test(oForm.elements[j].tagName)){if(oForm.elements[j].type!="button"&&oForm.elements[j].type!="submit"&&oForm.elements[j].type!="reset"){if(oForm.elements[j].type=="checkbox"||oForm.elements[j].type=="radio"){tags+=(firsttags==1?'':';-;')+oForm.elements[j].name+':+:'+(oForm.elements[j].checked?oForm.elements[j].value:'');}else{tags+=(firsttags==1?'':';-;')+oForm.elements[j].name+':+:'+oForm.elements[j].value;}
firsttags=0;}}}}}}
return tags;}
function iframeLoaded(iframeName,iframeElement,maxWidth,maxHeight,minWidth,minHeight){if(typeof xdKludge=='undefined'||!xdKludge){var doParent=true;}else{var doParent=false;}
setIframeSize(iframeName,iframeElement,maxWidth,maxHeight,minWidth,minHeight,doParent);}
function loadIframe(iframeName,url){if(window.frames[iframeName]){window.frames[iframeName].location=url;return false;}
else return true;}
function clearIframe(iframeName){loadIframe(iframeName,'about:blank');}
function showIframe(iframeName,doParent){if(isnull(iframeName)){iframeName='diviCrizo';}
var el=$$(iframeName,doParent);if(el){el.style.display='block';iframesinuse[iframeName]='iframeopen';}}
function hideIframe(iframeName,doParent){if(isnull(iframeName)){iframeName='diviCrizo';}
var el=$$(iframeName,doParent);if(el){el.style.display='none';iframesinuse[iframeName]='';}}
iframesinuse=[];function closeIframe(iframeName){hideIframe('div'+iframeName);window.frames[iframeName].location='common/html/blank.html';if(iframesinuse.inAssocArray('iframeopen')===false){hideOverlay();}}
function showOverlay(doParent){var div=$$('mainDiv',doParent);addClassName(div,'opacity25');div.style.zIndex=-1;setTimeout('mainDivonclick('+doParent+')',500);}
function mainDivonclick(doParent){var div=$$('mainDiv',doParent);div.onclick=function(){hideIframe();hideIframe('diviCrizo2');hideOverlay();clearIframe('iCrizo');clearIframe('iCrizo2');}}
function hideOverlay(doParent){var div=$$('mainDiv',doParent);removeClassName(div,'opacity25');div.style.zIndex=0;div.onclick='';}
function setIframeSize(iframeName,iframeElement,maxWidth,maxHeight,minWidth,minHeight,iparent){try{if(isnull(iframeName)){iframeName='iCrizo';}
if(typeof iparent=='undefined'||iparent){var doParent=true;}else{var doParent=false;}
if(doParent){var iframeWin=top.window.frames[iframeName];var iframeEl=(!isnull(iframeElement)?iframeElement:(document.getElementById?parent.document.getElementById(iframeName):document.all?parent.document.all[iframeName]:null));}else{var iframeWin=window.frames[iframeName];var iframeEl=(!isnull(iframeElement)?iframeElement:$$(iframeName));}
if(iframeEl&&iframeWin){iframeEl.style.height="auto";if(iframeEl.contentWindow){var iframeUrl=iframeEl.contentWindow.location.href;}else{var iframeUrl=iframeEl.contentDocument.location.href;}
if((iframeUrl.match('view_image')!=null)||(iframeUrl.match('any others??')!=null)){iframeEl.style.width="auto";}
var docHt=getElementHeight(iframeWin.document);var docWh=getElementWidth(iframeWin.document);var parHt=pageHeight((doParent?'parent':''));var parWh=pageWidth((doParent?'parent':''));var padWh=5+(isIE()?12:0);var padHt=30+(isIE()?12:0);var iframeHt=Math.max(Math.min(docHt+20,(!isnull(maxHeight)?maxHeight:parHt)),(!isnull(minHeight)?minHeight:1));var iframeWh=Math.max(Math.min(docWh+20,(!isnull(maxWidth)?maxWidth:parWh)),(!isnull(minWidth)?minWidth:1));if(iframeHt+padHt+30>parHt){iframeHt=parHt-padHt-30;}
if(iframeWh+padWh+30>parWh){iframeWh=parWh-padWh-30;}
if(iframeHt)iframeEl.style.height=iframeHt+"px";if(iframeWh)iframeEl.style.width=iframeWh+"px";resize(iframeWh+padWh,iframeHt+padHt,'div'+iframeName,true,doParent);}}
catch(err){}}
function chkPopup(includefind){var names=['Crizo','Crizo2','Popup','Print'];if(names.inArray(window.name)||(window.name.toLowerCase().match('appointment')!=null)){return true;}else if(((typeof includefind!='undefined')&&(includefind=='true'))&&((window.name=='CrizoFind')||(window.name=='CrizoFind2'))){return true;}else{return false;}}
function chkIframe(includefind){var names=['iCrizo','iCrizo2'];if(names.inArray(window.name)){return true;}else{return false;}}
function hrefpopup(uri){if(chkPopup('true')){redirect(uri);}else{redirect(appendquerystring(uri,'notpop'));}
return false;}
function setchoices(choice,postform){if(typeof postform=='undefined'){postform='editform';}
if(getCheckedValue(eval('document.'+postform+'.'+choice))!=''){var choiceid='dm_'+choice;$$(choiceid).style.visibility='visible';$$('dm_hdr').style.visibility='visible';}}
function clearchoices(choice,x,postform){if(typeof postform=='undefined'){postform='editform';}
var choiceid='dm_'+choice;setCheckedValue(eval('document.'+postform+'.'+choice),'null');$$(choiceid).style.visibility='hidden';if(choice=='gd'){eval('document.'+postform+'.gdn.selectedIndex=-1');}else if(choice=='heat'){eval('document.'+postform+'.heating.selectedIndex=-1');}else if(choice=='park'){eval('document.'+postform+'.parking.selectedIndex=-1');}else if(choice=='furnish'){eval('document.'+postform+'.furnished.selectedIndex=-1');}
if(typeof x=='undefined'){x='1';}
if(x=='1'){if(getSelectedRadio(eval('document.'+postform+'.gd'))==-1&&getSelectedRadio(eval('document.'+postform+'.heat'))==-1&&getSelectedRadio(eval('document.'+postform+'.park'))==-1){$$('dm_hdr').style.visibility='hidden';}}else if(x=='2'){if(getSelectedRadio(eval('document.'+postform+'.gd'))==-1&&getSelectedRadio(eval('document.'+postform+'.heat'))==-1&&getSelectedRadio(eval('document.'+postform+'.park'))==-1&&getSelectedRadio(eval('document.'+postform+'.wm'))==-1&&getSelectedRadio(eval('document.'+postform+'.dw'))==-1&&getSelectedRadio(eval('document.'+postform+'.td'))==-1&&getSelectedRadio(eval('document.'+postform+'.bi'))==-1){$$('dm_hdr').style.visibility='hidden';}}}
function placeFocus(formEl){if(typeof highlightHasBeenRun=="undefined"){highlightHasBeenRun=false;}
if(!highlightHasBeenRun){highlightWhenHasFocus();highlightHasBeenRun=true;}
setFormFocus(formEl);}
function disableSubmit(e){var btn=window.event?window.event.srcElement:e?e.target:null;if(btn){endisablesubmit(getformforel(btn),btn,'disable');}}
function getformforel(el){if(el){var form=el.parentNode;while(form.nodeName.toLowerCase()!='form'){form=form.parentNode;}
return form;}}
function setsubmitsforform(form){var input=form.getElementsByTagName('input');for(var j=0;j<input.length;j++){if(input[j].type.toLowerCase()=='submit'){if(input[j].type.toLowerCase()=='submit'){addFunctionBefore(input[j],'onclick',function(e){return disableSubmit(e);});}}}}
function endisablesubmit(form,el,action){if(action=='disable'){form.whichbutton=el;addClassName(el,'opacity25');el.onmouseout=function(){}}else{form.whichbutton=null;removeClassName(el,'opacity25');el.onmouseout=function(){removeClassName(this,'btndown');addClassName(this,'btnup');}}
return true;}
function setcurrentlink(linkrel,subtabid,tabid){if(isnull(tabid)){tabid="ddsubtabs";}
if($$(tabid)){var subdivs=$$(tabid).getElementsByTagName("div");for(var j=0;j<subdivs.length;j++){if(!isnull(subtabid)&&(subdivs[j].id!=subtabid)){continue;}
var menuitems=subdivs[j].getElementsByTagName("a");for(var i=0;i<menuitems.length;i++){if(menuitems[i].getAttribute("rel")==linkrel){menuitems[i].style.fontWeight='bold';ddtabmenu.selectedtab=j;break;}}}}}
function setCookiePageSize(){if(!chkIframe()&&!chkPopup()){cookiePageSize();}}
function processFrameAction(_array,uri){var results=new Array();for(var i=0;i<_array.length;i++){results[_array[i][0]]=_array[i][1];}
switch(results['action']){case'delete':addClassName($$('row'+results['id']),'strike');addClassName($$('row'+results['id']),'textred');if(!isnull(results['cell'])){var cell='R'+results['id']+'C'+results['cell'];$$(cell).innerHTML=$$(results['data']);}
break;case'update':ajaxpost(uri,'id='+encodeURIComponent(results['id']),'',updateCells);addClassName($$('row'+results['id']),'verylightgreenbackground');break;}}
function updateCells(responseText){var results=responseText.strToAssoc();var cols=results['cols'].split(';*;');for(var i=0;i<cols.length;i++){var col=cols[i].split(';^;');var cell='R'+results['id']+'C'+col[0];$$(cell).innerHTML=col[1];}}
String.prototype.strToAssoc=function(){var strAsAssoc=new Array();var keyValues=this.split(';=;');for(var i=0;i<keyValues.length;i++){var key=keyValues[i].split(';-;');strAsAssoc[key[0]]=key[1];}
return strAsAssoc;}
function expandspan(spanid,index,action,isrow,funccall){if(isnull(isrow)){isrow=false;}
if(action===true){if(isrow){switchRowOn(spanid+index);}else{switchOn(spanid+index);}
switchOff(spanid+index+'plus');switchOn(spanid+index+'minus');}else{if(isrow){switchRowOff(spanid+index);}else{switchOff(spanid+index);}
switchOff(spanid+index+'minus');switchOn(spanid+index+'plus');}
if(typeof funccall=='function'){funccall(index,action);}}

// Copyright (C) 2005-2008 Ilya S. Lyubinskiy. All rights reserved.
// Technical support: http://www.php-development.ru/
//
// YOU MAY NOT
// (1) Remove or modify this copyright notice.
// (2) Re-distribute this code or any part of it.
//     Instead, you may link to the homepage of this code:
//     http://www.php-development.ru/javascripts/dropdown.php
//
// YOU MAY
// (1) Use this code on your website.
// (2) Use this code as part of another product.
//
// NO WARRANTY
// This code is provided "as is" without warranty of any kind.
// You expressly acknowledge and agree that use of this code is at your own risk.


// ****************************************************************************
//	Modified by PHP-4-Business.co.uk - copyright PHP-4-Business 2010
//	- highlighting on mouseover / mouseout



// ***** Popup Control *********************************************************

// ***** at_show_aux *****

function at_show_aux(parent, child)
{
  var p = document.getElementById(parent);
  var c = document.getElementById(child );

  var top  = (c["at_position"] == "y") ? p.offsetHeight+2 : 0;
  var left = (c["at_position"] == "x") ? p.offsetWidth +2 : 0;

  /*
  for (; p; p = p.offsetParent)
  {
    top  += p.offsetTop;
    left += p.offsetLeft;
  }
  */

  c.style.position   = "absolute";
  c.style.top        = top +'px';
  c.style.left       = left+'px';
  c.style.display    = "block";
}

// ***** at_show *****

function at_show(that)
{
  var p = document.getElementById(that["at_parent"]);
  var c = document.getElementById(that["at_child" ]);

  at_show_aux(p.id, c.id);
  clearTimeout(c["at_timeout"]);
}

// ***** at_hide *****

function at_hide(that, delay)
{
	var p = document.getElementById(that["at_parent"]);
  var c = document.getElementById(that["at_child" ]);

  if (typeof delay == 'undefined') { delay = 333; }
  c["at_timeout"] = setTimeout("document.getElementById('"+c.id+"').style.display = 'none'", delay);
}

// ***** at_click *****

function at_click()
{
  var p = document.getElementById(this["at_parent"]);
  var c = document.getElementById(this["at_child" ]);

  if (c.style.display != "none") at_show_aux(p.id, c.id); else c.style.display = "none";
  return false;
}

// ***** at_attach *****

// PARAMETERS:
// parent   - id of the parent html element
// child    - id of the child  html element that should be droped down
// showtype - "click" = drop down child html element on mouse click
//            "hover" = drop down child html element on mouse over
// position - "x" = display the child html element to the right
//            "y" = display the child html element below
// cursor   - omit to use default cursor or specify CSS cursor name
// highclass   - classname used to highlight a child element on mouseover
// normalclass - classname when not highlit

function at_attach(parent, child, showtype, position, cursor, highclass, normalclass)
{
  var p = document.getElementById(parent);
  var c = document.getElementById(child);

  p["at_parent"]     = p.id;
  c["at_parent"]     = p.id;
  p["at_child"]      = c.id;
  c["at_child"]      = c.id;
  p["at_position"]   = position;
  c["at_position"]   = position;

  c["highclass"]     = highclass;
  c["normalclass"]   = normalclass;

  c.style.position   = "absolute";
  c.style.display    = "none";

  if (cursor != undefined) p.style.cursor = cursor;

  switch (showtype)
  {
    case "click":
      p.onclick     = at_click;
      p.onmouseout  = function(e) {at_hide(this);}
      c.onmouseover = function(e) {at_show(this); at_highlightOn(this,e);}
      c.onmouseout  = function(e) {at_hide(this); at_highlightOff(this,e);}
      break;
    case "hover":
      p.onmouseover = function(e) {at_show(this);}
      p.onmouseout  = function(e) {at_hide(this);}
      c.onmouseover = function(e) {at_show(this); at_highlightOn(this,e);}
      c.onmouseout  = function(e) {at_hide(this); at_highlightOff(this,e);}
      break;
  }
}

function at_highlightOn(o,e)
{
	var c = document.getElementById(o["at_child" ]);
	var tgt = which(e);
	//tgt.className = c["highclass"];
	addClassName(tgt, c["highclass"]);
}

function at_highlightOff(o,e)
{
	var c = document.getElementById(o["at_child" ]);
	var tgt = which(e);
	//tgt.className = c["normalclass"];
	removeClassName(tgt, c["highclass"]);
}

/***********************************************
* Simple Tree Menu- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

var persisteduls=new Object()
var ddtreemenu=new Object()

/* #0000292: would like a white background - please remove faded orange from menu and body
ddtreemenu.closefolder="common/images/foldingmenu/plus.jpg" //set image path to "closed" folder image
ddtreemenu.openfolder="common/images/foldingmenu/mm.jpg" //set image path to "open" folder image  */
ddtreemenu.closefolder="common/images/foldingmenu/plus.gif" //set image path to "closed" folder image
ddtreemenu.openfolder="common/images/foldingmenu/mm.gif" //set image path to "open" folder image

//////////No need to edit beyond here///////////////////////////

ddtreemenu.createTree=function(treeid, enablepersist, persistdays){
var ultags=document.getElementById(treeid).getElementsByTagName("ul")
if (typeof persisteduls[treeid]=="undefined")
persisteduls[treeid]=(enablepersist==true && ddtreemenu.getCookie(treeid)!="")? ddtreemenu.getCookie(treeid).split(",") : ""
for (var i=0; i<ultags.length; i++)
ddtreemenu.buildSubTree(treeid, ultags[i], i)
if (enablepersist==true){ //if enable persist feature
var durationdays=(typeof persistdays=="undefined")? 1 : parseInt(persistdays)
ddtreemenu.dotask(window, function(){ddtreemenu.rememberstate(treeid, durationdays)}, "unload") //save opened UL indexes on body unload
}
}

ddtreemenu.buildSubTree=function(treeid, ulelement, index){
ulelement.parentNode.className="submenu"
if (typeof persisteduls[treeid]=="object"){ //if cookie exists (persisteduls[treeid] is an array versus "" string)
if (ddtreemenu.searcharray(persisteduls[treeid], index)){
ulelement.setAttribute("rel", "open")
ulelement.style.display="block"
ulelement.parentNode.style.backgroundImage="url("+ddtreemenu.openfolder+")"
}
else
ulelement.setAttribute("rel", "closed")
} //end cookie persist code
else if (ulelement.getAttribute("rel")==null || ulelement.getAttribute("rel")==false) //if no cookie and UL has NO rel attribute explicted added by user
ulelement.setAttribute("rel", "closed")
else if (ulelement.getAttribute("rel")=="open") //else if no cookie and this UL has an explicit rel value of "open"
ddtreemenu.expandSubTree(treeid, ulelement) //expand this UL plus all parent ULs (so the most inner UL is revealed!)
ulelement.parentNode.onclick=function(e){
var submenu=this.getElementsByTagName("ul")[0]
if (submenu.getAttribute("rel")=="closed"){
submenu.style.display="block"
submenu.setAttribute("rel", "open")
ulelement.parentNode.style.backgroundImage="url("+ddtreemenu.openfolder+")"
}
else if (submenu.getAttribute("rel")=="open"){
submenu.style.display="none"
submenu.setAttribute("rel", "closed")
ulelement.parentNode.style.backgroundImage="url("+ddtreemenu.closefolder+")"
}
ddtreemenu.preventpropagate(e)
}
ulelement.onclick=function(e){
ddtreemenu.preventpropagate(e)
}
}

ddtreemenu.expandSubTree=function(treeid, ulelement){ //expand a UL element and any of its parent ULs
var rootnode=document.getElementById(treeid)
var currentnode=ulelement
currentnode.style.display="block"
currentnode.parentNode.style.backgroundImage="url("+ddtreemenu.openfolder+")"
while (currentnode!=rootnode){
if (currentnode.tagName=="UL"){ //if parent node is a UL, expand it too
currentnode.style.display="block"
currentnode.setAttribute("rel", "open") //indicate it's open
currentnode.parentNode.style.backgroundImage="url("+ddtreemenu.openfolder+")"
}
currentnode=currentnode.parentNode
}
}

ddtreemenu.flatten=function(treeid, action){ //expand or contract all UL elements
var ultags=document.getElementById(treeid).getElementsByTagName("ul")
for (var i=0; i<ultags.length; i++){
ultags[i].style.display=(action=="expand")? "block" : "none"
var relvalue=(action=="expand")? "open" : "closed"
ultags[i].setAttribute("rel", relvalue)
ultags[i].parentNode.style.backgroundImage=(action=="expand")? "url("+ddtreemenu.openfolder+")" : "url("+ddtreemenu.closefolder+")"
}
}

ddtreemenu.rememberstate=function(treeid, durationdays){ //store index of opened ULs relative to other ULs in Tree into cookie
var ultags=document.getElementById(treeid).getElementsByTagName("ul")
var openuls=new Array()
for (var i=0; i<ultags.length; i++){
if (ultags[i].getAttribute("rel")=="open")
openuls[openuls.length]=i //save the index of the opened UL (relative to the entire list of ULs) as an array element
}
if (openuls.length==0) //if there are no opened ULs to save/persist
openuls[0]="none open" //set array value to string to simply indicate all ULs should persist with state being closed
ddtreemenu.setCookie(treeid, openuls.join(","), durationdays) //populate cookie with value treeid=1,2,3 etc (where 1,2... are the indexes of the opened ULs)
}

////A few utility functions below//////////////////////

ddtreemenu.getCookie=function(Name){ //get cookie value
var re=new RegExp(Name+"=[^;]+", "i"); //construct RE to search for target name/value pair
if (document.cookie.match(re)) //if cookie found
return document.cookie.match(re)[0].split("=")[1] //return its value
return ""
}

ddtreemenu.setCookie=function(name, value, days){ //set cookei value
var expireDate = new Date()
//set "expstring" to either future or past date, to set or delete cookie, respectively
var expstring=expireDate.setDate(expireDate.getDate()+parseInt(days))
document.cookie = name+"="+value+"; expires="+expireDate.toGMTString()+"; path=/";
}

ddtreemenu.searcharray=function(thearray, value){ //searches an array for the entered value. If found, delete value from array
var isfound=false
for (var i=0; i<thearray.length; i++){
if (thearray[i]==value){
isfound=true
thearray.shift() //delete this element from array for efficiency sake
break
}
}
return isfound
}

ddtreemenu.preventpropagate=function(e){ //prevent action from bubbling upwards
if (typeof e!="undefined")
e.stopPropagation()
else
event.cancelBubble=true
}

ddtreemenu.dotask=function(target, functionref, tasktype){ //assign a function to execute to an event handler (ie: onunload)
var tasktype=(window.addEventListener)? tasktype : "on"+tasktype
if (target.addEventListener)
target.addEventListener(tasktype, functionref, false)
else if (target.attachEvent)
target.attachEvent(tasktype, functionref)
}

//DD Tab Menu- Script rewritten April 27th, 07: http://www.dynamicdrive.com
//**Updated Feb 23rd, 08): Adds ability for menu to revert back to default selected tab when mouse moves out of menu
// selectedtab & tabaction added by PHP-4-Business Nov' 2010

//Only 2 configuration variables below:

var ddtabmenu={
	disabletablinks: false, //Disable hyperlinks in 1st level tabs with sub contents (true or false)?
	snap2original: [true, 300], //Should tab revert back to default selected when mouse moves out of menu? ([true/false, delay_millisec]

	currentpageurl: window.location.href.replace("http://"+window.location.hostname, "").replace(/^\//, ""), //get current page url (minus hostname, ie: http://www.dynamicdrive.com/)
	selectedtab: "auto",				//gjw Default selected tab
	tabaction: "onMouseOver",		//gjw Action to trigger tab

definemenu:function(tabid, dselected){
	this[tabid+"-menuitems"]=null
	this[tabid+"-dselected"]=-1
	if (typeof dselected != 'undefined') { this.selectedtab = dselected; }		//gjw
	this.addEvent(window, function(){ddtabmenu.init(tabid)}, "load")					//gjw
},

showsubmenu:function(tabid, targetitem){
	var menuitems=this[tabid+"-menuitems"]
	this.clearrevert2default(tabid)
	for (i=0; i<menuitems.length; i++){
		menuitems[i].className=""
		if (typeof menuitems[i].hasSubContent!="undefined")
			document.getElementById(menuitems[i].getAttribute("rel")).style.display="none"
	}
	targetitem.className="current"
	if (typeof targetitem.hasSubContent!="undefined")
		document.getElementById(targetitem.getAttribute("rel")).style.display="block"
},

isSelected:function(menuurl){
	var menuurl=menuurl.replace("http://"+menuurl.hostname, "").replace(/^\//, "")
	return (ddtabmenu.currentpageurl==menuurl)
},

isContained:function(m, e){
	var e=window.event || e
	var c=e.relatedTarget || ((e.type=="mouseover")? e.fromElement : e.toElement)
	while (c && c!=m)try {c=c.parentNode} catch(e){c=m}
	if (c==m)
		return true
	else
		return false
},

revert2default:function(outobj, tabid, e){
	if (!ddtabmenu.isContained(outobj, tabid, e)){
		window["hidetimer_"+tabid]=setTimeout(function(){
			ddtabmenu.showsubmenu(tabid, ddtabmenu[tabid+"-dselected"])
		}, ddtabmenu.snap2original[1])
	}
},

clearrevert2default:function(tabid){
 if (typeof window["hidetimer_"+tabid]!="undefined")
		clearTimeout(window["hidetimer_"+tabid])
},

addEvent:function(target, functionref, tasktype){ //assign a function to execute to an event handler (ie: onunload)
	var tasktype=(window.addEventListener)? tasktype : "on"+tasktype
	if (target.addEventListener)
		target.addEventListener(tasktype, functionref, false)
	else if (target.attachEvent)
		target.attachEvent(tasktype, functionref)
},

init:function(tabid, dselected){
	dselected = this.selectedtab;		//gjw
	if (document.getElementById(tabid) != null) {		//gjw
		var menuitems=document.getElementById(tabid).getElementsByTagName("a")
		this[tabid+"-menuitems"]=menuitems
		for (var x=0; x<menuitems.length; x++){
			if (menuitems[x].getAttribute("rel")){
				this[tabid+"-menuitems"][x].hasSubContent=true
				if (ddtabmenu.disabletablinks)
					menuitems[x].onclick=function(){return false}
				if (ddtabmenu.snap2original[0]==true){
					var submenu=document.getElementById(menuitems[x].getAttribute("rel"))
					menuitems[x].onmouseout=function(e){ddtabmenu.revert2default(submenu, tabid, e)}
					submenu.onmouseover=function(){ddtabmenu.clearrevert2default(tabid)}
					submenu.onmouseout=function(e){ddtabmenu.revert2default(this, tabid, e)}
				}
			}
			else //for items without a submenu, add onMouseout effect
				menuitems[x].onmouseout=function(e){this.className=""; if (ddtabmenu.snap2original[0]==true) ddtabmenu.revert2default(this, tabid, e)}
			if (this.tabaction.toLowerCase() == "onclick")																					//gjw - use onclick to select
				menuitems[x].onclick=function(){ddtabmenu.showsubmenu(tabid, this);return false;}			//gjw - use onclick to select
			else																																										//gjw - use onclick to select
				menuitems[x].onmouseover=function(){ddtabmenu.showsubmenu(tabid, this)}
			if (dselected=="auto" && typeof setalready=="undefined" && this.isSelected(menuitems[x].href)){
				ddtabmenu.showsubmenu(tabid, menuitems[x])
				this[tabid+"-dselected"]=menuitems[x]
				var setalready=true
			}
			else if (parseInt(dselected)==x){
				ddtabmenu.showsubmenu(tabid, menuitems[x])
				this[tabid+"-dselected"]=menuitems[x]
			}
		}
	}
}
}



var Drag={obj:null,init:function(o,oRoot,minX,maxX,minY,maxY,bSwapHorzRef,bSwapVertRef,fXMapper,fYMapper)
{o.onmousedown=Drag.start;o.hmode=bSwapHorzRef?false:true;o.vmode=bSwapVertRef?false:true;o.root=oRoot&&oRoot!=null?oRoot:o;if(o.hmode&&isNaN(parseInt(o.root.style.left)))o.root.style.left="0px";if(o.vmode&&isNaN(parseInt(o.root.style.top)))o.root.style.top="0px";if(!o.hmode&&isNaN(parseInt(o.root.style.right)))o.root.style.right="0px";if(!o.vmode&&isNaN(parseInt(o.root.style.bottom)))o.root.style.bottom="0px";o.minX=typeof minX!='undefined'?minX:null;o.minY=typeof minY!='undefined'?minY:null;o.maxX=typeof maxX!='undefined'?maxX:null;o.maxY=typeof maxY!='undefined'?maxY:null;o.xMapper=fXMapper?fXMapper:null;o.yMapper=fYMapper?fYMapper:null;o.root.onDragStart=new Function();o.root.onDragEnd=new Function();o.root.onDrag=new Function();},start:function(e)
{var o=Drag.obj=this;e=Drag.fixE(e);var y=parseInt(o.vmode?o.root.style.top:o.root.style.bottom);var x=parseInt(o.hmode?o.root.style.left:o.root.style.right);o.root.onDragStart(x,y);o.lastMouseX=e.clientX;o.lastMouseY=e.clientY;if(o.hmode){if(o.minX!=null)o.minMouseX=e.clientX-x+o.minX;if(o.maxX!=null)o.maxMouseX=o.minMouseX+o.maxX-o.minX;}else{if(o.minX!=null)o.maxMouseX=-o.minX+e.clientX+x;if(o.maxX!=null)o.minMouseX=-o.maxX+e.clientX+x;}
if(o.vmode){if(o.minY!=null)o.minMouseY=e.clientY-y+o.minY;if(o.maxY!=null)o.maxMouseY=o.minMouseY+o.maxY-o.minY;}else{if(o.minY!=null)o.maxMouseY=-o.minY+e.clientY+y;if(o.maxY!=null)o.minMouseY=-o.maxY+e.clientY+y;}
document.onmousemove=Drag.drag;document.onmouseup=Drag.end;return false;},drag:function(e)
{e=Drag.fixE(e);var o=Drag.obj;var ey=e.clientY;var ex=e.clientX;var y=parseInt(o.vmode?o.root.style.top:o.root.style.bottom);var x=parseInt(o.hmode?o.root.style.left:o.root.style.right);var nx,ny;if(o.minX!=null)ex=o.hmode?Math.max(ex,o.minMouseX):Math.min(ex,o.maxMouseX);if(o.maxX!=null)ex=o.hmode?Math.min(ex,o.maxMouseX):Math.max(ex,o.minMouseX);if(o.minY!=null)ey=o.vmode?Math.max(ey,o.minMouseY):Math.min(ey,o.maxMouseY);if(o.maxY!=null)ey=o.vmode?Math.min(ey,o.maxMouseY):Math.max(ey,o.minMouseY);nx=x+((ex-o.lastMouseX)*(o.hmode?1:-1));ny=y+((ey-o.lastMouseY)*(o.vmode?1:-1));if(o.xMapper)nx=o.xMapper(y)
else if(o.yMapper)ny=o.yMapper(x)
Drag.obj.root.style[o.hmode?"left":"right"]=nx+"px";Drag.obj.root.style[o.vmode?"top":"bottom"]=ny+"px";Drag.obj.lastMouseX=ex;Drag.obj.lastMouseY=ey;Drag.obj.root.onDrag(nx,ny);return false;},end:function()
{document.onmousemove=null;document.onmouseup=null;Drag.obj.root.onDragEnd(parseInt(Drag.obj.root.style[Drag.obj.hmode?"left":"right"]),parseInt(Drag.obj.root.style[Drag.obj.vmode?"top":"bottom"]));Drag.obj=null;},fixE:function(e)
{if(typeof e=='undefined')e=window.event;if(typeof e.layerX=='undefined')e.layerX=e.offsetX;if(typeof e.layerY=='undefined')e.layerY=e.offsetY;return e;}};


var turnOffYearSpan=false;var weekStartsOnSunday=true;var showWeekNumber=false;var languageCode='en';var calendar_display_time=true;var todayStringFormat='[todayString] [UCFdayString]. [day] [monthString] [year]';var pathToImages='common/images/calendar/';var speedOfSelectBoxSliding=200;var intervalSelectBox_minutes=5;var calendar_offsetTop=0;var calendar_offsetLeft=0;var calendarDiv=false;var MSIE=false;var Opera=false;if(navigator.userAgent.indexOf('MSIE')>=0&&navigator.userAgent.indexOf('Opera')<0)MSIE=true;if(navigator.userAgent.indexOf('Opera')>=0)Opera=true;switch(languageCode){case"en":var monthArray=['January','February','March','April','May','June','July','August','September','October','November','December'];var monthArrayShort=['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'];var dayArray=['Mon','Tue','Wed','Thu','Fri','Sat','Sun'];var weekString='Week';var todayString='Today: ';break;}
if(weekStartsOnSunday){var tempDayName=dayArray[6];for(var theIx=6;theIx>0;theIx--){dayArray[theIx]=dayArray[theIx-1];}
dayArray[0]=tempDayName;}
var daysInMonthArray=[31,28,31,30,31,30,31,31,30,31,30,31];var currentMonth;var currentYear;var currentHour;var currentMinute;var calendarContentDiv;var returnDateTo;var returnFormat;var activeSelectBoxMonth;var activeSelectBoxYear;var activeSelectBoxHour;var activeSelectBoxMinute;var iframeObj=false;var iframeObj2=false;function EIS_FIX_EI1(where2fixit)
{if(!iframeObj2)return;iframeObj2.style.display='block';iframeObj2.style.height=document.getElementById(where2fixit).offsetHeight+1;iframeObj2.style.width=document.getElementById(where2fixit).offsetWidth;iframeObj2.style.left=getleftPos(document.getElementById(where2fixit))+1-calendar_offsetLeft;iframeObj2.style.top=getTopPos(document.getElementById(where2fixit))-document.getElementById(where2fixit).offsetHeight-calendar_offsetTop;}
function EIS_Hide_Frame()
{if(iframeObj2)iframeObj2.style.display='none';}
var returnDateToYear;var returnDateToMonth;var returnDateToDay;var returnDateToHour;var returnDateToMinute;var inputYear;var inputMonth;var inputDay;var inputHour;var inputMinute;var calendarDisplayTime=false;var selectBoxHighlightColor='#D60808';var selectBoxRolloverBgColor='#E2EBED';var selectBoxMovementInProgress=false;var activeSelectBox=false;function cancelCalendarEvent()
{return false;}
function isLeapYear(inputYear)
{if(inputYear%400==0||(inputYear%4==0&&inputYear%100!=0))return true;return false;}
var activeSelectBoxMonth=false;var activeSelectBoxDirection=false;function highlightMonthYear()
{if(activeSelectBoxMonth)activeSelectBoxMonth.className='';activeSelectBox=this;if(this.className=='monthYearActive'){this.className='';}else{this.className='monthYearActive';activeSelectBoxMonth=this;}
if(this.innerHTML.indexOf('-')>=0||this.innerHTML.indexOf('+')>=0){if(this.className=='monthYearActive')
selectBoxMovementInProgress=true;else
selectBoxMovementInProgress=false;if(this.innerHTML.indexOf('-')>=0)activeSelectBoxDirection=-1;else activeSelectBoxDirection=1;}else selectBoxMovementInProgress=false;}
function showMonthDropDown()
{if(document.getElementById('monthDropDown').style.display=='block'){document.getElementById('monthDropDown').style.display='none';EIS_Hide_Frame();}else{document.getElementById('monthDropDown').style.display='block';document.getElementById('yearDropDown').style.display='none';document.getElementById('hourDropDown').style.display='none';document.getElementById('minuteDropDown').style.display='none';if(MSIE)
{EIS_FIX_EI1('monthDropDown')}}}
function showYearDropDown()
{if(document.getElementById('yearDropDown').style.display=='block'){document.getElementById('yearDropDown').style.display='none';EIS_Hide_Frame();}else{document.getElementById('yearDropDown').style.display='block';document.getElementById('monthDropDown').style.display='none';document.getElementById('hourDropDown').style.display='none';document.getElementById('minuteDropDown').style.display='none';if(MSIE)
{EIS_FIX_EI1('yearDropDown')}}}
function showHourDropDown()
{if(document.getElementById('hourDropDown').style.display=='block'){document.getElementById('hourDropDown').style.display='none';EIS_Hide_Frame();}else{document.getElementById('hourDropDown').style.display='block';document.getElementById('monthDropDown').style.display='none';document.getElementById('yearDropDown').style.display='none';document.getElementById('minuteDropDown').style.display='none';if(MSIE)
{EIS_FIX_EI1('hourDropDown')}}}
function showMinuteDropDown()
{if(document.getElementById('minuteDropDown').style.display=='block'){document.getElementById('minuteDropDown').style.display='none';EIS_Hide_Frame();}else{document.getElementById('minuteDropDown').style.display='block';document.getElementById('monthDropDown').style.display='none';document.getElementById('yearDropDown').style.display='none';document.getElementById('hourDropDown').style.display='none';if(MSIE)
{EIS_FIX_EI1('minuteDropDown')}}}
function selectMonth()
{document.getElementById('calendar_month_txt').innerHTML=this.innerHTML
currentMonth=this.id.replace(/[^\d]/g,'');document.getElementById('monthDropDown').style.display='none';EIS_Hide_Frame();for(var no=0;no<monthArray.length;no++){document.getElementById('monthDiv_'+no).style.color='';}
this.style.color=selectBoxHighlightColor;activeSelectBoxMonth=this;writeCalendarContent();}
function selectHour()
{document.getElementById('calendar_hour_txt').innerHTML=this.innerHTML
currentHour=this.innerHTML.replace(/[^\d]/g,'');document.getElementById('hourDropDown').style.display='none';EIS_Hide_Frame();if(activeSelectBoxHour){activeSelectBoxHour.style.color='';}
activeSelectBoxHour=this;this.style.color=selectBoxHighlightColor;}
function selectMinute()
{document.getElementById('calendar_minute_txt').innerHTML=this.innerHTML
currentMinute=this.innerHTML.replace(/[^\d]/g,'');document.getElementById('minuteDropDown').style.display='none';EIS_Hide_Frame();if(activeSelectBoxMinute){activeSelectBoxMinute.style.color='';}
activeSelectBoxMinute=this;this.style.color=selectBoxHighlightColor;}
function selectYear()
{document.getElementById('calendar_year_txt').innerHTML=this.innerHTML
currentYear=this.innerHTML.replace(/[^\d]/g,'');document.getElementById('yearDropDown').style.display='none';EIS_Hide_Frame();if(activeSelectBoxYear){activeSelectBoxYear.style.color='';}
activeSelectBoxYear=this;this.style.color=selectBoxHighlightColor;writeCalendarContent();}
function switchMonth()
{if(this.src.indexOf('left')>=0){currentMonth=currentMonth-1;;if(currentMonth<0){currentMonth=11;currentYear=currentYear-1;}}else{currentMonth=currentMonth+1;;if(currentMonth>11){currentMonth=0;currentYear=currentYear/1+1;}}
writeCalendarContent();}
function createMonthDiv(){var div=document.createElement('DIV');div.className='monthYearPicker';div.id='monthPicker';for(var no=0;no<monthArray.length;no++){var subDiv=document.createElement('DIV');subDiv.innerHTML=monthArray[no];subDiv.onmouseover=highlightMonthYear;subDiv.onmouseout=highlightMonthYear;subDiv.onclick=selectMonth;subDiv.id='monthDiv_'+no;subDiv.style.width='56px';subDiv.onselectstart=cancelCalendarEvent;div.appendChild(subDiv);if(currentMonth&&currentMonth==no){subDiv.style.color=selectBoxHighlightColor;activeSelectBoxMonth=subDiv;}}
return div;}
function changeSelectBoxYear(e,inputObj)
{if(!inputObj)inputObj=this;var yearItems=inputObj.parentNode.getElementsByTagName('DIV');if(inputObj.innerHTML.indexOf('-')>=0){var startYear=yearItems[1].innerHTML/1-1;if(activeSelectBoxYear){activeSelectBoxYear.style.color='';}}else{var startYear=yearItems[1].innerHTML/1+1;if(activeSelectBoxYear){activeSelectBoxYear.style.color='';}}
for(var no=1;no<yearItems.length-1;no++){yearItems[no].innerHTML=startYear+no-1;yearItems[no].id='yearDiv'+(startYear/1+no/1-1);}
if(activeSelectBoxYear){activeSelectBoxYear.style.color='';if(document.getElementById('yearDiv'+currentYear)){activeSelectBoxYear=document.getElementById('yearDiv'+currentYear);activeSelectBoxYear.style.color=selectBoxHighlightColor;;}}}
function changeSelectBoxHour(e,inputObj)
{if(!inputObj)inputObj=this;var hourItems=inputObj.parentNode.getElementsByTagName('DIV');if(inputObj.innerHTML.indexOf('-')>=0){var startHour=hourItems[1].innerHTML/1-1;if(startHour<0)startHour=0;if(activeSelectBoxHour){activeSelectBoxHour.style.color='';}}else{var startHour=hourItems[1].innerHTML/1+1;if(startHour>14)startHour=14;if(activeSelectBoxHour){activeSelectBoxHour.style.color='';}}
var prefix='';for(var no=1;no<hourItems.length-1;no++){if((startHour/1+no/1)<11)prefix='0';else prefix='';hourItems[no].innerHTML=prefix+(startHour+no-1);hourItems[no].id='hourDiv'+(startHour/1+no/1-1);}
if(activeSelectBoxHour){activeSelectBoxHour.style.color='';if(document.getElementById('hourDiv'+currentHour)){activeSelectBoxHour=document.getElementById('hourDiv'+currentHour);activeSelectBoxHour.style.color=selectBoxHighlightColor;;}}}
function updateYearDiv()
{var yearSpan=5;if(turnOffYearSpan){yearSpan=0;}
var div=document.getElementById('yearDropDown');var yearItems=div.getElementsByTagName('DIV');for(var no=1;no<yearItems.length-1;no++){yearItems[no].innerHTML=currentYear/1-yearSpan+no;if(currentYear==(currentYear/1-yearSpan+no)){yearItems[no].style.color=selectBoxHighlightColor;activeSelectBoxYear=yearItems[no];}else{yearItems[no].style.color='';}}}
function updateMonthDiv()
{for(no=0;no<12;no++){document.getElementById('monthDiv_'+no).style.color='';}
document.getElementById('monthDiv_'+currentMonth).style.color=selectBoxHighlightColor;activeSelectBoxMonth=document.getElementById('monthDiv_'+currentMonth);}
function updateHourDiv()
{var div=document.getElementById('hourDropDown');var hourItems=div.getElementsByTagName('DIV');var addHours=0;if((currentHour/1-6+1)<0){addHours=(currentHour/1-6+1)*-1;}
for(var no=1;no<hourItems.length-1;no++){var prefix='';if((currentHour/1-6+no+addHours)<10)prefix='0';hourItems[no].innerHTML=prefix+(currentHour/1-6+no+addHours);if(currentHour==(currentHour/1-6+no)){hourItems[no].style.color=selectBoxHighlightColor;activeSelectBoxHour=hourItems[no];}else{hourItems[no].style.color='';}}}
function updateMinuteDiv()
{for(no=0;no<60;no+=intervalSelectBox_minutes){var prefix='';if(no<10)prefix='0';document.getElementById('minuteDiv_'+prefix+no).style.color='';}
if(document.getElementById('minuteDiv_'+currentMinute)){document.getElementById('minuteDiv_'+currentMinute).style.color=selectBoxHighlightColor;activeSelectBoxMinute=document.getElementById('minuteDiv_'+currentMinute);}}
function createYearDiv()
{if(!document.getElementById('yearDropDown')){var div=document.createElement('DIV');div.className='monthYearPicker';}else{var div=document.getElementById('yearDropDown');var subDivs=div.getElementsByTagName('DIV');for(var no=0;no<subDivs.length;no++){subDivs[no].parentNode.removeChild(subDivs[no]);}}
var d=new Date();if(currentYear){d.setFullYear(currentYear);}
var startYear=d.getFullYear()/1-5;var yearSpan=10;if(!turnOffYearSpan){var subDiv=document.createElement('DIV');subDiv.innerHTML='&nbsp;&nbsp;- ';subDiv.onclick=changeSelectBoxYear;subDiv.onmouseover=highlightMonthYear;subDiv.onmouseout=function(){selectBoxMovementInProgress=false;};subDiv.onselectstart=cancelCalendarEvent;div.appendChild(subDiv);}else{startYear=d.getFullYear()/1-0;yearSpan=2;}
for(var no=startYear;no<(startYear+yearSpan);no++){var subDiv=document.createElement('DIV');subDiv.innerHTML=no;subDiv.onmouseover=highlightMonthYear;subDiv.onmouseout=highlightMonthYear;subDiv.onclick=selectYear;subDiv.id='yearDiv'+no;subDiv.onselectstart=cancelCalendarEvent;div.appendChild(subDiv);if(currentYear&&currentYear==no){subDiv.style.color=selectBoxHighlightColor;activeSelectBoxYear=subDiv;}}
if(!turnOffYearSpan){var subDiv=document.createElement('DIV');subDiv.innerHTML='&nbsp;&nbsp;+ ';subDiv.onclick=changeSelectBoxYear;subDiv.onmouseover=highlightMonthYear;subDiv.onmouseout=function(){selectBoxMovementInProgress=false;};subDiv.onselectstart=cancelCalendarEvent;div.appendChild(subDiv);}
return div;}
function slideCalendarSelectBox()
{if(selectBoxMovementInProgress){if(activeSelectBox.parentNode.id=='hourDropDown'){changeSelectBoxHour(false,activeSelectBox);}
if(activeSelectBox.parentNode.id=='yearDropDown'){changeSelectBoxYear(false,activeSelectBox);}}
setTimeout('slideCalendarSelectBox()',speedOfSelectBoxSliding);}
function createHourDiv()
{if(!document.getElementById('hourDropDown')){var div=document.createElement('DIV');div.className='monthYearPicker';}else{var div=document.getElementById('hourDropDown');var subDivs=div.getElementsByTagName('DIV');for(var no=0;no<subDivs.length;no++){subDivs[no].parentNode.removeChild(subDivs[no]);}}
if(!currentHour)currentHour=0;var startHour=currentHour/1;if(startHour>14)startHour=14;var subDiv=document.createElement('DIV');subDiv.innerHTML='&nbsp;&nbsp;- ';subDiv.onclick=changeSelectBoxHour;subDiv.onmouseover=highlightMonthYear;subDiv.onmouseout=function(){selectBoxMovementInProgress=false;};subDiv.onselectstart=cancelCalendarEvent;div.appendChild(subDiv);for(var no=startHour;no<startHour+10;no++){var prefix='';if(no/1<10)prefix='0';var subDiv=document.createElement('DIV');subDiv.innerHTML=prefix+no;subDiv.onmouseover=highlightMonthYear;subDiv.onmouseout=highlightMonthYear;subDiv.onclick=selectHour;subDiv.id='hourDiv'+no;subDiv.onselectstart=cancelCalendarEvent;div.appendChild(subDiv);if(currentYear&&currentYear==no){subDiv.style.color=selectBoxHighlightColor;activeSelectBoxYear=subDiv;}}
var subDiv=document.createElement('DIV');subDiv.innerHTML='&nbsp;&nbsp;+ ';subDiv.onclick=changeSelectBoxHour;subDiv.onmouseover=highlightMonthYear;subDiv.onmouseout=function(){selectBoxMovementInProgress=false;};subDiv.onselectstart=cancelCalendarEvent;div.appendChild(subDiv);return div;}
function createMinuteDiv()
{if(!document.getElementById('minuteDropDown')){var div=document.createElement('DIV');div.className='monthYearPicker';}else{var div=document.getElementById('minuteDropDown');var subDivs=div.getElementsByTagName('DIV');for(var no=0;no<subDivs.length;no++){subDivs[no].parentNode.removeChild(subDivs[no]);}}
var startMinute=0;var prefix='';for(var no=startMinute;no<60;no+=intervalSelectBox_minutes){if(no<10)prefix='0';else prefix='';var subDiv=document.createElement('DIV');subDiv.innerHTML=prefix+no;subDiv.onmouseover=highlightMonthYear;subDiv.onmouseout=highlightMonthYear;subDiv.onclick=selectMinute;subDiv.id='minuteDiv_'+prefix+no;subDiv.onselectstart=cancelCalendarEvent;div.appendChild(subDiv);if(currentYear&&currentYear==no){subDiv.style.color=selectBoxHighlightColor;activeSelectBoxYear=subDiv;}}
return div;}
function highlightSelect()
{if(this.className=='selectBoxTime'){this.className='selectBoxTimeOver';this.getElementsByTagName('IMG')[0].src=pathToImages+'down_time_over.gif';}else if(this.className=='selectBoxTimeOver'){this.className='selectBoxTime';this.getElementsByTagName('IMG')[0].src=pathToImages+'down_time.gif';}
if(this.className=='selectBox'){this.className='selectBoxOver';this.getElementsByTagName('IMG')[0].src=pathToImages+'down_over.gif';}else if(this.className=='selectBoxOver'){this.className='selectBox';this.getElementsByTagName('IMG')[0].src=pathToImages+'down.gif';}}
function highlightArrow()
{if(this.src.indexOf('over')>=0){if(this.src.indexOf('left')>=0)this.src=pathToImages+'left.gif';if(this.src.indexOf('right')>=0)this.src=pathToImages+'right.gif';}else{if(this.src.indexOf('left')>=0)this.src=pathToImages+'left_over.gif';if(this.src.indexOf('right')>=0)this.src=pathToImages+'right_over.gif';}}
function highlightClose()
{if(this.src.indexOf('over')>=0){this.src=pathToImages+'close.gif';}else{this.src=pathToImages+'close_over.gif';}}
function closeCalendar(){document.getElementById('yearDropDown').style.display='none';document.getElementById('monthDropDown').style.display='none';document.getElementById('hourDropDown').style.display='none';document.getElementById('minuteDropDown').style.display='none';calendarDiv.style.display='none';if(iframeObj){iframeObj.style.display='none';EIS_Hide_Frame();}
if(activeSelectBoxMonth)activeSelectBoxMonth.className='';if(activeSelectBoxYear)activeSelectBoxYear.className='';}
function writeTopBar()
{var topBar=document.createElement('DIV');topBar.className='topBar';topBar.id='topBar';calendarDiv.appendChild(topBar);var leftDiv=document.createElement('DIV');leftDiv.style.marginRight='1px';var img=document.createElement('IMG');img.src=pathToImages+'left.gif';img.onmouseover=highlightArrow;img.onclick=switchMonth;img.onmouseout=highlightArrow;leftDiv.appendChild(img);topBar.appendChild(leftDiv);if(Opera)leftDiv.style.width='16px';var rightDiv=document.createElement('DIV');rightDiv.style.marginRight='1px';var img=document.createElement('IMG');img.src=pathToImages+'right.gif';img.onclick=switchMonth;img.onmouseover=highlightArrow;img.onmouseout=highlightArrow;rightDiv.appendChild(img);if(Opera)rightDiv.style.width='16px';topBar.appendChild(rightDiv);var monthDiv=document.createElement('DIV');monthDiv.id='monthSelect';monthDiv.onmouseover=highlightSelect;monthDiv.onmouseout=highlightSelect;monthDiv.onclick=showMonthDropDown;var span=document.createElement('SPAN');span.innerHTML=monthArray[currentMonth];span.id='calendar_month_txt';monthDiv.appendChild(span);var img=document.createElement('IMG');img.src=pathToImages+'down.gif';img.style.position='absolute';img.style.right='0px';monthDiv.appendChild(img);monthDiv.className='selectBox';if(Opera){img.style.cssText='float:right;position:relative';img.style.position='relative';img.style.styleFloat='right';}
topBar.appendChild(monthDiv);var monthPicker=createMonthDiv();monthPicker.style.left='37px';monthPicker.style.top=monthDiv.offsetTop+monthDiv.offsetHeight+1+'px';monthPicker.style.width='60px';monthPicker.id='monthDropDown';calendarDiv.appendChild(monthPicker);var yearDiv=document.createElement('DIV');yearDiv.id='yearSelect';yearDiv.onmouseover=highlightSelect;yearDiv.onmouseout=highlightSelect;yearDiv.onclick=showYearDropDown;var span=document.createElement('SPAN');span.innerHTML=currentYear;span.id='calendar_year_txt';yearDiv.appendChild(span);topBar.appendChild(yearDiv);var img=document.createElement('IMG');img.src=pathToImages+'down.gif';yearDiv.appendChild(img);yearDiv.className='selectBox';if(Opera){yearDiv.style.width='50px';img.style.cssText='float:right';img.style.position='relative';img.style.styleFloat='right';}
var yearPicker=createYearDiv();yearPicker.style.left='113px';yearPicker.style.top=monthDiv.offsetTop+monthDiv.offsetHeight+1+'px';yearPicker.style.width='35px';yearPicker.id='yearDropDown';calendarDiv.appendChild(yearPicker);var img=document.createElement('IMG');img.src=pathToImages+'close.gif';img.style.styleFloat='right';img.onmouseover=highlightClose;img.onmouseout=highlightClose;img.onclick=closeCalendar;topBar.appendChild(img);if(!document.all){img.style.position='absolute';img.style.right='2px';}}
function writeCalendarContent()
{var calendarContentDivExists=true;if(!calendarContentDiv){calendarContentDiv=document.createElement('DIV');calendarDiv.appendChild(calendarContentDiv);calendarContentDivExists=false;}
currentMonth=currentMonth/1;var d=new Date();d.setFullYear(currentYear);d.setDate(1);d.setMonth(currentMonth);var dayStartOfMonth=d.getDay();if(!weekStartsOnSunday){if(dayStartOfMonth==0)dayStartOfMonth=7;dayStartOfMonth--;}
document.getElementById('calendar_year_txt').innerHTML=currentYear;document.getElementById('calendar_month_txt').innerHTML=monthArray[currentMonth];document.getElementById('calendar_hour_txt').innerHTML=currentHour;document.getElementById('calendar_minute_txt').innerHTML=currentMinute;var existingTable=calendarContentDiv.getElementsByTagName('TABLE');if(existingTable.length>0){calendarContentDiv.removeChild(existingTable[0]);}
var calTable=document.createElement('TABLE');calTable.width='100%';calTable.cellSpacing='0';calendarContentDiv.appendChild(calTable);var calTBody=document.createElement('TBODY');calTable.appendChild(calTBody);var row=calTBody.insertRow(-1);row.className='calendar_week_row';if(showWeekNumber){var cell=row.insertCell(-1);cell.innerHTML=weekString;cell.className='calendar_week_column';cell.style.backgroundColor=selectBoxRolloverBgColor;}
for(var no=0;no<dayArray.length;no++){var cell=row.insertCell(-1);cell.innerHTML=dayArray[no];cell.width="14%";cell.className="dowRow";}
var row=calTBody.insertRow(-1);if(showWeekNumber){var cell=row.insertCell(-1);cell.className='calendar_week_column';cell.style.backgroundColor=selectBoxRolloverBgColor;var week=getWeek(currentYear,currentMonth,1);cell.innerHTML=week;}
for(var no=0;no<dayStartOfMonth;no++){var cell=row.insertCell(-1);cell.innerHTML='&nbsp;';}
var colCounter=dayStartOfMonth;var daysInMonth=daysInMonthArray[currentMonth];if(daysInMonth==28){if(isLeapYear(currentYear))daysInMonth=29;}
for(var no=1;no<=daysInMonth;no++){d.setDate(no-1);if(colCounter>0&&colCounter%7==0){var row=calTBody.insertRow(-1);if(showWeekNumber){var cell=row.insertCell(-1);cell.className='calendar_week_column';var week=getWeek(currentYear,currentMonth,no);cell.innerHTML=week;cell.style.backgroundColor=selectBoxRolloverBgColor;}}
var cell=row.insertCell(-1);if(currentYear==inputYear&&currentMonth==inputMonth&&no==inputDay){cell.className='activeDay';}
cell.innerHTML=no;cell.onclick=pickDate;colCounter++;}
if(!document.all){if(calendarContentDiv.offsetHeight)
document.getElementById('topBar').style.top=calendarContentDiv.offsetHeight+document.getElementById('timeBar').offsetHeight+document.getElementById('topBar').offsetHeight-1+5+'px';else{document.getElementById('topBar').style.top='';document.getElementById('topBar').style.bottom='0px';}}
if(iframeObj){if(!calendarContentDivExists)setTimeout('resizeIframe()',350);else setTimeout('resizeIframe()',10);}}
function resizeIframe()
{iframeObj.style.width=calendarDiv.offsetWidth+'px';iframeObj.style.height=calendarDiv.offsetHeight+'px';}
function pickTodaysDate()
{var d=new Date();currentMonth=d.getMonth();currentYear=d.getFullYear();pickDate(false,d.getDate());}
function pickDate(e,inputDay)
{var month=currentMonth/1+1;if(month<10)month='0'+month;var day;if(!inputDay&&this)day=this.innerHTML;else day=inputDay;if(day/1<10)day='0'+day;if(returnFormat){returnFormat=returnFormat.replace('dd',day);returnFormat=returnFormat.replace('mmm',monthArrayShort[(month/1)-1]);returnFormat=returnFormat.replace('mm',month);returnFormat=returnFormat.replace('yyyy',currentYear);returnFormat=returnFormat.replace('hh',currentHour);returnFormat=returnFormat.replace('ii',currentMinute);returnFormat=returnFormat.replace('d',day/1);returnFormat=returnFormat.replace('m',month/1);returnDateTo.value=returnFormat;try{returnDateTo.onchange();}catch(e){}}else{for(var no=0;no<returnDateToYear.options.length;no++){if(returnDateToYear.options[no].value==currentYear){returnDateToYear.selectedIndex=no;break;}}
for(var no=0;no<returnDateToMonth.options.length;no++){if(returnDateToMonth.options[no].value==parseInt(month)){returnDateToMonth.selectedIndex=no;break;}}
for(var no=0;no<returnDateToDay.options.length;no++){if(returnDateToDay.options[no].value==parseInt(day)){returnDateToDay.selectedIndex=no;break;}}
if(calendarDisplayTime){for(var no=0;no<returnDateToHour.options.length;no++){if(returnDateToHour.options[no].value==parseInt(currentHour)){returnDateToHour.selectedIndex=no;break;}}
for(var no=0;no<returnDateToMinute.options.length;no++){if(returnDateToMinute.options[no].value==parseInt(currentMinute)){returnDateToMinute.selectedIndex=no;break;}}}}
closeCalendar();}
function getWeek(year,month,day){if(!weekStartsOnSunday){day=(day/1);}else{day=(day/1)+1;}
year=year/1;month=month/1+1;var a=Math.floor((14-(month))/12);var y=year+4800-a;var m=(month)+(12*a)-3;var jd=day+Math.floor(((153*m)+2)/5)+
(365*y)+Math.floor(y/4)-Math.floor(y/100)+
Math.floor(y/400)-32045;var d4=(jd+31741-(jd%7))%146097%36524%1461;var L=Math.floor(d4/1460);var d1=((d4-L)%365)+L;NumberOfWeek=Math.floor(d1/7)+1;return NumberOfWeek;}
function writeTimeBar()
{var timeBar=document.createElement('DIV');timeBar.id='timeBar';timeBar.className='timeBar';var subDiv=document.createElement('DIV');subDiv.innerHTML='Time:';var hourDiv=document.createElement('DIV');hourDiv.onmouseover=highlightSelect;hourDiv.onmouseout=highlightSelect;hourDiv.onclick=showHourDropDown;hourDiv.style.width='30px';var span=document.createElement('SPAN');span.innerHTML=currentHour;span.id='calendar_hour_txt';hourDiv.appendChild(span);timeBar.appendChild(hourDiv);var img=document.createElement('IMG');img.src=pathToImages+'down_time.gif';hourDiv.appendChild(img);hourDiv.className='selectBoxTime';if(Opera){hourDiv.style.width='30px';img.style.cssText='float:right';img.style.position='relative';img.style.styleFloat='right';}
var hourPicker=createHourDiv();hourPicker.style.left='130px';hourPicker.style.width='35px';hourPicker.id='hourDropDown';calendarDiv.appendChild(hourPicker);var minuteDiv=document.createElement('DIV');minuteDiv.onmouseover=highlightSelect;minuteDiv.onmouseout=highlightSelect;minuteDiv.onclick=showMinuteDropDown;minuteDiv.style.width='30px';var span=document.createElement('SPAN');span.innerHTML=currentMinute;span.id='calendar_minute_txt';minuteDiv.appendChild(span);timeBar.appendChild(minuteDiv);var img=document.createElement('IMG');img.src=pathToImages+'down_time.gif';minuteDiv.appendChild(img);minuteDiv.className='selectBoxTime';if(Opera){minuteDiv.style.width='30px';img.style.cssText='float:right';img.style.position='relative';img.style.styleFloat='right';}
var minutePicker=createMinuteDiv();minutePicker.style.left='167px';minutePicker.style.width='35px';minutePicker.id='minuteDropDown';calendarDiv.appendChild(minutePicker);return timeBar;}
function writeBottomBar()
{var d=new Date();var bottomBar=document.createElement('DIV');bottomBar.id='bottomBar';bottomBar.style.cursor='pointer';bottomBar.className='todaysDate';var subDiv=document.createElement('DIV');subDiv.onclick=pickTodaysDate;subDiv.id='todaysDateString';subDiv.style.width=(calendarDiv.offsetWidth-95)+'px';var day=d.getDay();if(!weekStartsOnSunday){if(day==0)day=7;day--;}
var bottomString=todayStringFormat;bottomString=bottomString.replace('[monthString]',monthArrayShort[d.getMonth()]);bottomString=bottomString.replace('[day]',d.getDate());bottomString=bottomString.replace('[year]',d.getFullYear());bottomString=bottomString.replace('[dayString]',dayArray[day].toLowerCase());bottomString=bottomString.replace('[UCFdayString]',dayArray[day]);bottomString=bottomString.replace('[todayString]',todayString);subDiv.innerHTML=todayString+': '+d.getDate()+'. '+monthArrayShort[d.getMonth()]+', '+d.getFullYear();subDiv.innerHTML=bottomString;bottomBar.appendChild(subDiv);var timeDiv=writeTimeBar();bottomBar.appendChild(timeDiv);calendarDiv.appendChild(bottomBar);}
function getTopPos(inputObj)
{var returnValue=inputObj.offsetTop+inputObj.offsetHeight;while((inputObj=inputObj.offsetParent)!=null)returnValue+=inputObj.offsetTop;return returnValue+calendar_offsetTop;}
function getleftPos(inputObj)
{var returnValue=inputObj.offsetLeft;while((inputObj=inputObj.offsetParent)!=null)returnValue+=inputObj.offsetLeft;return returnValue+calendar_offsetLeft;}
function positionCalendar(inputObj)
{calendarDiv.style.left=getleftPos(inputObj)+'px';calendarDiv.style.top=getTopPos(inputObj)+'px';if(iframeObj){iframeObj.style.left=calendarDiv.style.left;iframeObj.style.top=calendarDiv.style.top;iframeObj2.style.left=calendarDiv.style.left;iframeObj2.style.top=calendarDiv.style.top;}}
function initCalendar()
{if(MSIE){iframeObj=document.createElement('IFRAME');iframeObj.style.filter='alpha(opacity=0)';iframeObj.style.position='absolute';iframeObj.border='0px';iframeObj.style.border='0px';iframeObj.style.backgroundColor='#FF0000';iframeObj2=document.createElement('IFRAME');iframeObj2.style.position='absolute';iframeObj2.border='0px';iframeObj2.style.border='0px';iframeObj2.style.height='1px';iframeObj2.style.width='1px';iframeObj2.src='blank.html';iframeObj.src='blank.html';document.body.appendChild(iframeObj2);document.body.appendChild(iframeObj);}
calendarDiv=document.createElement('DIV');calendarDiv.id='calendarDiv';calendarDiv.style.zIndex=1000;slideCalendarSelectBox();document.body.appendChild(calendarDiv);writeBottomBar();writeTopBar();if(!currentYear){var d=new Date();currentMonth=d.getMonth();currentYear=d.getFullYear();}
writeCalendarContent();}
function setTimeProperties()
{if(!calendarDisplayTime){document.getElementById('timeBar').style.display='none';document.getElementById('timeBar').style.visibility='hidden';document.getElementById('todaysDateString').style.width='100%';}else{document.getElementById('timeBar').style.display='block';document.getElementById('timeBar').style.visibility='visible';document.getElementById('hourDropDown').style.top=document.getElementById('calendar_minute_txt').parentNode.offsetHeight+calendarContentDiv.offsetHeight+document.getElementById('topBar').offsetHeight+'px';document.getElementById('minuteDropDown').style.top=document.getElementById('calendar_minute_txt').parentNode.offsetHeight+calendarContentDiv.offsetHeight+document.getElementById('topBar').offsetHeight+'px';document.getElementById('minuteDropDown').style.right='50px';document.getElementById('hourDropDown').style.right='50px';document.getElementById('todaysDateString').style.width='115px';}}
function calendarSortItems(a,b)
{return a/1-b/1;}
function displayCalendar(inputField,format,buttonObj,displayTime,timeInput)
{if(displayTime)calendarDisplayTime=true;else calendarDisplayTime=false;if(inputField.value.length>6){if(false){var items=inputField.value.split(/[^0-9]/gi);var positionArray=new Array();positionArray['m']=format.indexOf('mm');;if(positionArray['m']==-1)positionArray['m']=format.indexOf('m');positionArray['d']=format.indexOf('dd');if(positionArray['d']==-1)positionArray['d']=format.indexOf('d');positionArray['y']=format.indexOf('yyyy');positionArray['h']=format.indexOf('hh');positionArray['i']=format.indexOf('ii');var positionArrayNumeric=Array();positionArrayNumeric[0]=positionArray['m'];positionArrayNumeric[1]=positionArray['d'];positionArrayNumeric[2]=positionArray['y'];positionArrayNumeric[3]=positionArray['h'];positionArrayNumeric[4]=positionArray['i'];positionArrayNumeric=positionArrayNumeric.sort(calendarSortItems);var itemIndex=-1;currentHour='00';currentMinute='00';for(var no=0;no<positionArrayNumeric.length;no++){if(positionArrayNumeric[no]==-1)continue;itemIndex++;if(positionArrayNumeric[no]==positionArray['m']){currentMonth=items[itemIndex]-1;continue;}
if(positionArrayNumeric[no]==positionArray['y']){currentYear=items[itemIndex];continue;}
if(positionArrayNumeric[no]==positionArray['d']){tmpDay=items[itemIndex];continue;}
if(positionArrayNumeric[no]==positionArray['h']){currentHour=items[itemIndex];continue;}
if(positionArrayNumeric[no]==positionArray['i']){currentMinute=items[itemIndex];continue;}}
currentMonth=currentMonth/1;tmpDay=tmpDay/1;}else{if(inputField.value.match(/^[0-9]*?[\-\/\s]+([0-9]*?|[a-z]*?)[\-\/\s]+[0-9]*?$/gi)){var separator=format.substr(format.indexOf('dd')+2,1);var newValue="";var items=inputField.value.split(/[\-\/\s]/gi);for(i=0;i<2;i++){if(items[i].length<2){tmpValue="0"+items[i];newValue+=tmpValue.substr(tmpValue.length-2)+separator;}else{newValue+=items[i]+separator;}}
newValue+=items[2];inputField.value=newValue;}
var monthPos=format.indexOf('mmm');if(monthPos!=-1){currentMonth=inputField.value.substr(monthPos,3);currentMonth=monthArrayShort.existsit(currentMonth);}else{var monthPos=format.indexOf('mm');currentMonth=inputField.value.substr(monthPos,2)/1-1;}
var yearPos=format.indexOf('yyyy');currentYear=inputField.value.substr(yearPos,4);var dayPos=format.indexOf('dd');tmpDay=inputField.value.substr(dayPos,2);var hourPos=format.indexOf('hh');if(hourPos>=0){tmpHour=inputField.value.substr(hourPos,2);currentHour=tmpHour;}else{currentHour='00';}
var minutePos=format.indexOf('ii');if(minutePos>=0){tmpMinute=inputField.value.substr(minutePos,2);currentMinute=tmpMinute;}else{currentMinute='00';}}}else{var d=new Date();currentMonth=d.getMonth();currentYear=d.getFullYear();currentHour='08';currentMinute='00';tmpDay=d.getDate();}
inputYear=currentYear;inputMonth=currentMonth;inputDay=tmpDay/1;if(!calendarDiv){initCalendar();}else{if(calendarDiv.style.display=='block'){closeCalendar();return false;}
writeCalendarContent();}
returnFormat=format;returnDateTo=inputField;positionCalendar(buttonObj);calendarDiv.style.visibility='visible';calendarDiv.style.display='block';if(iframeObj){iframeObj.style.display='';iframeObj.style.height='140px';iframeObj.style.width='195px';iframeObj2.style.display='';iframeObj2.style.height='140px';iframeObj2.style.width='195px';}
setTimeProperties();updateYearDiv();updateMonthDiv();updateMinuteDiv();updateHourDiv();}
function displayCalendarSelectBox(yearInput,monthInput,dayInput,hourInput,minuteInput,buttonObj)
{if(!hourInput)calendarDisplayTime=false;else calendarDisplayTime=true;currentMonth=monthInput.options[monthInput.selectedIndex].value/1-1;currentYear=yearInput.options[yearInput.selectedIndex].value;if(hourInput){currentHour=hourInput.options[hourInput.selectedIndex].value;inputHour=currentHour/1;}
if(minuteInput){currentMinute=minuteInput.options[minuteInput.selectedIndex].value;inputMinute=currentMinute/1;}
inputYear=yearInput.options[yearInput.selectedIndex].value;inputMonth=monthInput.options[monthInput.selectedIndex].value/1-1;inputDay=dayInput.options[dayInput.selectedIndex].value/1;if(!calendarDiv){initCalendar();}else{writeCalendarContent();}
returnDateToYear=yearInput;returnDateToMonth=monthInput;returnDateToDay=dayInput;returnDateToHour=hourInput;returnDateToMinute=minuteInput;returnFormat=false;returnDateTo=false;positionCalendar(buttonObj);calendarDiv.style.visibility='visible';calendarDiv.style.display='block';if(iframeObj){iframeObj.style.display='';iframeObj.style.height=calendarDiv.offsetHeight+'px';iframeObj.style.width=calendarDiv.offsetWidth+'px';iframeObj2.style.display='';iframeObj2.style.height=calendarDiv.offsetHeight+'px';iframeObj2.style.width=calendarDiv.offsetWidth+'px'}
setTimeProperties();updateYearDiv();updateMonthDiv();updateHourDiv();updateMinuteDiv();}
Array.prototype.existsit=function(o){for(var i=0;i<this.length;i++)
if(this[i]===o)return i;return false;}
function trimit(stringToTrim){return stringToTrim.replace(/^\s+|\s+$/g,"");}

/***********************************************
* Cool DHTML tooltip script II- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

/*  Modified by PHP-4-Business.co.uk to create simulated drop-shadow effect in Gecko browsers */

var offsetfromcursorX=12 //Customize x offset of tooltip
var offsetfromcursorY=10 //Customize y offset of tooltip

var offsetdivfrompointerX=10 //Customize x offset of tooltip DIV relative to pointer image
var offsetdivfrompointerY=14 //Customize y offset of tooltip DIV relative to pointer image. Tip: Set it to (height_of_pointer_image-1).

/* See note in header.php */
document.write('<div id="dhtmltooltipouter"><div id="dhtmltooltipinner"></div></div>') //write out tooltip DIV
document.write('<img id="dhtmlpointer" src="common/images/tooltip/arrow2.gif">') //write out pointer image

var ie=document.all
var ns6=document.getElementById && !document.all
var enabletip=false
if (ie||ns6)
var tipobj=document.all? document.all["dhtmltooltipouter"] : document.getElementById? document.getElementById("dhtmltooltipouter") : ""
var tipobjinner=document.all? document.all["dhtmltooltipinner"] : document.getElementById? document.getElementById("dhtmltooltipinner") : ""

var pointerobj=document.all? document.all["dhtmlpointer"] : document.getElementById? document.getElementById("dhtmlpointer") : ""

function ietruebody(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function ddrivetip(thetext, thewidth, thecolor){
if (ns6||ie){
if (typeof thewidth!="undefined") tipobj.style.width=thewidth+"px"
if (typeof thecolor!="undefined" && thecolor!="") tipobj.style.backgroundColor=thecolor
tipobjinner.innerHTML=thetext
enabletip=true
return false
}
}

function positiontip(e){
if (enabletip){
var nondefaultpos=false
var curX=(ns6)?e.pageX : event.clientX+ietruebody().scrollLeft;
var curY=(ns6)?e.pageY : event.clientY+ietruebody().scrollTop;
//Find out how close the mouse is to the corner of the window
var winwidth=ie&&!window.opera? ietruebody().clientWidth : window.innerWidth-20
var winheight=ie&&!window.opera? ietruebody().clientHeight : window.innerHeight-20

var rightedge=ie&&!window.opera? winwidth-event.clientX-offsetfromcursorX : winwidth-e.clientX-offsetfromcursorX
var bottomedge=ie&&!window.opera? winheight-event.clientY-offsetfromcursorY : winheight-e.clientY-offsetfromcursorY

var leftedge=(offsetfromcursorX<0)? offsetfromcursorX*(-1) : -1000

//if the horizontal distance isn't enough to accomodate the width of the context menu
if (rightedge<tipobj.offsetWidth){
//move the horizontal position of the menu to the left by it's width
tipobj.style.left=curX-tipobj.offsetWidth+"px"
nondefaultpos=true
}
else if (curX<leftedge)
tipobj.style.left="5px"
else{
//position the horizontal position of the menu where the mouse is positioned
tipobj.style.left=curX+offsetfromcursorX-offsetdivfrompointerX+"px"
pointerobj.style.left=curX+offsetfromcursorX+"px"
}

//same concept with the vertical position
if (bottomedge<tipobj.offsetHeight){
tipobj.style.top=curY-tipobj.offsetHeight-offsetfromcursorY+"px"
nondefaultpos=true
}
else{
tipobj.style.top=curY+offsetfromcursorY+offsetdivfrompointerY+"px"
pointerobj.style.top=curY+offsetfromcursorY+"px"
}
tipobj.style.visibility="visible"
if (!nondefaultpos)
pointerobj.style.visibility="visible"
else
pointerobj.style.visibility="hidden"
}
}

function hideddrivetip(){
if (ns6||ie){
enabletip=false
tipobj.style.visibility="hidden"
pointerobj.style.visibility="hidden"
tipobj.style.left="-1000px"
tipobj.style.backgroundColor=''
tipobj.style.width=''
}
}

document.onmousemove=positiontip



function AutoCompleteDB()
{this.bEnd=false;this.nCount=0;this.aStr=new Object;}
AutoCompleteDB.prototype.add=function(str)
{this.nCount++;if(str=="")
this.bEnd=true;else
{var letter=str.substring(0,1);var rest=str.substring(1,str.length);if(!this.aStr[letter])this.aStr[letter]=new AutoCompleteDB();this.aStr[letter].add(rest);}}
AutoCompleteDB.prototype.getCount=function(str,bExact)
{if(str=="")
if(this.bEnd&&bExact&&(this.nCount==1))return 0;else return this.nCount;var letter=str.substring(0,1);var rest=str.substring(1,str.length);var nCount=0;var lLetter=letter.toLowerCase();if(this.aStr[lLetter])
nCount+=this.aStr[lLetter].getCount(rest,bExact&&(letter==lLetter));var uLetter=letter.toUpperCase();if(this.aStr[uLetter])
nCount+=this.aStr[uLetter].getCount(rest,bExact&&(letter==uLetter));return nCount;}
AutoCompleteDB.prototype.getStrings=function(str1,str2,outStr)
{if(str1=="")
{if(this.bEnd)
outStr.push(str2);for(var i in this.aStr)
this.aStr[i].getStrings(str1,str2+i,outStr);}
else
{var letter=str1.substring(0,1);var rest=str1.substring(1,str1.length);var lLetter=letter.toLowerCase();if(this.aStr[lLetter])
this.aStr[lLetter].getStrings(rest,str2+lLetter,outStr);var myRegxp=/[a-zA-Z]+/;if(myRegxp.test(letter)==true){var uLetter=letter.toUpperCase();if(this.aStr[uLetter])
this.aStr[uLetter].getStrings(rest,str2+uLetter,outStr);}}}
function AutoComplete(aStr,oText,oDiv,nMaxSize,nOffsetX,nOffsetY,cBackground,cHighlight)
{if((typeof cBackground=='undefined')||(typeof cBackground===null)){cBackground='AutoCompleteBackground';}
if((typeof cHighlight=='undefined')||(typeof cHighlight===null)){cHighlight='AutoCompleteHighlight';}
this.oText=oText;this.oDiv=oDiv;this.nMaxSize=nMaxSize;this.nOffsetX=nOffsetX;this.nOffsetY=nOffsetY;this.cBackground=cBackground;this.cHighlight=cHighlight;this.db=new AutoCompleteDB();var i,n=aStr.length;for(i=0;i<n;i++)
{this.db.add(String(aStr[i]));}
oText.AutoComplete=this;oText.onkeyup=function(){this.AutoComplete.onchange();}
oText.onblur=function(){this.AutoComplete.onblur();removeClassName(this,'highlightinput');}}
AutoComplete.prototype.onblur=function()
{this.oDiv.style.display="none";}
AutoComplete.prototype.onDivMouseDown=function()
{this.AutoComplete.oText.value=this.innerHTML;this.AutoComplete.onblur();this.AutoComplete.oText.focus();that=this;setTimeout(function(){that.AutoComplete.oText.focus();},300);}
AutoComplete.prototype.onDivMouseOver=function()
{this.className=this.AutoComplete.cHighlight;}
AutoComplete.prototype.onDivMouseOut=function()
{this.className=this.AutoComplete.cBackground;}
AutoComplete.prototype.onchange=function()
{var txt=this.oText.value;var nCount=this.db.getCount(txt,true);if((this.nMaxSize==-1)||((nCount<this.nMaxSize)&&(nCount>0)))
{while(this.oDiv.hasChildNodes())
this.oDiv.removeChild(this.oDiv.firstChild);var aStr=new Array();this.db.getStrings(txt,"",aStr);var i,n=aStr.length;for(i=0;i<n;i++)
{var oDiv=document.createElement('div');this.oDiv.appendChild(oDiv);oDiv.className=this.cBackground;oDiv.innerHTML=aStr[i];oDiv.onmousedown=AutoComplete.prototype.onDivMouseDown;oDiv.onmouseover=AutoComplete.prototype.onDivMouseOver;oDiv.onmouseout=AutoComplete.prototype.onDivMouseOut;oDiv.AutoComplete=this;}
this.oDiv.style.display="block";if(typeof(this.oDiv.style.posLeft)!='undefined'&&this.oDiv.style.posLeft!='NaN'){this.oDiv.style.posLeft=this.oText.style.posLeft+this.nOffsetX;this.oDiv.style.posTop=this.oText.style.posTop+this.nOffsetY;this.oDiv.style.posWidth=this.oText.style.posWidth;}else{this.oDiv.style.left=parseInt(this.oText.style.left)+this.nOffsetX+'px';this.oDiv.style.top=parseInt(this.oText.style.top)+this.nOffsetY+'px';this.oDiv.style.width=this.oText.style.width;}}
else
{this.oDiv.innerHTML="";this.oDiv.style.display="none";}}


