function _setCookie(cookieName,cookieValue,nDays) {
	var today = new Date();
	var expire = new Date();
	if (nDays==null || nDays==0) nDays=1;
	expire.setTime(today.getTime() + 3600000*24*nDays);
	document.cookie = cookieName+"="+escape(cookieValue)+ ";expires="+expire.toGMTString();
}
function getNumeroSel() {
	return document.form_internet.localidades_barrita2.options[document.form_internet.localidades_barrita2.selectedIndex].value;
}
function getCiudadSel() {
	return document.form_internet.localidades_barrita2.options[document.form_internet.localidades_barrita2.selectedIndex].text;
}
function initBodyArg() {
	updTelefonos();
	return;
}
function initBodyEx() {
	return;
}
function goHoteles(provincia, lang) {
	if (lang=='') {
		lang='es';
	}
	document.location = "http://hoteles.argentina.com/site/"+lang+"/provincias/"+provincia;
	return false;
}
function goCiudades(ciudad, lang) {
	if (lang=='') {
		lang='es';
	}
	base = "http://hoteles.argentina.com/site/"+lang+"/ciudades/";
	ciudad = new String(ciudad);
	ciudad = ciudad.replace("|","/");
//	alert(ciudad);
	document.location = base+ciudad+'/info.html';
	return false;
}
function updCiudadesyTelefonos(){
	var telefono = getNumeroSel();

	updTelefonos();

	pelota = document.getElementById("clave1");
	if( telefono == "5254-5000" )
	{
		pelota.innerHTML = "<br>Disque 011-5254-5000 al costo de llamada LOCAL desde<br><br>&nbsp;&nbsp;GLEW - GONZALEZ CATAN<br>&nbsp;&nbsp;JUAN MARIA GUTIERREZ <br>&nbsp&nbsp;LIBERTAD - MERLO (Prov.BS.AS.)";
	}
	if( telefono == "448-5000" )
	{
		pelota.innerHTML = "Disque 0221-448-5000 al costo de una llamada LOCAL desde <br><br>&nbsp;&nbsp;ABASTO - BARRIO PARQUE SICARDI <br>&nbsp;&nbsp;BARTOLOME BAVIO - EL PATO - ESTACION GOMEZ <br>&nbsp;&nbsp;JUAN MARIA GUTIERREZ - LA CAPILLA <br>&nbsp;&nbsp;LISANDRO OLMOS - OLIDEN - POBLET";
	}

	return;
}
function updTelefonos(){
	var telefono = getNumeroSel();
	ptelefono = document.getElementById("p_telefono");
	ptelefono.innerHTML = telefono;

	if (telefono=='5500-0000' || telefono=='515-5000' || telefono=='536-5000'
		|| telefono=='462-5000' || telefono=='517-5000' || telefono=='65-6555'
		|| telefono=='0351-536-5000' || telefono=='02322-65-6555'){
        document.getElementById("imgTurbo").src='http://imagenes.argentina.com/home/turbo_on.gif';
	}
	else {
		document.getElementById("imgTurbo").src='http://imagenes.argentina.com/home/turbo_off.gif';
	}
}

function goMultidiscador(){
	w=412;
	h=435;
	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	TopPosition = (screen.height) ? ((screen.height-h)/2)-20 : 0;
	settings =
	'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars=yes,location=no,resizable=yes,statusbar=no,menubar=no';
	pagego ='http://free.internet.argentina.com/software/multidiscador.x';
	newwindow = window.open(pagego,'MultiDiscador',settings);
	return false;
}
function NewWindow(mypage,myname,w,h){
	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	TopPosition = (screen.height) ? ((screen.height-h)/2)-20 : 0;
	settings ='height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars=no,location=no,resizable=no,statusbar=no,menubar=no';
	window.open(mypage,myname,settings)
}
function popInstalador() {
	numero = getNumeroSel();
	w=650;
	h=520;
	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	TopPosition = (screen.height) ? ((screen.height-h)/2)-20 : 0;
	settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars=no,location=no,resizable=yes,statusbar=no,menubar=no';
	url ="http://free.internet.argentina.com/ins.php?phonenumber="+numero;
	newwindow = window.open(url,'Go_Pop_Home',settings);
	return(false);
}
function goConfigFaq() {
	//	createCookie(name,value,days) definida en barra.js
	createCookie('TELEFONO',getNumeroSel());
	createCookie('CIUDAD',getCiudadSel());
	window.location="http://free.internet.argentina.com/visp/faq_new_config.x";
}
function loginAction() {
	//	verificar que haya selecc un modo de webmail
	//	set cookies
	//	submit el form de login
	if(document._login.modo.value == 0) {
		alert('Debe seleccionar un formato: Simple o Avanzado (Tres Paneles)');
		return false;
	}
	else {
		_setCookie('USUARIO', document._login.reglogin.value, 10);
		_setCookie('MODOMAIL', document._login.modo.value, 10);
		return true;
	}
}
