
var popUp;function OpenCalendar(idname,postBack)
{popUp=window.open('Calendar.aspx?formname='+document.forms[0].name+'&id='+idname+'&selected='+document.forms[0].elements[idname].value+'&postBack='+postBack,'popupcal','width=160,height=180,left=200,top=250');}
function SetDate(formName,id,newDate,postBack)
{eval('var theform = document.'+formName+';');popUp.close();theform.elements[id].value=newDate;if(postBack)
__doPostBack(id,'');}
function SetCookie(cookiename,cookievalue)
{document.cookie=cookiename+'='+cookievalue+';path=/';}
function ReadCookie(cookiename)
{var theCookie=""+document.cookie;var ind=theCookie.indexOf(cookiename);var ind1=theCookie.indexOf(';',ind);if(ind==-1||cookiename=="")return"";if(ind1==-1)ind1=theCookie.length;return unescape(theCookie.substring(ind+cookiename.length+1,ind1));}
function shade(id)
{var element=document.getElementById(id);switch(element.style.display)
{case"none":element.style.display="inline";break;case"inline":element.style.display="none";break;}}
function OpenHelpWindow(modname)
{window.open("../UI/Help.aspx?mod="+modname,null,"width=600,height=300,menubar=no,location=no,resizable=yes,scrollbars=yes,status=no");}
var Behaviour={list:new Array,register:function(sheet){Behaviour.list.push(sheet);},start:function(){Behaviour.addLoadEvent(function(){Behaviour.apply();});},apply:function(){for(h=0;sheet=Behaviour.list[h];h++){for(selector in sheet){list=document.getElementsBySelector(selector);if(!list){continue;}
for(i=0;element=list[i];i++){sheet[selector](element);}}}},addLoadEvent:function(func){var oldonload=window.onload;if(typeof window.onload!='function'){window.onload=func;}else{window.onload=function(){oldonload();func();}}}}
Behaviour.start();function getAllChildren(e){return e.all?e.all:e.getElementsByTagName('*');}
document.getElementsBySelector=function(selector){if(!document.getElementsByTagName){return new Array();}
var tokens=selector.split(' ');var currentContext=new Array(document);for(var i=0;i<tokens.length;i++){token=tokens[i].replace(/^\s+/,'').replace(/\s+$/,'');;if(token.indexOf('#')>-1){var bits=token.split('#');var tagName=bits[0];var id=bits[1];var element=document.getElementById(id);if(tagName&&element.nodeName.toLowerCase()!=tagName){return new Array();}
currentContext=new Array(element);continue;}
if(token.indexOf('.')>-1){var bits=token.split('.');var tagName=bits[0];var className=bits[1];if(!tagName){tagName='*';}
var found=new Array;var foundCount=0;for(var h=0;h<currentContext.length;h++){var elements;if(tagName=='*'){elements=getAllChildren(currentContext[h]);}else{elements=currentContext[h].getElementsByTagName(tagName);}
for(var j=0;j<elements.length;j++){found[foundCount++]=elements[j];}}
currentContext=new Array;var currentContextIndex=0;for(var k=0;k<found.length;k++){if(found[k].className&&found[k].className.match(new RegExp('\\b'+className+'\\b'))){currentContext[currentContextIndex++]=found[k];}}
continue;}
if(token.match(/^(\w*)\[(\w+)([=~\|\^\$\*]?)=?"?([^\]"]*)"?\]$/)){var tagName=RegExp.$1;var attrName=RegExp.$2;var attrOperator=RegExp.$3;var attrValue=RegExp.$4;if(!tagName){tagName='*';}
var found=new Array;var foundCount=0;for(var h=0;h<currentContext.length;h++){var elements;if(tagName=='*'){elements=getAllChildren(currentContext[h]);}else{elements=currentContext[h].getElementsByTagName(tagName);}
for(var j=0;j<elements.length;j++){found[foundCount++]=elements[j];}}
currentContext=new Array;var currentContextIndex=0;var checkFunction;switch(attrOperator){case'=':checkFunction=function(e){return(e.getAttribute(attrName)==attrValue);};break;case'~':checkFunction=function(e){return(e.getAttribute(attrName).match(new RegExp('\\b'+attrValue+'\\b')));};break;case'|':checkFunction=function(e){return(e.getAttribute(attrName).match(new RegExp('^'+attrValue+'-?')));};break;case'^':checkFunction=function(e){return(e.getAttribute(attrName).indexOf(attrValue)==0);};break;case'$':checkFunction=function(e){return(e.getAttribute(attrName).lastIndexOf(attrValue)==e.getAttribute(attrName).length-attrValue.length);};break;case'*':checkFunction=function(e){return(e.getAttribute(attrName).indexOf(attrValue)>-1);};break;default:checkFunction=function(e){return e.getAttribute(attrName);};}
currentContext=new Array;var currentContextIndex=0;for(var k=0;k<found.length;k++){if(checkFunction(found[k])){currentContext[currentContextIndex++]=found[k];}}
continue;}
if(!currentContext[0]){return;}
tagName=token;var found=new Array;var foundCount=0;for(var h=0;h<currentContext.length;h++){var elements=currentContext[h].getElementsByTagName(tagName);for(var j=0;j<elements.length;j++){found[foundCount++]=elements[j];}}
currentContext=found;}
return currentContext;}
function HttpRequest()
{var xmlhttp;var t=null;var error;var errorMsg;var url;var request;var requesttype="GET";var sync=true;var timeout="200";var response;this.setRequestType=setRequestType;this.getRequestType=getRequestType;this.setRequest=setRequest;this.getRequest=getRequest;this.setUrl=setUrl;this.getUrl=getUrl;this.setSync=setSync;this.getSync=getSync;this.setTimeout=setTimeout;this.getTimeout=getTimeout;this.getResponse=getResponse;this.getErrorMsg=getErrorMsg;this.getReadyState=getReadyState;this.init=init;this.callInProgress=callInProgress;this.prepare=prepare;this.stateChangeCallback=stateChangeCallback;this.send=send;function setRequestType(val){requesttype=val;}
function getRequestType(){return requesttype;}
function setRequest(val){request=val;}
function getRequest(){return request;}
function setUrl(val){url=val;};function getUrl(){return url;}
function setSync(val){sync=val;}
function getSync(){return sync;}
function setTimeout(val){timeout=val;}
function getTimeout(){return timeout;}
function getResponse(){return response;}
function getErrorMsg(){return errorMsg;}
function getReadyState(){return xmlhttp.readyState;}
function init()
{try{xmlhttp=new XMLHttpRequest();}catch(e){var MSXML_XMLHTTP_OBJECTS=new Array('MSXML2.XMLHTTP.5.0','MSXML2.XMLHTTP.4.0','MSXML2.XMLHTTP.3.0','MSXML2.XMLHTTP','Microsoft.XMLHTTP');var success=false;for(var i=0;i<MSXML_XMLHTTP_OBJECTS.length&&!success;i++)
{try{xmlhttp=new ActiveXObject(MSXML_XMLHTTP_OBJECTS[i]);success=true;}catch(e){}}
if(!success){alert('Error: Your browser does not meet the minimum requirements.');}}}
function callInProgress()
{switch(xmlhttp.readyState)
{case 1:case 2:case 3:return true;break;case 4:return false;break;}}
function prepare()
{if(callInProgress()){xmlhttp.abort();}
xmlhttp.onreadystatechange=stateChangeCallback;xmlhttp.open(requesttype,url,sync);}
function stateChangeCallback()
{if(xmlhttp.readyState==4){if(xmlhttp.status==200){response=xmlhttp.responseText;}
else{error=true;errorMsg='Could not retrieve the xml data.';}}}
function send()
{if(!xmlhttp){init();}
prepare();xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");xmlhttp.send(request);}}