// JavaScript Document
<!-- 
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
function YY_checkform() { //v4.71
//copyright (c)1998,2002 Yaromat.com
  var a=YY_checkform.arguments,oo=true,v='',s='',err=false,r,o,at,o1,t,i,j,ma,rx,cd,cm,cy,dte,at;
  for (i=1; i<a.length;i=i+4){
    if (a[i+1].charAt(0)=='#'){r=true; a[i+1]=a[i+1].substring(1);}else{r=false}
    o=MM_findObj(a[i].replace(/\[\d+\]/ig,""));
    o1=MM_findObj(a[i+1].replace(/\[\d+\]/ig,""));
    v=o.value;t=a[i+2];
    if (o.type=='text'||o.type=='password'||o.type=='hidden'){
      if (r&&v.length==0){err=true}
      if (v.length>0)
      if (t==1){ //fromto
        ma=a[i+1].split('_');if(isNaN(v)||v<ma[0]/1||v > ma[1]/1){err=true}
      } else if (t==2){
        rx=new RegExp("^[\\w\.=-]+@[\\w\\.-]+\\.[a-zA-Z]{2,4}$");if(!rx.test(v))err=true;
      } else if (t==3){ // date
        ma=a[i+1].split("#");at=v.match(ma[0]);
        if(at){
          cd=(at[ma[1]])?at[ma[1]]:1;cm=at[ma[2]]-1;cy=at[ma[3]];
          dte=new Date(cy,cm,cd);
          if(dte.getFullYear()!=cy||dte.getDate()!=cd||dte.getMonth()!=cm){err=true};
        }else{err=true}
      } else if (t==4){ // time
        ma=a[i+1].split("#");at=v.match(ma[0]);if(!at){err=true}
      } else if (t==5){ // check this 2
            if(o1.length)o1=o1[a[i+1].replace(/(.*\[)|(\].*)/ig,"")];
            if(!o1.checked){err=true}
      } else if (t==6){ // the same
            if(v!=MM_findObj(a[i+1]).value){err=true}
      }
    } else
    if (!o.type&&o.length>0&&o[0].type=='radio'){
          at = a[i].match(/(.*)\[(\d+)\].*/i);
          o2=(o.length>1)?o[at[2]]:o;
      if (t==1&&o2&&o2.checked&&o1&&o1.value.length/1==0){err=true}
      if (t==2){
        oo=false;
        for(j=0;j<o.length;j++){oo=oo||o[j].checked}
        if(!oo){s+='* '+a[i+3]+'\n'}
      }
    } else if (o.type=='checkbox'){
      if((t==1&&o.checked==false)||(t==2&&o.checked&&o1&&o1.value.length/1==0)){err=true}
    } else if (o.type=='select-one'||o.type=='select-multiple'){
      if(t==1&&o.selectedIndex/1==0){err=true}
    }else if (o.type=='textarea'){
      if(v.length<a[i+1]){err=true}
    }
    if (err){s+='* '+a[i+3]+'\n'; err=false}
  }
  if (s!=''){alert('The required information is incomplete or contains errors:\t\t\t\t\t\n\n'+s)}
  document.MM_returnValue = (s=='');
}

function KW_cal_class(m,d,y,d1,d2,mn,c) { // v1.3.0
	this.o="";this.dsp="";this.m=m;this.d=d;this.y=y;this.d1=d1;this.d2=d2;
	this.mn=mn,this.sy=((y%100)<10)?"0"+(y%100):(y%100);this.mm=(m<10)?"0"+m:m;this.c=c
	this.dd=(d<10)?"0"+d:d;	iD=new Date(y,(m-1),d);eD=new Date();eD.setMilliseconds(0)
	eD.setHours(0);eD.setMinutes(0);eD.setSeconds(0);this.ofs=parseInt((eD-iD)/86400000)
	this.gC=function(){iD=new Date(this.y,(this.m-1),this.d);sD=this.dsp.toString()
	retVal="on";if (sD.indexOf("<a")!=0)retVal="off";if (iD.getDay()==0||iD.getDay()==6)
	if (sD.indexOf("<a")!=0)retVal="wkendoff";else retVal="wkendon";if (this.c==0)
	if (sD.indexOf("<a")!=0)retVal="ntmoff";else retVal="ntmon";if (this.ofs==0) 
	retVal="today";	if (this.spc()==true)retVal="special";return "kw_cal_"+retVal;}
	this.spc=function(){var retVal=false;dc=document;if (dc.kw_sp){ for (var i=0;i<dc.kw_sp.length;i++){
	if (this.m==dc.kw_sp[i].m&&(this.y==dc.kw_sp[i].y||dc.kw_sp[i].y=="*")&&this.d==dc.kw_sp[i].d)
	retVal=true;}} return retVal;}
}

