function home(){
	dir = '/';
	if(getCookieValue("home")!=null && getCookieValue("home")!='')
		dir+=getCookieValue("home");
	location.href=dir;
}
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);
 	home();
}
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 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 g(lnk){
 var c=getCookieValue("pr_categ");
 if (c==null) c="";
 window.location=urlDflt+lnk+"&as_pr_categ_id="+c;
}
function setPrCategID(){
	var pr_categ=getCookieValue("pr_categ");
	if (pr_categ!=null) 
		document.fheader.as_pr_categ_id.value=pr_categ;
}
function h(lnk){
	var c=getCookieValue("pr_categ");
 	if (c==null)
 		c=""; 	
 	window.location=urlBase+"jm/"+lnk+"&as_pr_categ_id="+c;
}
function change(arr_homes,ck_member_val){
	it= 1/(arr_homes.length>0?arr_homes.length:1);
	setCookie("member",1,null);
	rnd = Math.random();
	for(i=0;i<arr_homes.length;i++){
		if(rnd<(i+1)*it){
		    setCookie("home",arr_homes[i],null);
		    break;
		}
	}
	location.href='/'+getCookieValue("home");
}
var flg1=true;
var flg2=true;
var txtorig1; 
var txtorig2; 
function inn(txt,i) {
 if (eval('flg'+i)){
  eval('txtorig'+i+'=txt.value;');
  eval('flg'+i+'=false;');
 }
 if (txt.value == eval('txtorig'+i)) txt.value = '';
}
function out(txt,i) {
 if (txt.value == '') txt.value = eval('txtorig'+i);
}
function wOpen(pURL, pName, w, h, scroll, text, specialSettings){
	xLeft=(screen.width)?(screen.width-w)/2:0;
	xTop=(screen.height)?(screen.height-h)/2:0;
	xSettings = 'height='+h+',width='+w+',top='+xTop+',left='+xLeft+',scrollbars='+scroll+specialSettings
	hwnd = window.open(pURL,pName,xSettings);
	if(hwnd.window.focus)
		hwnd.window.focus();
	if(text != "") 
		hwnd.document.write(text);
	hwnd.document.close();
	return hwnd;
}


