// 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_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 validationregistration(theForm)
{
	
/*  if (theForm.uname.value == "")
  {
    alert("Please enter the \"User Name\" .");
    theForm.uname.focus();
    return (false);
  }*/
 if (theForm.password.value == "")
  {
    alert("Please enter the \"Password\" .");
    theForm.password.focus();
    return (false);
  }
 if (theForm.repassword.value == "")
  {
    alert("Please enter the \"Password\" .");
    theForm.repassword.focus();
    return (false);
  }
 if (theForm.repassword.value != theForm.password.value)
  {
    alert("Password Mismatch.");
    theForm.password.focus();
    return (false);
  }
  
  if (theForm.email.value == "")
  {
    alert("Please enter the \"E-Mail\" .");
    theForm.email.focus();
    return (false);
  }
  if (theForm.reemail.value != theForm.email.value)
  {
    alert("Mismatch \"E-Mail\" .");
    theForm.reemail.focus();
    return (false);
  }
if(theForm.email.value.indexOf(" ") >= 0)
{
	alert("Please enter your email-id without any white space character.");
	theForm.email.focus();
	return (false);
}
if ( (theForm.email.value.indexOf("@") == -1) || (theForm.email.value.indexOf(".") == -1) )
{
	alert("Please enter a valid email-id"); 
	theForm.email.focus();
	return (false);
}


BeforeAtRate = theForm.email.value.substring(0,theForm.email.value.indexOf("@"));
AfterAtRate = theForm.email.value.substring(theForm.email.value.indexOf("@")+1,theForm.email.value.length);

if (AfterAtRate.indexOf(".") == -1)
{
	alert("Please enter a valid email-id"); 
	theForm.email.focus();
	return (false);
}

middle = AfterAtRate.substring(0, AfterAtRate.indexOf("."));
last = AfterAtRate.substring(AfterAtRate.indexOf(".") + 1,AfterAtRate.length);

if (BeforeAtRate.length == 0 || middle.length == 0 || last.length == 0)
{
	alert("Please enter a valid email-id"); 
	theForm.email.focus();
	return (false);
}
  if (theForm.reemail.value == "")
  {
    alert("Please enter the \"E-Mail\" .");
    theForm.reemail.focus();
    return (false);
  }

  if (theForm.fname.value == "")
  {
    alert("Please enter the \"First Name\" .");
    theForm.fname.focus();
    return (false);
  }
  if (theForm.phno.value == "")
  {
    alert("Please enter the \"Phone No\" .");
    theForm.phno.focus();
    return (false);
  }
  
  if (theForm.country.value == "")
  {
    alert("Please enter the \"Country\" .");
    theForm.country.focus();
    return (false);
  }
  return(true);
}

function validationchangepass(theForm)
{
	
  if (theForm.password.value == "")
  {
    alert("Please enter the \"Password\" .");
    theForm.password.focus();
    return (false);
  }
 if (theForm.repassword.value == "")
  {
    alert("Please enter the \"Password\" .");
    theForm.repassword.focus();
    return (false);
  }
 if (theForm.repassword.value != theForm.password.value)
  {
    alert("Password Mismatch.");
    theForm.password.focus();
    return (false);
  }

}

function validationcart(theForm)
{	
  if (!isnumeric(theForm.qty.value))
  {
    alert("Please enter valid qty .");
    theForm.qty.focus();
    return (false);
  }
}

function zoom(arg1,arg2,arg3)
{
	var newwin;	
	//alert (arg);
//        newwin=window.open(arg, "", "toolbar=0, scrollbars=0, location=0, statusbar=0, menubar=0, resizable=yes, directories=0, screenX=0, screenY=0, width=300 height=600");
newwin=window.open("zoomin.asp?id=" + arg1 + "&rn=" + arg2 + "&cat=" + arg3,"", "toolbar=0, scrollbars=0, location=0, statusbar=0, menubar=0, resizable=yes, directories=0, screenX=0, screenY=0, width=413 height=291");
}

function validationquote(theForm)
{
  if (theForm.fname.value == "")
  {
    alert("Please enter the \"Name\" .");
    theForm.fname.focus();
    return (false);
  }
   if (theForm.email.value == "")
  {
    alert("Please enter the \"Email No\" .");
    theForm.email.focus();
    return (false);
  }
  if(theForm.email.value.indexOf(" ") >= 0)
{
	alert("Please enter your email-id without any white space character.");
	theForm.email.focus();
	return (false);
}
if ( (theForm.email.value.indexOf("@") == -1) || (theForm.email.value.indexOf(".") == -1) )
{
	alert("Please enter a valid email-id"); 
	theForm.email.focus();
	return (false);
}


BeforeAtRate = theForm.email.value.substring(0,theForm.email.value.indexOf("@"));
AfterAtRate = theForm.email.value.substring(theForm.email.value.indexOf("@")+1,theForm.email.value.length);

if (AfterAtRate.indexOf(".") == -1)
{
	alert("Please enter a valid email-id"); 
	theForm.email.focus();
	return (false);
}

middle = AfterAtRate.substring(0, AfterAtRate.indexOf("."));
last = AfterAtRate.substring(AfterAtRate.indexOf(".") + 1,AfterAtRate.length);

if (BeforeAtRate.length == 0 || middle.length == 0 || last.length == 0)
{
	alert("Please enter a valid email-id"); 
	theForm.email.focus();
	return (false);
}
  
  if (theForm.phno.value == "")
  {
    alert("Please enter the \"Phone No\" .");
    theForm.phno.focus();
    return (false);
  }
  if (theForm.country.value == "")
  {
    alert("Please enter the \"Country\" .");
    theForm.country.focus();
    return (false);
  }
  return(true);
}



function validationquote1(theForm)
{
  if (theForm.msg.value == "")
  {
    alert("Please enter the \"Message\" .");
    theForm.msg.focus();
    return (false);
  }
  return(true);
}
