// JavaScript Document
var strQueryStrings = "[<%=request.querystring()%>]";
//Funciones para corregir ejemplos



function SetLanguage(selection){
	url = "/?mod=setlanguage&language=" + selection + "&red=" + strQueryStrings;
	document.location = url;
}

function PopImage(type,id, place){
	window.open("image.asp?type=" + type + "&id=" + id + "&place=" + place,"image","toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=1,height=1,left = 0,top = 0");
}

function SearchMan(selection){
	url = "/?mod=search&type=advanced&man_id=" + selection;
	document.location = url;
}

function addToCart(product_id, field_id){
	var quant = document.getElementById("products_to_alter_" + field_id).value;
	if(quant!=0){
		document.location = "/?mod=cart&action=add&id=" + product_id + "&quant=" + quant;
	}
}
function addToCart2(product_id, field_id){

		document.location = "/?mod=cart&action=add&id=" + product_id + "&quant=1" ;
	
}
function deleteFromCart(cookie_id, field_id){
	var quant = document.getElementById("products_to_alter_" + field_id).value;
	if(quant!=0){
		document.location = "/?mod=cart&action=delete&id=" + cookie_id + "&quant=" + quant;
	}
}

function showError(number, source, description){
	div_name = "errordiv";
	document.getElementById(div_name).style.visibility = "";
}



var dom = (document.getElementById) ? true : false;
var ns5 = ((navigator.userAgent.indexOf("Gecko")>-1) && dom) ? true: false;
var ie5 = ((navigator.userAgent.indexOf("MSIE")>-1) && dom) ? true : false;
var ns4 = (document.layers && !dom) ? true : false;
var ie4 = (document.all && !dom) ? true : false;



var nodyn = (!ns5 && !ns4 && !ie4 && !ie5) ? true : false;

// resize fix for ns4
var origWidth, origHeight;
if (ns4) {
	origWidth = window.innerWidth; origHeight = window.innerHeight;
	window.onresize = function() { if (window.innerWidth != origWidth || window.innerHeight != origHeight) history.go(0); }
}

// avoid error of passing event object in older browsers
if (nodyn) { event = "nope" }

function getCookie(name) {
    var dc = document.cookie;
    var prefix = name + "=";
    var begin = dc.indexOf("; " + prefix);
    if (begin == -1) {
        begin = dc.indexOf(prefix);
        if (begin != 0) return null;
    } else {
        begin += 2;
    }
    var end = document.cookie.indexOf(";", begin);
    if (end == -1) {
        end = dc.length;
    }
    return unescape(dc.substring(begin + prefix.length, end));
}
startList = function() {
if (document.all&&document.getElementById) {
navRoot = document.getElementById("menulist");
if (navRoot){
	for (i=0; i<navRoot.childNodes.length; i++) {
		node = navRoot.childNodes[i];
		if (node.nodeName=="LI") {
			node.onmouseover=function() {
				this.className+=" over";
			  }
			  node.onmouseout=function() {
				  this.className=this.className.replace(" over", "");
				   }
			   }
		  }
	 }}
}
window.onload=startList;


