// JavaScript Document
$(document).ready(function(){
	$("#link_empresa").click(function(){
		$("#menu_productos").slideUp('slow');
		$("#menu_catalogo").slideUp('slow');
		$("#menu_empresa").slideToggle('slow');
	});
	$("#link_productos").click(function(){
		$("#menu_empresa").slideUp('slow');
		$("#menu_catalogo").slideUp('slow');
		$("#menu_productos").slideToggle('slow');
	});
	$("#link_catalogo").click(function(){
		$("#menu_empresa").slideUp('slow');
		$("#menu_productos").slideUp('slow');
		$("#menu_catalogo").slideToggle('slow');
	});
});


function trim(inputString) {
   // Removes leading and trailing spaces from the passed string. Also
   // removes consecutive spaces and replaces it with one space.
   var retValue = inputString;
   var ch = retValue.substring(0, 1);
   while (ch == " ") { // Check for spaces at the beginning of the string
      retValue = retValue.substring(1, retValue.length);
      ch = retValue.substring(0, 1);
   }
   ch = retValue.substring(retValue.length-1, retValue.length);
   while (ch == " ") { // Check for spaces at the end of the string
      retValue = retValue.substring(0, retValue.length-1);
      ch = retValue.substring(retValue.length-1, retValue.length);
   }
   while (retValue.indexOf("  ") != -1) { // Note that there are two spaces in the string - look for multiple spaces within the string
      retValue = retValue.substring(0, retValue.indexOf("  ")) + retValue.substring(retValue.indexOf("  ")+1, retValue.length); // Again, there are two spaces in each of the strings
   }
   return retValue; // Return the trimmed string back to the user
} // Ends the "trim" functio


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() { //v6.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 sel_dest(val){
	if( (val=="Espaņa") || (val=="United States") || (val=="France") || (val=="China") || (val=="Germany") ){
		document.getElementById("del_email").value = val;
	}
	else if((val=="Austria")) document.getElementById("del_email").value = "Germany";
	else document.getElementById("del_email").value = "Espaņa";
}
function scrollear(dir, axis, desplazamiento, velocidad, selector){
	if( ((dir!=1)&&(dir!=-1)) || (axis!="x")&&(axis!="y") || (selector=="") ) return false;
	else{
		if(dir==-1) signo = "-";
		else signo = "+";
		$(selector).scrollTo(signo+"="+desplazamiento+"px", velocidad, {axis: axis});
	}
}