if(window.location.hostname == 'localhost' || window.location.hostname == '10.0.0.21'){
	var SiteUrl = '/fmvida/';
}else{
	var SiteUrl = '/';
}

/*
	Votacion
*/
function ProcVot(formid){
	var form = document.getElementById(formid);
	var checkedVal = getCheckedValue(form.IdOpcion);
	var idEncuesta = form.wIdEncuesta.value;
	var urlEncuesta = SiteUrl + 'votacion.php?IdOpcion=' + checkedVal + '&wIdEncuesta=' + idEncuesta;
	//document.getElementById('floatdiv').style.display = '';
	//document.getElementById('divinfotext').innerHTML = 'Procesando su voto...';
	//setTimeout('', 1500);
	var myAjax = new Ajax.Request(urlEncuesta, {method: 'get', onSuccess: RespuestaVotacion});
	
}

function RespuestaVotacion(t){
	//alert(t.responseText);
	respuestas=t.responseText.split('<!--ENCUESTAS GENERADAS-->');
	document.getElementById('encuestaonline').innerHTML = respuestas[1];

	//document.getElementById('divinfotext').innerHTML = respuestas[0];
	setTimeout('hidePopUp()', 2000);
}

function hidePopUp(){
	
}

/*
	Vida Log Mensajes
*/
function cambiarTema(idTema, pagina){
	document.getElementById('wIdTema').value = idTema;
	var url = SiteUrl + 'ajax.php?w=vlmensajes&tema='+idTema+'&p='+pagina
	var myAjax = new Ajax.Request(url, {method: 'get', onSuccess: cambioMensajes});
}
function cambioMensajes(t){
	document.getElementById('MensajesBody').innerHTML = t.responseText;
}
/*
	Juegos - Paginador de Fijos
*/
function PJ(pagina){
	var url = SiteUrl + 'ajax.php?w=pag_juegos&p='+pagina
	var myAjax = new Ajax.Request(url, {method: 'get', onSuccess: cambioPagJuegos});
}
function cambioPagJuegos(t){
	document.getElementById('placa_juegos_anteriores').innerHTML = t.responseText;
}
/*
	Horoscopo
*/
function cambiarHoros(Horos){
	var url = SiteUrl + 'ajax.php?w=horos&signo='+Horos
	var myAjax = new Ajax.Request(url, {method: 'get', onSuccess: cambioHoros});
}
function cambioHoros(t){
	document.getElementById('contenedor_horoscopo').innerHTML = t.responseText;
}

/*
	Otras Funciones
*/

function getCheckedValue(radioObj) {
	if(!radioObj)
		return "";
	var radioLength = radioObj.length;
	if(radioLength == undefined)
		if(radioObj.checked)
			return radioObj.value;
		else
			return "";
	for(var i = 0; i < radioLength; i++) {
		if(radioObj[i].checked) {
			return radioObj[i].value;
		}
	}
	return "";
}

function gup( name ){
  name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
  var regexS = "[\\?&]"+name+"=([^&#]*)";
  var regex = new RegExp( regexS );
  var results = regex.exec( window.location.href );
  if( results == null )
    return "";
  else
    return results[1];
}