
var isNav4,isIE4,isNav5,isIE5,isInitialized,minorVersion,isAllMaximised,showLayerCount=0;function stopEnterPressKey(evt)
{var evt=(evt)?evt:((event)?event:null);var node=(evt.target)?evt.target:((evt.srcElement)?evt.srcElement:null);if((evt.keyCode==13)&&(node.type=="text"))
{return false;}}
if(window.SymRealWinOpen!=null){window.open=window.SymRealWinOpen;}
window.onerror=errorHandler;function init(){if(isInitialized==null){isInitialized=true;isNav4=false;isIE4=false;isNav5=false;isIE5=false;isAllMaximised=false;var appName=navigator.appName;if(parseInt(navigator.appVersion.charAt(0))>=5){isNav5=appName=="Netscape";isIE5=appName.indexOf("Microsoft")!=-1;}
else if(parseInt(navigator.appVersion.charAt(0))>=4){isNav4=appName=="Netscape";isIE4=appName.indexOf("Microsoft")!=-1;}
minorVersion=0;if(navigator.appVersion.charAt(1)=='.'){minorVersion=parseInt(navigator.appVersion.charAt(2));}
if(typeof(allowUnload)=="undefined"){allowUnload=true;}
if(typeof(hasChanged)=="undefined"){hasChanged=false;}}}
function cancelEvent()
{init();if(isIE5||isIE4||(navigator.appName=="Microsoft Internet Explorer"))
{event.returnValue=false;event.cancelBubble=true;}
else
{event.preventDefault();event.stopPropagation();}}
function setBGc(theId,colour){var c;c=findElement(theId);if(c!=null){c.style.backgroundColor=colour;}}
function setIsAllMaximised(v){init();isAllMaximised=v;}
function setHasChanged(v){hasChanged=v;if(v==true){allowUnload=false;}
else{allowUnload=true;}}
function unloadMessage(){if(allowUnload==false){return'You will lose any unsaved edits';}
if(typeof(hasChanged)=="undefined"){hasChanged=false;}
setHasChanged(hasChanged);}
function findElement(id,theDocument){init();var theType;theType=typeof id;if(theType!='string'){return id;}
if(theDocument==null){theDocument=document;}
else{if(typeof(theDocument)=='string'){theDocument=getElement(theDocument);if(theDocument==null){return null;}}}
id=id.toUpperCase();var elm=theDocument.getElementById(id);return elm;}
function getElement(thePath,theObject){init();if(theObject==null){theObject=window;}
var pos;pos=thePath.indexOf(".");if(pos!=-1){var name,aPath;name=thePath.substring(0,pos);aPath=thePath.substring(pos+1);aObject=theObject[name];if(typeof(aObject)=="undefined"){alert("the object "+name+" is not found");return null;}
return getElement(aPath,aObject);}
else{aObject=theObject[thePath];if(typeof(aObject)=="undefined"){alert("the object "+thePath+" is not found");return null;}
return aObject;}}
function errorHandler(){return true;}
function WindowOpener(aURL,aName,theFeatures,atX,atY){callWindow(aURL,aName,theFeatures,atX,atY);}
function callWindow(aURL,aName,theFeatures,atX,atY){init();if(atX==null||atX<0)atX=0;if(atY==null||atY<0)atY=0;var temp=aURL+"";if(temp!=""){var now=new Date();if(temp.indexOf("?")!=-1){temp+="&TIMESTAMP="+now.getMilliseconds();}
else{temp+="?TIMESTAMP="+now.getMilliseconds();}
if(aName!=null){aName+="";while(aName.indexOf("@")!=-1||aName.indexOf("~")!=-1){aName=aName.replace("@","_");aName=aName.replace("~","_");}}}
if(isIE4||isIE5){if(aName!=null){aName+="";while(aName.indexOf(" ")!=-1){aName=aName.replace(" ","_");}}}
if(isIE4){temp2=theFeatures+',left='+atX+',top='+atY;}
else{temp2=theFeatures+',screenX='+atX+',screenY='+atY;}
var aWindow;aWindow=open(temp,aName,temp2);if(aWindow!=null){aWindow.focus();}
return aWindow;}
function wo(aURL,aName,width,height,theFeatures,maximise){init();atX=0;var maxWidth=screen.width;if(screen.availWidth!=null){maxWidth=screen.availWidth;}
var maxHeight=screen.height;if(screen.availHeight!=null){maxHeight=screen.availHeight;}
if(typeof(maximise)=='undefined'){maximise=isAllMaximised;}
maxWidth-=20;maxHeight-=30;var vMargin=6;var hMargin=6;if(width>maxWidth||maximise){width=maxWidth;}
if(height>maxHeight||maximise){height=maxHeight;}
if(width>0){atX=(maxWidth-width)/2+(vMargin)/2;theFeatures+=",width="+width;}
atY=0;if(height>0){atY=(maxHeight-height)/2+(hMargin)/2;theFeatures+=",height="+height;}
var w;w=callWindow(aURL,aName,theFeatures,atX,atY);return w;}
function won(aURL,aName,width,height,maximise){wo(aURL,aName,width,height,"toolbar=yes,location=yes,directories=yes,resizable=yes,menubar=yes,scrollbars=yes,status=yes",maximise);}
function wosn(aURL,aName,width,height,maximise){cwsn(aURL,aName,width,height);}
function cwsn(aURL,aName,width,height,maximise){return wo(aURL,aName,width,height,"toolbar=no,location=no,directories=no,resizable=yes,menubar=no,scrollbars=yes,status=no",maximise);}
function wosy(aURL,aName,width,height,maximise){cwsy(aURL,aName,width,height,maximise);}
function cwsy(aURL,aName,width,height,maximise){return wo(aURL,aName,width,height,"toolbar=no,location=no,directories=no,resizable=yes,menubar=no,scrollbars=yes,status=yes",maximise);}
function wmod(aURL,aName,width,height){if(window.showModalDialog){return window.showModalDialog(aURL,aName,'dialogHeight:'+height+'px;dialogWidth:'+width+'px;status:no;resizable:no;toolbar:no;location:no;directories:no;menubar:no;scrollbars:yes');}
else{return wo(aURL,aName,width,height,"toolbar=no,location=no,directories=no,resizable=yes,menubar=no,scrollbars=yes,status=no,modal=yes");}}
function setStyleVisible(theId,show){var aElement;aElement=findElement(theId);if(aElement!=null){if(show!=false){show=true;}
if(isNav4&&isNav5==false){if(show){aElement.visibility="show";}
else{aElement.visibility="hide";}}
else{if(show){aElement.style.visibility="visible";}
else{aElement.style.visibility="hidden";}}}}
function isStyleVisible(theId){var aElement;aElement=findElement(theId);if(aElement!=null){if(isNav4&&isNav5==false){if(aElement.visibility=="hide"){return false;}
else{return true;}}
else{if(aElement.style.visibility=="hidden"){return false;}
else{return true;}}}
return false;}
function setY(theId,px){var aElement;aElement=findElement(theId);if(aElement!=null){if(isNav5){aElement.style.top=px;}
else if(isNav4){aElement.top=px;}
else{aElement.style.posTop=px;}}}
function setX(theId,thePoint){var aElement;aElement=findElement(theId);if(aElement!=null){if(isNav5){aElement.style.left=thePoint;}
else if(isNav4){aElement.left=thePoint;}
else{aElement.style.posLeft=thePoint;}}}
function setZ(theId,theLevel){var aElement;aElement=findElement(theId);if(aElement!=null)
{if(theLevel>0)
{aElement.style.position="absolute";aElement.style.zIndex=theLevel;}
else
{aElement.style.zIndex=0;aElement.style.position="static";}}}
function getX(theId){var aElement;aElement=findElement(theId);var x;if(aElement==null){x=0;}
else if(aElement.X!=null){x=aElement.X;}
else if(aElement.pageX!=null){x=aElement.pageX;}
else if(aElement.x!=null){x=aElement.x;}
else if(isNav5){x=aElement.style.left;}
else if(isNav4){x=aElement.left;}
else if(aElement.style!=null){x=aElement.style.posLeft;}
if(x==''||x==null||typeof(x)=="undefined"){var el=aElement;for(var lx=0;el!=null;el=el.offsetParent){lx+=el.offsetLeft;}
x=lx;}
else{x+=getScrollX();}
if(x==null||typeof(x)=="undefined"){x=0;}
return x;}
function getEventY(event){init();if(isNav4){return event.pageY;}
else{var y;y=event.clientY;y+=document.body.scrollTop;return y;}}
function getEventX(event){init();var x;if(isNav4){x=event.pageX;}
else{x=event.clientX;}
var sx=getScrollX();x+=sx;return x;}
function getY(theId){var aElement;aElement=findElement(theId);var y;if(aElement==null){y=0;}
else if(aElement.Y!=null){y=aElement.Y;}
else if(aElement.pageY!=null){y=aElement.pageY;}
else if(aElement.y!=null){y=aElement.y;}
else if(isNav5&&aElement.style!=null){y=aElement.style.top;}
else if(isNav4){y=aElement.top;}
else if(aElement.style!=null){y=aElement.style.posTop;}
if(y==''||y==null||typeof(y)=="undefined"){var el=aElement;var ly=0
for(;el!=null;el=el.offsetParent)ly+=el.offsetTop;y=ly;}
if(y==null||typeof(y)=="undefined"){y=0;}
return y;}
function getScreenWidth(){var maxWidth=screen.width;if(screen.availWidth!=null){maxWidth=screen.availWidth;}
maxWidth-=20;return maxWidth;}
function getScreenHeight(){var maxHeight=screen.height;if(screen.availHeight!=null){maxHeight=screen.availHeight;}
maxHeight-=30;return maxHeight;}
function adjustWindowSize(width,height){var maxWidth=getScreenWidth();var maxHeight=getScreenHeight();var vMargin=6;var hMargin=6;if(width>maxWidth){width=maxWidth;}
if(height>maxHeight){height=maxHeight;}
top.resizeTo(width,height);if(width>0){atX=(maxWidth-width)/2+(vMargin)/2;}
atY=0;if(height>0){atY=(maxHeight-height)/2+(hMargin)/2;}
top.moveTo(atX,atY);}
function getScrollY(){if(isNav4||isNav5||isIE4||isIE5){return 0;}
else{return window.document.body.scrollTop;}}
function getScrollX(){if(isIE5){return 0;}
else{return window.document.body.scrollLeft;}}
function getScrollHeight(){if(isNav4){return window.pageXOffset;}
else{return window.document.body.scrollLeft;}}
function getWindowHeight(){init();if(isNav4||isNav5){return window.innerHeight;}
else{return window.document.body.offsetHeight;}}
function getWindowWidth(){init();if(isNav4||isNav5){return window.innerWidth;}
else{return window.document.body.offsetWidth;}}
function closeWin(){if(window.opener!=null)
window.opener.doRefresh();window.close()}
function closeAndRefresh(win){win.attachEvent("onunload",closeWin);}
function checkCurtain()
{var isFnd=false;if(window.hasHTMLTextEditor)
{var elems=document.getElementsByTagName("INPUT");for(var i=0;isFnd==false&&i<elems.length;i++)
{var elm=elems[i];if(elm.id.substr(0,15)=="ONLOAD_COMPLETE")
{if(elm.value=='false')
{isFnd=true;}}}}
if(isFnd==false)
{showCurtain(false);}}
function showCurtain(flag,theWindow){init();if(theWindow==null)theWindow=window;if(theWindow.showLayer!=null){var curtain,pleaseWait;curtain=theWindow.findElement('CURTAIN');pleaseWait=findElement("PLEASEWAIT");if(curtain!=null&&pleaseWait!=null){if(flag==true){var scrollX;scrollX=theWindow.document.body.scrollWidth;var scrollY;scrollY=theWindow.document.body.scrollHeight;curtain.style.height=scrollY;curtain.style.width=scrollX;theWindow.showLayer(curtain,true);centrePleaseWait(pleaseWait);}
else{theWindow.showLayer(curtain,false);theWindow.setStyleVisible(pleaseWait,false);}}}}
function centrePleaseWait(pleaseWait,theWindow){init();if(theWindow==null)theWindow=window;if(pleaseWait==null)pleaseWait=findElement("PLEASEWAIT");centreLayer(pleaseWait,theWindow);theWindow.setStyleVisible(pleaseWait,true);}
function showPleaseWait(){var y;y=getScrollY();y+=getWindowHeight()/2-150/2;var x;x=getScrollX();x+=getWindowWidth()/2-300/2;var pleaseWait;pleaseWait=findElement("PLEASEWAIT");if(pleaseWait!=null){setY(pleaseWait,y);setX(pleaseWait,x);setStyleVisible(pleaseWait,true)
return;}}
function hidePleaseWait(){var pleaseWait;pleaseWait=findElement("PLEASEWAIT");if(pleaseWait!=null){setStyleVisible(pleaseWait,false);}}
function encodeHex(val){var len;var it;var tot;var base;var remain;var tmp;var hexvals;hexvals="0123456789ABCDEF"
val=""+val;len=val.length;if(len<1)
return 0;it=0;tot="";while(it<len){tmp=charToAscii(val.charAt(it));base=tmp/16;remain=tmp%16;tot=tot+hexvals.charAt(base)+hexvals.charAt(remain);it=it+1;}
return tot;}
function decodeHex(val){var len;var it;var tot;var L;var H;var tmp;var hexvals;hexvals="0123456789ABCDEF"
val=""+val;len=val.length;if(len<1)
return 0;it=0;tot="";while(it<len){H=val.charAt(it);if(it+1<len){L=val.charAt(it+1);}
else{L=H;H=0;}
posH=hexvals.indexOf(H);posL=hexvals.indexOf(L);if(posH<0||posL<0)
return"";tmp=(posH*16)+posL;tot=tot+asciiToChar(tmp);it=it+2;}
return tot;}
function charToAscii(val){var symbols=" !\"#$%&'()*+,-./0123456789:;<=>?@";var loAZ="abcdefghijklmnopqrstuvwxyz";symbols+=loAZ.toUpperCase();symbols+="[\\]^_`";symbols+=loAZ;symbols+="{|}~";var loc;loc=symbols.indexOf(val);if(loc>-1){return(32+loc);}
return(0);}
function asciiToChar(val){var symbols=" !\"#$%&'()*+,-./0123456789:;<=>?@";var loAZ="abcdefghijklmnopqrstuvwxyz";symbols+=loAZ.toUpperCase();symbols+="[\\]^_`";symbols+=loAZ;symbols+="{|}~";if(val>=32){return symbols.charAt(val-32);}
return(0);}
function getFieldValue(theID){var theElem;theElem=findElement(theID);if(theElem!=null){if(theElem.type=='checkbox'){return theElem.checked;}
return theElem.value;}
return null;}
function updateFieldValue(theID,theValue,theDocument){var theElem;if(theDocument==null){theDocument=document;}
theElem=findElement(theID,theDocument);if(theElem!=null){if(theElem.type=='checkbox'){theElem.checked=theValue;}
else{theElem.value=theValue;}}}
function updateValue(theID,theValue,theDocument){var theElem;var val;if(theDocument==null){theDocument=document;}
theElem=findElement(theID,theDocument);if(theElem!=null){val=decodeHex(theValue);if(theElem.type=='checkbox'){theElem.checked=val;}
else{theElem.value=val;}}}
function getEncodedHexFieldValue(theID){var val;val=getFieldValue(theID);if(val!=null){return encodeHex(val);}
return"";}
function getDecodedHexFieldValue(theID){var val;val=getFieldValue(theID);if(val!=null){return decodeHex(val);}
return null;}
function doRefresh(theDocument){window.onbeforeunload=null;try
{var refresher;if(theDocument==null){theDocument=document;}
else{if(typeof(theDocument)=='string'){theDocument=getElement(theDocument);if(theDocument==null){theDocument=document;}}}
var theWindow;if(theDocument!=null){if(theDocument.defaultView!=null){theWindow=theDocument.defaultView;}
else{theWindow=theDocument.parentWindow;}}
if(theWindow==null)theWindow=window;if(theWindow.refreshHandler!=null)
{theWindow.refreshHandler();return;}
showCurtain(true,theWindow);if(theWindow.preRefresh!=null){theWindow.preRefresh();}
refresher=findElement('REFRESH',theDocument);if(refresher!=null){if(refresher.submit!=null||refresher.tagName=='FORM'){refresher.submit();}
else{if(refresher.form!=null)
refresher.form.submit();else{if(refresher.click!=null)
refresher.click();else
theDocument.location.reload();}}}
else{theDocument.location.reload();}}
catch(e)
{showCurtain(false);alert("could not refresh screen {"+e+"}");}}
function doUpdate(theDocument){window.onbeforeunload=null;try
{var refresher;if(theDocument==null){theDocument=document;}
else{if(typeof(theDocument)=='string'){theDocument=getElement(theDocument);if(theDocument==null){theDocument=document;}}}
var theWindow;if(theDocument!=null){if(theDocument.defaultView!=null){theWindow=theDocument.defaultView;}
else{theWindow=theDocument.parentWindow;}}
if(theWindow==null)theWindow=window;showCurtain(true,theWindow);refresher=findElement('UPDATE',theDocument);if(refresher!=null){if(refresher.click!=null)
{refresher.click();}
else if(refresher.submit!=null||refresher.tagName=='FORM'){alert("form submit");refresher.submit();}
else{if(refresher.form!=null)
refresher.form.submit();else{theDocument.location.reload();}}}
else{theDocument.location.reload();}}
catch(e)
{showCurtain(false);alert("could not udpate screen {"+e+"}");}}
function showCombos(flag){if(window.nativeCombos=="Y")
{var list;list=document.getElementsByTagName("SELECT");for(var i=0;i<list.length;i++){var element;element=list[i];if(flag==true){element.style.visibility="";}
else{setStyleVisible(element,false);}}}}
function getScrollXY(){var scrOfY=0;if(typeof(window.pageYOffset)=='number'){scrOfY=window.pageYOffset;}else if(document.body&&(document.body.scrollLeft||document.body.scrollTop)){scrOfY=document.body.scrollTop;}else if(document.documentElement&&(document.documentElement.scrollLeft||document.documentElement.scrollTop)){scrOfY=document.documentElement.scrollTop;}
return scrOfY;}
function centreLayer(theId,theWindow){init();aElement=findElement(theId);if(aElement!=null){if(theWindow==null)theWindow=window;var windowX;windowX=theWindow.document.body.clientWidth;var windowY;windowY=theWindow.document.body.clientHeight;var windowScrollY=getScrollXY();var y;y=getScrollY();y+=windowScrollY+windowY/2-aElement.offsetHeight/2;var x;x=getScrollX();x+=windowX/2-aElement.offsetWidth/2;aElement.style.top=y;aElement.style.left=x;}}
function showLayer(theId,flag){init();if(flag==true){showLayerCount=showLayerCount+1
if(isNav4==false&&isNav5==false){if(showLayerCount==1){showCombos(false);}}
setStyleVisible(theId,true);}
else{showLayerCount=showLayerCount-1
setStyleVisible(theId,false);if(isNav4==false&&isNav5==false){if(showLayerCount<=0){showCombos(true);setHasChanged(hasChanged);showLayerCount=0;}}}}
var popup=new Popup();function Popup(){var lastID;var lastMouseX;var lastMouseY;var timer;this.toggle=popupToggle;this.hide=popupHide;this.mouseOut=popupMouseOut;this.mouseIn=popupMouseIn;this.getId=popupGetId;}
function popupGetId(){return this.lastID;}
function popupToggle(theID){init();if(this.lastID!=null){var theLast;theLast=findElement(this.lastID);if(theLast!=null){setStyleVisible(theLast,false)}
if(this.lastID==theID){this.lastID=null;return;}}
this.lastID=theID;if(theID=='')return;var theDiv;theDiv=findElement(theID);setStyleVisible(theDiv,true);setY(theDiv,this.lastMouseY);setX(theDiv,this.lastMouseX);}
function popupHide(){init();var theID=this.lastID;if(theID==null)return;this.lastID=null;var theLast;theLast=findElement(theID);if(theLast!=null){setStyleVisible(theLast,false)}}
function popupMouseOut(theID){if(this.timer!=null)clearTimeout(this.timer);this.timer=setTimeout('popup.hide()',1000);}
function popupMouseIn(theID,sourceItem,offsetY,offsetX){if(this.timer!=null)clearTimeout(this.timer);if(this.lastID!=null&&this.lastID!=theID){var theLast;theLast=findElement(this.lastID);if(theLast!=null){setStyleVisible(theLast,false)}
this.lastID=null;}
if(typeof(offsetY)=='undefined'){offsetY=-10;}
if(typeof(offsetX)=='undefined'){offsetX=10;}
if(sourceItem!=null){if(sourceItem.type=='click'){this.lastMouseY=getEventY(sourceItem);this.lastMouseX=getEventX(sourceItem);}
else{this.lastMouseY=getY(sourceItem);this.lastMouseX=getX(sourceItem);}}
this.lastMouseY+=offsetY;this.lastMouseX+=offsetX;if(this.lastID==null){this.toggle(theID)}}
function getParameters(){var args=new Object();var query=location.search.substring(1);var pairs=query.split("&");for(var i=0;i<pairs.length;i++){var pos=pairs[i].indexOf('=');if(pos==-1)continue;var argname=pairs[i].substring(0,pos);var value=pairs[i].substring(pos+1);args[argname]=unescape(value);}
return args;}
function checkChoices(id,key,choiceKey){var mcInput=findElement(id);var checkBox=findElement(key);var searchValue=","+choiceKey+",";if(checkBox.checked){if(mcInput.value.indexOf(searchValue)==-1){mcInput.value+=searchValue;}}
else{mcInput.value=mcInput.value.replace(searchValue,"");}}
function trim(TRIM_VALUE){if(TRIM_VALUE.length<1){return"";}
TRIM_VALUE=rTrim(TRIM_VALUE);TRIM_VALUE=lTrim(TRIM_VALUE);if(TRIM_VALUE==""){return"";}
else{return TRIM_VALUE;}}
function rTrim(VALUE){var w_space=String.fromCharCode(32);var v_length=VALUE.length;var strTemp="";if(v_length<0){return"";}
var iTemp=v_length-1;while(iTemp>-1){if(VALUE.charAt(iTemp)==w_space){}
else{strTemp=VALUE.substring(0,iTemp+1);break;}
iTemp=iTemp-1;}
return strTemp;}
function selectAllCheckboxes(prefix,suffix,fg,theDocument){init();if(theDocument==null){theDocument=document;}
else{if(typeof(theDocument)=='string'){theDocument=getElement(theDocument);if(theDocument==null){return null;}}}
if(isNav4||isNav5){for(var i=0;i<theDocument.forms.length;i++){var aForm;aForm=theDocument.forms[i];for(var e=0;e<aForm.elements.length;e++){var theElem;theElem=aForm.elements[e];selectCheckboxElem(theElem,prefix,suffix,fg);}}}
else{if(!theDocument.all)return null;for(var j=0;j<theDocument.all.length;j++){theElem=theDocument.all[j];selectCheckboxElem(theElem,prefix,suffix,fg);}}
return null;}
function selectCheckboxElem(theElem,prefix,suffix,fg){var id=theElem.name;if(theElem.type=='checkbox'&&id&&id.length>0&&id.substring(0,prefix.length)==prefix)
{if(suffix)
{var start=id.length-suffix.length;var tmpSuffix=id.substr(start,suffix.length);if(tmpSuffix==suffix)
{updateFieldValue(theElem,fg);}}
else
{updateFieldValue(theElem,fg);}}}
function lTrim(VALUE){var w_space=String.fromCharCode(32);if(v_length<1){return"";}
var v_length=VALUE.length;var strTemp="";var iTemp=0;while(iTemp<v_length){if(VALUE.charAt(iTemp)==w_space){}
else{strTemp=VALUE.substring(iTemp,v_length);break;}
iTemp=iTemp+1;}
return strTemp;}
var ajax=false;if(navigator.appName=="Microsoft Internet Explorer")
{ajax=new ActiveXObject("Microsoft.XMLHTTP");}
else
{ajax=new XMLHttpRequest();}
function ajaxRequest(url)
{ajax.open("GET",url);ajax.onreadystatechange=ajaxResponse;ajax.send(null);}
function ajaxResponse()
{if(ajax.readyState==4)
doRefresh();}