function MouseOn(but_bg)
{
	but_bg.className="tdbg_on";
	but_bg.style.cursor="hand";
}
function MouseOff(but_bg, cpage)
{
	var chref = document.location.href;
	var start = chref.lastIndexOf("/");
	var nhref = chref.substr(start+1, chref.length)
	if (cpage == nhref + ".asp")
		but_bg.className="tdbg_on";
	else
		but_bg.className="tdbg_off";
}

function chngUrl(strUrl)
{
	window.location=strUrl + ".asp";
}

function preloadImages() { //v3.0
	var d=document;
	if(d.images)
	{
		if(!d.p) d.p=new Array();
		var i,j=d.p.length,a=preloadImages.arguments;
		for(i=0; i<a.length; i++)
			if (a[i].indexOf("#")!=0)
			{
				d.p[j]=new Image;
				d.p[j++].src=a[i];
			}
	}
}
function open_image(imgName)
{
	var img=imgName;
	var fs=window.open("","full_size","width=1024, height=768, menubar=0, resizable=0, scrollbars=0, status=0, toolbar=0, location=0, copyhistory=0, dependent=1");
	fs.moveTo(0,0);
	fs.document.write("<html>");
	fs.document.write("<body bgcolor='#000000' topmargin='0' leftmargin='0'>");
	fs.document.write("<table border='0' width='1024' height='768' cellpadding='0' cellspacing='0'>");
	fs.document.write("<tr>");
	fs.document.write("<td valign='middle' align='center' width='100%' height='100%'>");
	fs.document.write("<img src='"+img+"' onClick='window.close();' alt='Click to close' style='cursor:hand;'>");
	fs.document.write("</td>");
	fs.document.write("</tr>");
	fs.document.write("</table>");
	fs.document.write("</body>");
	fs.document.write("</html>");
}
function upd(trg)
{
	var trgt = trg;
	var cday = "";
	var cmonth = "";
	var cyear = "";
	if(trgt == "m9")
	{
		cday = String(document.getElementById("bday").value);
		cmonth = String(document.getElementById("bmonth").value);
		cyear = String(document.getElementById("byear").value);
	}
	if(trgt == "m16")
	{
		cday = String(document.getElementById("eday").value);
		cmonth = String(document.getElementById("emonth").value);
		cyear = String(document.getElementById("eyear").value);
	}
	if(trgt == "m17")
	{
		cday = document.getElementById("lday").value;
		cmonth = document.getElementById("lmonth").value;
		cyear = document.getElementById("lyear").value;
	}
	if(trgt == "m34")
	{
		cday = document.getElementById("w1sday").value;
		cmonth = document.getElementById("w1smonth").value;
		cyear = document.getElementById("w1syear").value;
	}
	if(trgt == "m35")
	{
		cday = document.getElementById("w1lday").value;
		cmonth = document.getElementById("w1lmonth").value;
		cyear = document.getElementById("w1lyear").value;
	}
	if(trgt == "m45")
	{
		cday = document.getElementById("w2sday").value;
		cmonth = document.getElementById("w2smonth").value;
		cyear = document.getElementById("w2syear").value;
	}
	if(trgt == "m46")
	{
		cday = document.getElementById("w2lday").value;
		cmonth = document.getElementById("w2lmonth").value;
		cyear = document.getElementById("w2lyear").value;
	}
	if(trgt == "m56")
	{
		cday = document.getElementById("w3sday").value;
		cmonth = document.getElementById("w3smonth").value;
		cyear = document.getElementById("w3syear").value;
	}
	if(trgt == "m57")
	{
		cday = document.getElementById("w3lday").value;
		cmonth = document.getElementById("w3lmonth").value;
		cyear = document.getElementById("w3lyear").value;
	}
	if(trgt == "m67")
	{
		cday = document.getElementById("w4sday").value;
		cmonth = document.getElementById("w4smonth").value;
		cyear = document.getElementById("w4syear").value;
	}
	if(trgt == "m68")
	{
		cday = document.getElementById("w4lday").value;
		cmonth = document.getElementById("w4lmonth").value;
		cyear = document.getElementById("w4lyear").value;
	}
	if(trgt == "m78")
	{
		cday = document.getElementById("w5sday").value;
		cmonth = document.getElementById("w5smonth").value;
		cyear = document.getElementById("w5syear").value;
	}
	if(trgt == "m79")
	{
		cday = document.getElementById("w5lday").value;
		cmonth = document.getElementById("w5lmonth").value;
		cyear = document.getElementById("w5lyear").value;
	}

	if(cday.length != "" && cmonth.length != "" && cyear.length != "")
		document.getElementById(trgt).value = (cday.length==1?"0"+cday:cday) + "/"+ (cmonth.length==1?"0"+cmonth:cmonth) + "/" + cyear;
	else
		document.getElementById(trgt).value = "";
}
function openclose(pane)
{
	var npane = pane;
	if(document.getElementById(npane).style.display == '')
		document.getElementById(npane).style.display = 'none';
	else
		document.getElementById(npane).style.display = '';
}
