
//Quita los espacios de una cadena
function trimStr(str) {
  str = this != window? this : str;
  return str.replace(/^\s+/g, '').replace(/\s+$/g, '');
}

//Muestra la una de las imagenes de menu y oculta el resto
function ShowSmallConcept(div_number,total_divs){
	num_concepts = total_divs;

	for (i = 0;i < num_concepts;i++){
		eval("showConcept"+i+".style.display='none'");
	}
	eval("showConcept"+div_number+".style.display='block'");
}

//Cambio entre mapas de la seccion contact us
function ShowMap(div_number){
	for (i = 1;i < 4;i++){ //los mapas van del 1 al 3
		eval("map"+i+".style.display='none'");
	}
	eval("map"+div_number+".style.display='block'");
}

//Abre un popup para mostrar una imagen en tamaņo grande
function ShowImage (image,width,height,top,left){
	width_window = width + 160;
	height_window = height + 100;

	if (width < 800){ width_window = 800} //para las imagenes de las caņitas esas, ancho minimo

	window.open("view_image.php?imagen=" + image + "&img_width=" + width + "&img_height=" + height,"","left=" + left + ",top=" + top + ",width="+ width_window +",height= "+ height_window +",toolbar=no,status=no,scrollbars=yes,fullscreen=no,resizable=yes");
}


function Open_Specifications(product,width,height){

	filename = "includes/popups/spec_" + product + ".php";
	
	window.open(filename,"","toolbar=no,scrollbars=yes,width=" + width + ",height=" + height + ",top=50,left=200");

}

function Open_LocationDetails(locationpage,width,height){

	filename = "includes/popups/location_" + locationpage + ".php";
	
	window.open(filename,"","toolbar=no,scrollbars=yes,width=" + width + ",height=" + height + ",top=100,left=200");

}

function Open_Popup(locationpage,width,height,top,left){

	filename = "includes/popups/"+locationpage;
	
	window.open(filename,"","toolbar=no,scrollbars=yes,width=" + width + ",height=" + height + ",top=" + top + ",left=" + left);

}

function SetFocus(objeto){
	objeto.style.backgroundColor="#FFFFCC";
}

function LostFocus(objeto){
	objeto.style.backgroundColor="";
}


function LoadPic_ToDiv(pic,div){
	//alert("pic:" + pic + " div:" + div);
	//alert("document."+ div + ".innerHTML = \"<img src='images/" + pic + "' border='0'>\"");
	//alert(div.id);
	objeto = document.getElementById(div);
	eval("objeto.innerHTML= \"<img src='images/" + pic + "' border='1' bordercolor='#FFFFFF'>\"");
}

//Funciones de la pagina de profesionalweb

function set_ref() {
	document.formulario.referencia.value= document.formulario.dominio1.value + "20042004103248";
}


function checkdomain(theURL,winName,features) { //v2.0
	var dominio="";
	//dominio=(document.forms["formulario"].dominio1.value);
	dominio=(document.formulario.dominio1.value);
	if (dominio==""){
	alert("Please enter a domain name");
	//document.formulario.dominio1.style.backgroundColor="FFCCCC";
	document.formulario.dominio1.focus();
	} else {
	var extension="";
	//extension=(document.forms["formulario"].extension.value);
	extension=(document.formulario.extension.value);
	theURL=theURL + "?i_domain_name=" + dominio + "&i_domain_ext=" + extension;
	window.open(theURL,winName,features);
	}
}

 function calcula_anyos_registro() {
// alert('NO DISPONIBLE: En construccion.');
//alert(document.formulario.anyos_registro.value);

	if (document.formulario.anyos_registro.value=="1"){
		document.formulario.coste.value="13943";
		precio_dominio.innerHTML = "The price for this service is 139,43 &euro;";
	 } else if (document.formulario.anyos_registro.value=="2"){
		document.formulario.coste.value="20918";
		precio_dominio.innerHTML = "The price for this service is 209,18 &euro;";
	 } else if (document.formulario.anyos_registro.value=="5") {
		document.formulario.coste.value="54091";
		precio_dominio.innerHTML = "The price for this service is 540,91 &euro;";
	 } else if (document.formulario.anyos_registro.value=="10"){
		document.formulario.coste.value="97364";
		precio_dominio.innerHTML = "The price for this service is 973,64 &euro;";
	 }
 
 }