function KW_setThisDisplay(f,n,d,o,a1,a2,a3,a4,w,l,sd){ // v1.4.0
	var rV="<a href=\"javascript:window.opener.KW_setCalendar('"+f+"',"+n+",'"+l+"'); window.close();\">"+d+"</a>";
	if ((a1==1&&o>0)||(a1==-1&&o<1)||(a1==2&&o>=0)) rV=d;if (a2>0) {if (o<=-a2) rV=d;} 
	else if (a2<0) {if (o>=-a2) rV=d;}if (a3!=-1) {ss=a3.split("|");if (ss[w]==1) rV=d} 
	if (a4>0) {if (o>=-a4 && o<0) rV=d;} if (a4<0) {if (o<=-a4 && o>0) rV=d; } if (sd) {
	rV=d} return rV;
}

function KW_date_class(m,d,y) {this.m=m;this.d=d;this.y=y;}

function KW_setCalendar(obj,n,l) { // v1.3.0
	dc=document;dO=dc.tMh[n];if (obj.indexOf("|")==-1)MM_findObj(obj).value=dO.o;
	else {oS=obj.split("|");tV= new Array(dO.m,dO.d,dO.y);for(var i=0;i<3;i++) {
	tO=MM_findObj(oS[i]);dc.KW_calYear=dO.y;for (var j=0;j<tO.options.length;j++)
	if (tO.options[j].value==tV[i]) tO.selectedIndex=j;}}dc.KW_calMonth=dO.m-1;
	if (l!=''){o=MM_findObj(l);v="hide";if (o.style){o=o.style; v='hidden'} o.visibility=v}
}

function KW_setDel(val) { // v1.3.1
	return (val.match(/\.gif$|\.png$|\.jpg$|\.jpeg$/i))?"<img src=\""+val+"\" class=\"kw_img\">":val
}

