// ------------------------------------------------------------------

	function turnOn(imgName) {
		if (document.images) {
			document[imgName].src = eval(imgName + 'on.src');
		}
	}
	
	function turnOff(imgName) {
		if (document.images) {
			document[imgName].src = eval(imgName + 'off.src');
		}
	}
	
	function funnel_win(theURL,winName,width,height) {
		var myWin = window.open(theURL,winName,'width=' + width + ',height=' + height + ',top=' + (screen.height-height)/2 + ',left=' + (screen.width-width)/2 + ',scrollbars=yes');
	}

	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_showHideLayers() { //v3.0 (id, null, 'show/hide')
	  var i,p,v,obj,args=MM_showHideLayers.arguments;
	  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
	    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
	    obj.visibility=v; }
	}
	
// ------------------------------------------------------------------

	function enlargeRuler() {
		minPageHeight = 287;
		minRulerHeight = 0;
		if (document.layers) {
			if (window.innerHeight > minPageHeight) document.images['ruler'].height = (window.innerHeight - minPageHeight) + minRulerHeight;
		}
		else if (document.documentElement.clientHeight > 0) {
			if (document.documentElement.clientHeight > minPageHeight) document.images['ruler'].height = (document.documentElement.clientHeight - minPageHeight) + minRulerHeight;
		}
		else {
			if (document.body.clientHeight > minRulerHeight) document.images['ruler'].height = (document.body.clientHeight - minPageHeight) + minRulerHeight;
		}
	}
	
	function myRuler() {
		minPageHeight = 287;
		minRulerHeight = 0;
		if (document.layers) document.write ('<img src=\"' + rootURL + 'pub/images/dot.gif\" width=\"1\" height=\"'+((window.innerHeight > minPageHeight) ? (window.innerHeight - (minPageHeight + 10)) + minRulerHeight : 1)+'\" name=\"ruler\">');
			else document.write ('<img src=\"' + rootURL + 'pub/images/dot.gif\" width=\"1\" height=\"1\" name=\"ruler\">');
	}
	
	url = document.location.href;
	xend = url.lastIndexOf("/") + 1;
	rootURL = url.substring(0, xend);

function mouseOverTeeth(tooth){
	alert('test');
	document.getElementById('menu_0'+tooth).src = 'images/titlearea/0'+tooth+'_on.jpg';
	document.getElementById('titleImage').src = 'images/titlearea/01_0'+tooth+'.jpg';
	}

//--------------------------------------------------------

function mouseOffTeeth(tooth){
	document.getElementById('menu_0'+tooth).src = 'images/titlearea/0'+tooth+'_off.jpg';
	document.getElementById('titleImage').src = 'images/titlearea/01_01.jpg';
	document.getElementById('menuText'+tooth).style.display = 'none';
}

function paperOver(){
	document.getElementById('menu_01').src = 'images/paper/01_on.gif';
	//document.getElementById('titleImage').src = 'images/titlearea/01_01.jpg';
}


function paperOff(){
	document.getElementById('menu_01').src = 'images/paper/01_off.gif';
	//document.getElementById('titleImage').src = 'images/titlearea/01_01.jpg';
}

function menuOn(id){
	document.getElementById('menu_bone'+id).src = 'images/bones/01_on.gif';
	document.getElementById('menu_title'+id).style.display = 'block';
	document.getElementById('menu_title'+0).style.display = 'none';
	//document.getElementById('titleImage').src = 'images/titlearea/01_01.jpg';
}

function menuOff(id){
	document.getElementById('menu_bone'+id).src = 'images/bones/01_off.gif';
	document.getElementById('menu_title'+id).style.display = 'none';
	document.getElementById('menu_title'+0).style.display = 'block';
	//document.getElementById('titleImage').src = 'images/titlearea/01_01.jpg';
}

function loginFlipVisible() {
	document.getElementById('menuText'+7).style.display = 'none';
	if (document.getElementById('login_div').style.display == 'block'){
			 document.getElementById('login_div').style.display = 'none';
			 //document.getElementById('titleImage').style.display = 'block';
	}
	else {
		 document.getElementById('login_div').style.display = 'block';
		 //document.getElementById('titleImage').style.display = 'none';
	}
	return false;
}

function validateLogin() {
	var alertmsg = '';
	if (document.getElementById('user_id').value.length < 1 ) {
		alertmsg = 'Please Enter a user name\n';
	}
	else if (document.getElementById('user_id').value.length < 8 ) {
		alertmsg = 'User ID must be atleast 8 characters long\n';
	}	
	
	if (document.getElementById('passwd').value.length < 1 ) {
		alertmsg = alertmsg+'Please Enter a password\n';
	}
	else if (document.getElementById('passwd').value.length < 8 ) {
		alertmsg = alertmsg+'A password must be atleast 8 characters long\n';
	}	
	
	if (alertmsg == '') return true;
	else {
		alert(alertmsg);
		return false;
	}
}

function changePage(id, pic_page_id) {
	window.location = 'default.asp?id='+id+'&l=1&pic_page_id='+pic_page_id;	
}

function mouseOverTeeth(tooth){
	document.getElementById('menu_0'+tooth).src = 'images/titlearea/0'+tooth+'_on.jpg';
	//document.getElementById('titleImage').src = 'images/titlearea/01_0'+tooth+'.jpg';
	if (document.getElementById('login_div').style.display != 'block')	
		document.getElementById('menuText'+tooth).style.display = 'block';
}


function mainPageLoad(){
	
	var image1 = new Image();
	var image2 = new Image();
	for (i = 2; i < 10; i ++) {
		if (i != 6) {
			image1.src = 'images/titlearea/01_0' + i +'.jpg';
			image2.src = 'images/titlearea/0' + i + '_on.jpg';
			//alert(image1.src + '\n' | image2.src);
		}
	}
}