// JavaScript Document
function go_to(url){
	document.location.href=url;
}

function nvj_flotante(url,tit,op){
	window.open(url,tit,op);
}

//call a popup with alias
function nvj_popup(alias){

	var url = "popup.php?q="+alias;
	window.open(url,"iTEKPOPUP", "width=10, height=10, scrollbars=yes");
}

function nvj_ver_foto(id,path){
	url=path+"/flo_foto.php?id="+id;
	op="scrollbars='NO',width=500,height=500";	
	tit="Potosi_de_noche";
	nvj_flotante(url,tit,op)
}

function nvjs_acordion(cual,donde){

	if (donde){
		$('div.item_'+cual).slideUp('slow');
		document.getElementById('linkUp_'+cual).style.display = 'inline';
		document.getElementById('linkDw_'+cual).style.display = 'none';
	}else{
		$('div.item_'+cual).slideDown('slow');
		document.getElementById('linkUp_'+cual).style.display = 'none';
		document.getElementById('linkDw_'+cual).style.display = 'inline';
	}
}

function nvj_reload(ruta){	
	if(ruta){		
		document.location.href="index.php?q="+ruta;
	}else{
		document.location.reload();
	}
}

function nvj_window(path,w,h){
	t_vname = "ventana"+String(Math.floor(Math.random()*50));
	window.open(path,t_vname,"directories=0,toolbar=0,status=no,width="+w+",height="+h+",scrollbars=0,top=200,left=200");
}

//----------------------------------------------
// Cabins & homes manager
function nvf_cabins(qmode,qv1){
	estef = document.forms['cabinsform'];
	switch (qmode){
		case "cabinid":
			vars = "";
			if (estef['wcabin'].value>0)
				vars = 'cabin=' + estef['wcabin'].value;
			else{
				if (estef['wprice1'].value>0)
					vars = 'price=' + estef['wprice1'].value;
				else{
					if (estef['wpersons'].value>0)
						vars = 'persons=' + estef['wpersons'].value;
					else{
						if (estef['wprice2'].value>0)
							vars = 'priceoff=' + estef['wprice2'].value;
					}
				}
			}
			linker = '/lodging/cabins_n_homes?'+vars+'&info='+qv1;
			break;
		default:
			linker = '/lodging/cabins_n_homes?'+qmode+'='+qv1;
			break;
	}
	document.location.href = linker;
}
// Cabins row
function nvf_cabinsRoll(este,qmode,qclass){
	//alert(este);
	if (qmode==1){
		este.className = "oak-row-3";
		este.style.cursor = 'pointer';
	}else{
		este.className = "oak-row-"+qclass;
		este.style.cursor = 'auto';
	}
}
