// 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_prodReload(tmp){	
	var rr=tmp+"&page=";
	var cbo=document.getElementById('idProd').value;
	var vect=cbo.split("-");
	
	rr+=vect[0]+"#"+vect[1];
	
	nvj_reload(rr);
}

function nvjs_ficha(nn,kk){
	t_vname = "WFID"+String(Math.floor(Math.random()*50));
	if (kk==0){
		t_path = "/area_academica/ficha?cid="+nn;
		window.open(t_path,t_vname,"directories=0,toolbar=0,status=no,width=805,height=635,scrollbars=0,top=200,left=200");
	}else{
		t_path = "/area_academica/ficha2?cid="+nn;
		window.open(t_path,t_vname,"directories=0,toolbar=0,status=no,width=880,height=630,scrollbars=yes,top=200,left=200");
	}
}
// Accordion 2
function nvjs_accordion2(cual,donde){
	if (donde){
		$('div.'+cual+'e').slideDown('slow');
		document.getElementById(cual+'o').style.display = 'none';
		document.getElementById(cual+'c').style.display = 'inline';
	}else{
		$('div.'+cual+'e').slideUp('slow');
		document.getElementById(cual+'o').style.display = 'inline';
		document.getElementById(cual+'c').style.display = 'none';
	}
}
// xtra fichas info
nv_sele = 0;
function nvjs_fichaXtra(nnk){
	nv_sele = nnk;
	for(nv_t=1; nv_t<=7; nv_t++){
		document.getElementById('rcolWindowTitle'+nv_t).style.display = "none";
		document.getElementById('rcolWindowTxt'+nv_t).style.display = "none";
	}
	document.getElementById('rcolWindowTitle'+nnk).style.display = "block";
	document.getElementById('rcolWindowTxt'+nnk).style.display = "block";
}
// despliega ventana MM
function nvjs_gallery(qurl,qw,qh){
	t_vname = "MM"+String(Math.floor(Math.random()*50));
	window.open(qurl,t_vname,"width="+qw+",height="+qh+",status=no,toolbar=no,top=200,left=330,resizable=no");
}
