function LoginArea(){
  window.open("http://secure.faxportlogistics.com/login.asp","","");
}

function ShowInventory(iCode){
  Execute("/ShowCustomer.asp?Cust=" + iCode,"");
}


function ViewImage(sVal){
	document.getElementById("Image").scr = sVal;
	alert(document.getElementById("Image").scr);
}

function PreLoad (objetoImagen, rutaImagen) 
{
    if (document.images)
    {
	eval (objetoImagen +' = new Image()')
	eval (objetoImagen +'.src = "' + rutaImagen + '"')
    }
}

function ChangeImage (capa,nombreImagen,objetoImagen) 
{
    if (document.layers && capa!=null)
	eval('document.' + capa + '.document.images["' + nombreImagen + '"].src = ' + objetoImagen + '.src')
    else
	document.images[nombreImagen].src = eval(objetoImagen + ".src")
}

function FilterCat(){
  document.frmFilters.Target.value="";
  document.frmFilters.submit();
  
}

function SearchItems(){
  if (document.frmFilters.KEYWord.value != ""){
    document.frmFilters.Target.value="FIND";
    document.frmFilters.submit();
  }
}

function SetSpanish(){
  ExecuteLang("SP");
}

function SetEnglish(){
  ExecuteLang("EN");
}

function Page2(iPic){
  var xURL = window.location.href;
  var xPos = 0;
  var xPos1 = 0;

  xPos1 = xURL.indexOf("?");
  
 if (xPos1==-1){
 	xPos = xURL.indexOf("?page=");
  	if (xPos==-1){
    	window.location.href = xURL + "?page=" + iPic;
 	}else{
    	var xAux = xURL.substring(0,xPos);
    	var xChange = xURL.substring(xPos+1, xURL.length);
    	var xPos2 = xChange.indexOf("?");
    	if (xPos2 == -1){
    	  window.location.href = xAux + "?page=" + iPic;
    	}else{
    	  var xCad2 = xChange.substring(xPos2, xChange.length);
    	  window.location.href = xAux + "?page=" + iPic + xCad2;
    	}
  	}
 }else{
 	xPos = xURL.indexOf("?page=");
  	if (xPos==-1){
    	xPos = xURL.indexOf("&page=");
  		if (xPos==-1){
    		window.location.href = xURL + "&page=" + iPic;
  		}else{
   			var xAux = xURL.substring(0,xPos);
   			var xChange = xURL.substring(xPos+1, xURL.length);
   			var xPos2 = xChange.indexOf("&");
    		if (xPos2 == -1){
      			window.location.href = xAux + "&page=" + iPic;
    		}else{
      			var xCad2 = xChange.substring(xPos2, xChange.length);
      			window.location.href = xAux + "&page=" + iPic + xCad2;
   			}
  		}
 	}else{
    	var xAux = xURL.substring(0,xPos);
    	var xChange = xURL.substring(xPos+1, xURL.length);
    	var xPos2 = xChange.indexOf("?");
    	if (xPos2 == -1){
    	  window.location.href = xAux + "?page=" + iPic;
    	}else{
    	  var xCad2 = xChange.substring(xPos2, xChange.length);
    	  window.location.href = xAux + "?page=" + iPic + xCad2;
    	}
  	}
 } 
 
}

function NewSearch(){
  if (document.frmDRT.KEYWord.value != ""){
    document.frmDRT.submit();
  }
}