var DIR="";
if (location.href.indexOf('sublimeserver')>0) {DIR = "/montecable";}

var imgs=DIR+"/artworks";
var dir_scripts=DIR+"/scripts"

String.prototype.trim = function() {return this.replace(/^\s+|\s+$/g,'');}

function check_contratar_premiumn(form) {

	var o=document.getElementsByName("paquetes[]");
	var count=0;
	var str="";
	for (var i=0;i<o.length;i++) {
		if (o[i].checked) {
			if (str!="") str+=", ";
			str+=o[i].value;
			count++;
		}
	}
	if (count==0) {
		alert("Seleccione uno o mas paquetes por favor");
		return false;
	}

	if (!window.confirm("Ha seleccionado los paquetes "+str+", haga click en Aceptar para continuar, por favor"))
		return false;

	return true;
}

function confirm_cuponera() {

	if (window.confirm("¿ Desea comprar esta cuponera ?")) {
		return true;
	} else {
		return false;
	}
}

function confirm_contratar() {

	if (window.confirm("¿ Desea contratar este evento ?")) {
		return true;
	} else {
		return false;
	}
}

function print(FacTpo,FacNro) {

	var url="ver_factura.php?FacTpo="+FacTpo+"&FacNro="+FacNro;
	abrirVentana(url, 1024, 768, "win"+FacNro);

}

function abrirVentana(url, width, height, name) {
	if (name==null) {name='nueva_ventana';}
	var str = "height=" + height + ",innerHeight=" + height;
	str += ",width=" + width + ",innerWidth=" + width;
	if (window.screen) {
		var ah = screen.availHeight - 30;
		var aw = screen.availWidth - 10;
		var xc = (aw - width) / 2;
		var yc = (ah - height) / 2;
		str += ",left=" + xc + ",screenX=" + xc;
		str += ",top=" + yc + ",screenY=" + yc;
	}

	str += ",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no";

	objwin=window.open(url, name, str);
	objwin.focus();
}


window.status='::: MONTECABLE - El Gran Espectáculo :::';
document.title='::: MONTECABLE ...El gran Espectaculo :::';

function getObj(id) {
	if (document.getElementById) {return document.getElementById(id)}
	else if (document.all) {return document.all[id]}
	else {return document.all[id]}
}

function nav_genero(id) {

	/*
	series=29
	variedades=72
	infantiles=38
	culturales?=7 (documentales)
	deportes=45
	*/

	var url="";

	switch (id) {
		case "estrenos":
			url="estrenos.php";
			break;
		case "series":
			url="estrenos.php?genero=12";
			break;
		case "variedades":
			url="estrenos.php?genero=4";
			break;
		case "infantiles":
			url="estrenos.php?genero=14";
			break;
		case "culturales":
			url="estrenos.php?genero=8";
			break;
		case "deportes":
			url="estrenos.php?genero=5";
			break;
	}

	if (url!="") {location.href=url;}

	return false;

}

