
function legalwindow( page ) {
window.self.name="polarsite";		// name for main window to able the back links to polar site
options =
  "height=280,width=392,resizable=yes,"
+ "screenX=50,screenY=50,"		// netscape
+ "left=50, top=50,"			// IE
+ "location=no,scrollbars=yes,menubar=no,"
+ "toolbar=no,titlebar=no,personalbar=no,"
+ "personalbar=no,directories=no,"
+ "fullscreen=no"; 		// IE only
	window.open(page, "Legal", options);
}

function glossarywindow( page ) {
window.self.name="polarsite";		// name for main window to able the back links to polar site
options =
  "height=280,width=392,resizable=yes,"
+ "screenX=50,screenY=50,"		// netscape
+ "left=50, top=50,"			// IE
+ "location=no,scrollbars=no,menubar=no,"
+ "toolbar=no,titlebar=no,personalbar=no,"
+ "personalbar=no,directories=no,"
+ "fullscreen=no"; 		// IE only
	window.open(page, "glossary", options);
}

function productfinderwindow( page ) {
window.self.name="polarsite";		// name for main window to able the back links to polar site
options =
  "height=324,width=888,resizable=no,"
+ "screenX=50,screenY=50,"		// netscape
+ "left=50, top=50,"			// IE
+ "location=no,scrollbars=no,menubar=no,"
+ "toolbar=no,titlebar=no,personalbar=no,"
+ "personalbar=no,directories=no,"
+ "fullscreen=no"; 		// IE only
	window.open(page, "productfinder", options);
}
function helpwindow( page ) {
window.self.name="polarsite";		// name for main window to able the back links to polar site
options =
  "height=280,width=392,resizable=yes,"
+ "screenX=50,screenY=50,"		// netscape
+ "left=50, top=50,"			// IE
+ "location=no,scrollbars=yes,menubar=no,"
+ "toolbar=no,titlebar=no,personalbar=no,"
+ "personalbar=no,directories=no,"
+ "fullscreen=no"; 		// IE only
	window.open(page, "Help", options);
}

function featurewindow( page, tabs, content ) {
window.self.name="polarsite";		// name for main window to able the back links to polar site
options =
  "height=280,width=392,resizable=no,"
+ "screenX=50,screenY=50,"		// netscape
+ "left=50, top=50,"			// IE
+ "location=no,scrollbars=no,menubar=no,"
+ "toolbar=no,titlebar=no,personalbar=no,"
+ "personalbar=no,directories=no,"
+ "fullscreen=no"; 		// IE only
  gwin=window.open("", "glossary", options);
  gwin.document.write('<html><head><title>Glosario Polar</title>');
  gwin.document.write('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head>');
  gwin.document.write('<frameset rows="91,*" border="0" framespacing="0" frameborder="NO" onLoad="self.focus();">');
  gwin.document.write('<frame src="');
  gwin.document.write(tabs);
  gwin.document.write('" name="tabs" marginwidth="0" marginheight="0" scrolling="NO" frameborder="NO" noresize>');
  gwin.document.write('<frame src="');
  gwin.document.write(content);
  gwin.document.write('" name="content" marginwidth="0" marginheight="0" scrolling="YES" frameborder="NO" noresize>');
  gwin.document.write('</frameset><noframes><body bgcolor="#FFFFFF" text="#000000"></body></noframes></html>');
  gwin.focus();
  gwin.document.close();
}

//Funcion utilizada para validar el formulario de busca de distribuidores
//-->No esta terminado
function validar_form(formulari){
	if(formulari.tipotienda[0].checked==0 && formulari.tipotienda[1].checked==0 && formulari.tipotienda[2].checked==0 && 
	   formulari.tipotienda[3].checked==0 && formulari.tipotienda[4].checked==0 && formulari.tipotienda[5].checked==0){
		alert("Debe escoger el tipo de tienda a buscar");
		return false;
  	}
	else{
		if(formulari.codigo.value=="" && formulari.localidad.value==""){
			alert("Debe indicar el código postal a utilizar y/o el nombre de la localidad");
			return false;
		}
		else{
			//Generamos la cadena de los tipos para la busqueda
			var primero=0;
			var tipos="";
	
			for(var i=0; i<6; i++){
				if(formulari.tipotienda[i].checked){
					if(primero==0){
						tipos=formulari.tipotienda[i].value;
						primero=1;
					}				
					else{
						tipos+="-"+formulari.tipotienda[i].value;
					}
				}
			}
			//Inicializamos el texto hidden con la lista de los tipos de tienda
			formulari.cad_tipos.value=tipos;
			return true;
		}
	}
}
