adTime=10;  // seconds ad reminder is shown
chanceAd=1; // ad will be shown 1 in X times (put 1 for everytime)

var ns=(document.layers);
var ie=(document.all);
var w3=(document.getElementById && !ie);
var calunit=ns? "" : "px"
adCount=0;
function mOver1(){
	if(!ns && !ie && !w3) return;
	if(ie)		adDiv=eval('document.all.sub01.style');
	else if(ns)	adDiv=eval('document.layers["sub01"]');
	else if(w3)	adDiv=eval('document.getElementById("sub01").style');
	//randAd=Math.ceil(Math.random()*chanceAd);
        //if (ie||w3)
        //adDiv.visibility="visible";
        //else
        //adDiv.visibility ="show";
	showAd1();
	for (k = 0; k < document.forms.length; ++k) {
				for(j = 0; j< document.forms[k].length; ++j) { 
					var e = document.forms[k].elements[j]; 
					if(e.type == "select-one") {
						document.forms[k].elements[j].style.visibility = "hidden"
					}
				}
	}
}
function showAd1(){
	if (ie){documentWidth  =truebody().offsetWidth/2-153;
	documentHeight = 328}	
	else if (ns){documentWidth=window.innerWidth/2-143;
	documentHeight=328} 
	else if (w3){documentWidth=self.innerWidth/2-143;
	documentHeight=328} 
	

	adDiv.left=documentWidth-200+calunit;adDiv.top =documentHeight-200+calunit;
	if (ie||w3)
    adDiv.visibility="visible";
    else
    adDiv.visibility ="show";
	//setTimeout("showAd1()",1000);}
	//else closeAd();
}
function mOut1(){
	if(!ns && !ie && !w3) return;
		if(ie)		adDiv=eval('document.all.sub01.style');
		else if(ns)	adDiv=eval('document.layers["sub01"]');
		else if(w3)	adDiv=eval('document.getElementById("sub01").style');
	if (ie||w3)
	adDiv.visibility="hidden";
	else
	adDiv.visibility ="hide";
	
	for (k = 0; k < document.forms.length; ++k) {
				for(j = 0; j< document.forms[k].length; ++j) { 
					var e = document.forms[k].elements[j]; 
					if(e.type == "select-one") {
						document.forms[k].elements[j].style.visibility = "visible"
					}
				}
	}
}

