var MouseX=0;var MouseY=0;var cursor={x:0,y:0};if(document.onmousemove){document.onmousemove=mouseMove;}
else if(document.addEventListener){document.addEventListener("mousedown",mouseMove,false);document.addEventListener("mouseup",mouseMove,false);document.addEventListener("mousemove",mouseMove,false);}
else if(document.attachEvent){document.attachEvent("onmousedown",mouseMove);document.attachEvent("onmouseup",mouseMove);document.attachEvent("onmousemove",mouseMove);}
else if(document.captureEvents){document.captureEvents(Event.MOUSEDOWN|Event.MOUSEMOVE|Event.MOUSEUP);}
function mouseMove(e){if(!e)var e=window.event;if(e.pageX||e.pageY){cursor.x=e.pageX;cursor.y=e.pageY;}
else if(e.clientX||e.clientY){if(document.body){if(document.documentElement){cursor.x=e.clientX+document.body.scrollLeft
+document.documentElement.scrollLeft;cursor.y=e.clientY+document.body.scrollTop
+document.documentElement.scrollTop;}}}
MouseY=cursor.y;MouseX=cursor.x;}
function mp3Player(mp3,id,as){if(undefined==as){as=0;}
var htm='';htm+='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="165" height="38" id="niftyPlayer1" align="">'+"\n";htm+='<param name=movie value="/wfiles/niftyplayer.swf?file='+mp3+'&as='+as+'">'+"\n";htm+='<param name=quality value=high>'+"\n";htm+='<param name=bgcolor value=#FFFFFF>'+"\n";htm+='<embed src="/wfiles/niftyplayer.swf?file='+mp3+'&as='+as+'" quality=high bgcolor=#FFFFFF width="165" height="38" name="niftyPlayer1" align="" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">'+"\n";htm+='</embed>'+"\n";htm+='</object>'+"\n";setText(id,htm);}
function embedFlash(swf,param){if(undefined==param['width']){param['width']=400;}
if(undefined==param['height']){param['height']=300;}
if(undefined==param['bgcolor']){param['bgcolor']='#FFFFFF';}
if(undefined==param['name']){param['name']='flashobj';}
var htm='';htm+='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+param['width']+'" height="'+param['height']+'" id="'+param['name']+'" align="">'+"\n";htm+='<param name=movie value="'+swf+'">'+"\n";htm+='<param name="quality" value="high">'+"\n";htm+='<param name="wmode" value="transparent">'+"\n";htm+='<param name="bgcolor" value="'+param['bgcolor']+'">'+"\n";htm+='<embed src="'+swf+'" wmode="transparent" quality="high" bgcolor="'+param['bgcolor']+'" width="'+param['width']+'" height="'+param['height']+'" name="'+param['name']+'" align="" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">'+"\n";htm+='</embed>'+"\n";htm+='</object>'+"\n";if(undefined!=param['debug']){alert(htm);}
if(undefined!=param['popup']&&param['popup']==1){popUpDiv(htm,param);}
else{setText(param['id'],htm);}}
function makeDivFloat(id,sx,sy){setFloatDiv(id,sx,sy).floatIt();}
var d=document;var ns=(navigator.appName.indexOf("Netscape")!=-1);function setFloatDiv(id,sx,sy){var el=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id];var px=document.layers?"":"px";window[id+"_obj"]=el;if(d.layers){el.style=el;}
el.cx=el.sx=sx;el.cy=el.sy=sy;el.sP=function(x,y){this.style.left=x+px;this.style.top=y+px;};el.floatIt=function(){var pX,pY;pX=(this.sx>=0)?0:ns?innerWidth:document.documentElement&&document.documentElement.clientWidth?document.documentElement.clientWidth:document.body.clientWidth;pY=ns?pageYOffset:document.documentElement&&document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop;if(this.sy<0){pY+=ns?innerHeight:document.documentElement&&document.documentElement.clientHeight?document.documentElement.clientHeight:document.body.clientHeight;}
this.cx+=(pX+this.sx-this.cx)/8;this.cy+=(pY+this.sy-this.cy)/8;this.sP(this.cx,this.cy);setTimeout(this.id+"_obj.floatIt()",40);}
return el;}
function iframePopup(url,opts){var htm='';if(undefined==opts['iwidth']){opts['iwidth']=350;}
if(undefined==opts['iheight']){opts['iheight']=200;}
if(undefined==opts['iscrolling']){opts['iscrolling']='auto';}
htm+='<iframe src="'+url+'" width="'+opts['iwidth']+'" height="'+opts['iheight']+'" frameborder="0" marginwidth="0" marginheight="0" scrolling="'+opts['iscrolling']+'" align="center">Your browser does not support iframes.</iframe>';popUpDiv(htm,opts);return false;}
function ajaxPopup(url,params,useropts){var pid='ajaxPopupDiv';var opt={id:pid,drag:1}
if(useropts){for(var key in opt){if(undefined!=useropts[key]){opt[key]=useropts[key];}}
for(var key in useropts){if(undefined==opt[key]){opt[key]=useropts[key];}}}
popUpDiv('<div class="w_bold w_lblue w_big"><img src="/wfiles/loading_blu.gif" border="0"> loading...please wait.</div>',opt);ajaxGet(url,opt['id']+'_Body',params);}
function popUpDiv(content,param){var s="position:absolute;top:200px;left:200px;margin:5px;z-index:999;";var bs="padding:5px;border:1px solid #d6dee7;background:#FFF;";clearTimeout('popupdiv_timeout');if(undefined!=param['width']){s+='width:'+param['width']+'px;';}
if(undefined!=param['height']){bs+='height:'+param['height']+'px;overflow:auto;';}
var opt={id:'w'+new Date().getTime(),style:s,title:"",closestyle:"cursor:pointer;",close:'<img src="/wfiles/x_red.gif" border="0">',bodystyle:bs,titleleft:20,body:content}
if(param){for(var key in opt){if(undefined!=param[key]){opt[key]=param[key];}}
for(var key in param){if(undefined==opt[key]){opt[key]=param[key];}}}
var masterdiv;if(undefined!=document.getElementById(opt.id)){removeDiv(opt.id);}
if(undefined!=document.getElementById(opt.id)){masterdiv=document.getElementById(opt.id);var bodyid=opt.id+'_Body';masterdiv.style.display='block';if(undefined!=document.getElementById(bodyid)){setText(bodyid,opt.body);}}
else{masterdiv=document.createElement("div");masterdiv.setAttribute("id",opt['id']);masterdiv.style.zIndex='698';masterdiv.style.position='absolute';var t=document.createElement("table");t.border=0;t.align="left";t.cellPadding=0;t.cellSpacing=0;if(undefined!=opt['width']){t.style.width=opt['width']+'px';}
var bgcolor='#49495a';if(opt.titlebgcolor){bgcolor=opt.titlebgcolor;}
else if(param.titlebgcolor){bgcolor=param.titlebgcolor;}
if(undefined==param['noborder']){t.style.border='1px solid '+bgcolor;}
else{t.style.border='0px solid '+bgcolor;}
var tb=document.createElement("tbody");if(undefined==param['notop']){var toprow=document.createElement("tr");var titlecell=document.createElement("td");titlecell.noWrap=true;titlecell.align='right';titlecell.style.fontFamily='arial';titlecell.style.fontSize='11px';titlecell.style.backgroundColor=bgcolor;if(opt.titlecolor){titlecell.style.color=opt.titlecolor;}
else{titlecell.style.color='#FFFFFF';}
var titlediv=document.createElement("div");var titletxt='<div id="'+opt['id']+'_Title'+'" style="float:left;margin-left:10px;margin-top:1px">'+opt['title']+'</div>';titletxt+='<a href="#" style="font-weight:bold;font-size:12px;font-family:arial;color:#970000;text-decoration:none;padding:0 3px 0 0;" onClick="fadeId(\''+opt['id']+'\',1);return false;">X</a>';titlediv.innerHTML=titletxt;titlecell.appendChild(titlediv);toprow.appendChild(titlecell);tb.appendChild(toprow);}
var bodyrow=document.createElement("tr");bodyrow.height='100%';var bodycell=document.createElement("td");bodycell.style.backgroundColor='#FFFFFF';var bodydiv=document.createElement("div");bodydiv.innerHTML='<div id="'+opt['id']+'_Body'+'">'+opt.body+'</div>';bodycell.appendChild(bodydiv);bodyrow.appendChild(bodycell);tb.appendChild(bodyrow);if(undefined==param['nobot']){var botrow=document.createElement("tr");var botcell=document.createElement("td");botcell.noWrap=true;botcell.align='right';botcell.style.fontFamily='arial';botcell.style.fontSize='11px';var bgcolor='#FFFFFF';if(opt.botbgcolor){bgcolor=opt.botbgcolor;}
else if(param.botbgcolor){bgcolor=param.botbgcolor;}
botcell.style.backgroundColor=bgcolor;var botdiv=document.createElement("div");var bottxt='<a href="#" class="w_red w_bold w_link"" onClick="fadeId(\''+opt['id']+'\',1);return false;">Close</a>';botdiv.innerHTML=bottxt;botcell.appendChild(botdiv);botrow.appendChild(botcell);tb.appendChild(botrow);}
t.appendChild(tb);masterdiv.style.display='block';masterdiv.appendChild(t);if(opt.drag&&undefined==param['notop']){Drag.init(titlediv,masterdiv);titlediv.style.cursor='move';}
document.body.appendChild(masterdiv);}
if(opt.center){var xy=centerObject(masterdiv);var x=0;;var y=0;var cvalue=opt.center+'';if(cvalue.indexOf('x')!=-1){x=xy[0];}
else if(cvalue.indexOf('y')!=-1){y=xy[1];}
else{x=xy[0];y=xy[1];}
if(undefined!=opt.x){xvalue=opt.x+'';if(xvalue.indexOf('+')!=-1){x=Math.round(MouseX+parseInt(xvalue));}
else if(xvalue.indexOf('-')!=-1){x=Math.round(MouseX-Math.abs(parseInt(xvalue)));}
else{x=Math.round(opt.x);}
if(x<0){x=0;}}
if(undefined!=opt.y){yvalue=opt.y+'';if(yvalue.indexOf('+')!=-1){y=Math.round(MouseY+parseInt(yvalue));}
else if(yvalue.indexOf('-')!=-1){y=Math.round(MouseY-Math.abs(parseInt(yvalue)));}
else{y=Math.round(opt.y);}
if(y<0){y=0;}}
if(x<0){x=0;}
if(y<0){y=0;}
masterdiv.style.position='absolute';masterdiv.style.left=x+"px";masterdiv.style.top=y+"px";}
else if(param.topright){masterdiv.style.position='absolute';masterdiv.style.top=param.topright+"px";masterdiv.style.right=param.topright+"px";}
else if(param.topleft){masterdiv.style.position='absolute';masterdiv.style.top=param.topleft+"px";masterdiv.style.left=param.topleft+"px";}
else if(param.botright){masterdiv.style.position='absolute';masterdiv.style.bottom=param.botright+"px";masterdiv.style.right=param.botright+"px";}
else if(param.botleft){masterdiv.style.position='absolute';masterdiv.style.bottom=param.botleft+"px";masterdiv.style.left=param.botleft+"px";}
else if(opt.screen){var xy=showOnScreen(masterdiv);var x=0;;var y=0;var cvalue=opt.screen+'';if(cvalue.indexOf('x')!=-1){x=xy[0];}
else if(cvalue.indexOf('y')!=-1){y=xy[1];}
else{x=xy[0];y=xy[1];}
if(undefined!=opt.x){xvalue=opt.x+'';if(xvalue.indexOf('+')!=-1){x=x+Math.abs(parseInt(xvalue));}
else if(xvalue.indexOf('-')!=-1){x=x-Math.abs(parseInt(xvalue));}
else{x=x+Math.round(opt.x);}}
if(undefined!=opt.y){yvalue=opt.y+'';if(yvalue.indexOf('+')!=-1){y=y+Math.abs(parseInt(yvalue));}
else if(yvalue.indexOf('-')!=-1){y=y-Math.abs(parseInt(yvalue));}
else{y=y+Math.round(opt.y);}}
if(x<0){x=0;}
if(y<0){y=0;}
masterdiv.style.left=x+"px";masterdiv.style.top=y+"px";}
else if(opt.mouse){var x=0;var y=0;var cvalue=opt.mouse+'';if(cvalue.indexOf('x')!=-1){x=MouseX;}
else if(cvalue.indexOf('y')!=-1){y=MouseY;}
if(undefined!=opt.x){xvalue=opt.x+'';if(xvalue.indexOf('+')!=-1){x=Math.round(MouseX+parseInt(xvalue));}
else if(xvalue.indexOf('-')!=-1){x=Math.round(MouseX-Math.abs(parseInt(xvalue)));}
else{x=MouseX;}}
if(undefined!=opt.y){yvalue=opt.y+'';if(yvalue.indexOf('+')!=-1){y=Math.round(MouseY+parseInt(yvalue));}
else if(yvalue.indexOf('-')!=-1){y=Math.round(MouseY-Math.abs(parseInt(yvalue)));}
else{y=MouseY;}}
if(x<0){x=0;}
if(y<0){y=0;}
masterdiv.style.top=y+"px";masterdiv.style.left=x+"px";}
else{if(undefined!=opt.x){masterdiv.style.left=opt.x+"px";}
if(undefined!=opt.y){masterdiv.style.top=opt.y+"px";}}
if(opt.timeout){var t=Math.round(opt.timeout*1000);popupdiv_timeout=setTimeout("removeDivOnExit('"+opt.id+"','"+opt.fade+"')",t);}
else if(opt.fade){masterdiv.onmouseout=function(e){if(undefined==e){e=fixE(e);}
if(undefined!=e){if(checkMouseLeave(this,e)){fadeId(this.id,1);}}}}}
function createTable(){var t=document.createElement("table");tb=document.createElement("tbody")
t.setAttribute("border","1")
var tr=document.createElement("tr");var td;var d;d=document.createElement("div")
d.style.backgroundColor="red";d.style.minHeight="20px";d.style.width="50px";td=document.createElement("td");td.appendChild(d)
tr.appendChild(td);d=document.createElement("div")
d.style.backgroundColor="green";d.style.minHeight="20px";d.style.width="50px";td=document.createElement("td");td.appendChild(d)
tr.appendChild(td);tb.appendChild(tr);t.appendChild(tb);alert(t);document.getElementById("ajaxstatus").appendChild(t);}
function removeDiv(divid){return removeId(divid);}
function removeId(divid){setText(divid,'');if(isIE){document.getElementById(divid).removeNode(true);}
else{var x=document.getElementById(divid);x.parentNode.removeChild(x);}
return;}
function removeDivOnExit(divid,fade){var obj=getObject(divid);if(undefined==obj){return;}
if(!isMouseOver(divid)){if(undefined!=fade&&fade==1){fadeId(divid,1);}
else{removeDiv(divid);}
return;}
if(undefined!=fade&&fade==1){obj.onmouseout=function(e){if(undefined==e){e=fixE(e);}
if(undefined!=e){if(checkMouseLeave(this,e)){fadeId(this.id,1);}}}}
else{obj.onmouseout=function(e){if(undefined==e){e=fixE(e);}
if(undefined!=e){if(checkMouseLeave(this,e)){removeDiv(this.id);}}}}}
function isMouseOver(id){var exy=getXY(id);if(undefined==exy){return true;}
var ewh=getWidthHeight(id);if(MouseX>=exy[0]&&MouseX<=exy[0]+ewh[0]&&MouseY>=exy[1]&&MouseY<=exy[1]+ewh[1]){return true;}
return false;}
function getChildById(obj,id){if(obj.id==id){return obj;}
if(obj.hasChildNodes()){for(var i=0;i<obj.childNodes.length;i++){var child=getChildById(obj.childNodes[i],id);if(child!=null){return child;}}}
return null;}
function centerObject(obj){var sObj=getObject(obj);if(undefined==sObj){return false;}
var w=getWidth(sObj);var h=getHeight(sObj);var sw=getWidth();var sh=getHeight();var x=Math.round((sw/2)-(w/2));var y=Math.round((sh/2)-(h/2));sObj.style.position='absolute';sObj.style.left=x+'px';if(undefined==y){y=200;}
if(y<10){y=200;}
sObj.style.top=y+'px';return new Array(x,y);}
function hideOnExit(obj){var sObj=getObject(obj);if(undefined==sObj){return false;}
sObj.onmouseout=function(e){if(undefined==e){e=fixE(e);}
if(undefined!=e){if(checkMouseLeave(this,e)){this.style.display='none';}}}}
function showOnScreen(obj){var sObj=getObject(obj);if(undefined==sObj){return false;}
if(sObj.style.display=='block'){return true;}
sObj.style.position='absolute';sObj.style.visibility='hidden';sObj.style.display='block';var w=getWidth(sObj);var h=getHeight(sObj);var screen=getViewPort();var sw=getWidth();var sh=getHeight();var x=cursor.x;var y=cursor.y;if(x+w+20>sw){var z=x-w;while(z<0){z++;}
x=z;}
if(y+h+20>sh){var z=y-h;while(z<0){z++;}
y=z;}
sObj.style.left=x+'px';sObj.style.top=y+'px';sObj.style.visibility='visible';return new Array(x,y);}
function getViewPort(){var viewport={};if(typeof window.innerWidth!='undefined')
{viewport.w=window.innerWidth,viewport.h=window.innerHeight}
else if(typeof document.documentElement!='undefined'&&typeof document.documentElement.clientWidth!='undefined'&&document.documentElement.clientWidth!=0)
{viewport.w=document.documentElement.clientWidth,viewport.h=document.documentElement.clientHeight}
else
{viewport.w=document.getElementsByTagName('body')[0].clientWidth,viewport.h=document.getElementsByTagName('body')[0].clientHeight}
return viewport;}
sfHover=function(){var navEls=GetElementsByAttribute('ul','id','w_nav');for(var n=0;n<navEls.length;n++){var sfEls=navEls[n].getElementsByTagName("LI");for(var i=0;i<sfEls.length;i++){sfEls[i].onmouseover=function(){this.className="sfhover";}
sfEls[i].onmouseout=function(){this.className="";}}}}
if(window.addEventListener){window.addEventListener("load",sfHover,false);}
else if(window.attachEvent){window.attachEvent("onload",sfHover);}
function initBehaviors(){var navEls=GetElementsByAttribute('*','_behavior','.+');for(var n=0;n<navEls.length;n++){var behavior=navEls[n].getAttribute('_behavior').toLowerCase();if(behavior=='pin'){navEls[n].onmouseout=function(e){if(undefined==e){e=fixE(e);}
if(undefined!=e){if(checkMouseLeave(this,e)){this.style.display='none';var onhide=this.getAttribute('onhide');if(onhide){eval(onhide);}}}}}
else if(behavior=='drag'){var head=navEls[n].getAttribute('head');var headobj=getObject(head);navEls[n].style.position='relative';if(undefined==headobj){Drag.init(navEls[n]);}
else{Drag.init(headobj,navEls[n]);}}
else if(behavior=='clock'){var id=navEls[n].getAttribute('id');if(id){startClock(id,1);}}
else if(behavior=="time"){var id=navEls[n].getAttribute('id');if(id){startClock(id,0);}}
else if(behavior=="float"){var id=navEls[n].getAttribute('id');if(id){var top=navEls[n].getAttribute('top');floatDiv(id,top);}}
else if(behavior=="stopwatch"){var id=navEls[n].getAttribute('id');if(id){stopWatch(id,0);}}
else if(behavior=="slideshow"){var id=navEls[n].getAttribute('id');if(id){var t=navEls[n].getAttribute('timer');if(t){slideShow(id,0,t);}
else{slideShow(id,0);}}}
else if(behavior=='menu'){var dname=navEls[n].getAttribute('display');if(dname){navEls[n].onmouseover=function(e){var dname=this.getAttribute('display');dObj=getObject(dname);if(dObj){if(dObj.style.display=='block'){return true;}
dObj.style.display='block';}
var dmouse=this.getAttribute('mouse');var dx=this.getAttribute('x');var dy=this.getAttribute('y');if(undefined!=dmouse){var x=0;var y=0;if(dmouse.indexOf('x')!=-1){x=MouseX;}
else if(dmouse.indexOf('y')!=-1){y=MouseY;}
else{x=MouseX;y=MouseY;}
if(undefined!=dx){xvalue=dx+'';if(xvalue.indexOf('+')!=-1){x=Math.round(MouseX+parseInt(xvalue));}
else if(xvalue.indexOf('-')!=-1){x=Math.round(MouseX-Math.abs(parseInt(xvalue)));}
else{x=Math.round(Math.abs(parseInt(xvalue)));}}
if(undefined!=dy){yvalue=dy+'';if(yvalue.indexOf('+')!=-1){y=Math.round(MouseY+parseInt(yvalue));}
else if(yvalue.indexOf('-')!=-1){y=Math.round(MouseY-Math.abs(parseInt(yvalue)));}
else{y=Math.round(Math.abs(parseInt(yvalue)));}}
dObj.style.position='absolute';dObj.style.top=y+"px";dObj.style.left=x+"px";}}
navEls[n].onmouseout=function(e){if(undefined==e){e=fixE(e);}
if(undefined!=e){if(checkMouseLeave(this,e)){var dname=this.getAttribute('display');dObj=getObject(dname);if(dObj){var hide=0;if(undefined!=dObj.className){if(dObj.className.indexOf("current")==-1){hide++;}}
else{var cclass=dObj.getAttribute('class');if(undefined==cclass){hide++;}
else{if(cclass.indexOf("current")==-1){hide++;}}}
if(hide){dObj.style.display='none';}}
var onhide=this.getAttribute('onhide');if(onhide){eval(onhide);}}}}}}
else{var id=navEls[n].getAttribute('id');var re=new RegExp('^\@([a-z]+)[(](.+)[)]$','igm');var res=re.exec(behavior);if(res&&res.length>0){var func=res[1].toLowerCase();var str=res[2].toLowerCase();switch(func){case'sum':var result=0;var sids=str.split(/[,:\s]+/);for(var s=0;s<sids.length;s++){result+=Math.round(getText(sids[s]));}
setText(navEls[n],result);break
case'math':doMath(id);break
case'raid':var cObj=getObject(str);if(typeof(cObj)=='object'){var val=getText(navEls[n]);setText(cObj,val);startRaid(id,str);}
break}}}}}
if(window.addEventListener){window.addEventListener("load",initBehaviors,false);}
else if(window.attachEvent){window.attachEvent("onload",initBehaviors);}
function floatDiv(id,t,b){var obj=getObject(id);var top=0;if(undefined!=obj.parentNode&&parseInt(obj.parentNode.scrollTop)>0){top=parseInt(obj.parentNode.scrollTop);}
else if(undefined!=document.documentElement&&parseInt(document.documentElement.scrollTop)>0){top=parseInt(document.documentElement.scrollTop);}
else if(undefined!=document.body&&parseInt(document.body.scrollTop)>0){top=parseInt(document.body.scrollTop);}
else{return false;}
var stay=parseInt(t);var newtop=Math.round(top+stay);obj.style.top=newtop+'px';setTimeout("floatDiv('"+id+"','"+t+"')",250);}
function addDragToTextarea(sid){var obj=document.getElementById(sid);var w=Math.round(obj.offsetWidth+10);var dragarea=obj.id+'_dragarea';var dragcheckbox=obj.id+'_dragcheckbox';var cx=findPosX(obj);var cy=findPosY(obj);var xpos=Math.round(cx+obj.offsetWidth-6);var ypos=Math.round(cy+obj.offsetHeight-12);var html='<span parentid="'+sid+'" textareadrag="1" id="'+dragarea+'" style="position:absolute;left:'+xpos+'px;top:'+ypos+'px;cursor:crosshair;color:#7F9DB9;font-size:13pt;font-family:times;" title="Drag to adjust size">&#9688;</span>';var pobj=getParent(obj);pobj.insertAdjacentHTML('beforeEnd',html);var dragobj=document.getElementById(dragarea);Drag.init(dragobj);dragobj.onDrag=function(x,y){var pid=this.getAttribute('parentid');var obj=document.getElementById(pid);var w=Math.round(x-cx+6);var h=Math.round(y-cy+12);if(w>0){obj.style.width=w+'px';}
if(h>0){obj.style.height=h+'px';}
var cid=this.id;var dragObjs=GetElementsByAttribute('span','textareadrag','1');for(var n=0;n<dragObjs.length;n++){if(dragObjs[n].id!=cid){var parentid=dragObjs[n].getAttribute('parentid');if(undefined!=parentid){var cpobj=document.getElementById(parentid);var px=findPosX(cpobj);var py=findPosY(cpobj);var cxpos=Math.round(px+cpobj.offsetWidth-6);var cypos=Math.round(py+cpobj.offsetHeight-12);dragObjs[n].lastMouseX=cxpos;dragObjs[n].lastMouseY=cypos;dragObjs[n].style.left=cxpos+'px';dragObjs[n].style.top=cypos+'px';}}}}}
function storeCaret(text)
{if(typeof(text.createTextRange)!='undefined'){text.caretPos=document.selection.createRange().duplicate();}}
function replaceText(text,textarea)
{if(typeof(textarea.caretPos)!="undefined"&&textarea.createTextRange)
{var caretPos=textarea.caretPos;caretPos.text=caretPos.text.charAt(caretPos.text.length-1)==' '?text+' ':text;caretPos.select();}
else if(typeof(textarea.selectionStart)!="undefined")
{var begin=textarea.value.substr(0,textarea.selectionStart);var end=textarea.value.substr(textarea.selectionEnd);var scrollPos=textarea.scrollTop;textarea.value=begin+text+end;if(textarea.setSelectionRange)
{textarea.focus();textarea.setSelectionRange(begin.length+text.length,begin.length+text.length);}
textarea.scrollTop=scrollPos;}
else
{textarea.value+=text;textarea.focus(textarea.value.length-1);}}
function surroundText(text1,text2,textarea)
{if(typeof(textarea.caretPos)!="undefined"&&textarea.createTextRange)
{var caretPos=textarea.caretPos;caretPos.text=caretPos.text.charAt(caretPos.text.length-1)==' '?text1+caretPos.text+text2+' ':text1+caretPos.text+text2;caretPos.select();}
else if(typeof(textarea.selectionStart)!="undefined")
{var begin=textarea.value.substr(0,textarea.selectionStart);var selection=textarea.value.substr(textarea.selectionStart,textarea.selectionEnd-textarea.selectionStart);var end=textarea.value.substr(textarea.selectionEnd);var newCursorPos=textarea.selectionStart;var scrollPos=textarea.scrollTop;textarea.value=begin+text1+selection+text2+end;if(textarea.setSelectionRange)
{if(selection.length==0)
textarea.setSelectionRange(newCursorPos+text1.length,newCursorPos+text1.length);else
textarea.setSelectionRange(newCursorPos,newCursorPos+text1.length+selection.length+text2.length);textarea.focus();}
textarea.scrollTop=scrollPos;}
else
{textarea.value+=text1+text2;textarea.focus(textarea.value.length-1);}}
function isEmptyText(theField)
{var theValue=theField.value;while(theValue.length>0&&(theValue.charAt(0)==' '||theValue.charAt(0)=='\t'))
theValue=theValue.substring(1,theValue.length);while(theValue.length>0&&(theValue.charAt(theValue.length-1)==' '||theValue.charAt(theValue.length-1)=='\t'))
theValue=theValue.substring(0,theValue.length-1);if(theValue==''){return true;}
else{return false;}}
function findPosX(xobj){var curleft=0;if(xobj.offsetParent){while(xobj.offsetParent){curleft+=xobj.offsetLeft;xobj=xobj.offsetParent;}}
else if(xobj.x){curleft+=xobj.x;}
return curleft;}
function findPosY(yobj){var curtop=0;if(yobj.offsetParent){while(yobj.offsetParent){curtop+=yobj.offsetTop;yobj=yobj.offsetParent;}}
else if(yobj.y){curtop+=yobj.y;}
return curtop;}
var TimoutArray=new Array();function slideShow(divid,idx,s){if(undefined==s){s=10;}
var ms=Math.round(s*1000);idx=Math.round(idx+0)
var obj=getObject(divid);id='slideshow';clearTimeout(TimoutArray[id]);var imgs=obj.getElementsByTagName("img");if(imgs.length==0){return false;}
if(idx==imgs.length){idx=0;}
for(var i=0;i<imgs.length;i++){if(i==idx){setOpacity(imgs[i],0.0);imgs[i].style.display='block';fadeIn(imgs[i].id);}
else{if(imgs[i].style.display=='block'){fadeOut(imgs[i].id);}
imgs[i].style.display='none';imgs[i].style.opacity=0.0;}}
idx=Math.round(idx+1);TimoutArray[id]=setTimeout("slideShow('"+divid+"',"+idx+","+s+")",ms);}
function stopWatch(id){clearTimeout(TimoutArray[id]);var stime=getText(id);var hour=0;var min=0;var sec=0;if(stime.length){var parts=stime.split(':');hour=parseInt(parts[0]);min=parseInt(parts[1]);sec=parseInt(parts[2]);}
sec++;if(sec==60){sec=0;min++;}
if(min==60){min=0;hour++;}
var newtext=hour+":"+min+":"+sec;setText(id,newtext);TimoutArray[id]=setTimeout("stopWatch('"+id+"')",1000);}
function startClock(id,live){clearTimeout(TimoutArray[id]);var dt=new Date();var h=dt.getHours();var m=dt.getMinutes();var s=dt.getSeconds();var p=" am";if(h>12){h=h-12;p=" pm";}
var timestr='';if(h<10){timestr+="0";}
timestr+=h;timestr+=":";if(m<10){timestr+="0";}
timestr+=m;timestr+=":";if(s<10){timestr+="0";}
timestr+=s;timestr+=p;setText(id,timestr);if(live){TimoutArray[id]=setTimeout("startClock('"+id+"',"+live+")",1000);}}
function startRaid(id,raidid){clearTimeout(TimoutArray[id]);setText(id,getText(raidid));TimoutArray[id]=setTimeout("startRaid('"+id+"','"+raidid+"')",250);}
function startSum(id,sumid){clearTimeout(TimoutArray[id]);var sumIds=GetElementsByAttribute('*','id',sumid);var sum=0;for(var s=0;s<sumIds.length;s++){var cval=getText(sumIds[s]);var val=Math.round(cval);sum=sum+val;}
setText(id,sum);TimoutArray[id]=setTimeout("startSum('"+id+"','"+sumid+"')",250);}
function doMath(id){var behavior=document.getElementById(id).getAttribute('_behavior').toLowerCase();var re=new RegExp('^\@([a-z]+)[(](.+)[)]$','igm');var str;var res=re.exec(behavior);if(res&&res.length>0){var func=res[1].toLowerCase();var str=res[2].toLowerCase();var result=0;var mre=new RegExp('([a-z0-9\_]+)','igm');while(mres=mre.exec(str)){if(mres&&mres.length>0){var mname=mres[1];var txt=getText(mres[1]);var evalstr='str.replace(/'+mname+'/,\''+txt+'\')';str=eval(evalstr);}}
try{str=eval(str);setText(id,str);}
catch(err){setText(id,err);}}}
function stopTimeout(id){clearTimeout(TimoutArray[id]);}
function checkMouseEnter(element,evt){if(element.contains&&evt.fromElement){return!element.contains(evt.fromElement);}
else if(evt.relatedTarget){return!containsDOM(element,evt.relatedTarget);}}
function checkMouseLeave(element,evt){if(element.contains&&undefined!=evt.toElement){return!element.contains(evt.toElement);}
else if(evt.relatedTarget){return!containsDOM(element,evt.relatedTarget);}}
function containsDOM(container,containee){var isParent=false;do{if((isParent=container==containee)){break;}
containee=containee.parentNode;}
while(containee!=null);return isParent;}
function isOver(dragId,containerId){var dragPos=getPos(dragId);var dw=getWidth(dragId);var dx=dragPos.x+parseInt(dw/2);var contPos=getPos(containerId);var w=getWidth(containerId);var h=getHeight(containerId);var lft=contPos.x+w;var h=contPos.y+h;if(dx>contPos.x&&dx<lft&&dragPos.y>contPos.y&&dragPos.y<h){return true;}
return false;}
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";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.startX=x;o.startY=y;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.onmouseover=function(){this.style.cursor='move';}
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);Drag.obj.lastX=x;Drag.obj.lastY=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);var navEls=GetElementsByAttribute('*','_ondragover','.+');for(var n=0;n<navEls.length;n++){if(isOver(Drag.obj,navEls[n])){var dofunc=navEls[n].getAttribute('_ondragover');navEls[n].setAttribute('_dragover',1);var targetdiv=new Object();for(var a=0;a<navEls[n].attributes.length;a++){var attrib=navEls[n].attributes[a];targetdiv[attrib.name]=attrib.value;}
var dropdiv=new Object();for(var a=0;a<Drag.obj.root.attributes.length;a++){var attrib=Drag.obj.root.attributes[a];dropdiv[attrib.name]=attrib.value;}
dropdiv.startX=Drag.obj.startX;dropdiv.startY=Drag.obj.startY;window[dofunc](targetdiv,dropdiv);}
else{var dragover=navEls[n].getAttribute('_dragover');if(undefined!=dragover&&dragover==1&&undefined!=navEls[n].getAttribute('_ondragout')){navEls[n].setAttribute('_dragover',0);var dofunc=navEls[n].getAttribute('_ondragout');var targetdiv=new Object();for(var a=0;a<navEls[n].attributes.length;a++){var attrib=navEls[n].attributes[a];targetdiv[attrib.name]=attrib.value;}
var dropdiv=new Object();for(var a=0;a<Drag.obj.root.attributes.length;a++){var attrib=Drag.obj.root.attributes[a];dropdiv[attrib.name]=attrib.value;}
dropdiv.startX=Drag.obj.startX;dropdiv.startY=Drag.obj.startY;window[dofunc](targetdiv,dropdiv);}}}
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"]));var navEls=GetElementsByAttribute('*','_ondrop','.+');for(var n=0;n<navEls.length;n++){if(isOver(Drag.obj,navEls[n])){var dropfunc=navEls[n].getAttribute('_ondrop');var targetdiv=new Object();for(var a=0;a<navEls[n].attributes.length;a++){var attrib=navEls[n].attributes[a];targetdiv[attrib.name]=attrib.value;}
var dropdiv=new Object();for(var a=0;a<Drag.obj.root.attributes.length;a++){var attrib=Drag.obj.root.attributes[a];dropdiv[attrib.name]=attrib.value;}
dropdiv.startX=Drag.obj.startX;dropdiv.startY=Drag.obj.startY;window[dropfunc](targetdiv,dropdiv);}}
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;}}
function initDrop(tagname,tagatt,attval){if(undefined==tagname){tagname='div';}
if(undefined==tagatt){tagatt='_behavior';}
if(undefined==attval){attval='dropdown';}
var navEls=GetElementsByAttribute(tagname,tagatt,attval);for(var n=0;n<navEls.length;n++){navEls[n].onmouseout=function(e){if(undefined==e){e=fixE(e);}
if(undefined!=e){if(checkMouseLeave(this,e)){this.style.display='none';var onhide=this.getAttribute('onhide');if(onhide){eval(onhide);}}}}}};var agt=navigator.userAgent.toLowerCase();var isFirefox=(agt.indexOf('firefox')!=-1);var isIE=(agt.indexOf('msie')!=-1);var isNetscape=(agt.indexOf('netscape')!=-1);var isOpera=agt.indexOf("opera")!=-1;var isIE=agt.indexOf("msie")!=-1&&!isOpera;var isMoz=agt.indexOf("mozilla/5.")==0&&!isOpera;if(typeof(document.getElementById)=="undefined")
document.getElementById=function(id)
{return document.all[id];}
if(typeof HTMLElement!="undefined"&&!HTMLElement.prototype.insertAdjacentElement){HTMLElement.prototype.insertAdjacentElement=function(where,parsedNode){switch(where){case'beforeBegin':this.parentNode.insertBefore(parsedNode,this)
break;case'afterBegin':this.insertBefore(parsedNode,this.firstChild);break;case'beforeEnd':this.appendChild(parsedNode);break;case'afterEnd':if(this.nextSibling){this.parentNode.insertBefore(parsedNode,this.nextSibling);}
else{this.parentNode.appendChild(parsedNode);}
break;}}
HTMLElement.prototype.insertAdjacentHTML=function(where,htmlStr){var r=this.ownerDocument.createRange();r.setStartBefore(this);var parsedHTML=r.createContextualFragment(htmlStr);this.insertAdjacentElement(where,parsedHTML)}
HTMLElement.prototype.insertAdjacentText=function(where,txtStr){var parsedText=document.createTextNode(txtStr)
this.insertAdjacentElement(where,parsedText)}}
function showClock(divid,offset){d=new Date();utc=d.getTime()+(d.getTimezoneOffset()*60000);nd=new Date(utc+(3600000*offset));var t=nd.toLocaleString();setText(divid,t);setTimeout("showClock('"+divid+"',"+offset+")",1000);}
function isDST(){var today=new Date;var yr=today.getFullYear();var dst_start=new Date("March 14, "+yr+" 02:00:00");var dst_end=new Date("November 07, "+yr+" 02:00:00");var day=dst_start.getDay();dst_start.setDate(14-day);day=dst_end.getDay();dst_end.setDate(7-day);if(today>=dst_start&&today<dst_end){return true;}
else{return false;}}
function abort(msg){alert(msg);return false;}
function includeScript(url){document.write('<script type="text/javascript" src="'+url+'"></script>');}
function appendText(obj,val,lf){var cObj=getObject(obj);if(undefined==cObj){return abort("undefined object passed to appendText");}
var cval=trim(getText(obj));var newval=cval+val;if(lf){newval+="\r\n";}
setText(obj,newval);}
function containsHtml(txt){return(/[\<\>]/.test(txt));}
function containsSpaces(txt){return(/[\ ]/.test(trim(txt)));}
function setOpacity(obj,level){var cObj=getObject(obj);cObj.style.opacity=level;cObj.style.MozOpacity=level;cObj.style.KhtmlOpacity=level;cObj.style.filter="alpha(opacity="+(level*100)+");";}
function fadeIn(id){for(i=0;i<=1;i+=(1/20)){setTimeout("setOpacity('"+id+"',"+i+")",i*1000);}}
function fadeOut(id){for(i=0;i<=1;i+=(1/20)){setTimeout("setOpacity('"+id+"',"+(1-i)+")",i*1000);}}
function stripHtml(str){var re=/(<([^>]+)>)/gi;newstr=str.replace(re,"");return newstr;}
function expand(index){var section=document.getElementById('expand_section_'+index);var icon=document.getElementById('expand_icon_'+index);if(section.style.display=='none'){section.style.display='block';icon.innerHTML='<img src="/wfiles/minus.gif" border="0">';}
else{section.style.display='none';icon.innerHTML='<img src="/wfiles/plus.gif" border="0">';}}
function fixE(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;}
function getBrowserHeight(){var myHeight=0;if(typeof(window.innerWidth)=='number'){myHeight=window.innerHeight;}
else{if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)){myHeight=document.documentElement.clientHeight;}
else{if(document.body&&(document.body.clientWidth||document.body.clientHeight)){myHeight=document.body.clientHeight;}}}
return myHeight;}
function getCookie(name){name=trim(name);var cookies=document.cookie.split(";");var tmp;for(var i=0;i<cookies.length;i++){tmp=cookies[i].split("=");var cname=trim(tmp[0]);var cval=trim(tmp[1]);if(cname==name){return unescape(cval);}}
return null;}
function preloadImages(images){if(document.images){var i=0;var imageArray=new Array();imageArray=images.split(',');var imageObj=new Image();for(i=0;i<=imageArray.length-1;i++){imageObj.src=images[i];}}}
function GetElementsByAttribute(tag,att,val){val=val.replace(/\[\]$/,"\\\[\\\]");var a,list,found=new Array(),re=new RegExp(val,'i');list=document.getElementsByTagName(tag);for(var i=0;i<list.length;++i){a=list[i].getAttribute(att);if(undefined==a){a=list[i][att];}
if(typeof(a)=='string'&&(val.length==0||a.search(re)!=-1)){found[found.length]=list[i];}}
return found;}
function jsDocs(id){list=document.getElementsByTagName('script');for(var i=0;i<list.length;++i){var cObj=list[i];var txt=getText(cObj);if(txt.length){}
else{var vals;for(name in cObj){var type=typeof(cObj[name]);vals+=name+' = '+type+'<br>\n';if(type=='function'){}
else if(type=='string'){vals+=name+' = ['+getText(cObj[name])+']<hr>\n';}
else if(type=='object'){vals+=name+' = '+cObj[name]+'<hr>\n';}}
if(id){setText(id,vals);}
else{alert(vals);}}}
return;}
function getHeight(id){if(undefined==id){return document.body.clientHeight;}
var idObj=getObject(id);if(undefined==idObj){return null;}
if(undefined!=idObj.innerHeight){return idObj.innerHeight;}
return idObj.offsetHeight;}
function getObject(obj){if(typeof(obj)=='object'){return obj;}
else if(typeof(obj)=='string'){if(undefined!=document.getElementById(obj)){return document.getElementById(obj);}
else if(undefined!=document.getElementsByName(obj)){var els=document.getElementsByName(obj);if(els.length==1){return els[0];}}
else if(undefined!=document.all[obj]){return document.all[obj];}}
return null;}
function getParent(obj){var cObj=getObject(obj);if(undefined==cObj){return abort("undefined object passed to getParent");}
if(undefined==cObj.parentNode){return cObj;}
var pobj=cObj.parentNode;if(typeof(cObj.parentNode)=="object"){return cObj.parentNode;}
else{return getParent(pobj);}}
function getSelText(fld){var txt='';if(undefined!=fld){if(document.selection){fld.focus();txt=document.selection.createRange();}
else{var len=fld.value.length;var start=fld.selectionStart;var end=fld.selectionEnd;txt=fld.value.substring(start,end);}}
else{if(window.getSelection){txt=window.getSelection();}
else if(document.getSelection){txt=document.getSelection();}
else if(document.selection){txt=document.selection.createRange().text;}}
return txt;}
function getText(obj){var cObj=getObject(obj);if(undefined==cObj){return'';}
if(undefined!=cObj.value){return cObj.value;}
else if(undefined!=cObj.innerHTML){return cObj.innerHTML;}
else if(undefined!=cObj.innerText){return cObj.innerText;}
else{}
return'';}
function getWidth(id){if(undefined==id){return document.body.clientWidth;}
var idObj=getObject(id);if(undefined==idObj){return'?';}
if(undefined!=idObj.innerWidth){return idObj.innerWidth;}
return idObj.offsetWidth;}
function getWidthHeight(id){if(undefined==id){return[document.body.clientWidth,document.body.clientHeight];}
var idObj=getObject(id);if(undefined==idObj){return undefined;}
if(undefined!=idObj.innerWidth){return[idObj.innerWidth,idObj.innerHeight];}
return[idObj.offsetWidth,idObj.offsetHeight];}
function getXY(id){if(undefined==id){return[document.body.clientLeft,document.body.clientTop];}
var idObj=getObject(id);if(undefined==idObj){return undefined;}
if(undefined!=idObj.offsetLeft){return[idObj.offsetLeft,idObj.offsetTop];}
return undefined;}
function getPos(ctrl){var pos={x:0,y:0};if(undefined==ctrl){return pos;}
if(ctrl.offsetParent){while(ctrl){pos.x+=ctrl.offsetLeft;pos.y+=ctrl.offsetTop;ctrl=ctrl.offsetParent;}}
else if(ctrl.x&&ctrl.y){pos.x+=ctrl.x;pos.y+=ctrl.y;}
return pos;}
function fadeId(eid,remove){var TimeToFade=200.0;var element=getObject(eid);if(undefined==element){return;}
if(element.FadeState==null){if(element.style.opacity==null||element.style.opacity==''||element.style.opacity=='1'){element.FadeState=2;}
else{element.FadeState=-2;}}
if(element.FadeState==1||element.FadeState==-1){element.FadeState=element.FadeState==1?-1:1;element.FadeTimeLeft=TimeToFade-element.FadeTimeLeft;}
else{element.FadeState=element.FadeState==2?-1:1;element.FadeTimeLeft=TimeToFade;setTimeout("animateFade("+new Date().getTime()+",'"+eid+"','"+remove+"')",33);}}
function animateFade(lastTick,eid,remove){var TimeToFade=200.0;var curTick=new Date().getTime();var elapsedTicks=curTick-lastTick;var element=getObject(eid);if(undefined==element){return;}
if(element.FadeTimeLeft<=elapsedTicks){element.style.opacity=element.FadeState==1?'1':'0';element.style.filter='alpha(opacity = '+(element.FadeState==1?'100':'0')+')';element.FadeState=element.FadeState==1?2:-2;if(undefined!=remove&&remove==1){removeDiv(eid);}
return;}
element.FadeTimeLeft-=elapsedTicks;var newOpVal=element.FadeTimeLeft/TimeToFade;if(element.FadeState==1){newOpVal=1-newOpVal;}
element.style.opacity=newOpVal;element.style.filter='alpha(opacity = '+(newOpVal*100)+')';setTimeout("animateFade("+curTick+",'"+eid+"','"+remove+"')",33);}
function replaceText(obj,s,r,i){var cObj=getObject(obj);if(undefined==obj){return abort("undefined object passed to replaceText");}
var opt='ig';if(i){opt='g';}
var regexp=new RegExp(s,opt);var txt=getText(obj);var newval=txt.replace(regexp,r);setText(obj,newval);}
function resizeIframe(id){var fobj=getObject(id);if(undefined==fobj){window.status='pageframe not found. resize failed';return false;}
var h=getBrowserHeight();fobj.style.height=h+'px';return 1;}
function setText(obj,txt){var cObj=getObject(obj);if(undefined==cObj){return null;}
if(undefined!=cObj.value){cObj.value=txt;}
else if(undefined!=cObj.innerHTML){cObj.innerHTML=txt;}
else if(undefined!=cObj.innerText){cObj.innerText=txt;}
else{return null;}}
function setStyle(obj,s,v){var cObj=getObject(obj);if(undefined==cObj){return abort("undefined object passed to setStyle:"+obj);}
if(v.length==0){return;}
if(s.length==0){return;}
var str="cObj.style."+s+"='"+v+"';";eval(str);}
function setClassName(obj,v){var cObj=getObject(obj);if(undefined==cObj){return abort("undefined object passed to setClassName");}
var current=cObj.className;if(!v){return;}
if(v.length==0){return;}
if(current==v){return;}
var str="cObj.className='"+v+"';";eval(str);}
function showContextId(id){showId(id,-5,-30);hideOnExit(id);return false;}
function showId(id,xoff,yoff){if(undefined==document.getElementById(id)){alert('Error in showId\n"'+id+'" is not defined as a valid object');return;}
var formObj=document.getElementById(id);formObj.style.position='absolute';if(undefined!=xoff){var x=MouseX;x=Math.round(x+xoff);formObj.style.left=x+"px";}
if(undefined!=yoff){var y=MouseY;y=Math.round(y+yoff);formObj.style.top=y+"px";}
formObj.style.display='inline';return true;}
function showDropDown(id){var cObj=getObject(id);if(undefined==cObj){return abort("undefined object passed to showIdBlock:"+id);}
if(cObj.style.display=='block'){cObj.style.display='none';return false;}
cObj.style.display='block';hideOnExit(cObj);return false;}
function hideId(id){var cObj=getObject(id);if(undefined==cObj){return abort("undefined object passed to showHide:"+id);}
cObj.style.display='none';}
function showDrop(oid,h){var navEls=GetElementsByAttribute('div','id',oid);for(var i=0;i<navEls.length;i++){if(undefined!=h){if(h==1){navEls[i].style.display='none';}}
else if(navEls[i].style.display=='block'){navEls[i].style.display='none';}
else{navEls[i].style.display='block';}}
return false;}
function showHide(id){var cObj=getObject(id);if(undefined==cObj){return abort("undefined object passed to showHide:"+id);}
if(cObj.style.display=='none'){cObj.style.display='block';showOnScreen(id);}
else{cObj.style.display='none';}}
function showProperties(obj,id,v){var cObj=getObject(obj);if(undefined==cObj){return abort("undefined object passed to showProperties");}
var str="Properties that have values for :"+cObj+"\n";var namestr='';for(name in cObj){if(cObj[name]){var type=typeof(cObj[name]);if(v||(type!="object"&&type!="function")){var val=cObj[name];str+="["+name+"]["+type+"]";if(v||type=='number'){str+=val;}
str+="<br>\r\n";}}
namestr+=name+", ";}
if(!id){alert(str);}
else{setText(id,str);}}
function str_replace(search,replace,str){var f=search,r=replace,s=str;var ra=r instanceof Array,sa=s instanceof Array,f=[].concat(f),r=[].concat(r),i=(s=[].concat(s)).length;while(j=0,i--){if(s[i]){while(s[i]=s[i].split(f[j]).join(ra?r[j]||"":r[0]),++j in f){};}};return sa?s:s[0];}
function trim(value){if(null!=value&&undefined!=value&&""!=value){var rval=value.replace(/^[\ \s\0\r\n\t]*/g,"");rval=rval.replace(/[\ \s\0\r\n\t]*$/g,"");return rval;}
else{return"";}}
function urlEncode(str){str=str+'';str=str.replace(/\//g,"%2F");str=str.replace(/\?/g,"%3F");str=str.replace(/\</g,"%3C");str=str.replace(/\>/g,"%3E");str=str.replace(/\"/g,"%22");str=str.replace(/=/g,"%3D");str=str.replace(/&/g,"%26");str=str.replace(/\#/g,"%23");return str;};function autoFill(theForm,answerid,ro){if(undefined==ro){ro=0;}
var answers=new Array();var slist=GetElementsByAttribute('div','id',answerid);for(i=0;i<slist.length;i++){var ename=slist[i].getAttribute('name');if(ename!='null'){var val=getText(slist[i]);answers[ename]=val;}}
for(var i=0;i<theForm.length;i++){var etype=theForm[i].type;var ename=theForm[i].getAttribute('name');var aname=ename.replace(/\[/,"");aname=aname.replace(/\]/,"");var answer=answers[aname];if(ro){theForm[i].style.backgroundColor='#FFFFFF';theForm[i].style.color='#000000';theForm[i].style.border='1px solid #7f9db9';if(etype=='textarea'){theForm[i].readOnly=true;}
else if(etype=='text'){theForm[i].readOnly=true;}
else{theForm[i].disabled=true;}}
if(undefined!=answers[aname]){if(etype=='checkbox'){var vals=answers[aname].split(':');var evalue=theForm[i].getAttribute('value');for(s=0;s<vals.length;s++){if(evalue==vals[s]){theForm[i].checked=true;}}}
else{theForm[i].value=answers[aname];}}}}
function ajaxAddEditForm(table,id,flds,userparams){var params='_action=editform&-table='+table;var xtitle='Add New Record';if(undefined!=id&&id>0){params+='&_id='+id;xtitle='Edit Record';}
if(undefined!=flds){params+='&-fields='+flds;}
if(undefined!=userparams){params+='&'+userparams;}
ajaxPopup('/php/index.php',params,{id:'addeditform',y:'-200',title:xtitle,mouse:1,x:'+50',drag:1});return false;}
function autoGrow(box,maxheight){if(undefined==maxheight){maxheight=400;}
if(box.scrollHeight<maxheight&&box.scrollHeight>box.clientHeight&&!window.opera){box.style.height=box.scrollHeight+'px';}}
function comboCompleteMatch(sText,arrValues){sText=sText.toLowerCase();for(var i=0;i<arrValues.length;i++){aval=arrValues[i].toLowerCase();if(aval.indexOf(sText)==0){return i;}}
return-1;}
function comboComplete(oTextbox,oEvent,vid){var comboSelectionText=getText(vid);var selectionLines=comboSelectionText.split("\n");var arrayValues=new Array();for(var i=0;i<selectionLines.length;i++){var cline=trim(selectionLines[i]);if(cline.length==0){continue;}
var matches=cline.match(/tval=\"(.+?)\"/ig);for(m in matches){var val=matches[m].replace('tval="','');val=val.replace(/\"$/,'');arrayValues.push(val);}}
var code=parseInt(oEvent.keyCode)
switch(code){case 38:if(undefined!=oTextbox.getAttribute('last_index')){var mi=parseInt(oTextbox.getAttribute('last_index'));if(mi>0){mi=mi-1;if(undefined!=arrayValues[mi]){oTextbox.value=arrayValues[mi].replace('&amp;','&');;oTextbox.setAttribute('last_index',mi);textboxSelect(oTextbox,iLen,oTextbox.value.length);return false;}}}
break;case 40:if(undefined!=oTextbox.getAttribute('last_index')){var mi=parseInt(oTextbox.getAttribute('last_index'));if(mi<arrayValues.length){mi=mi+1;if(undefined!=arrayValues[mi]){oTextbox.value=arrayValues[mi].replace('&amp;','&');;oTextbox.setAttribute('last_index',mi);textboxSelect(oTextbox,iLen,oTextbox.value.length);return false;break;}}}
break;case 37:case 39:case 33:case 34:case 36:case 35:case 13:case 9:case 27:case 16:case 17:case 18:case 20:case 8:case 46:return true;break;default:textboxReplaceSelect(oTextbox,String.fromCharCode(isIE?oEvent.keyCode:oEvent.charCode));var iLen=oTextbox.value.length;var mi=comboCompleteMatch(oTextbox.value,arrayValues);if(mi>-1){oTextbox.value=arrayValues[mi].replace('&amp;','&');;oTextbox.setAttribute('last_index',mi);textboxSelect(oTextbox,iLen,oTextbox.value.length);}
return false;}}
function filemanagerEdit(id,page,param){var obj=getObject(id);var fname=obj.getAttribute('filename');var desc=getText(obj);var htm='';htm+='<form class="w_form" method="post" action="/'+page+'" onSubmit="return submitForm(this);">'+"\n";htm+='<table border="0">'+"\n";htm+='<tr><th>Name</th><td><input type="text" name="file_name" value="'+fname+'" style="width:300px;"></td></tr>'+"\n";htm+='<tr><th>Desc</th><td><textarea name="file_desc" style="width:300px;height:60;" onkeypress="autoGrow(this,200);">'+desc+'</textarea></td></tr>'+"\n";htm+='<tr><td align="right" colspan="2"><input type="submit" value="Save Changes"></td></tr>'+"\n";htm+='</table>'+"\n";if(param){htm+='<div style="display:none" id="params">'+"\n";for(var key in param){htm+='<textarea name="'+key+'">'+param[key]+'</textarea>'+"\n";}
htm+='</div>'+"\n";}
htm+='</form><br />'+"\n";popUpDiv(htm,{title:'filemanager Edit',drag:1,center:'x',y:'-100',width:350});return false;}
function dynamicSelect(fld,v,p){if(undefined==fld){return false;}
if(undefined==v){v='other';}
var dname=fld.name;if(fld.getAttribute('displayname')){dname=fld.getAttribute('displayname');}
if(undefined==p){p='Enter '+v+' "'+dname+'" below and click OK.';}
if(fld.value.toLowerCase()==v.toLowerCase()){var other=prompt(p);if(undefined!=other&&other.length>0){for(var i=0;i<fld.options.length;i++){if(fld.options[i].value==other){fld.value=fld.options[i].value;return false;}}
fld.options[fld.length]=new Option(other.toLowerCase(),other);fld.value=other;}}
return false;}
function remindMeForm(){var frm='';frm+='<div style="padding:5px;">'+"\n";frm+='<form method="POST" name="remindMe" action="/php/index.php" onSubmit="ajaxSubmitForm(this,\'remindMePopup_Body\');return false;">'+"\n";frm+=' <input type="hidden" name="_remind" value="1">'+"\n";frm+=' <input type="hidden" name="tname" value="remind me">'+"\n";frm+=' <div class="w_lblue">Enter your email address and we will send you a reminder.</div>'+"\n";frm+=' <b>Email Address</b><br>'+"\n";frm+='  <input type="text" name="email" maxlength="255" name="email" mask=".+@.+..{2,6}" maskmsg="Invalid Email Address" required="1" requiredmsg="Enter the email address you registered with." value="" onFocus="this.select();" style="width:200px;font-size:8pt;font-family:arial;">'+"\n";frm+=' <div align="right" style="margin-right:2px;margin-top:5px;"><input type="submit" class="w_formsubmit" value="Remind Me"></div>'+"\n";frm+='</form>';frm+='</div>'+"\n";popUpDiv(frm,{title:'Remind Me Form',id:'remindMePopup',drag:1,width:220,x:'+10',y:'+10'});document.remindMe.email.focus();return false;}
function setProcessing(id,msg){if(undefined==msg){msg='Processing ...';}
var str='<div class="w_lblue"><img src="/wfiles/loading_blu.gif" border="0"> '+msg+'</div>';setText(id,str);return;}
function submitRemindMeForm(frm){setProcessing('reminderMessage');ajaxSubmitForm(frm,'remindMeForm_Body');return false;}
function setDateTimeBox(id,d,h,m,ap){if(undefined==d||d.length==0){var cdate=new Date();d=cdate.getMonth()+'-'+cdate.getDate()+'-'+cdate.getFullYear();}
var dparts=d.split('-',3);h=parseInt(h*1);if(ap=='PM'){h=h+12;}
if(h<10){h='0'+h;}
if(m.length==1){m='0'+m;}
var t=dparts[2]+'-'+dparts[0]+'-'+dparts[1]+' '+h+':'+m+':00';setText(id,t);return 1;}
function setTimeBox(id,h,m,ap){h=parseInt(h*1);if(ap=='PM'){h=h+12;}
if(h.length==1){h='0'+h;}
if(m.length==1){m='0'+m;}
var t=h+':'+m+':00';setText(id,t);return 1;}
function showColors(color,hexbox,colorbox){window.status=color+","+hexbox+","+colorbox;var setEl=document.getElementById(hexbox);setEl.innerHTML=color;setEl=document.getElementById(colorbox);setEl.style.backgroundColor=color;}
function showColor(color){showColors(color,'show_hex','show_color');}
var setHexObj;var setHexDiv;var setHexImg;function selectColor(divid,frmObj,imgid){setHexObj=frmObj;setHexDiv=divid;setHexImg=imgid;ajaxGet('/wfiles/colortable.html',divid);}
function setHex(hex){setText(setHexObj,hex);setText(setHexDiv,'');setStyle(setHexImg,'backgroundColor',hex);}
function showToolbar(field,cat){var list=GetElementsByAttribute('div','id','toolbar');for(var i=0;i<list.length;i++){var cfield=list[i].getAttribute('field');var ccat=list[i].getAttribute('category');if(cfield==field&&ccat==cat){list[i].style.display='block';}
else{list[i].style.display='none';}}}
function checkAllElements(att,val,ck){var cust=GetElementsByAttribute('input',att,'^'+val+'$');var cnt=0;for(var i=0;i<cust.length;i++){if(cust[i].type=='checkbox'){cust[i].checked=ck;cnt++;}}
if(ck){return cnt;}
return 0;}
function setTimeField(frmname,fldname){var dt=new Date();var h=dt.getHours();var m=dt.getMinutes();if(m<10){m="0"+m;}
var p="am";if(h>12){h=h-12;p="pm";}
if(h<10){h="0"+h;}
var obj=getObject(frmname+'_'+fldname+'_hour');obj.value=h;obj=getObject(frmname+'_'+fldname+'_minute');obj.value=m;obj=getObject(frmname+'_'+fldname+'_ampm');obj.value=p;}
function insertAtCursor(myField,myValue){var obj=getObject(myField);if(document.selection){obj.focus();sel=document.selection.createRange();sel.text=myValue;}
else if(obj.selectionStart||obj.selectionStart=='0'){var startPos=obj.selectionStart;var endPos=obj.selectionEnd;obj.value=obj.value.substring(0,startPos)+myValue+obj.value.substring(endPos,obj.value.length);}
else{obj.value+=myValue;}}
function isCreditCardNumber(ccNumb){var valid="0123456789"
var len=ccNumb.length;var iCCN=parseInt(ccNumb);var sCCN=ccNumb.toString();sCCN=sCCN.replace(/^\s+|\s+$/g,'');var iTotal=0;var bNum=true;var temp;var calc;for(var j=0;j<len;j++){temp=""+sCCN.substring(j,j+1);if(valid.indexOf(temp)=="-1"){return false;}}
if(len>=15&&len<=20){for(var i=len;i>0;i--){calc=parseInt(iCCN)%10;calc=parseInt(calc);iTotal+=calc;i--;iCCN=iCCN/10;calc=parseInt(iCCN)%10;calc=calc*2;switch(calc){case 10:calc=1;break;case 12:calc=3;break;case 14:calc=5;break;case 16:calc=7;break;case 18:calc=9;break;default:calc=calc;}
iCCN=iCCN/10;iTotal+=calc;}
var m=iTotal%10;if(m==0){return true;}
else{return false;}}
return false;}
function textboxSelect(oTextbox,iStart,iEnd){switch(arguments.length){case 1:oTextbox.select();break;case 2:iEnd=oTextbox.value.length;case 3:if(isIE){var oRange=oTextbox.createTextRange();oRange.moveStart("character",iStart);oRange.moveEnd("character",-oTextbox.value.length+iEnd);oRange.select();}
else if(isMoz){oTextbox.setSelectionRange(iStart,iEnd);}
break;}
oTextbox.focus();}
function textboxReplaceSelect(oTextbox,sText){if(isIE){var oRange=document.selection.createRange();oRange.text=sText;oRange.collapse(true);oRange.select();}
else if(isMoz){var iStart=oTextbox.selectionStart;oTextbox.value=oTextbox.value.substring(0,iStart)+sText+oTextbox.value.substring(oTextbox.selectionEnd,oTextbox.value.length);oTextbox.setSelectionRange(iStart+sText.length,iStart+sText.length);}
oTextbox.focus();}
function submitForm(theForm,popup,debug){if(undefined==debug){debug==0;}
if(undefined==theForm){alert("No form object passed to submitForm");return false;}
if(undefined!=theForm._action){if(theForm._action.value=='Delete'){return true;}}
var quickmask=new Array();quickmask['alpha']='^[a-zA-Z_-\\?\\ \\\']+$';quickmask['alphanumeric']='^[0-9a-zA-Z_-\\.\\?\\ \\\']+$';quickmask['calendar']='^[0-9]{1,4}-[0-9]{1,2}-[0-9]{1,4}$';quickmask['email']='.+@.+\\..{2,6}';quickmask['integer']='^[0-9]+$';quickmask['hexcolor']='^#[abcdef0-9]{6,6}$';quickmask['decimal']='^[0-9]*\\.[0-9]+$';quickmask['number']='(^[0-9]+$)|(^[0-9]+\\.[0-9]+$)';quickmask['phone']='^([0-9]{3,3}[\\-\\.][0-9]{3,3}[\\-\\.][0-9]{4,4}|\\([0-9]{3,3}\\)\\ [0-9]{3,3}[\\-][0-9]{4,4})$';quickmask['time']='^[0-9]{1,2}\\:[0-9]{2}$';quickmask['ssn']='^[0-9]{3,3}-[0-9]{2,2}-[0-9]{4,4}$';quickmask['zipcode']='^[0-9]{5,5}(\\-[0-9]{4,4})*$';if(theForm.length==0){return false;}
if(debug==1){alert("Form length: "+theForm.length);}
for(var i=0;i<theForm.length;i++){if(debug==1){alert("Checking "+theForm[i].name+" of type "+theForm[i].type);}
if(theForm[i].name=='password'&&undefined!=theForm.password_confirm){if(theForm[i].value.length==0||theForm.password_confirm.value.length==0){submitFormAlert('Password is required',popup,5);theForm[i].focus();return false;}
if(theForm[i].value!=theForm.password_confirm.value){submitFormAlert('Passwords do not match.  Please retype password.',popup,5);theForm[i].focus();return false;}}
var dname=theForm[i].name;if(theForm[i].getAttribute('displayname')){dname=theForm[i].getAttribute('displayname');}
var required=0;if(undefined!=theForm[i].getAttribute('required')){required=theForm[i].getAttribute('required');}
if(debug==1){alert(dname+' type='+theForm[i].type+', required='+required+', value=['+theForm[i].value+']');}
if(required==1){if(theForm[i].type=='checkbox'){var checkname='name';if(theForm[i].getAttribute('checkname')){checkname=theForm[i].getAttribute('checkname');}
var checkval=theForm[i].getAttribute(checkname);var checkboxlist=GetElementsByAttribute('input',checkname,checkval);var isChecked=0;for(var c=0;c<checkboxlist.length;c++){if(checkboxlist[c].type=='checkbox'&&checkboxlist[c].checked){isChecked++;}
else if(checkboxlist[c].type=='text'&&checkboxlist[c].value!=''){isChecked++;}}
if(isChecked==0){var msg=dname+" is required";if(theForm[i].getAttribute('requiredmsg')){msg=theForm[i].getAttribute('requiredmsg');}
submitFormAlert(msg,popup,5);theForm[i].focus();return false;}}
else if(theForm[i].type=='radio'){var checkboxlist=GetElementsByAttribute('input','name',theForm[i].name);var isChecked=0;for(var c=0;c<checkboxlist.length;c++){if(checkboxlist[c].type=='radio'&&checkboxlist[c].checked){isChecked++;}
else if(checkboxlist[c].type=='text'&&checkboxlist[c].value!=''){isChecked++;}}
if(isChecked==0){var msg=dname+" is required";if(theForm[i].getAttribute('requiredmsg')){msg=theForm[i].getAttribute('requiredmsg');}
submitFormAlert(msg,popup,5);theForm[i].focus();return false;}}
else if(theForm[i].value==''){var msg=dname+" is required";if(theForm[i].getAttribute('requiredmsg')){msg=theForm[i].getAttribute('requiredmsg');}
submitFormAlert(msg,popup,5);theForm[i].focus();return false;}}
if(theForm[i].getAttribute('mask')&&theForm[i].getAttribute('mask').value!=''&&theForm[i].value!=''){var mask=theForm[i].getAttribute('mask');if(mask=='ccnumber'){if(isCreditCardNumber(theForm[i].value)==false){var msg=dname+" must be of valid credit card number ";if(theForm[i].getAttribute('maskmsg')){msg=theForm[i].getAttribute('maskmsg');}
submitFormAlert(msg,popup,5);theForm[i].focus();return false;}}
else if(mask=='intlphone'){if(checkInternationalPhone(theForm[i].value)==false){var msg=dname+" must be a valid phone number";if(theForm[i].getAttribute('maskmsg')){msg=theForm[i].getAttribute('maskmsg');}
submitFormAlert(msg,popup,5);theForm[i].focus();return false;}}
else if(mask!='searchandreplace'){var rmask=mask;if(undefined!=quickmask[mask]){rmask=quickmask[mask]+'';}
var re=new RegExp(rmask,'i');if(re.test(theForm[i].value)==false){var msg=dname+" must be of type "+mask;if(theForm[i].getAttribute('maskmsg')){msg=theForm[i].getAttribute('maskmsg');}
submitFormAlert(msg,popup,5);theForm[i].focus();return false;}}}
if(theForm[i].type=='textarea'&&theForm[i].getAttribute('maxlength')){var len=theForm[i].value.length;var max=Math.abs(theForm[i].getAttribute('maxlength'));if(len>max){var msg=dname+" must be less than "+max+" characters\nYou entered "+len+" characters.";submitFormAlert(msg,popup,5);theForm[i].focus();return false;}}
if(theForm[i].type=='file'&&theForm[i].getAttribute('accept')&&theForm[i].value.length){var allow=theForm[i].getAttribute('accept');if(debug==1){alert(" -- File type allowed exts:"+allow);}
var exts=allow.split(',');var valid=0;for(s=0;s<exts.length;s++){if(theForm[i].value.lastIndexOf(exts[s])!=-1){valid++;}}
if(valid==0){var msg=dname+" must be of valid file type:  "+allow;if(theForm[i].getAttribute('acceptmsg')){msg=theForm[i].getAttribute('acceptmsg');}
submitFormAlert(msg,popup,5);theForm[i].focus();return false;}}}
return true;}
function imposeMaxlength(obj,max){return(obj.value.length<=max);}
function submitSurveyForm(theForm,opts){if(undefined==theForm){alert('submitSurveyForm Error: No Form');return false;}
if(!submitForm(theForm)){return false;}
var enames=new Array();for(var i=0;i<theForm.length;i++){var fname=theForm[i].name;enames[fname]=1;}
for(var i=0;i<theForm.length;i++){if(undefined==theForm[i].name){continue;}
var fname=theForm[i].name;if(fname.length==0){continue;}
if(undefined!=opts){for(var optkey in opts){if(opts[optkey]!=1){continue;}
if(theForm[i].getAttribute(optkey)){var optval=theForm[i].getAttribute(optkey);if(optval.length){var fieldname=optkey+'_'+fname;if(undefined==enames[fieldname]){enames[fieldname]=1;var addfield=document.createElement("textarea");addfield.setAttribute('NAME',fieldname);addfield.style.display='none';addfield.value=optval;theForm.appendChild(addfield);}}}}}}
return true;}
function checkInternationalPhone(strPhone){var digits="0123456789";var phoneNumberDelimiters=".()- ";var validWorldPhoneChars=phoneNumberDelimiters+"+";var minDigitsInIPhoneNumber=10;var bracket=3;strPhone=trim(strPhone);if(strPhone.indexOf("+")>1)return false;if(strPhone.indexOf("-")!=-1){bracket=bracket+1;}
if(strPhone.indexOf("(")!=-1&&strPhone.indexOf("(")>bracket){return false;}
var brchr=strPhone.indexOf("(");if(strPhone.indexOf("(")!=-1&&strPhone.charAt(brchr+2)!=")"){return false;}
if(strPhone.indexOf("(")==-1&&strPhone.indexOf(")")!=-1){return false;}
s=stripCharsInBag(strPhone,validWorldPhoneChars);return(isInteger(s)&&s.length>=minDigitsInIPhoneNumber);}
function isInteger(s){var i;for(i=0;i<s.length;i++){var c=s.charAt(i);if(((c<"0")||(c>"9")))return false;}
return true;}
function trim(value){if(null!=value&&undefined!=value&&""!=value){var rval=value.replace(/^[\ \s\0\r\n\t]*/g,"");rval=rval.replace(/[\ \s\0\r\n\t]*$/g,"");return rval;}
else{return"";}}
function stripCharsInBag(s,bag){var i;var returnString="";for(i=0;i<s.length;i++){var c=s.charAt(i);if(bag.indexOf(c)==-1)returnString+=c;}
return returnString;}
function submitFormAlert(msg,popup,timer){if(undefined==popup){popup=0;}
if(popup){html='';html+='<div style="padding:10px;font-size:12pt;width:300px;background:#FFF;z-index:600">'+"\n";html+=' <div>'+"\n";html+='  <h4 style="margin:2px;padding:2px;"><img src="/wfiles/warn.gif" border="0"> '+msg+'</h4>'+"\n";html+=' </div>'+"\n";html+=' <div style="margin-top:10px;" align="right"><a href="#" class="w_red w_link w_bold" onClick="removeId(\'submitFormAlertBox\');return false;"><img src="/wfiles/x_red.gif" border="0"> Close</a></div>'+"\n";html+='</div>'+"\n";if(undefined!=timer&&timer>0){popUpDiv(html,{id:'submitFormAlertBox',title:'Attention!',drag:1,width:300,height:300,center:1,timout:timer});}
else{popUpDiv(html,{id:'submitFormAlertBox',title:'Attention!',drag:1,width:300,height:300,center:1});}}
else{alert(msg);}
return false;}
function showFormData(theForm,id){if(undefined==theForm){alert("No form object passed to formData");return false;}
if(theForm.length==0){return false;}
var str='';for(var i=0;i<theForm.length;i++){var dname=theForm[i].name;var type=typeof(theForm[i]);alert(theForm[i]);str+='Name: '+dname+"<br>\r\n";str+='Type: '+type+"<br>\r\n";}
if(!id){alert(str);}
else{setText(id,str);}}
function checkPerl(field,value){if(undefined==document._perlcheck){alert('document._perlcheck does not exist.');return false;}
var pfield=field+"_perlcheck";if(undefined==value){alert('Nothing to check.');return false;}
if(value.length==0){alert('Nothing to check.');return false;}
document.getElementById(pfield).innerHTML='<img src="/wfiles/busy.gif" title="checking Perl syntax" border="0" width="12" height="12">';document._perlcheck.perlcheck.value=value;ajaxSubmitForm(document._perlcheck,pfield,5);return false;}
function cloneObj(c){var obj=getObject(c);var inc=obj.getAttribute('inc');if(undefined==inc){inc=1;}
else{inc=parseFloat(inc);inc++;}
obj.setAttribute('inc',inc);var cloneObj=obj.cloneNode(true);var clonedInputs=cloneObj.getElementsByTagName('input');for(var i=0;i<clonedInputs.length;i++){var cname=clonedInputs[i].getAttribute('name');if(undefined==cname){continue;}
var ctype=clonedInputs[i].getAttribute('type');if(cname=='_clone'&&ctype.toLowerCase()=='button'){clonedInputs[i].style.display='none';}
if(ctype.toLowerCase()!='button'&&ctype.toLowerCase()!='hidden'){clonedInputs[i].value='';}
var newname=cname+'_'+inc;if(cname.indexOf('_path')!=-1){newname=cname.replace(/path/,"");newname+=inc+'_path';}
clonedInputs[i].setAttribute('name',newname)}
var clonedSelects=cloneObj.getElementsByTagName('select');for(var i=0;i<clonedSelects.length;i++){var cname=clonedSelects[i].getAttribute('name');if(undefined==cname){continue;}
var newname=cname+'_'+inc;clonedSelects[i].setAttribute('name',newname)}
var clonedTextareas=cloneObj.getElementsByTagName('textarea');for(var i=0;i<clonedTextareas.length;i++){var cname=clonedTextareas[i].getAttribute('name');if(undefined==cname){continue;}
clonedTextareas[i].value='';var newname=cname+'_'+inc;clonedTextareas[i].setAttribute('name',newname)}
obj.parentNode.appendChild(cloneObj);}
function ajaxSubmitForm(theform,sid,tmeout){ajaxPost(theform,sid,tmeout);}
function ajaxPopup(url,params,useropts){var pid='ajaxPopupDiv';var opt={id:pid,drag:1}
if(useropts){for(var key in opt){if(undefined!=useropts[key]){opt[key]=useropts[key];}}
for(var key in useropts){if(undefined==opt[key]){opt[key]=useropts[key];}}}
popUpDiv('<div class="w_bold w_lblue w_big"><img src="/wfiles/loading_blu.gif" border="0"> loading...please wait.</div>',opt);ajaxGet(url,opt['id']+'_Body',params);}
function ajaxPost(theform,sid,tmeout,callback,var1,var2,var3,var4,var5){if(undefined==theform){alert("No form object passed to submitForm");return false;}
var ok=submitForm(theform);if(!ok){return false;}
if(undefined==tmeout||tmeout<60000){tmeout=60000;}
var AJUid=new Date().getTime()+"";var status=AjaxRequest.submit(theform,{'groupName':sid,'timeout':tmeout,'callback':callback,'var1':var1,'var2':var2,'var3':var3,'var4':var4,'var5':var5,'AjaxRequestUniqueId':AJUid,'onGroupBegin':function(req){var name=this.groupName;document.body.style.cursor='wait';setProcessing(name);},'onGroupEnd':function(req){document.body.style.cursor='default';},'onTimeout':function(req){var name=this.groupName;setText(name,"<b style=\"color:red\">ajaxPost Timed Out Error</b>");},'onError':function(req){var name=this.groupName;setText(name,req.responseText);},'onComplete':function(req){var sid=this.groupName;if(undefined!=this.callback){if(this.callback=='popUpDiv'){var val=req.responseText;popUpDiv(val,{center:1,drag:1});}
else{var str=this.callback+'(req);';eval(str);}}
else if(undefined!=sid){var val=req.responseText;if(document.getElementById(sid)){document.getElementById(sid).style.display='inline';document.getElementById(sid).innerHTML=val;}
else{alert('ajaxPost could not find sid:'+sid);}}
else{alert('ajaxPost could not find sid:'+sid);}}});return status;}
function callWaSQL(id,name,params){var url='/cgi-bin/wasql.pl';ajaxGet(url,name,'&_view='+id+'&'+params);}
function ajaxGet(url,name,params,callback){var guid=getCookie('GUID');if(undefined==document.getElementById(name)){if(undefined==callback||callback!='popUpDiv'){alert('Error in ajaxGet\n'+name+' is not defined as a valid object id');return;}}
AjaxRequest.get({'url':url+'?'+params,'callback':callback,'onSuccess':function(req){if(undefined!=this.callback){if(this.callback=='popUpDiv'){var val=trim(req.responseText);popUpDiv(val,{id:this.groupName,center:1,drag:1});}
else{var name=this.groupName;setText(name,req.responseText);setStyle(name,'display','inline');var str=this.callback+'(req);';eval(str);}}
else{var name=this.groupName;setText(name,req.responseText);setStyle(name,'display','inline');}},'timeout':60000,'groupName':name,'onGroupBegin':function(req){document.body.style.cursor='wait';setProcessing('ajaxstatus');},'onGroupEnd':function(req){document.body.style.cursor='default';setText('ajaxstatus',' ');},'onTimeout':function(req){var name=this.groupName;setText(name,"<b style=\"color:red\">ajaxGet Timed Out Error</b>");}});return false;}
function newXmlHttpRequest(){if(window.XMLHttpRequest){return new XMLHttpRequest();}
else if(window.ActiveXObject){/*@cc_on @*//*@if (@_jscript_version >= 5)
  try {
   return new ActiveXObject("Msxml2.XMLHTTP");
  } catch (e) {
   try {
    return new ActiveXObject("Microsoft.XMLHTTP");
   } catch (E) {
    return null;
   }
  }
  @end @*/}
else{return null;}}
function AjaxRequest(){var req=new Object();req.timeout=null;req.generateUniqueUrl=true;req.url=window.location.href;req.method="GET";req.async=true;req.username=null;req.password=null;req.xAttribute=null;req.xValue=null;req.xName=null;req.xAction=null;req.xId=null;req.parameters=new Object();req.requestIndex=AjaxRequest.numAjaxRequests++;req.responseReceived=false;req.groupName=null;req.callback=null;req.var1=null;req.var2=null;req.var3=null;req.var4=null;req.var5=null;req.queryString="";req.responseText=null;req.responseXML=null;req.status=null;req.statusText=null;req.aborted=false;req.xmlHttpRequest=null;req.onTimeout=null;req.onLoading=null;req.onLoaded=null;req.onInteractive=null;req.onComplete=null;req.onSuccess=null;req.onError=null;req.onGroupBegin=null;req.onGroupEnd=null;req.xmlHttpRequest=AjaxRequest.getXmlHttpRequest();if(req.xmlHttpRequest==null){return null;}
req.xmlHttpRequest.onreadystatechange=function(){if(req==null||req.xmlHttpRequest==null){return;}
if(req.xmlHttpRequest.readyState==1){req.onLoadingInternal(req);}
if(req.xmlHttpRequest.readyState==2){req.onLoadedInternal(req);}
if(req.xmlHttpRequest.readyState==3){req.onInteractiveInternal(req);}
if(req.xmlHttpRequest.readyState==4){req.onCompleteInternal(req);}};req.onLoadingInternalHandled=false;req.onLoadedInternalHandled=false;req.onInteractiveInternalHandled=false;req.onCompleteInternalHandled=false;req.onLoadingInternal=function(){if(req.onLoadingInternalHandled){return;}
AjaxRequest.numActiveAjaxRequests++;if(AjaxRequest.numActiveAjaxRequests==1&&typeof(window['AjaxRequestBegin'])=="function"){AjaxRequestBegin();}
if(req.groupName!=null){if(typeof(AjaxRequest.numActiveAjaxGroupRequests[req.groupName])=="undefined"){AjaxRequest.numActiveAjaxGroupRequests[req.groupName]=0;}
AjaxRequest.numActiveAjaxGroupRequests[req.groupName]++;if(AjaxRequest.numActiveAjaxGroupRequests[req.groupName]==1&&typeof(req.onGroupBegin)=="function"){req.onGroupBegin(req.groupName);}}
if(typeof(req.onLoading)=="function"){req.onLoading(req);}
req.onLoadingInternalHandled=true;};req.onLoadedInternal=function(){if(req.onLoadedInternalHandled){return;}
if(typeof(req.onLoaded)=="function"){req.onLoaded(req);}
req.onLoadedInternalHandled=true;};req.onInteractiveInternal=function(){if(req.onInteractiveInternalHandled){return;}
if(typeof(req.onInteractive)=="function"){req.onInteractive(req);}
req.onInteractiveInternalHandled=true;};req.onCompleteInternal=function(){if(req.onCompleteInternalHandled||req.aborted){return;}
req.onCompleteInternalHandled=true;AjaxRequest.numActiveAjaxRequests--;if(AjaxRequest.numActiveAjaxRequests==0&&typeof(window['AjaxRequestEnd'])=="function"){AjaxRequestEnd(req.groupName);}
if(req.groupName!=null){AjaxRequest.numActiveAjaxGroupRequests[req.groupName]--;if(AjaxRequest.numActiveAjaxGroupRequests[req.groupName]==0&&typeof(req.onGroupEnd)=="function"){req.onGroupEnd(req.groupName);}}
req.responseReceived=true;req.status=req.xmlHttpRequest.status;req.statusText=req.xmlHttpRequest.statusText;req.responseText=req.xmlHttpRequest.responseText;req.responseXML=req.xmlHttpRequest.responseXML;if(typeof(req.onComplete)=="function"){req.onComplete(req);}
if(req.xmlHttpRequest.status==200&&typeof(req.onSuccess)=="function"){req.onSuccess(req);}
else if(typeof(req.onError)=="function"){req.onError(req);}
delete req.xmlHttpRequest['onreadystatechange'];req.xmlHttpRequest=null;};req.onTimeoutInternal=function(){if(req!=null&&req.xmlHttpRequest!=null&&!req.onCompleteInternalHandled){req.aborted=true;req.xmlHttpRequest.abort();AjaxRequest.numActiveAjaxRequests--;if(AjaxRequest.numActiveAjaxRequests==0&&typeof(window['AjaxRequestEnd'])=="function"){AjaxRequestEnd(req.groupName);}
if(req.groupName!=null){AjaxRequest.numActiveAjaxGroupRequests[req.groupName]--;if(AjaxRequest.numActiveAjaxGroupRequests[req.groupName]==0&&typeof(req.onGroupEnd)=="function"){req.onGroupEnd(req.groupName);}}
if(typeof(req.onTimeout)=="function"){req.onTimeout(req);}
delete req.xmlHttpRequest['onreadystatechange'];req.xmlHttpRequest=null;}};req.process=function(){if(req.xmlHttpRequest!=null){if(req.generateUniqueUrl&&req.method=="GET"){req.parameters["AjaxRequestUniqueId"]=new Date().getTime()+""+req.requestIndex;}
var content=null;for(var i in req.parameters){if(req.queryString.length>0){req.queryString+="&";}
req.queryString+=encodeURIComponent(i)+"="+encodeURIComponent(req.parameters[i]);}
if(req.method=="GET"){if(req.queryString.length>0){req.url+=((req.url.indexOf("?")>-1)?"&":"?")+req.queryString;}}
req.xmlHttpRequest.open(req.method,req.url,req.async,req.username,req.password);if(req.method=="POST"){if(typeof(req.xmlHttpRequest.setRequestHeader)!="undefined"){req.xmlHttpRequest.setRequestHeader('Content-type','application/x-www-form-urlencoded');}
content=req.queryString;}
if(req.timeout>0){setTimeout(req.onTimeoutInternal,req.timeout);}
req.xmlHttpRequest.send(content);}};req.handleArguments=function(args){for(var i in args){if(typeof(req[i])=="undefined"){req.parameters[i]=args[i];}
else{req[i]=args[i];}}};req.getAllResponseHeaders=function(){if(req.xmlHttpRequest!=null){if(req.responseReceived){return req.xmlHttpRequest.getAllResponseHeaders();}
alert("Cannot getAllResponseHeaders because a response has not yet been received");}};req.getResponseHeader=function(headerName){if(req.xmlHttpRequest!=null){if(req.responseReceived){return req.xmlHttpRequest.getResponseHeader(headerName);}
alert("Cannot getResponseHeader because a response has not yet been received");}};return req;}
AjaxRequest.getXmlHttpRequest=function(){if(window.XMLHttpRequest){return new XMLHttpRequest();}
else if(window.ActiveXObject){/*@cc_on @*//*@if (@_jscript_version >= 5)
  try {
   return new ActiveXObject("Msxml2.XMLHTTP");
  } catch (e) {
   try {
    return new ActiveXObject("Microsoft.XMLHTTP");
   } catch (E) {
    return null;
   }
  }
  @end @*/}
else{return null;}};AjaxRequest.isActive=function(){return(AjaxRequest.numActiveAjaxRequests>0);};AjaxRequest.get=function(args){AjaxRequest.doRequest("GET",args);};AjaxRequest.post=function(args){AjaxRequest.doRequest("POST",args);};AjaxRequest.doRequest=function(method,args){if(typeof(args)!="undefined"&&args!=null){var myRequest=new AjaxRequest();myRequest.method=method;myRequest.handleArguments(args);myRequest.process();}};AjaxRequest.submit=function(theform,args){var myRequest=new AjaxRequest();if(myRequest==null){return false;}
var serializedForm=AjaxRequest.serializeForm(theform);myRequest.method=theform.method.toUpperCase();myRequest.url=theform.action;myRequest.handleArguments(args);myRequest.queryString=serializedForm;myRequest.process();return true;};AjaxRequest.serializeForm=function(theform){var els=theform.elements;if(undefined==els){alert('Ajax Request serializeForm failed');return false;}
var len=els.length;var queryString="";this.addField=function(name,value){if(queryString.length>0){queryString+="&";}
queryString+=encodeURIComponent(name)+"="+encodeURIComponent(value);};for(var i=0;i<len;i++){var el=els[i];if(!el.disabled){switch(el.type){case'text':case'password':case'submit':case'hidden':case'textarea':this.addField(el.name,el.value);break;case'select-one':if(el.selectedIndex>=0){this.addField(el.name,el.options[el.selectedIndex].value);}
break;case'select-multiple':for(var j=0;j<el.options.length;j++){if(el.options[j].selected){this.addField(el.name,el.options[j].value);}}
break;case'checkbox':case'radio':if(el.checked){this.addField(el.name,el.value);}
break;}}}
return queryString;};AjaxRequest.numActiveAjaxRequests=0;AjaxRequest.numActiveAjaxGroupRequests=new Object();AjaxRequest.numAjaxRequests=0;;function positionInfo(object){var p_elm=object;this.getElementLeft=getElementLeft;function getElementLeft(){var x=0;var elm;if(typeof(p_elm)=="object"){elm=p_elm;}
else{elm=document.getElementById(p_elm);}
while(elm!=null){x+=elm.offsetLeft;elm=elm.offsetParent;}
return parseInt(x);}
this.getElementWidth=getElementWidth;function getElementWidth(){var elm;if(typeof(p_elm)=="object"){elm=p_elm;}
else{elm=document.getElementById(p_elm);}
return parseInt(elm.offsetWidth);}
this.getElementRight=getElementRight;function getElementRight(){return getElementLeft(p_elm)+getElementWidth(p_elm);}
this.getElementTop=getElementTop;function getElementTop(){var y=0;var elm;if(typeof(p_elm)=="object"){elm=p_elm;}
else{elm=document.getElementById(p_elm);}
while(elm!=null){y+=elm.offsetTop;elm=elm.offsetParent;}
return parseInt(y);}
this.getElementHeight=getElementHeight;function getElementHeight(){var elm;if(typeof(p_elm)=="object"){elm=p_elm;}
else{elm=document.getElementById(p_elm);}
return parseInt(elm.offsetHeight);}
this.getElementBottom=getElementBottom;function getElementBottom(){return getElementTop(p_elm)+getElementHeight(p_elm);}}
function CalendarControl(){var calendarId='CalendarControl';var currentYear=0;var currentMonth=0;var currentDay=0;var nowMonth=getCurrentMonth();var nowDay=getCurrentDay();var nowYear=getCurrentYear();var selectedYear=0;var selectedMonth=0;var selectedDay=0;var months=['January','February','March','April','May','June','July','August','September','October','November','December'];var dateField=null;function getProperty(p_property){var p_elm=calendarId;var elm=null;if(typeof(p_elm)=="object"){elm=p_elm;}
else{elm=document.getElementById(p_elm);}
if(elm!=null){if(elm.style){elm=elm.style;if(elm[p_property]){return elm[p_property];}
else{return null;}}
else{return null;}}}
function setElementProperty(p_property,p_value,p_elmId){var p_elm=p_elmId;var elm=null;if(typeof(p_elm)=="object"){elm=p_elm;}
else{elm=document.getElementById(p_elm);}
if((elm!=null)&&(elm.style!=null)){elm=elm.style;elm[p_property]=p_value;}}
function setProperty(p_property,p_value){setElementProperty(p_property,p_value,calendarId);}
function getDaysInMonth(year,month){return[31,((!(year%4)&&((year%100)||!(year%400)))?29:28),31,30,31,30,31,31,30,31,30,31][month-1];}
function getDayOfWeek(year,month,day){var date=new Date(year,month-1,day)
return date.getDay();}
this.setDate=setDate;function setDate(year,month,day){if(dateField){if(month<10){month="0"+month;}
if(day<10){day="0"+day;}
var dateString=month+"-"+day+"-"+year;dateField.value=dateString;if(undefined!=dateField.id){var cObj=document.getElementById(dateField.id);if(undefined!=cObj){ch=cObj.getAttribute('changed');if(undefined!=ch){eval(ch);}}}
hide();}
return;}
this.changeMonth=changeMonth;function changeMonth(change){currentMonth+=change;currentDay=0;if(currentMonth>12){currentMonth=1;currentYear++;}
else if(currentMonth<1){currentMonth=12;currentYear--;}
calendar=document.getElementById(calendarId);calendar.innerHTML=calendarDrawTable();}
this.changeYear=changeYear;function changeYear(change){currentYear+=change;currentDay=0;calendar=document.getElementById(calendarId);calendar.innerHTML=calendarDrawTable();}
this.gotoToday=gotoToday;function gotoToday(){currentYear=getCurrentYear();currentMonth=getCurrentMonth();currentDay=0;calendar=document.getElementById(calendarId);calendar.innerHTML=calendarDrawTable();}
this.gotoCurrent=gotoCurrent;function gotoCurrent(){currentYear=selectedYear;currentMonth=selectedMonth;currentDay=0;calendar=document.getElementById(calendarId);calendar.innerHTML=calendarDrawTable();}
function getCurrentYear(){var year=new Date().getYear();if(year<1900){year+=1900;}
return year;}
function getCurrentMonth(){return new Date().getMonth()+1;}
function getCurrentDay(){return new Date().getDate();}
function calendarDrawTable(){var dayOfMonth=1;var validDay=0;var startDayOfWeek=getDayOfWeek(currentYear,currentMonth,dayOfMonth);var daysInMonth=getDaysInMonth(currentYear,currentMonth);var css_class=null;var table="<table cellspacing='1' cellpadding='0' border='0'>";table=table+"<tr valign='top'>";table=table+"  <td class='previous' nowrap title='Previous Month'><a href='javascript:changeCalendarControlMonth(-1);'>&#9668;</a></td>";table=table+"  <td  nowrap class='title' colspan='5' align='center' style='width:90px;'>"+months[currentMonth-1]+"</td>";table=table+"  <td class='next' nowrap title='Next Month' align='right'><a href='javascript:changeCalendarControlMonth(1);'>&#9658;</a></td>";table=table+"</tr>\n";table=table+"<tr valign='top'>";table=table+"  <td class='next' nowrap title='Jump 10 Years Back'><a href='javascript:changeCalendarControlYear(-10);'>&#9668;&#124;</a></td>";table=table+"  <td class='previous' nowrap title='Previous Year'><a href='javascript:changeCalendarControlYear(-1);'>&#9668;</a></td>";table=table+"  <td colspan=\"3\" class='title' align='center' style='width:54px;'>"+currentYear+"</td>";table=table+"  <td class='next' nowrap title='Next Year' align='right'><a href='javascript:changeCalendarControlYear(1);'>&#9658;</a></td>";table=table+"  <td class='next' nowrap title='Jump 10 Years Ahead' align='right'><a href='javascript:changeCalendarControlYear(10);'>&#124;&#9658;</a></td>";table=table+"</tr>\n";table=table+"<tr class='tablerow'><td>S</td><td>M</td><td>T</td><td>W</td><td>T</td><td>F</td><td>S</td></tr>";for(var week=0;week<6;week++){table=table+"<tr class='tablerow'>";for(var dayOfWeek=0;dayOfWeek<7;dayOfWeek++){if(week==0&&startDayOfWeek==dayOfWeek){validDay=1;}
else if(validDay==1&&dayOfMonth>daysInMonth){validDay=0;}
if(validDay){if(dayOfMonth==selectedDay&&currentYear==selectedYear&&currentMonth==selectedMonth&&dayOfMonth==nowDay&&currentYear==nowYear&&currentMonth==nowMonth){css_class='current_today';}
else if(dayOfMonth==selectedDay&&currentYear==selectedYear&&currentMonth==selectedMonth){css_class='current';}
else if(dayOfMonth==nowDay&&currentYear==nowYear&&currentMonth==nowMonth){css_class='today';}
else if(dayOfWeek==0||dayOfWeek==6){css_class='weekend';}
else{css_class='weekday';}
table=table+"<td><a class='"+css_class+"' href=\"javascript:setCalendarControlDate("+currentYear+","+currentMonth+","+dayOfMonth+")\">"+dayOfMonth+"</a></td>";dayOfMonth++;}
else{table=table+"<td class='empty'>&nbsp;</td>";}}
table=table+"</tr>";}
table=table+"<tr class='footer' align='center'>";table=table+"  <td nowrap title='Go to Current Selection'><a class='gotoCurrent' href='javascript:changeCalendarToCurrent("+selectedYear+","+selectedMonth+");'>&#9788;</a></td>";table=table+"  <td width='100%' colspan='5' nowrap title='Close This Calendar Control' style='width:90px;font-size:9pt;'><a class='footer' href='javascript:hideCalendarControl();'>Close</a></td>";table=table+"  <td nowrap title='Go to Today'><a class='gotoToday' href='javascript:changeCalendarToToday();'>&#9788;</a></td>";table=table+"</tr>";table=table+"</table>";return table;}
this.show=show;function show(field){var cObj=getObject(calendarId);if(dateField==field&&cObj.style.display!='none'){hideCalendarControl();return;}
else{dateField=field;}
if(dateField){try{var dateString=new String(dateField.value);var dateParts=dateString.split("-");selectedMonth=parseInt(dateParts[0],10);selectedDay=parseInt(dateParts[1],10);selectedYear=parseInt(dateParts[2],10);}catch(e){}}
if(!(selectedYear&&selectedMonth&&selectedDay)){selectedMonth=getCurrentMonth();selectedDay=getCurrentDay();selectedYear=getCurrentYear();}
currentMonth=selectedMonth;currentDay=selectedDay;currentYear=selectedYear;if(document.getElementById){calendar=document.getElementById(calendarId);calendar.innerHTML=calendarDrawTable(currentYear,currentMonth);setProperty('display','block');var fieldPos=new positionInfo(dateField);var calendarPos=new positionInfo(calendarId);var x=fieldPos.getElementLeft();var y=fieldPos.getElementBottom();setProperty('left',x+"px");setProperty('top',y+"px");}}
this.hide=hide;function hide(){if(dateField){setProperty('display','none');dateField=null;}}}
var calendarControl=new CalendarControl();function showCalendarControl(textField){calendarControl.show(textField);}
function hideCalendarControl(){calendarControl.hide();}
function setCalendarControlDate(year,month,day){calendarControl.setDate(year,month,day);}
function changeCalendarControlYear(change){calendarControl.changeYear(change);}
function changeCalendarToToday(){calendarControl.gotoToday();}
function changeCalendarToCurrent(){calendarControl.gotoCurrent();}
function changeCalendarControlMonth(change){calendarControl.changeMonth(change);}
document.write("<div id='CalendarControl' _behavior='dropdown'></div>");;var niftyOk=(document.getElementById&&document.createElement&&Array.prototype.push);var niftyCss=false;String.prototype.find=function(what){return(this.indexOf(what)>=0?true:false);}
var oldonload=window.onload;if(typeof(NiftyLoad)!='function')NiftyLoad=function(){};if(typeof(oldonload)=='function')
window.onload=function(){oldonload();AddCss();NiftyLoad()};else window.onload=function(){AddCss();NiftyLoad()};function AddCss(){niftyCss=true;var l=CreateEl("link");l.setAttribute("type","text/css");l.setAttribute("rel","stylesheet");l.setAttribute("href","niftyCorners.css");l.setAttribute("media","screen");document.getElementsByTagName("head")[0].appendChild(l);}
function Nifty(selector,options){if(niftyOk==false)return;if(niftyCss==false)AddCss();var i,v=selector.split(","),h=0;if(options==null)options="";if(options.find("fixed-height"))
h=getElementsBySelector(v[0])[0].offsetHeight;for(i=0;i<v.length;i++)
Rounded(v[i],options);if(options.find("height"))SameHeight(selector,h);}
function Rounded(selector,options){var i,top="",bottom="",v=new Array();if(options!=""){options=options.replace("left","tl bl");options=options.replace("right","tr br");options=options.replace("top","tr tl");options=options.replace("bottom","br bl");options=options.replace("transparent","alias");if(options.find("tl")){top="both";if(!options.find("tr"))top="left";}
else if(options.find("tr"))top="right";if(options.find("bl")){bottom="both";if(!options.find("br"))bottom="left";}
else if(options.find("br"))bottom="right";}
if(top==""&&bottom==""&&!options.find("none")){top="both";bottom="both";}
v=getElementsBySelector(selector);for(i=0;i<v.length;i++){FixIE(v[i]);if(top!="")AddTop(v[i],top,options);if(bottom!="")AddBottom(v[i],bottom,options);}}
function AddTop(el,side,options){var d=CreateEl("b"),lim=4,border="",p,i,btype="r",bk,color;d.style.marginLeft="-"+getPadding(el,"Left")+"px";d.style.marginRight="-"+getPadding(el,"Right")+"px";if(options.find("alias")||(color=getBk(el))=="transparent"){color="transparent";bk="transparent";border=getParentBk(el);btype="t";}
else{bk=getParentBk(el);border=Mix(color,bk);}
d.style.background=bk;d.className="niftycorners";p=getPadding(el,"Top");if(options.find("small")){d.style.marginBottom=(p-2)+"px";btype+="s";lim=2;}
else if(options.find("big")){d.style.marginBottom=(p-10)+"px";btype+="b";lim=8;}
else d.style.marginBottom=(p-5)+"px";for(i=1;i<=lim;i++)
d.appendChild(CreateStrip(i,side,color,border,btype));el.style.paddingTop="0";el.insertBefore(d,el.firstChild);}
function AddBottom(el,side,options){var d=CreateEl("b"),lim=4,border="",p,i,btype="r",bk,color;d.style.marginLeft="-"+getPadding(el,"Left")+"px";d.style.marginRight="-"+getPadding(el,"Right")+"px";if(options.find("alias")||(color=getBk(el))=="transparent"){color="transparent";bk="transparent";border=getParentBk(el);btype="t";}
else{bk=getParentBk(el);border=Mix(color,bk);}
d.style.background=bk;d.className="niftycorners";p=getPadding(el,"Bottom");if(options.find("small")){d.style.marginTop=(p-2)+"px";btype+="s";lim=2;}
else if(options.find("big")){d.style.marginTop=(p-10)+"px";btype+="b";lim=8;}
else d.style.marginTop=(p-5)+"px";for(i=lim;i>0;i--)
d.appendChild(CreateStrip(i,side,color,border,btype));el.style.paddingBottom=0;el.appendChild(d);}
function CreateStrip(index,side,color,border,btype){var x=CreateEl("b");x.className=btype+index;x.style.backgroundColor=color;x.style.borderColor=border;if(side=="left"){x.style.borderRightWidth="0";x.style.marginRight="0";}
else if(side=="right"){x.style.borderLeftWidth="0";x.style.marginLeft="0";}
return(x);}
function CreateEl(x){return(document.createElement(x));}
function FixIE(el){if(el.currentStyle!=null&&el.currentStyle.hasLayout!=null&&el.currentStyle.hasLayout==false)
el.style.display="inline-block";}
function SameHeight(selector,maxh){var i,v=selector.split(","),t,j,els=[],gap;for(i=0;i<v.length;i++){t=getElementsBySelector(v[i]);els=els.concat(t);}
for(i=0;i<els.length;i++){if(els[i].offsetHeight>maxh)maxh=els[i].offsetHeight;els[i].style.height="auto";}
for(i=0;i<els.length;i++){gap=maxh-els[i].offsetHeight;if(gap>0){t=CreateEl("b");t.className="niftyfill";t.style.height=gap+"px";nc=els[i].lastChild;if(nc.className=="niftycorners")
els[i].insertBefore(t,nc);else els[i].appendChild(t);}}}
function getElementsBySelector(selector){var i,j,selid="",selclass="",tag=selector,tag2="",v2,k,f,a,s=[],objlist=[],c;if(selector.find("#")){if(selector.find(" ")){s=selector.split(" ");var fs=s[0].split("#");if(fs.length==1)return(objlist);f=document.getElementById(fs[1]);if(f){v=f.getElementsByTagName(s[1]);for(i=0;i<v.length;i++)objlist.push(v[i]);}
return(objlist);}
else{s=selector.split("#");tag=s[0];selid=s[1];if(selid!=""){f=document.getElementById(selid);if(f)objlist.push(f);return(objlist);}}}
if(selector.find(".")){s=selector.split(".");tag=s[0];selclass=s[1];if(selclass.find(" ")){s=selclass.split(" ");selclass=s[0];tag2=s[1];}}
var v=document.getElementsByTagName(tag);if(selclass==""){for(i=0;i<v.length;i++)objlist.push(v[i]);return(objlist);}
for(i=0;i<v.length;i++){c=v[i].className.split(" ");for(j=0;j<c.length;j++){if(c[j]==selclass){if(tag2=="")objlist.push(v[i]);else{v2=v[i].getElementsByTagName(tag2);for(k=0;k<v2.length;k++)objlist.push(v2[k]);}}}}
return(objlist);}
function getParentBk(x){var el=x.parentNode,c;while(el.tagName.toUpperCase()!="HTML"&&(c=getBk(el))=="transparent")
el=el.parentNode;if(c=="transparent")c="#FFFFFF";return(c);}
function getBk(x){var c=getStyleProp(x,"backgroundColor");if(c==null||c=="transparent"||c.find("rgba(0, 0, 0, 0)"))
return("transparent");if(c.find("rgb"))c=rgb2hex(c);return(c);}
function getPadding(x,side){var p=getStyleProp(x,"padding"+side);if(p==null||!p.find("px"))return(0);return(parseInt(p));}
function getStyleProp(x,prop){if(x.currentStyle)
return(x.currentStyle[prop]);if(document.defaultView.getComputedStyle)
return(document.defaultView.getComputedStyle(x,'')[prop]);return(null);}
function rgb2hex(value){var hex="",v,h,i;var regexp=/([0-9]+)[, ]+([0-9]+)[, ]+([0-9]+)/;var h=regexp.exec(value);for(i=1;i<4;i++){v=parseInt(h[i]).toString(16);if(v.length==1)hex+="0"+v;else hex+=v;}
return("#"+hex);}
function Mix(c1,c2){var i,step1,step2,x,y,r=new Array(3);if(c1.length==4)step1=1;else step1=2;if(c2.length==4)step2=1;else step2=2;for(i=0;i<3;i++){x=parseInt(c1.substr(1+step1*i,step1),16);if(step1==1)x=16*x+x;y=parseInt(c2.substr(1+step2*i,step2),16);if(step2==1)y=16*y+y;r[i]=Math.floor((x*50+y*50)/100);r[i]=r[i].toString(16);if(r[i].length==1)r[i]="0"+r[i];}
return("#"+r[0]+r[1]+r[2]);}