var CUR_FOTO = 0;
function Carga_foto(ruta,nombre,idVestido) {
	var PeliculaObj = document.pn_imagen_coleccion;
	CUR_FOTO = idVestido;
	
	PeliculaObj.SetVariable("foto", ruta);
	try { PeliculaObj.SetVariable("nombre_vestido", unescape( nombre )); } 
	catch(e) {}
}

function AddFav(){
	var PeliculaObj = document.pn_imagen_coleccion;

	if (CUR_FOTO != 0 && CUR_FOTO != "0" && CUR_FOTO != "undefined") {
	    PeliculaObj.SetVariable("addFav", "yes");
	    PeliculaObj.SetVariable("idVestido", CUR_FOTO);
	}
}

function Imprimir() {
    var PeliculaObj = document.pn_imagen_coleccion;	

    if (CUR_FOTO != 0 && CUR_FOTO != "0" && CUR_FOTO != "undefined") {
        PeliculaObj.SetVariable("imprimir", "yes");
        PeliculaObj.SetVariable("idVestido", CUR_FOTO);
    }
}

function descargarPdf(idioma) {
    var idiomaServices = "1";
    switch (idioma) {
        case 1:
            idiomaServices = "1";
            break;
        case 2:
        case 3:
            idiomaServices = "3";
            break;
        case 4:
        case 5:
            idiomaServices = "2";
            break;
        case 6:
            idiomaServices = "8";
            break;
			
        case 7:
            idiomaServices = "6";
            break;

        case 8:
            idiomaServices = "7";
            break;

        case 9:
            idiomaServices = "5";
            break;

        case 10:
            idiomaServices = "8";
            break;

        case 11:
            idiomaServices = "9";
            break;

    }

    if (CUR_FOTO != 0 && CUR_FOTO != "0" && CUR_FOTO != "undefined") {
        var w = window.open("http://webservices.pronovias.com/pdf.asp?idioma=" + idiomaServices  + "&idvestido=" + CUR_FOTO + "&idVista=1&marca=2");
    }
}


function loadAjaxMaps(idTienda, lat, lng) {
    window.open('http://www.pronovias.com/googleMaps.asp?idTienda=' + idTienda + '&ie=1&lat=' + lat + '&lng=' + lng, '', 'width=410,height=460,scrollbars=false');
}

function openPolitica(pag) {
    window.open(pag, "legal", "width=400,height=500,scrollbars=1");
}

function AddScreen(Screen) {
    WEBStore.GlobalScreen.SetScreenResolution(Screen);

    // if (Screen == "1024") {
    //     window.location = '/selFullWindow.html';
    // }
    // else {
        if (!$.browser.opera) {
            setTimeout("window.location = window.location;", 100);
        }
    // }
}

$(document).ready(function() {
    if ($("div").is("#area_scroll")) {
        $('#area_scroll').jScrollPane({ scrollbarWidth: 20, scrollbarMargin: 10, showArrows: true });
    }
    if ($("div").is("#area_scroll_buscador")) {
        $('#area_scroll_buscador').jScrollPane({ scrollbarWidth: 20, scrollbarMargin: 10, showArrows: true });
    }
});




/* MENU IZQUIERDA */

function ocultaMenu(m) {
	if (m=="2011") {
		// imo, ocultar los menus 2010 y 2011
		var arrColecciones2011 = [ "9002", "9003", "9004", "9005", "9006", "9007", "9008" ];
		$.each(arrColecciones2011, function(index, value) { 
			$("#menu_"+value).css("display", "none");
			// $("#menu_"+value).fadeOut(40*(index+1));
		});
	}
	else if (m=="2010") {
		var arrColecciones2010 = [ "35", "42", "404", "405"];
		$.each(arrColecciones2010, function(index, value) { 
			$("#menu_"+value).css("display", "none");
			// $("#menu_"+value).fadeOut(40*(index+1));
		});
	}
}

	function ensenaMenu(m) {
		if (m=="2011") {
			// imo, ocultar los menus 2010 y 2011
			var arrColecciones2011 = [ "9002", "9003", "9004", "9005", "9006", "9007", "9008" ];
			$.each(arrColecciones2011, function(index, value) { 
				$("#menu_"+value).css("display", "block");
				$("#menu_"+value).slideDown(900);
				
			});
		}
		else if (m=="2010") {
			var arrColecciones2010 = [ "35", "42", "404", "405"];
			$.each(arrColecciones2010, function(index, value) { 
				// $("#menu_"+value).slideDown(900);
				$("#menu_"+value).css("display", "block");
			});
		}
	}

	
	$(document).ready(function() {
		// ocultamos los menús
		b2010Ocultado = true;
		if (!stayOnHome) {
			if($("#menu_32").attr("class")=="nivel2marcado") {
				ensenaMenu("2010");
				b2010Ocultado = false;
			}
			if($("#menu_9000").attr("class")=="nivel2marcado") {
				ensenaMenu("2011");
			}
		}
		
		// marcamos overs
		$("#menu_9000").hover(
			function () {
				$(this).addClass("menuover");
			}, 
			function () {
				$(this).removeClass("menuover");
			}
		);
		
		/*
		$('#menu_9000').click(function() {
			ensenaMenu("2011");
			ocultaMenu("2010");
		});
		*/

		$("#menu_32").hover(
			function () {
				$(this).addClass("menuover");
			}, 
			function () {
				$(this).removeClass("menuover");
			}
		);

		/*
		$('#menu_32').click(function() {
			ensenaMenu("2010");
			ocultaMenu("2011");
		});		
		*/
	});