function KW_expertCalendar(){ // v1.4.1 
	var dc=document,a=KW_expertCalendar.arguments,d=new Date();d.setDate(1); if (a[29]!=-1) 
	d.setMonth(a[29]);else if (dc.KW_calMonth) d.setMonth(dc.KW_calMonth);cMn= d.getMonth(); 
	pMt=((cMn-1)<0)?11:cMn-1;nMh=((cMn+1)>11)?0:cMn+1;if (a[30]!=-1) d.setFullYear(a[30]);
	else if (dc.KW_calYear) d.setYear(dc.KW_calYear);cYr=d.getFullYear();pYr=(pMt==11)?cYr-1:cYr;
	nYr=(nMh==0)?cYr+1:cYr;wdy=d.getDay();dc.tMh=new Array();if (a[25]==1) wdy=((--wdy)<0)?6:wdy;
	tpM=new Date(d.getFullYear(),d.getMonth(),d.getDate()-wdy);for (var i=0;i<wdy;i++) {
	n=dc.tMh.length;dc.tMh[n]= new KW_cal_class((tpM.getMonth()+1),tpM.getDate(),tpM.getFullYear(),
	a[21],a[23],a[tpM.getMonth()],0);dc.tMh[n].o=eval("dc.tMh["+n+"]."+a[20])+dc.tMh[n].d1+
	eval("dc.tMh["+n+"]."+a[22])+dc.tMh[n].d2+eval("dc.tMh["+n+"]."+a[24]);	dc.tMh[n].dsp=
	(a[31]==1)?"&nbsp;":KW_setThisDisplay(a[19],n,tpM.getDate(),dc.tMh[n].ofs,a[26],a[27],
	a[28],a[42],tpM.getDay(),a[41],(dc.tMh[n].spc() && a[45]==1));tpM.setDate(tpM.getDate()+1)}EOM=false;for (var i=1;!EOM;i++) {
	n=dc.tMh.length;dc.tMh[n]=new KW_cal_class((d.getMonth()+1),d.getDate(),d.getFullYear(),
	a[21],a[23],a[d.getMonth()],1);;dc.tMh[n].o=eval("dc.tMh["+n+"]."+a[20])+dc.tMh[n].d1+
	eval("dc.tMh["+n+"]."+a[22])+dc.tMh[n].d2+eval("dc.tMh["+n+"]."+a[24]);
	dc.tMh[n].dsp=KW_setThisDisplay(a[19],n,d.getDate(),dc.tMh[n].ofs,a[26],a[27],a[28],a[42],
	d.getDay(),a[41],(dc.tMh[n].spc() && a[45]==1));d.setDate(d.getDate()+1);if (d.getDate()==1) EOM=true;} wdy=d.getDay();
	if (a[25]==1) wdy=((--wdy)<0)?6:wdy;for (var i=wdy;i<7;i++) {n=dc.tMh.length;
	dc.tMh[n]= new KW_cal_class((d.getMonth()+1),d.getDate(),d.getFullYear(),a[21],a[23],
	a[d.getMonth()],0);dc.tMh[n].o=eval("dc.tMh["+n+"]."+a[20])+dc.tMh[n].d1+
	eval("dc.tMh["+n+"]."+a[22])+dc.tMh[n].d2+eval("dc.tMh["+n+"]."+a[24]);
	dc.tMh[n].dsp=(a[31]==1)?"&nbsp;":KW_setThisDisplay(a[19],n,d.getDate(),dc.tMh[n].ofs,
	a[26],a[27],a[28],a[42],d.getDay(),a[41],(dc.tMh[n].spc() && a[45]==1));d.setDate(d.getDate()+1);} 
	ns4 =(dc.layers)?true:false;px=(ns4||window.opera)?'':'px';s=a[32];if (a[33]==-1) 
	{ww=window;d="document.getElementById('"+a[32].name+"')";k=1;x=0;y=0;xpos=0;ypos=0;
	iM=(navigator.appVersion.indexOf("Mac")==-1);p=".offsetParent";if (dc.getElementById) {
	if (!eval(d)) {d=d.replace(/.getElementById/,".getElementsByName")}
	while (eval(d+p)) {	x+=parseInt(eval(d+p+".offsetLeft"));
	y+=parseInt(eval(d+p+".offsetTop"));p+=".offsetParent";}ox=parseInt(s.offsetLeft);
	oy=parseInt(s.offsetTop);} else {x=parseInt(screen.height/2-75);ox=0;oy=0;
	y=parseInt(screen.width/2-75);}xp=parseInt(x+ox),yp=parseInt(y+oy+20);
	winW=(ns4)?window.innerWidth-16:dc.body.offsetWidth-20;
	winH=(ns4)?window.innerHeight:dc.body.offsetHeight;if (dc.all && iM) winH+=dc.body.scrollTop
	if ((xp+a[35])>winW) xp=winW-a[35]; if ((yp+a[36])>winH) yp=winH-a[36];	
	if (a[41]=='') {if (isNaN(ww.screenX)) {xp=xp-dc.body.scrollLeft+ww.screenLeft;
	yp=yp-dc.body.scrollTop+ww.screenTop;}else {xp=xp+ww.screenX+
	(ww.outerWidth-ww.innerWidth)-ww.pageXOffset;yp=yp+ww.screenY+
	(ww.outerHeight-24-ww.innerHeight)-ww.pageYOffset;	}if (!iM && dc.all)
	{ xp=xp-dc.body.scrollLeft;yp=yp-dc.body.scrollTop}}a[33]=xp;a[34]=yp}
	str="<html><head><title>"+a[cMn]+" "+cYr; accs="<a class=\"kw_cal_a\" ";
	str+="</title></head><link href=\""+a[43]+"\" rel=\"stylesheet\" type=\"text/css\" />"
	str+="<body style=\"margin:0; background-color:"+a[44]+";\">";if (a[41]!='' && !ns4) str="";
	str+="<table class=\"kw_cal_tbl2\"><tr><td colspan=\"7\">"
	str+="<table width=\""+(a[35]-10)+"\" border=0 cellspacing=0 cellpadding=0 class=\"kw_cal_tbl2\">";
	endStr="','"+a[31]+"',0";for(ix=33;ix<37;ix++)endStr+=","+a[ix];for(ix=37;ix<46;ix++)
	endStr+=",'"+a[ix]+"'";bStr="";for (var j=0;j<29;j++) bStr+="'"+a[j]+"',";
	aStr1=bStr+"'"+pMt+"','"+pYr+endStr;aStr2=bStr+"'"+nMh+"','"+nYr+endStr;str+="<tr><td "
	str+="class=\"kw_cal_mnth\">"+accs+"href=\"javascript:window.opener.KW_expertCalendar("+aStr1;
	str+=")\">"+KW_setDel(a[37])+"</a>"+a[cMn]+accs+"href=\"javascript:window.opener.KW_expertCalendar("
	str+=aStr2+")\">"+KW_setDel(a[38])+"</a></td>";aStr1=bStr+"'"+cMn+"','"+(cYr-1)+endStr;
	aStr2=bStr+"'"+cMn+"','"+(cYr+1)+endStr;str+="<td class=\"kw_cal_yr\">"+accs
	str+="href=\"javascript:window.opener.KW_expertCalendar("+aStr1+")\">"+KW_setDel(a[39])+"</a>"
	str+=cYr+accs+"href=\"javascript:window.opener.KW_expertCalendar("+aStr2+")\">"
	str+=KW_setDel(a[40])+"</a></td></tr></table></td></tr><tr>"
	for (var i=(a[25]==1)?13:12;i<19;i++) str+="<td class=\"kw_cal_wktitle\">"+a[i]+"</td>";
	if (a[25]==1) str+="<td class=\"kw_cal_wktitle\">"+a[12]+"</td>";str+="</tr>";
	for (var i=0;i<dc.tMh.length;i++) {if ((i)/7==parseInt((i)/7)) str+="<tr>"; 
	tdClass=dc.tMh[i].gC();temp=dc.tMh[i].dsp.toString();tdActive=(temp.indexOf("<a")!=-1)?"id='kwon'":"";
	str+="<td class=\""+tdClass+"\" "+tdActive+">"+dc.tMh[i].dsp+"</td>"
	if ((i+1)/7==parseInt((i+1)/7))str+="</tr>";}str+=(a[41]==''&&!ns4)?"</table></body></html>":"</table>";
	if (a[41]!='' && !ns4) {t=MM_findObj(a[41]);v="show";if (t.style) { t=t.style; v='visible'}
	t.visibility=v;	t.left=xp+px;t.top=yp+px;while (str.indexOf('window.opener.')!=-1)
	str=str.replace('window.opener.','');p1=str.indexOf(" window.close();"); while (p1!=-1) {
	str=str.substring(0,p1)+str.substring(p1+16);p1=str.indexOf(" window.close();")}
	MM_findObj(a[41]).innerHTML=str;} else {var nnx=(ns4)?1.25:1;var look='width='+(a[35]*nnx)
	look+=',height='+(a[36]*nnx)+',left='+a[33]+',top='+a[34];
	popwin=window.open('','calendar',look);	with(popwin.document){open();write(str);close();}}
}
function tmt_regExpValidator(f,re,eMsg,ru,r){
	var myErr="";var fv=MM_findObj(f).value;var rex=new RegExp(unescape(re));
	var t=eval(ru+rex.test(fv));if(r){if(fv.length<=0||!t){alert(unescape(eMsg));myErr+="eMsg";}}
	else if(fv.length>0&&!t){alert(unescape(eMsg));myErr+="eMsg";}document.MM_returnValue=(myErr=="");
}

function textCounter(field,cntfield,maxlimit) {
if (field.value.length > maxlimit) // if too long...trim it!
field.value = field.value.substring(0, maxlimit);
// otherwise, update 'characters left' counter
else
cntfield.value = maxlimit - field.value.length;
}

//  -->
