
// JavaScript Document
function attachEventListener(target, eventType, functionRef, capture) {
    if (typeof target.addEventListener != "undefined") {
        target.addEventListener(eventType, functionRef, capture);
    } else if (typeof target.attachEvent != "undefined") {
        target.attachEvent("on" + eventType, functionRef);
    } else {
        return false;
    }
    return true;
}


function target_blank() {
	if (!document.getElementsByTagName) return;
	var anchors = document.getElementsByTagName("a");
	var i, enlace;
	for (i = 0; i < anchors.length; i++) {
		if (anchors[i].getAttribute("href") && anchors[i].getAttribute("rel") == "external") anchors[i].target = "_blank";
	}
}


$(document).ready(function(){
			$("a[rel^='prettyPhoto']").prettyPhoto({
				animationSpeed: 'normal', /* fast/slow/normal */
				padding: 40, /* padding for each side of the picture */
				opacity: 0.80, /* Value betwee 0 and 1 */
				showTitle: true, /* true/false */
				allowresize: true, /* true/false */
				counter_separator_label: '/', /* The separator for the gallery counter 1 "of" 2 */
				theme: 'dark_square', /* light_rounded / dark_rounded / light_square / dark_square */
				callback: function(){}
			});
		});






function mostrar_ocultar_informacion(){ 
	$(document).ready(function() {	
		$("h2.listaproducto").toggle(
			function () { 
				$(this).next().slideDown("fast");
				$(this).addClass("abierto");
			},
			function () { 
				$(this).next().slideUp("fast");
				$(this).removeClass("abierto");
			}
		);
	});
}



attachEventListener(window, "load", target_blank, false);
mostrar_ocultar_informacion();

