
var Common=function()
{this.vShowLoading=false;this.vControlsElements=[];this.tLoading='Loading data...';this.tB=' b';this.tKb=' Kb';this.tMb=' Mb';this.tNoDataFound='No data found!';this.vPicPath='/admin/images/toolbar/';this.vPicSpacer='/images/spacer.gif'
this.vPicWidth=18;this.vError='';this.vMainClassName='';this.vId=null;this.vIdElement=null;this.vControlId=null;this.vJSDebug=false;this.vDebugLog='';this.vDebugLastTime;this.vDebugStartTime;}
Common.prototype.fError=function()
{alert('Control Error: '+this.vError);}
Common.prototype.fShowLoading=function()
{if(!this.vControlsElements['Loading'])
{var tDiv=document.createElement('DIV');var tText=document.createTextNode(this.tLoading);tDiv.appendChild(tText);tDiv.style.position='absolute';tDiv.style.top=window.scrollY+'px';tDiv.style.left=window.scrollX+'px';tDiv.style.color='white';tDiv.style.backgroundColor='red';tDiv.style.padding='5px';tDiv.style.border='1px solid white';tDiv.style.fontWeight='bold';document.body.appendChild(tDiv);this.vControlsElements['Loading']=tDiv;}}
Common.prototype.fNoShowLoading=function()
{if(this.vControlsElements['Loading'])
document.body.removeChild(this.vControlsElements['Loading']);this.vControlsElements['Loading']=null;}
Common.prototype.fLockControl=function()
{if(!this.vControlLocked)
{this.vControlLocked=true;if(this.vControlIdElement)
{this.vControlIdElement.className=this.vMainClassName+'LockTree';if(this.vShowLoading)
{var tDiv=document.createElement('DIV');tDiv.id=this.vTreeLoadingId;tDiv.className=this.vMainClassName+'loading';tDiv.innerHTML=this.tLoading;document.body.appendChild(tDiv);}}
else
{if(this.vShowLoading)
{var tDiv=document.createElement('DIV');tDiv.id=this.vTreeLoadingId;tDiv.className=this.vMainClassName+'loading';tDiv.innerHTML=this.tLoading;document.body.appendChild(tDiv);}}}}
Common.prototype.fLockElements=function()
{if(this.vControlIdElement)
{for(var i in this.vControlsElements)
this.vControlsElements[i].fLockControl();var hh=this.vControlIdElement.getElementsByTagName('INPUT');for(var i=0;i<hh.length;i++)
{hh[i].setAttribute('oldDisabled',hh[i].getAttribute('disabled'));hh[i].setAttribute('disabled',1);}
hh=this.vControlIdElement.getElementsByTagName('TEXTAREA');for(var i=0;i<hh.length;i++)
{hh[i].setAttribute('oldDisabled',hh[i].getAttribute('disabled'));hh[i].setAttribute('disabled',1);}
this.vControlIdElement.className=this.vMainClassName+'tablocked';}}
Common.prototype.fLockElements=function()
{if(this.vControlIdElement)
{for(var i in this.vControlsElements)
this.vControlsElements[i].fLockControl();var hh=this.vControlIdElement.getElementsByTagName('INPUT');for(var i=0;i<hh.length;i++)
{hh[i].setAttribute('oldDisabled',hh[i].getAttribute('disabled'));hh[i].setAttribute('disabled',1);}
hh=this.vControlIdElement.getElementsByTagName('TEXTAREA');for(var i=0;i<hh.length;i++)
{hh[i].setAttribute('oldDisabled',hh[i].getAttribute('disabled'));hh[i].setAttribute('disabled',1);}}}
Common.prototype.fUnLockElements=function()
{this.vControlLocked=false;if(this.vControlIdElement)
{for(var i in this.vControlsElements)
this.vControlsElements[i].fUnLockControl();var hh=this.vControlIdElement.getElementsByTagName('INPUT');for(var i=0;i<hh.length;i++)
hh[i].disabled=hh[i].getAttribute('oldDisabled');hh=this.vControlIdElement.getElementsByTagName('TEXTAREA');for(var i=0;i<hh.length;i++)
hh[i].disabled=hh[i].getAttribute('oldDisabled');}}
Common.prototype.fGetObjCount=function(Obj)
{var counter=0;for(var i in Obj)
counter++;return counter;}
Common.prototype.fGetControlCount=function()
{var counter=0;for(var i in this.vControls)
if((this.vControls[i]['visible'])&&(i!='new')&&(i!='tree'))
counter++;return counter;}
Common.prototype.fSerialize=function()
{var o=arguments[0];if(o.length)
{for(var i=0;i<o.length;i++)
{this.ParseProp(o,i);}}
else
{for(property in o)
{this.fParseProp(o,property);}}
this.tData=this.tData.substr(0,(this.tData.length-1));return this.tData;}
Common.prototype.fParseProp=function()
{var o=arguments[0];var p=arguments[1];if(typeof o[p]!='function')
{switch(typeof o[p])
{case'number':var len=String(o[p]).length;this.tData+='n:'+p+':'+len+':'+o[p];break;case'string':var len=o[p].length;this.tData+='s:'+p+':'+len+':'+o[p];break;case'boolean':var b=(o[p])?1:0;this.tData+='b:'+p+':'+b;break;case'object':if(o[p]!=null)
{var objdata=this.fSerialize(o[p]);var len=objdata.length;var type=o[p].constructor.toString();var sindex=type.indexOf(' ')+1;var sindex2=type.indexOf('(');type=type.substring(sindex,sindex2);this.tData+='o:'+type+':'+p+':'+len+':'+objdata;}
break;}
this.tData+=':';}}
Common.prototype.fUnserialize=function()
{var data=arguments[0];var o=arguments[1];if(data[0]!='s'&&data[0]!='b'&&data[0]!='o'&&data[0]!='n')
return o;var i;for(i=0;i<data.length;i++)
{var mode=GetNextString();var d=null;var propname;if(mode=='s')
{propname=GetNextString();var len=Number(GetNextString());d=data.substr(i,len);i+=len;}
else if(mode=='n')
{propname=GetNextString();var len=Number(GetNextString());d=Number(data.substr(i,len));i+=len;}
else if(mode=='b')
{propname=GetNextString();d=(data[this.ti]==1)?true:false;i++;}
else if(mode=='o')
{var type=GetNextString();propname=GetNextString();var len=Number(GetNextString());var odata=data.substr(i,len);eval('d = new '+type);d=this.fUnserialize(odata,d);i+=len;}
o[propname]=d;}
return o;function GetNextString()
{var n=data.indexOf(':',i);var strdata=data.substring(i,n);i+=strdata.length+1;return strdata;}}
Common.prototype.fGetNextString=function()
{var data=arguments[0];var i=arguments[1];var n=data.indexOf(':',i);var strdata=data.substring(i,n);i+=strdata.length+1;alert(strdata);return strdata;}
Common.prototype.fSetCookie=function()
{var curCookie=arguments[0]+"="+escape(arguments[1])+((arguments[2])?"; expires="+
expires.toGMTString():"")+
((arguments[3])?"; path="+arguments[3]:"")+
((arguments[4])?"; domain="+arguments[4]:"")+
((arguments[5])?"; secure":"")
if((arguments[0]+"="+escape(arguments[1])).length<=4000)
document.cookie=curCookie
else
if(confirm("Cookie exceed 4KB!"))
document.cookie=curCookie}
Common.prototype.fGetCookie=function()
{var prefix=arguments[0]+"="
var cookieStartIndex=document.cookie.indexOf
(prefix)
if(cookieStartIndex==-1)
return null
var cookieEndIndex=document.cookie.indexOf(";",cookieStartIndex+prefix.length)
if(cookieEndIndex==-1)
cookieEndIndex=document.cookie.length
return unescape(document.cookie.substring(cookieStartIndex+prefix.length,cookieEndIndex))}
Common.prototype.a=function()
{if(this.vJSDebug)
{var dd=new Date;if(!this.vDebugStartTime)
this.vDebugStartTime=dd.getTime();this.vDebugLog+='+'+((dd.getTime()-this.vDebugStartTime)/1000)+(this.vDebugLastTime?(' + '+(dd.getTime()-this.vDebugLastTime)/1000):' + 0')+' '+arguments[0]+' '+'\n';this.vDebugLastTime=dd.getTime();}}
Common.prototype.sl=function()
{if(this.vJSDebug)
{alert(this.vDebugLog);this.vDebugLog='';this.vDebugStartTime='';}}
Common.prototype.fGetExtFromType=function()
{switch(arguments[0])
{case'image/pjpeg':case'image/jpeg':return'jpg';break;case'image/x-png':return'png';break;case'image/gif':return'gif';break;case'application/x-shockwave-flash':return'swf';break;}}
Common.prototype.fFormatSize=function()
{var size=arguments[0]||0;if(size>1048576)
size=Math.round(size/1048576)+this.tMb;else if(size>1024)
size=Math.round(size/1024)+''+this.tKb;else
size=size+this.tB;return size;}
Common.prototype.fTruncate=function()
{var s=arguments[0];var l=arguments[1];var sep=arguments[2]||'...';if(s)
{if(s.length>l)
{return s.substring(0,Math.ceil(l/2))+sep+s.substring(s.length-Math.ceil(l/2),s.length);}
else
return arguments[0];}
else
{return arguments[0];}}
Common.prototype.fExplode=function()
{var sep=arguments[0];var str=arguments[1];var res=[];var counter=0;while(str.indexOf(sep,0)>0)
{res[counter]=[];res[counter]['str']=str.substr(0,str.indexOf(sep,0)-sep.length);res[counter]['x']=1;str=str.substr(str.indexOf(sep,0)+sep.length,str.length);counter++;}
if(str!='')
{res[counter]=[];res[counter]['str']=str;res[counter]['x']=1;}
return res;}
var xAjax=function()
{this.vDebugHeight=100;this.vDebugHeightTitle=16;this.vDebugClassName='ajax_';this.vDebugWnd=null;this.vDebugWndContent=null;this.vDebugSeparator='<hr>';this.vMode=1;this.vDebugWndElementName='ajax_debug_wnd';this.vDebugContentElementName='ajax_debug_wnd_content';}
xAjax.prototype=new Common;xAjax.prototype.AJAXcreateRequestObject=function()
{var xmlHttp=false;try
{xmlHttp=new ActiveXObject('Msxml2.XMLHTTP');}
catch(e)
{try
{xmlHttp=new ActiveXObject('Microsoft.XMLHTTP');}
catch(e2)
{xmlHttp=false;}}
if(!xmlHttp&&typeof XMLHttpRequest!='undefined')
{xmlHttp=new XMLHttpRequest();}
return xmlHttp;}
xAjax.prototype.AJAXPostData=function()
{var AJAXhttp=this.AJAXcreateRequestObject();var p=this;if(!AJAXhttp)return false;AJAXhttp.onreadystatechange=function()
{if(AJAXhttp.readyState==4)
{p.AJAXresponseText=AJAXhttp.responseText;if(AJAXhttp.responseXML)
{p.vAJAXReceivedData=AJAXhttp.responseXML;p.AJAXprocessVars();p.AJAXprocessArrays(p.vAJAXReceivedData.firstChild);p.AJAXdebug();p.AJAXprocessExec();}
if(p.vAutoShow==true)
{p.fShow();}}}
AJAXhttp.open('POST',arguments[0],true);AJAXhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");AJAXhttp.send(this.AJAXurlEncodeData(arguments[1]));return true;}
xAjax.prototype.AJAXurlEncodeData=function(data)
{var query=[];if(data instanceof Object)
{for(var k in data)
{if(!(data[k]instanceof Function))
{if(data[k]instanceof Object)
{for(var j in data[k])
{if(data[k][j]instanceof Object)
{for(var i in data[k][j])
query.push(encodeURIComponent(k)+"["+j+"]["+i+"]="+encodeURIComponent(data[k][j][i]));}
else
query.push(encodeURIComponent(k)+"["+j+"]="+encodeURIComponent(data[k][j]));}}
else
query.push(encodeURIComponent(k)+"="+encodeURIComponent(data[k]));}}
return query.join('&');}
else
{return encodeURIComponent(data);}}
xAjax.prototype.AJAXprocessVars=function()
{if(this.vAJAXReceivedData)
{var tt=this.vAJAXReceivedData.getElementsByTagName('VarName');if(!tt)
tt=this.vAJAXReceivedData.getElementsByTagName('VN');if(tt)
{for(var i=0;i<tt.length;i++)
{for(var j=0;j<tt.item(i).attributes.length;j++)
{if(tt.item(i).attributes[j].name=='name'||tt.item(i).attributes[j].name=='n')
{var qq=tt.item(i).getElementsByTagName('data');if(!qq)
var qq=tt.item(i).getElementsByTagName('d');if((qq.item(0).attributes[0].name=='type'&&qq.item(0).attributes[0].value=='int')||(qq.item(0).attributes[0].name=='t'&&qq.item(0).attributes[0].value=='i'))
eval(tt.item(i).attributes[j].value+'='+(qq.item(0).childNodes.length?qq.item(0).childNodes[0].nodeValue:''));else if((qq.item(0).attributes[0].name=='type'&&qq.item(0).attributes[0].value=='string')||(qq.item(0).attributes[0].name=='t'&&qq.item(0).attributes[0].value=='s'))
{eval(tt.item(i).attributes[j].value+'=\''+(qq.item(0).childNodes.length?qq.item(0).childNodes[0].nodeValue:'')+'\'');}}}}}}}
xAjax.prototype.AJAXprocessArrays=function(x)
{var x=arguments[0];if(x)
{for(var i=0;i<x.childNodes.length;i++)
{var tt=x.childNodes[i];if(tt.tagName=='VarArrayName'||tt.tagName=='VAN')
{var nodeName=tt.getAttribute('name');if(!nodeName)
nodeName=tt.getAttribute('n');if(arguments[1])
{eval(arguments[1]+' = new Array');}
else
{eval(nodeName+' = new Array');}
for(var j=0;j<tt.childNodes.length;j++)
{if(tt.childNodes[j].tagName=='data'||tt.childNodes[j].tagName=='d')
{var aType=tt.childNodes[j].getAttribute('type')
if(!aType)
aType=tt.childNodes[j].getAttribute('t')
var akey=tt.childNodes[j].getAttribute('key')
if(!akey)
akey=tt.childNodes[j].getAttribute('k')
if(aType=='array'||aType=='a')
{this.AJAXprocessArrays(tt.childNodes[j],(arguments[1]?arguments[1]:nodeName)+'['+(akey?'\''+akey+'\'':k)+']');}
else
{if(tt.childNodes[j].childNodes.length>0)
{var zz=tt.childNodes[j].childNodes[0].nodeValue;eval((arguments[1]?arguments[1]:nodeName)+"['"+(akey?akey.replace(/\'/g,"\\'"):k)+"']"+'= zz'+';');}}}}}}}}
xAjax.prototype.__call=function()
{alert(arguments[0]);}
xAjax.prototype.AJAXprocessExec=function()
{var tt=this.vAJAXReceivedData.getElementsByTagName('Exec');if(!tt||tt.length==0)
tt=this.vAJAXReceivedData.getElementsByTagName('E');for(var i=0;i<tt.length;i++)
{var zz=tt[i].childNodes[0].nodeValue;if(zz)
{this.aOnExec(zz);}}}
xAjax.prototype.aOnExec=function()
{if(arguments[0]=='this.fShow()')
this.fShow();if(arguments[0]=='error')
this.fError(this.vError);}
xAjax.prototype.AJAXdebug=function()
{var tt=this.vAJAXReceivedData.getElementsByTagName('Ajax');var tTable,tTbody,tTr,tTd,tText,tImg,tDiv;var p=this;if(tt.length>0)
{if(!this.vDebugWnd)
{this.vDebugWnd=document.getElementById(this.vDebugWndElementName);this.vDebugWndContent=document.getElementById(this.vDebugContentElementName);}
if(!this.vDebugWnd)
{tTable=document.createElement('TABLE');tTable.border=1;tTable.className=this.vDebugClassName+'main_tab';tTable.height=this.vDebugHeight;tTable.id=this.vDebugWndElementName;tTbody=document.createElement('TBODY');tTr=document.createElement('TR');tTr.className=this.vDebugClassName+'tr_header';tTd=document.createElement('TD');tTd.innerHTML='&nbsp;Debug Window.&nbsp;&nbsp;Click to hide';tTr.appendChild(tTd);tTd=document.createElement('TD');tTd.width=this.vPicWidth;tImg=document.createElement('IMG');tImg.src=this.vPicPath+'trash.gif';tImg.className='hand';tImg.onclick=function()
{p.vDebugWndContent.innerHTML='';}
tTd.appendChild(tImg);tTr.appendChild(tTd);tTd=document.createElement('TD');tTd.width=this.vPicWidth;tTd.height=this.vDebugHeightTitle;tImg=document.createElement('IMG');tImg.src=this.vPicPath+'export.gif';tImg.className='hand';tImg.onclick=function()
{if(this.getAttribute('full')!=1)
{p.vDebugWnd.style.position='absolute';p.vDebugWnd.style.top=document.body.scrollTop;p.vDebugWnd.style.height=document.body.clientHeight;p.vDebugWndContent.style.height=document.body.clientHeight-p.vDebugHeightTitle-4;this.src=p.vPicPath+'import.gif';this.setAttribute('full',1);p.vDebugFull=1;}
else
{this.setAttribute('full',0);this.src=p.vPicPath+'export.gif';p.vDebugWnd.style.position='';p.vDebugWnd.height=p.vDebugHeight;p.vDebugFull=0;}}
tTd.appendChild(tImg);tTr.appendChild(tTd);tTd=document.createElement('TD');tTd.width=this.vPicWidth;tImg=document.createElement('IMG');tImg.src=this.vPicPath+'close.gif';tImg.className='hand';tImg.onclick=function()
{p.vDebugWnd.parentNode.removeChild(p.vDebugWnd);p.vDebugWnd=null;p.vDebugWndContent=null;}
tTd.appendChild(tImg);tTr.appendChild(tTd);tTbody.appendChild(tTr);tTr=document.createElement('TR');tTr.className=this.vDebugClassName+'tr_content';tTd=document.createElement('TD');tTd.className=this.vDebugClassName+'td_content';tTd.colSpan=4;tDiv=document.createElement('DIV');tDiv.id=this.vDebugContentElementName;tDiv.height=this.vDebugHeight-this.vDebugHeightTitle;tDiv.style.height=this.vDebugHeight-this.vDebugHeightTitle;tDiv.className=this.vDebugClassName+'div_content';this.vDebugWndContent=tDiv;tTd.appendChild(tDiv);tTr.appendChild(tTd);tTbody.appendChild(tTr);tTable.appendChild(tTbody);document.body.appendChild(tTable);this.vDebugWnd=tTable;}
this.vDebugWndContent.innerHTML='<pre>'+tt[0].childNodes[0].nodeValue+this.vDebugSeparator+this.vDebugWndContent.innerHTML;}}
var xText=function()
{this.vPostData=[];this.tLoading='Loading data...';this.vDataFieldName='text';this.vControlClassName='xtext_';this.vShowLoading=false;this.vTextPrefix='';this.vTextSuffix='';this.vEmptyId=0;this.vControlLoadingElement=null;}
xText.prototype=new xAjax;xText.prototype.fError=function()
{alert('Class xText Error: '+this.vError);}
xText.prototype.fInit=function()
{if(!this.vIdElement&&this.vId)
{this.vIdElement=document.getElementById(this.vId);}
if(!this.vIdElement)
{this.vError='Element `'+this.vId+'` not found in DOM';this.fError();return;}
if(!this.vDataUrl)
{this.vError='vDataUrl is empty!';this.fError();return;}
this.vControlId=this.vId+Math.random();this.fGetData();}
xText.prototype.fGetData=function()
{var tl,tS;if(this.vShowLoading)
{this.fCleanContent();if(!this.vControlLoadingElement)
{tS=document.createElement('DIV');tS.className=this.vControlClassName+'loading';if(this.tLoading!='')
{tl=document.createTextNode(this.tLoading);tS.appendChild(tl);}
this.vIdElement.appendChild(tS);this.vControlLoadingElement=tS;}}
this.fLockControl();this.AJAXPostData(this.vDataUrl,this.vPostData);}
xText.prototype.fLockControl=function()
{this.vControlLocked=true;}
xText.prototype.fCleanContent=function()
{if(this.vControlElement)
{this.vControlElement.parentNode.removeChild(this.vControlElement);this.vControlElement=null;}
if(this.vControlLoadingElement)
{this.vControlLoadingElement.parentNode.removeChild(this.vControlLoadingElement);this.vControlLoadingElement=null;}}
xText.prototype.fShow=function()
{this.onShow();this.disabled=false;this.vControlLocked=false;this.fCleanContent();if(!this.vNoShow)
{var tText,tSpan;tSpan=document.createElement('DIV');tSpan.className=this.vControlClassName;if(this.vTextPrefix)
{tl=document.createTextNode(this.vTextPrefix);tSpan.appendChild(tl);}
if(this.vType=='text')
{tSpan.innerHTML=this.AJAXresponseText;}
else
{tText=document.createTextNode(this.vData[this.vDataFieldName]);tSpan.appendChild(tText);}
if(this.vTextSuffix)
{tl=document.createTextNode(this.vTextSuffix);tSpan.appendChild(tl);}
if(this.vName)
{tSpan.name=this.vName;tSpan.id=this.vName;}
this.vIdElement.appendChild(tSpan);this.vControlElement=tSpan;}
this.onShowEnd();}
xText.prototype.onShow=function()
{}
xText.prototype.onShowEnd=function()
{}
var xTab=function()
{this.vTabInfo=[];this.vMainTabClass='x_tab_title';this.vContainerClass='x_tab_cont';this.oTexsts=[];}
xTab.prototype=new xText;xTab.prototype.fInit=function()
{var p=this,tDiv;for(var i in this.vTabInfo)
{var tt=document.getElementById(this.vTabInfo[i]['tab_id']);if(tt&&(tt.getAttribute("is_tab")=="1"))
{this.vTabInfo[i]['tabElement']=tt;tt.setAttribute('indexId',i);tt.onmouseover=function()
{if(p.vTabInfo[this.getAttribute('indexId')]['active'])
this.className=p.vMainTabClass+'_active_hover';else
this.className=p.vMainTabClass+'_hover';}
tt.onmouseout=function()
{if(p.vTabInfo[this.getAttribute('indexId')]['active'])
this.className=p.vMainTabClass+'_active';else
this.className=p.vMainTabClass;}
tt.onclick=function()
{p.onTabClick(this.getAttribute('indexId'));}
tDiv=document.createElement('DIV');tDiv.className=this.vContainerClass;if(this.vAutoFillTab&&this.vAutoFillTab==i)
{tDiv.innerHTML=this.oTabContainer.innerHTML;this.oTabContainer.innerHTML="";}
else
tDiv.style.display='none';if(!this.vAutoFillTab)
this.oTabContainer.appendChild(tDiv);this.vTabInfo[i]['oContent']=tDiv;}}
if(this.vAutoFillTab)
{this.fAttachTabs();}}
xTab.prototype.fAttachTabs=function()
{for(var i in this.vTabInfo)
{if(this.vTabInfo[i]['oContent'])
{this.oTabContainer.appendChild(this.vTabInfo[i]['oContent']);}}}
xTab.prototype.onTabClick=function()
{var tInd=arguments[0];if(this.vTabInfo[tInd]['active']!=1)
{this.fSetActive(tInd);}}
xTab.prototype.fSetActive=function()
{var p=this;this.vActiveIndex=-1;for(var i in this.vTabInfo)
{if(i==arguments[0]&&this.vTabInfo[i]['tabElement'])
{this.vTabInfo[i]['active']=1;this.vActiveIndex=i;this.vTabInfo[i]['tabElement'].className=this.vMainTabClass+'_active';this.vTabInfo[i]['oContent'].style.display='';if(!this.oTexsts[i]&&this.vAutoFillTab!=i)
{this.oTexsts[i]=new xText;this.oTexsts[i].vTextIndex=i;this.oTexsts[i].vDataUrl=this.vTabInfo[i]['vDataUrl'];this.oTexsts[i].vType=this.vTabInfo[i]['vDataType'];this.oTexsts[i].vTypeContent=this.vTabInfo[i]['vDataTypeContent'];this.oTexsts[i].vIdElement=this.vTabInfo[i]['oContent'];this.oTexsts[i].vAutoShow=this.vTabInfo[i]['vAutoShow'];this.oTexsts[i].vShowLoading=this.vTabInfo[i]['vShowLoading'];this.oTexsts[i].tLoading=this.vTabInfo[i]['tLoading'];this.oTexsts[i].vNoShow=this.vTabInfo[i]['vNoShow'];this.oTexsts[i].vContainerClass=this.vContainerClass;this.oTexsts[i].onShow=function()
{p.onTabLoad(this.vTextIndex);}
this.oTexsts[i].onShowEnd=function()
{p.onTabLoadEnd(this.vTextIndex)}
if(!this.oTexsts[i].vNoInit)
this.oTexsts[i].fInit();}}
else if(this.vTabInfo[i]['tabElement'])
{delete this.vTabInfo[i]['active'];this.vTabInfo[i]['tabElement'].className=this.vMainTabClass;this.vTabInfo[i]['oContent'].style.display='none';}}}
xTab.prototype.onTabLoad=function()
{if(this.vTabInfo[arguments[0]].onShow)
{this.vTabInfo[arguments[0]].onShow();}}
xTab.prototype.onTabLoadEnd=function()
{if(this.vTabInfo[arguments[0]].onShowEnd)
this.vTabInfo[arguments[0]].onShowEnd();}
function xHelper()
{this.vTimer=null;this.vDataUrl='';this.vElementId=null;this.vPostData=[];this.vCells=[];this.vAutoShow=true;this.vActiveIndex=-1;this.vSizeAdd=2;this.vStartTabIndex=100;this.vCellCounter=0;this.vMainClass='xhelper';}
xHelper.prototype=new xAjax;xHelper.prototype.fInit=function()
{var p=this;this.vElementId.onkeyup=function()
{if(this.getAttribute('old_value')!=this.value)
{if(p.vTimer)
clearTimeout(p.vTimer);if(!p.vJustClosed)
p.vTimer=setTimeout(function(){p.fGetData()},100);else
p.vJustClosed=false;}}
this.vElementId.onclick=function()
{if((this.vDataList)&&(!this.getAttribute('nocache')))
{p.fShow();}
else
{if(!this.getAttribute('nocache'))
{if(p.vTimer)
clearTimeout(p.vTimer);p.fGetData();}}
p.fHelperClick=true;}
this.vElementId.onkeydown=function(e)
{if(!e)
e=event;if(e.keyCode==40||e.keyCode==34)
{if(p.vElementHelper)
{if(p.vActiveIndex>-1)
p.vCells[p.vActiveIndex].className=p.vMainClass+'_cell_out'
if(p.vActiveIndex==p.vCellCounter-1)
p.vActiveIndex=0;else
p.vActiveIndex++
p.vCells[p.vActiveIndex].className=p.vMainClass+'_cell_over'
return false;}}
else if(e.keyCode==38||e.keyCode==33)
{if(p.vElementHelper)
{if(p.vActiveIndex>-1)
p.vCells[p.vActiveIndex].className=p.vMainClass+'_cell_out'
if(p.vActiveIndex<=0)
p.vActiveIndex=p.vCellCounter-1;else
p.vActiveIndex--;p.vCells[p.vActiveIndex].className=p.vMainClass+'_cell_over';return false;}}
else if(e.keyCode==13)
{if(p.vActiveIndex>-1)
{p.vElementId.value=p.vDataList[p.vCells[p.vActiveIndex].getAttribute('dataId')]['str'];p.vElementHelper.parentNode.removeChild(p.vElementHelper);p.vElementHelper=null;p.vElementId.focus();p.vElementId.dataArray=null;p.vJustClosed=true;return false;}}
else if(e.keyCode==9)
{p.fHide();}}
this.oOldBodyOnClick=document.body.onclick;document.body.onclick=function(){p.fHide();}
this.vElementId.setAttribute('autocomplete','off');}
xHelper.prototype.fGetData=function()
{if(this.vElementId.value!='')
{this.vPostData['text']=this.vElementId.value;this.AJAXPostData(this.vDataUrl,this.vPostData);}}
xHelper.prototype.fPrepareData=function()
{this.vDataList=[];if(this.AJAXresponseText)
{this.vDataList=this.fExplode('\n',this.AJAXresponseText)}}
xHelper.prototype.fShow=function()
{this.onShow();this.fPrepareData();var p=this;this.vCellCounter=0;this.vActiveIndex=-1;this.vElementId.setAttribute('old_value',this.vElementId.value);this.vElementId.dataArray=this.vDataList;this.vElementId.focus();if(this.vElementHelper)
{this.vElementHelper.parentNode.removeChild(this.vElementHelper);this.vElementHelper=null;}
if(this.vDataList.length>0)
{this.vElementId.setAttribute('old_tabIndex',this.vElementId.tabIndex);this.vElementId.tabIndex=this.vStartTabIndex;fTable=document.createElement("TABLE");fTable.border='0';fTable.className=this.vMainClass;fTable.cellSpacing=0;fTable.cellPadding=0;fTable.style.position='absolute';fTable.style.top=(this.fGetTop(this.vElementId)+this.vElementId.clientHeight+this.vSizeAdd)+'px';fTable.style.left=this.fGetLeft(this.vElementId)+'px';ftBody=document.createElement("TBODY");for(i in this.vDataList)
{if((this.vDataList[i]['str']!='')&&(this.vDataList[i]['x']==1))
{row=document.createElement("TR");cell=document.createElement("TD");cell.appendChild(document.createTextNode(this.vDataList[i]['str']));if(this.vActiveIndex==this.vCellCounter)
cell.className=this.vMainClass+'_cell_over';else
cell.className=this.vMainClass+'_cell_out';cell.setAttribute('menuId',this.vCellCounter);cell.setAttribute('dataId',i);cell.onmouseover=function()
{if(p.vActiveIndex>-1)
p.vCells[p.vActiveIndex].className=p.vMainClass+'_cell_out'
this.className=p.vMainClass+'_cell_over';}
cell.onmouseout=function()
{this.className=p.vMainClass+'_cell_out';}
cell.onclick=function(e)
{p.vElementId.value=this.innerHTML;if(p.vElementHelper)
{p.vElementHelper.parentNode.removeChild(p.vElementHelper);p.vElementHelper=null}
p.vElementId.focus();p.vElementId.setAttribute('tabIndex',p.vElementId.getAttribute('old_tabIndex'));p.vElementId.dataArray=null;p.vJustClosed=true;return false;}
row.appendChild(cell);this.vCells[this.vCellCounter]=cell;ftBody.appendChild(row);this.vCellCounter++;}}
fTable.appendChild(ftBody);document.body.appendChild(fTable);this.vElementHelper=fTable;}
this.onShowEnd();}
xHelper.prototype.fGetTop=function()
{el=arguments[0];var top=0;try{top+=el.offsetTop;}catch(e){}
if(el&&(el.tagName.toLowerCase()!='body'))
top+=this.fGetTop(el.offsetParent);return top;}
xHelper.prototype.fHide=function()
{this.vElementId.setAttribute('tabIndex',this.vElementId.getAttribute('old_tabIndex'));this.vElementId.dataArray=null;if(this.vElementHelper)
{this.vElementHelper.parentNode.removeChild(this.vElementHelper);this.vElementHelper=null}
if(this.oOldBodyOnClick)
this.oOldBodyOnClick();}
xHelper.prototype.fGetLeft=function()
{el=arguments[0];var left=0;try{left+=el.offsetLeft;}catch(e){}
if(el&&(el.tagName.toLowerCase()!='body'))
left+=this.fGetLeft(el.offsetParent);return left;}
xHelper.prototype.onShow=function()
{}
xHelper.prototype.onShowEnd=function()
{}
function xTop10()
{this.tCountImg=10;this.tTimeInterval=50;this.tIncO=0.1;this.tImgIds='note_demo';this.tLinkIds='hover_demo';this.oImg=[];this.oLinks=[];if(!arguments[0])
this.fInit();}
xTop10.prototype.fInit=function()
{var p=this;for(var i=1;i<this.tCountImg+1;i++)
{this.oImg[i]=document.getElementById(this.tImgIds+i);this.oLinks[i]=document.getElementById(this.tLinkIds+i);this.oLinks[i].setAttribute('arrayIndex',i);if(i>1)
{this.oLinks[i].onmouseover=function()
{p.oImg[this.getAttribute('arrayIndex')].style.display='';p.oImg[this.getAttribute('arrayIndex')].setAttribute('op',0);p.oImg[this.getAttribute('arrayIndex')].timer=setTimeout("fShowUpPic("+this.getAttribute('arrayIndex')+", "+p.vOID+", false)",p.tTimeInterval);p.oImg[this.getAttribute('arrayIndex')].style.opacity=p.oImg[this.getAttribute('arrayIndex')].MozOpacity=0;p.oImg[this.getAttribute('arrayIndex')].style.filter="alpha(opacity=0)";}
this.oLinks[i].onmouseout=function()
{if(this.getAttribute('arrayIndex')!=1)
{if(p.oImg[this.getAttribute('arrayIndex')].timer)
clearTimeout(p.oImg[this.getAttribute('arrayIndex')].timer);p.oImg[this.getAttribute('arrayIndex')].timer=setTimeout("fShowUpPic("+this.getAttribute('arrayIndex')+", "+p.vOID+", true)",p.tTimeInterval);}}}}}
function fShowUpPic()
{var pIndex=arguments[0];var oIndex=arguments[1];var fl=arguments[2];if(fl)
o=0-tTop10o[oIndex].tIncO
else
o=tTop10o[oIndex].tIncO
tTop10o[oIndex].oImg[pIndex].setAttribute('op',tTop10o[oIndex].oImg[pIndex].getAttribute('op')*1+o);tTop10o[oIndex].oImg[pIndex].style.opacity=tTop10o[oIndex].oImg[pIndex].getAttribute('op');tTop10o[oIndex].oImg[pIndex].style.MozOpacity=tTop10o[oIndex].oImg[pIndex].getAttribute('op');tTop10o[oIndex].oImg[pIndex].style.filter="alpha(opacity="+(tTop10o[oIndex].oImg[pIndex].getAttribute('op')*100)+")";if((tTop10o[oIndex].oImg[pIndex].getAttribute('op')<1&&!fl)||((tTop10o[oIndex].oImg[pIndex].getAttribute('op')>0&&fl)))
{tTop10o[oIndex].oImg[pIndex].timer=setTimeout("fShowUpPic("+pIndex+", "+oIndex+", "+fl+")",tTop10o[oIndex].tTimeInterval);}}
var monthDays=new Array(31,28,31,30,31,30,31,31,30,31,30,31);var dayNameShort=new Array('Sun','Mon','Tue','Wed','Thu','Fri','Sat');var dayOffsetDate=new Date(2004,9,03,0,0,0,0);var dayOffset=dayOffsetDate.getDay();function monthChanged(monthYear,dayBoxId){var dayVal;var month=eval(monthYear.substring(5,7));var year=eval(monthYear.substring(0,4));var numDays=monthDays[month-1];var fromDay=1;var today=new Date;var i;var dd=document.getElementById(dayBoxId);var optionText;var optionValue;var aDate=new Date;var prevVal=eval(dd.value);var didSet=false;if(getCookie('date_val')!=null){prevVal=eval(getCookie('date_val'));}
if(navigator.appName=='Netscape'){year=year-1900;}
if(((month-1)==today.getMonth())&&(year==today.getYear())){fromDay=today.getDate();}
if(month==2){if((year%4==0&&year%100!=0)||(year%400==0)){numDays=29;}
else{numDays=28;}}
for(i=0;i<=31;i++){try{dd.remove(0);}
catch(ex){i=32;}}
if(navigator.appName=='Netscape'){aDate.setYear(year+1900);}
else{aDate.setYear(year);}
aDate.setMonth(month-1);aDate.setDate(fromDay);if(aDate.getMonth!=(month-1)){aDate.setMonth(month-1);}
for(i=0;i<=(numDays-fromDay);i++){aDate.setDate(i+fromDay);dayVal=aDate.getDay()-dayOffset;if(dayVal<0){dayVal=7+dayVal;}
optionValue=i+fromDay;optionText=dayNameShort[dayVal]+' '+optionValue;dd.options[i]=new Option(optionText,optionValue);if(prevVal==(i+fromDay)){dd.selectedIndex=i;didSet=true;}}
if(!didSet){dd.selectedIndex=0;}
try{dd.focus();}
catch(ex){}
return true;}
function putCookie(name,value){setCookie(name,value,null,'/','toptable.co.uk',null);}
function setCookie(name,value,expires,path,domain,secure){DeleteCookie(name,path,domain);document.cookie=name+"="+escape(value)+
((expires)?"; expires="+expires.toGMTString():"")+
((path)?"; path="+path:"")+
((domain)?"; domain="+domain:"")+
((secure)?"; secure":"");return true;}
function getCookieVal(offset){var endstr=document.cookie.indexOf(";",offset);if(endstr==-1)
endstr=document.cookie.length;return unescape(document.cookie.substring(offset,endstr));}
function FixCookieDate(date){var base=new Date(0);var skew=base.getTime();if(skew>0)
date.setTime(date.getTime()-skew);}
function DeleteCookie(name,path,domain){if(getCookie(name)){document.cookie=name+"="+((path)?"; path="+path:"")+((domain)?"; domain="+domain:"")+"; expires=Thu, 01-Jan-70 00:00:01 GMT";}}
function getCookie(name){var arg=name+"=";var alen=arg.length;var clen=document.cookie.length;var i=0;while(i<clen){var j=i+alen;if(document.cookie.substring(i,j)==arg)
return getCookieVal(j);i=document.cookie.indexOf(" ",i)+1;if(i==0)break;}
return null;}
function writeSelect(){document.write('<select name="EventDay" onChange="return putCookie(\'date_val\', document.getElementById(\'select4\').value);" id="select4" style="width:70px;">'+'<option value="1"'+'></option>'+'<option value="2"'+'></option>'+'<option value="3"'+'></option>'+'<option value="4"'+'></option>'+'<option value="5"'+'></option>'+'<option value="6"'+'></option>'+'<option value="7"'+'></option>'+'<option value="8"'+'></option>'+'<option value="9"'+'></option>'+'<option value="10"'+'></option>'+'<option value="11"'+'></option>'+'<option value="12"'+'></option>'+'<option value="13"'+'></option>'+'<option value="14"'+'></option>'+'<option value="15"'+'></option>'+'<option value="16"'+'></option>'+'<option value="17"'+'></option>'+'<option value="18"'+'></option>'+'<option value="19"'+'></option>'+'<option value="20"'+'></option>'+'<option value="21"'+'></option>'+'<option value="22"'+'></option>'+'<option value="23"'+'></option>'+'<option value="24"'+'></option>'+'<option value="25"'+'></option>'+'<option value="26"'+'></option>'+'<option value="27"'+'></option>'+'<option value="28"'+'></option>'+'<option value="29"'+'></option>'+'<option value="30"'+'></option>'+'<option value="31"'+'></option>'+'</select>');}