var	wHandleVkbd = null;
var hCurrentField = null;

function winVkbd(hFieldObj) {
   if (wHandleVkbd  && !wHandleVkbd.closed) {
	   wHandleVkbd.close();
	}
   wHandleVkbd = window.open("hebrew.html","","width=390,height=375");
   wHandleVkbd.opener = this;
   hCurrentField = hFieldObj;
  }

function closeVkbd() {
   if (wHandleVkbd)
	  wHandleVkbd.close();
	}	
	
function Validationkeyword(theform)
{
  if (theform.Keyword.value == "")
  {
    alert("Please enter your search keyword.");
    theform.Keyword.focus();
    return (false);
  }
    return (true);
 } 
 
 function ValidationLogin()
{
  if (frmLogin.uid.value == "" || frmLogin.pwd.value == "")
  {
    alert("Please enter your login username and password.");
    frmLogin.uid.focus();
    return (false);
  }
    return (true);
 } 

function displayWindow(url, width, height) {
      var url1 = 'bigimage.asp?pic=' + url + '&height=' + height + '&width=' + width;
	  var Win = window.open(url1,"",'width=' + (width + 20) + ',height=' + (height + 60) + ',resizable=1,scrollbars=yes,menubar=no,status=no' );
	}
		
function switchImage(sColor,fillsize) {
	var colorpath = 'color/' ;
	var colorPic = ColorMatrix[sColor];
	
    if (sColor != "") {
	   if (document.images.ItemPic) {
		   document.images.ItemPic.src = colorpath + colorPic;
	      }
	   } 
	   
	if (fillsize == 1) {FillSizeList();}    
    }
    
function Validateminorder()
 {                      
   var f = window.document.frmDetail;
   var qty = f.qty.value;
   var minorder = f.minorder.value;
   
   if (qty == "")
  {
    alert("Please enter Qty.");
    f.qty.focus();
    return (false);
  }
  
  for(var i=0; i < f.elements.length; i++) {
      var e = f.elements[i];
      
      if (e.type == "select-one" && e.options[e.options.selectedIndex].value =="mustselect") {
         alert("You have to choose this option."); 
         e.focus();
         return (false);
      }
    }
   
   return (true);
 }
 
 
 function ValidateWholesale()
{
 var f = document.frmRegister;
 
 if (f.Company_name1.value == "")
  {
    alert("Company name is Required.");
    f.Company_name1.focus();
    return (false);
  }
 
 if (f.Conatct_Name1.value == "")
  {
    alert("Conatct Name is Required.");
    f.Conatct_Name1.focus();
    return (false);
  }
 
 if (f.Address_1.value == "")
  {
    alert("Address1 is Required.");
    f.Address_1.focus();
    return (false);
  }
 
 if (f.City1.value == "")
  {
    alert("City is Required.");
    f.City1.focus();
    return (false);
  }  
 
 if (f.State1.options[f.State1.options.selectedIndex].value == "") {
     alert("Please Select State.");
     f.State1.focus();
     return (false);
  }
  
 if (f.Zip_Code1.value == "")
  {
    alert("Zip Code is Required.");
    f.Zip_Code1.focus();
    return (false);
  }  
  
 if (f.Phone1.value == "")
  {
    alert("Phone is Required.");
    f.Phone1.focus();
    return (false);
  }  
 
 if (f.E_mail1.value == "")
  {
    alert("E-mail Address is Required.");
    f.E_mail1.focus();
    return (false);
  }
  
 return (true);
}  