// Functions that handle show - hide layers. //

function MM_showHideLayers() { //v3.0

  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 MM_findObj(n, d) { //v4.0

  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 && document.getElementById) 

  x=document.getElementById(n); 

  return x;

}



//reloads the window if Nav4 resized

function MM_reloadPage(init) {  

  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {

    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}

  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();

}

MM_reloadPage(true);





//Resize Page for maximum view area//

function maxview(){

	window.moveTo(0,0);

	window.resizeTo(screen.availWidth, screen.availHeight);

}



//HIDE THE INFO IN THE STATUS BAR

function nostat(){

	status='';

	return true;



}



// DOLOGIN ----------------------------------------------

function dologin(data){

	var vcheck = "yes";

	for(i=0;i<document.ulo.length;i++){

		if(document.ulo.elements[i].value == ""){

			alert ("\nInvalid Entry. Please Revise.")

			document.ulo.elements[i].focus();

			vcheck = "no";

			return false;

		}

	}

	if(vcheck == "yes"){

		document.ulo.action = "sitescripts/li.php";

		document.ulo.submit();

		return true;

	}

	else{

		return false;

	}

	

}

//---------------------------------------------------------

//VERIFY CONTACT US FORM

function fun_feedback(data){

	for(i=0;i<document.feedback.length;i++){

		if(document.feedback.fromname.value == ""){

			alert ("\nInvalid Entry. Please Revise.")

			document.feedback.fromname.focus();

			return false;

		}

		else{

			if(document.feedback.fromemail.value == ""){

				alert ("\nInvalid Entry. Please Revise.")

				document.feedback.fromemail.focus();

				return false;

			}

		}		

	}

	document.feedback.submit();

	return true;



}



//VERIFY LOG IN FORM

function fun_login(data){

	for(i=0;i<document.vmenu.length;i++){

		if(document.login.uemail.value == ""){

			alert ("\nInvalid Entry. Please Revise.")

			document.login.uemail.focus();

			return false;

		}

		else{

			if(document.login.upwd.value == ""){

				alert ("\nInvalid Entry. Please Revise.")

				document.login.upwd.focus();

				return false;

			}

		}		

	}

	document.login.submit();

	return true;



}

//VERIFY FORMS (f)

function fcheck0(data){

	for(i=0;i<document.forms[0].length;i++){

		if(document.forms[0].elements[i].value == "" || document.forms[0].elements[i].value == 666){

			alert ("\nInvalid Entry. Please Revise.")

			document.forms[0].elements[i].focus();

			return false;

		}

	}

	document.forms[0].submit();

	return true;



}



//VERIFY FORMS (f)

function fcheck(data){

	for(i=0;i<document.forms[1].length;i++){
		if(document.forms[1].elements[i].type!="hidden")
		{
			if(document.forms[1].elements[i].value == "" || document.forms[1].elements[i].value == 666)
			{
	
				alert ("\nInvalid Entry. Please Revise.")
				document.forms[1].elements[i].focus();			
				return false;
	
			}
		}

	}

	document.forms[1].submit();

	return true;



}


function fcheckanis(data){

	for(i=0;i<document.forms[1].length;i++){
		if(document.forms[1].elements[i].type!="hidden")
		{
			if(document.forms[1].elements[i].value == "" || document.forms[1].elements[i].value == 666)
			{
	
				alert ("\nInvalid Entry. Please Revise.")
				document.forms[1].elements[i].focus();			
				return false;
	
			}
		}

	}

	return true;

}





//VERIFY FORMS (f)

function fcheck2(data){

	for(i=0;i<document.forms[2].length;i++){

		if(document.forms[2].elements[i].name == "MPITEM_PICTURE[]"){

			if(document.forms[2].with_pic.value == 1 && document.forms[2].elements[i].value == ""){

				alert ("\nInvalid Entry. Please Revise.")

				document.forms[2].elements[i].focus();

				return false;

			}

		}

		else{

			if(document.forms[2].elements[i].value == "" || document.forms[2].elements[i].value == 666){

				alert ("\nInvalid Entry. Please Revise.")

				document.forms[2].elements[i].focus();

				return false;

			}

				

		}	

	}

	document.forms[2].submit();

	return true;



}



//CONFIRMATION 

function verify(){

	if(confirm("\nAre you certain about this action?.")){

		document.forms[0].submit();

		return true;

	}

	else{

		return false;

	}	



}



//CONFIRMATION 

function fverify(){

	if(confirm("\nAre you certain about this action?.")){

		document.forms[1].submit();

		return true;

	}

	else{

		return false;

	}	



}



//CONFIRMATION 

function deltrans(){

	if(confirm("\nAre you certain about this action?.")){

		document.act.action = "VJSmain.php?a=d";

		document.act.submit();

		return true;

	}

	else{

		return false;

	}	



}



//OPEN WINDOW

function OpenWindow(file,n,h,w){

	window.open(file,n,'height='+h+',width='+w+',scrollbars=auto,location=no,menubar=no,toolbar=no,resizable=no');

}



//OPEN WINDOW2

function OpenWindow2(file,n,h,w){

	window.open(file,n,'height='+h+',width='+w+',scrollbars=yes,location=no,menubar=no,toolbar=no,resizable=no');

}



function toolTips(evt,currElem) {

// Creates the tool tip for Internet Explorer

  if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4)) {

    tipWin = eval("document.all." + currElem + ".style");

// Number at end of next line indicates the number of pixels from the bottom of the cursor the tip is

    tipWin.top = parseInt(evt.y)+2;

// Number at end of next line indicates the number of pixels to the left of the cursor the tip is

    tipWin.left = Math.max(2,parseInt(evt.x)+15);

    tipWin.visibility = "visible";

    tipWin.status = "";

  }

// Creates the tool tip for Netscape

  if ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) >= 4)) {

    tipWin = eval("document." + currElem);

// Number at end of next line indicates the number of pixels from the bottom of the cursor the tip is

    tipWin.top = parseInt(evt.pageY)+2;

// Number at end of next line indicates the number of pixels to the left of the cursor the tip is

    tipWin.left = Math.max(2,parseInt(evt.pageX)+15);

    tipWin.visibility = "visible";

    tipWin.status = "";

  }

}





function tipDown(currElem) {

// Closes the tool tip for Internet Explorer

  if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4)) {

    tipWin = eval("document.all." + currElem + ".style");

    tipWin.visibility = "hidden";

  }

// Closes the tool tip for Netscape

  if ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) >= 4)) {

    tipWin = eval("document." + currElem);

    tipWin.visibility = "hidden";

  }

}