function f_logout(){
	setCookie("orguseridp","0",null);
 	setCookie("orghash","0",null);
 	setCookie("orgnickp","0",null);
 	setCookie("orguserid","0",null);
 	setCookie("orgpago","0",null);
 	setCookie("pr_categ","",null);
 	setCookie("member","1",null);
 	location.reload(true);
}
function setLog(){

 if ( window.location.pathname.indexOf("org_item_abm") > 0 || window.location.pathname.indexOf("org_item_categ") > 0)
 	return;
 ck = getCookieValue("orguserid"); 
 if (ck==null||ck.length < 4 ){ 	
	document.write("<a target=\"_top\" href=\"org_validate.user_login?as_url="+self.location.pathname+"&as_user=&as_password=&as_nav_bar=Y&as_params="+escape(self.location.search)+"\" class=hpcateg id=\"MENU:ENTRAR\">Entrar</a>");
 } else {
 	document.write("<a target=\"_top\" href=\"/jm/logout\" class=hpcateg id=\"MENU:SALIR\">Salir</a>");
 }

}
function imgLog(k1, k2, k3, k4, k5, k6, k7){
	rnd = Math.random();
	if ( rnd < .5 ){
		var out = "<img width=1 height=1 border=0 bordercolor=white src=\"/jm/ml.track.me?p=Y";
		if ( k1 != null )	out += "&k1="+k1;
		if ( k2 != null )	out += "&k2="+k2;
		if ( k3 != null )	out += "&k3="+k3;
		if ( k4 != null )	out += "&k4="+k4;
		if ( k5 != null )	out += "&k5="+k5;
		if ( k6 != null )	out += "&k6="+k6;
		if ( k7 != null )	out += "&k7="+k7;
		out += "&r="+(Math.round(rnd*100000))+"\">";
		document.write(out);
	} else {
		var out = "<img src=\"/org-img/t.gif\" width=1 height=1 border=0 bordercolor=white>";
	}
}	
function setPrCategID(){
 var pr_categ=getCookieValue("pr_categ");
 if (pr_categ!=null) document.fheader2.as_pr_categ_id.value=pr_categ;
}
function getBase(urlBase){
	pos = urlBase.indexOf("//")+2;
	if (pos != -1){
		urlBasePart = urlBase.substring(pos);
	}else{
		alert("Error: URL Invalida");
	}
	pos2 = urlBasePart.indexOf("/")+pos;
	if (pos2 == -1)
		alert("Error: URL Invalida");
	return urlBase.substring(0,pos2);
}

function openW(lnk,winName,features) { //v2.0     	            
    
    if (lnk.substring(0,1)=="/"){
    	theURL = getBase(document.getElementsByTagName('base')[0].href)+lnk;
    }else{
    	theURL = document.getElementsByTagName('base')[0].href+lnk;
    }     
    
    window.open(theURL,winName,features);
}
function h(lnk){
 var c=getCookieValue("pr_categ");
 if (c==null) c="";
 window.location=urlBase+"jm/"+lnk+"&as_pr_categ_id="+c;
}

function goCat(lnk, prCateg){
 var len = goCat.arguments.length; 
 if (len == 1 || prCateg == ""){
    window.location=lnk+"&as_pr_categ_id=AD";
 }else {
    var c=getCookieValue("pr_categ");
    if (c==null){
        window.location= document.getElementsByTagName('base')[0].href +"org_prcateg.p_checkRule?as_pr_categ_id=AD&as_redirect="+escape(lnk+"&as_pr_categ_id=AD");
    }else{
       window.location=lnk+"&as_pr_categ_id="+c;
    } 
 }	
	
}