function truebody(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function mOver2(){
	if(!ns && !ie && !w3) return;
	if(ie)		adDiv=eval('document.all.sub02.style');
	else if(ns)	adDiv=eval('document.layers["sub02"]');
	else if(w3)	adDiv=eval('document.getElementById("sub02").style');
	//randAd=Math.ceil(Math.random()*chanceAd);
        
	showAd2();
	for (k = 0; k < document.forms.length; ++k) {
				for(j = 0; j< document.forms[k].length; ++j) { 
					var e = document.forms[k].elements[j]; 
					if(e.type == "select-one") {
						document.forms[k].elements[j].style.visibility = "hidden"
					}
				}
	}
}
function showAd2(){
	if (ie){documentWidth  =truebody().offsetWidth/2-76;
	documentHeight = 328}	
	else if (ns){documentWidth=window.innerWidth/2-66;
	documentHeight=328} 
	else if (w3){documentWidth=self.innerWidth/2-66;
	documentHeight=328} 
		
	adDiv.left=documentWidth-200+calunit;adDiv.top =documentHeight-200+calunit;
	
	if (ie||w3)
        adDiv.visibility="visible";
        else
        adDiv.visibility ="show";
	//setTimeout("showAd2()",1000);}
	//else closeAd();
}
function mOut2(){
if(!ns && !ie && !w3) return;
	if(ie)		adDiv=eval('document.all.sub02.style');
	else if(ns)	adDiv=eval('document.layers["sub02"]');
	else if(w3)	adDiv=eval('document.getElementById("sub02").style');
if (ie||w3)
adDiv.visibility="hidden";
else
adDiv.visibility ="hide";
for (k = 0; k < document.forms.length; ++k) {
				for(j = 0; j< document.forms[k].length; ++j) { 
					var e = document.forms[k].elements[j]; 
					if(e.type == "select-one") {
						document.forms[k].elements[j].style.visibility = "visible"
					}
				}
	}
}

function mOver3(){
	if(!ns && !ie && !w3) return;
	if(ie)		adDiv=eval('document.all.sub03.style');
	else if(ns)	adDiv=eval('document.layers["sub03"]');
	else if(w3)	adDiv=eval('document.getElementById("sub03").style');
	//randAd=Math.ceil(Math.random()*chanceAd);
        
	showAd3();
	for (k = 0; k < document.forms.length; ++k) {
				for(j = 0; j< document.forms[k].length; ++j) { 
					var e = document.forms[k].elements[j]; 
					if(e.type == "select-one") {
						document.forms[k].elements[j].style.visibility = "hidden"
					}
				}
	}
}
function showAd3(){
	if (ie){documentWidth  =truebody().offsetWidth/2+1;
	documentHeight = 328}	
	else if (ns){documentWidth=window.innerWidth/2+window.pageXOffset+12;
	documentHeight=328;} 
	else if (w3){documentWidth=self.innerWidth/2+window.pageXOffset+12;
	documentHeight=328;} 
	adDiv.left=documentWidth-200+calunit;adDiv.top =documentHeight-200+calunit;
	if (ie||w3)
        adDiv.visibility="visible";
        else
        adDiv.visibility ="show";
	//setTimeout("showAd3()",1000);}
	//else closeAd();
}
function mOut3(){
if(!ns && !ie && !w3) return;
	if(ie)		adDiv=eval('document.all.sub03.style');
	else if(ns)	adDiv=eval('document.layers["sub03"]');
	else if(w3)	adDiv=eval('document.getElementById("sub03").style');
if (ie||w3)
adDiv.visibility="hidden";
else
adDiv.visibility ="hide";
for (k = 0; k < document.forms.length; ++k) {
				for(j = 0; j< document.forms[k].length; ++j) { 
					var e = document.forms[k].elements[j]; 
					if(e.type == "select-one") {
						document.forms[k].elements[j].style.visibility = "visible"
					}
				}
	}
}

function mOver4(){
	if(!ns && !ie && !w3) return;
	if(ie)		adDiv=eval('document.all.sub04.style');
	else if(ns)	adDiv=eval('document.layers["sub04"]');
	else if(w3)	adDiv=eval('document.getElementById("sub04").style');
	//randAd=Math.ceil(Math.random()*chanceAd);
        
	showAd4();
	for (k = 0; k < document.forms.length; ++k) {
				for(j = 0; j< document.forms[k].length; ++j) { 
					var e = document.forms[k].elements[j]; 
					if(e.type == "select-one") {
						document.forms[k].elements[j].style.visibility = "hidden"
					}
				}
	}
}
function showAd4(){
	if (ie){documentWidth  =truebody().offsetWidth/2+81;
	documentHeight = 328}	
	else if (ns){documentWidth=window.innerWidth/2+window.pageXOffset+91;
	documentHeight=328;} 
	else if (w3){documentWidth=self.innerWidth/2+window.pageXOffset+91;
	documentHeight=328;} 
	adDiv.left=documentWidth-200+calunit;adDiv.top =documentHeight-200+calunit;
	if (ie||w3)
        adDiv.visibility="visible";
        else
        adDiv.visibility ="show";
	//setTimeout("showAd4()",1000);}
	//else closeAd();
}
function mOut4(){
if(!ns && !ie && !w3) return;
	if(ie)		adDiv=eval('document.all.sub04.style');
	else if(ns)	adDiv=eval('document.layers["sub04"]');
	else if(w3)	adDiv=eval('document.getElementById("sub04").style');
if (ie||w3)
adDiv.visibility="hidden";
else
adDiv.visibility ="hide";
for (k = 0; k < document.forms.length; ++k) {
				for(j = 0; j< document.forms[k].length; ++j) { 
					var e = document.forms[k].elements[j]; 
					if(e.type == "select-one") {
						document.forms[k].elements[j].style.visibility = "visible"
					}
				}
	}
}

function mOver7(){
	if(!ns && !ie && !w3) return;
	if(ie)		adDiv=eval('document.all.sub07.style');
	else if(ns)	adDiv=eval('document.layers["sub07"]');
	else if(w3)	adDiv=eval('document.getElementById("sub07").style');
	//randAd=Math.ceil(Math.random()*chanceAd);
        //if (ie||w3)
        //adDiv.visibility="visible";
        //else
        //adDiv.visibility ="show";
	showAd7();
	for (k = 0; k < document.forms.length; ++k) {
				for(j = 0; j< document.forms[k].length; ++j) { 
					var e = document.forms[k].elements[j]; 
					if(e.type == "select-one") {
						document.forms[k].elements[j].style.visibility = "hidden"
					}
				}
	}
}
function showAd7(){
	if (ie){documentWidth  =truebody().offsetWidth/2+140;
	documentHeight = 328}	
	else if (ns){documentWidth=window.innerWidth/2-143;
	documentHeight=328} 
	else if (w3){documentWidth=self.innerWidth/2-143;
	documentHeight=328} 
	

	adDiv.left=documentWidth-200+calunit;adDiv.top =documentHeight-200+calunit;
	if (ie||w3)
    adDiv.visibility="visible";
    else
    adDiv.visibility ="show";
	//setTimeout("showAd1()",1000);}
	//else closeAd();
}
function mOut7(){
	if(!ns && !ie && !w3) return;
		if(ie)		adDiv=eval('document.all.sub07.style');
		else if(ns)	adDiv=eval('document.layers["sub07"]');
		else if(w3)	adDiv=eval('document.getElementById("sub07").style');
	if (ie||w3)
	adDiv.visibility="hidden";
	else
	adDiv.visibility ="hide";
	
	for (k = 0; k < document.forms.length; ++k) {
				for(j = 0; j< document.forms[k].length; ++j) { 
					var e = document.forms[k].elements[j]; 
					if(e.type == "select-one") {
						document.forms[k].elements[j].style.visibility = "visible"
					}
				}
	}
}
function mOver11(){
	if(!ns && !ie && !w3) return;
	if(ie)		adDiv=eval('document.all.sub20.style');
	else if(ns)	adDiv=eval('document.layers["sub20"]');
	else if(w3)	adDiv=eval('document.getElementById("sub20").style');
	//randAd=Math.ceil(Math.random()*chanceAd);
        //if (ie||w3)
        //adDiv.visibility="visible";
        //else
        //adDiv.visibility ="show";
	showAd11();
	for (k = 0; k < document.forms.length; ++k) {
				for(j = 0; j< document.forms[k].length; ++j) { 
					var e = document.forms[k].elements[j]; 
					if(e.type == "select-one") {
						document.forms[k].elements[j].style.visibility = "hidden"
					}
				}
	}
}
function showAd11(){
	if (ie){documentWidth  =truebody().offsetWidth/2+265;
	documentHeight = 288}	
	else if (ns){documentWidth=window.innerWidth/2-143;
	documentHeight=328} 
	else if (w3){documentWidth=self.innerWidth/2-143;
	documentHeight=328} 
	

	adDiv.left=documentWidth-200+calunit;adDiv.top =documentHeight-200+calunit;
	if (ie||w3)
    adDiv.visibility="visible";
    else
    adDiv.visibility ="show";
	//setTimeout("showAd1()",1000);}
	//else closeAd();
}
function mOut11(){
	if(!ns && !ie && !w3) return;
		if(ie)		adDiv=eval('document.all.sub20.style');
		else if(ns)	adDiv=eval('document.layers["sub20"]');
		else if(w3)	adDiv=eval('document.getElementById("sub20").style');
	if (ie||w3)
	adDiv.visibility="hidden";
	else
	adDiv.visibility ="hide";
	
	for (k = 0; k < document.forms.length; ++k) {
				for(j = 0; j< document.forms[k].length; ++j) { 
					var e = document.forms[k].elements[j]; 
					if(e.type == "select-one") {
						document.forms[k].elements[j].style.visibility = "visible"
					}
				}
	}
}
function mOver10() {
	//writeCalendar();
	
	if(!ns && !ie && !w3) return;
	if(ie)		adDiv=eval('document.all.sub10.style');
	else if(ns)	adDiv=eval('document.layers["sub10"]');
	else if(w3)	adDiv=eval('document.getElementById("sub10").style');
	showCalendar();
//alert("fuck")
}
function showCalendar(){
	if (ie){documentWidth  =truebody().offsetWidth/2+407;
	documentHeight = 520}	
	else if (ns){documentWidth  =truebody().offsetWidth/2+407;
	documentHeight = 520}	
	else if (w3){documentWidth  =truebody().offsetWidth/2+407;
	documentHeight = 520}	
	adDiv.left=documentWidth-200+calunit;adDiv.top =documentHeight-200+calunit;
	if (ie||w3)
    adDiv.visibility="visible";
    else
    adDiv.visibility ="show";
	
}
function mOut10(){
	if(!ns && !ie && !w3) return;
		if(ie)		adDiv=eval('document.all.sub10.style');
		else if(ns)	adDiv=eval('document.layers["sub10"]');
		else if(w3)	adDiv=eval('document.getElementById("sub10").style');
	if (ie||w3)
	adDiv.visibility="hidden";
	else
	adDiv.visibility ="hide";
}

now = new Date();
var global_month = now.getMonth();
var	global_day = now.getDay();
var	global_year = now.getYear();


function changeCal(loc, val) {
	changeDate(loc, val);
	//writeCalendar();
}
function changeDate(loc, val) {
	if (loc == 1) {
		global_month = val;
	}
	//global_month = document.create_reg_form.selMonth.value;
	//alert("global_month = " + global_month)
	global_day = "1";
	if (loc == 2) {
		global_year = val;
	}
	alert("global_month = " + global_month + "\nglobal_year = " + global_year)
}
function maxDays(mm, yyyy){
var mDay;
	if((mm == 3) || (mm == 5) || (mm == 8) || (mm == 10)){ 
		mDay = 30;
  	}
  	else{
  		mDay = 31
  		if(mm == 1){
   			if (yyyy/4 - parseInt(yyyy/4) != 0){
   				mDay = 28
   			}
		   	else{
   				mDay = 29
  			}
		}
  }
return mDay; 
}
function getDayOfTheWeedk(myDate) {
	myDate = new Date();
	return(myDate.getDay());
}