function stminot(stelement,stcontid){var stnotcont = Array('stnotcontid1','stnotcontid2','stnotcontid3','stnotcontid4','stnotcontid5');
for(var i=0; i < stnotcont.length; i++){if(stcontid == stnotcont[i]){document.getElementById(stnotcont[i]).style.display = "block";}else{document.getElementById(stnotcont[i]).style.display = "none";}}}function stregion(stelement,stseccid){document.getElementById(stseccid).parentNode.id = stelement.name+'loadid';
document.getElementById(stseccid).parentNode.innerHTML = 'Cargando.... <img src="http://www.elsalvador503.com/comunidad/contenido/cargadormini.gif" />';stsecc = 'st_7';stvar = 'stsecc='+stsecc+'&estatipo='+stelement.name+'&rpid='+stelement.value;STRdatos('POST','',stvar,stelement.name+'loadid',2);}function stcategorias(stelement,stseccid){document.getElementById(stseccid).parentNode.id = stelement.name+'loadid';document.getElementById(stseccid).parentNode.innerHTML = 'Cargando.... <img src="http://www.elsalvador503.com/comunidad/contenido/cargadormini.gif" />';stsecc = 'st_12';stvar = 'stsecc='+stsecc+'&cattipo='+stelement.name+'&catid='+stelement.value;STRdatos('POST','',stvar,stelement.name+'loadid',2);}function stpopup(stusuarioid,stcat,sttipo){var stsecc,stvar;switch(stcat){case 'addamigos':switch(sttipo){case 'enviar':stsecc = 'st_6';stvar = 'stsecc='+stsecc+'&id='+stusuarioid;document.getElementById('stinpopup').style.display = 'block';STRdatos('POST','',stvar,'stinpopup',2);break;case 'cerrar':document.getElementById('stinpopup').innerHTML = '';document.getElementById('stinpopup').style.display = 'none';break;}break;case 'attachnotita':switch(sttipo){case 'foto':var stnfoto = document.getElementById('nimgmid'+stusuarioid).style.display = (document.getElementById('nimgmid'+stusuarioid).style.display != 'block' ? 'block' : 'none');document.getElementById('nimggid'+stusuarioid).style.display = (document.getElementById('nimggid'+stusuarioid).style.display != 'block' ? 'block' : 'none');break;}break;case 'cambiaravatar':switch(sttipo){case 'cambiar':stsecc = 'st_8';stvar = 'stsecc='+stsecc+'&id='+stusuarioid;document.getElementById('stinpopup').style.display = 'block';STRdatos('POST','',stvar,'stinpopup',2);break;case 'cerrar':document.getElementById('stinpopup').innerHTML = '';document.getElementById('stinpopup').style.display = 'none';break;}break;case 'mensajepop':switch(sttipo){case 'mensajef':stsecc = 'st_10';stvar = 'stsecc='+stsecc+'&id='+stusuarioid;document.getElementById('stinpopup').style.display = 'block';STRdatos('POST','',stvar,'stinpopup',2);break;case 'enviar':stsecc = 'st_11';var Amigos = new stformvars(stusuarioid);stvars='stsecc='+stsecc+Amigos.stvar;STRdatos('POST','',stvars,'stinpopup',2);break;case 'cerrar':document.getElementById('stinpopup').innerHTML = '';document.getElementById('stinpopup').style.display = 'none';break;}break;}}function stvotos(stelement,stsuarioid,stseccid,stsubid,stcat){var stvar,stvoto,stsecc;stsecc = '\u0073\u0074\u005F\u0031';stvoto = parseInt(stelement.innerHTML);stvar = 'stsecc='+stsecc+'&id='+stsuarioid+'&abid='+stseccid+'&fid='+stsubid+'&nvoto='+stvoto+'&stcat='+stcat;STRdatos('POST','',stvar,'stvotos',2);}function stvotosdes(stelement,sttipo){if(sttipo == 4){switch(parseInt(stelement.innerHTML)){case 1:document.getElementById('votodes').innerHTML = '<img src="http://www.elsalvador503.com/comunidad/contenido/muymala.gif" />';break;case 2:document.getElementById('votodes').innerHTML = '<img src="http://www.elsalvador503.com/comunidad/contenido/mala.gif" />';break;case 3:document.getElementById('votodes').innerHTML = '<img src="http://www.elsalvador503.com/comunidad/contenido/buena.gif" />';break;case 4:document.getElementById('votodes').innerHTML = '<img src="http://www.elsalvador503.com/comunidad/contenido/muybuena.gif" />';break;
case 5:document.getElementById('votodes').innerHTML = '<img src="http://www.elsalvador503.com/comunidad/contenido/impresionante.gif" />';break;}}else{document.getElementById('votodes').innerHTML='';}}function stcomentarios(stelement,stsuarioid,stseccid,stsubid,stcat,stcomentid,stcontenedor){var stvar,stcoment,stsecc;stcoment = stelement.getElementsByTagName('TEXTAREA')[0].value;stelement.getElementsByTagName('TEXTAREA')[0].value = '';stcoment = stcoment.replace(/^(\s|\&nbsp;)*|(\s|\&nbsp;)*$/g,"");if(stcoment == ''){stelement.getElementsByTagName('TEXTAREA')[0].style.backgroundColor = 'red';alert('Escribe un comentario');return false;}stsecc = 'st_2';stvar = 'stsecc='+stsecc+'&id='+stsuarioid+'&abid='+stseccid+'&fid='+stsubid+'&coment='+stcoment.replace(/\x26/gi,'%26')+'&stcat='+stcat+'&comentid='+stcomentid;STRdatos('POST','',stvar,stcontenedor,2);}function stdelcoment(stsuarioid,stseccid,stsubid,stcomentid,stcat,stcontenedor){var stvar,stsecc,stconfirm;stsecc = 'st_3';
var stconfirm = confirm('\u00BFSeguro que quieres eliminar este comentario\u003F');if(stconfirm){
stvar = 'stsecc='+stsecc+'&id='+stsuarioid+'&abid='+stseccid+'&fid='+stsubid+'&comentid='+stcomentid+'&stcat='+stcat;STRdatos('POST','',stvar,stcontenedor,2);}}function staddamigos(stelement){document.getElementById('stpopcargador').style.display = 'block';var stsecc = 'st_4'; var Amigos = new stformvars(stelement);
stvars='stsecc='+stsecc+Amigos.stvar;STRdatos('POST','',stvars,'stpopload',2);}var stformvars = function(stelement){this.stelement = stelement;this.stvar; var stform,stformobj;this.stvar = '';stform = this.stelement.parentNode.getElementsByTagName('FORM');for(var i=0; i<stform.length; i++){stformobj = stform[i].getElementsByTagName('*');for(var k=0; k < stformobj.length; k++){;switch(stformobj[k].tagName.toLowerCase())
{case 'input': switch(stformobj[k].type.toLowerCase()){case 'text': case 'hidden': case 'password':this.stvar+='&'+stformobj[k].name+'='+stformobj[k].value.replace(/\x26/gi,'%26');break;}break;case 'textarea':this.stvar+= '&'+stformobj[k].name+'='+stformobj[k].value.replace(/\x26/gi,'%26');stformobj[k].value = '';
break;
case 'select':
this.stvar+= '&'+stformobj[k].name+'='+stformobj[k].value.replace(/\x26/gi,'%26');
stformobj[k].value = '';break;
}}}} 
function stabrirlist(stelement,stelmid,sttipo,stsecc,stuid){var stnewelement;
document.getElementById(stelmid).style.display = (document.getElementById(stelmid).style.display != 'block' ? 'block' : 'none');switch(sttipo){case 'stbarchivos':stelement.firstChild.className = (stelement.firstChild.className != 'icoder' ? 'icoder' : 'icodown');break;case 'stnotitas':var vstsecc='st_5';stelement.parentNode.style.display = (stelement.parentNode.style.display != 'block' ? 'block' : 'none');switch(stsecc){case 'stfoto':STRdatos('POST','','stsecc='+vstsecc+'&id='+stuid+'&notasecc=foto',stelmid,2);break;case 'stvideo':STRdatos('POST','','stsecc='+vstsecc+'&id='+stuid+'&notasecc=video',stelmid,2);break;}break;case 'stnotitasclose':document.getElementById('stnotitaattach').style.display = (document.getElementById('stnotitaattach').style.display != 'block' ? 'block' : 'none');break;}}function stloadfunc(stfunc){var oldonload = window.onload;if (typeof window.onload != "function"){window.onload = stfunc;}else{window.onload=function(){if(oldonload){oldonload();}stfunc+'()';}}}var stmapa = null;function stborrarmarca(){stmapa.clearOverlays();document.getElementById("eucidmarcaid").value = 0;}function stubicacionmapa(){
if (GBrowserIsCompatible()){var	stlatact = parseFloat(document.getElementById("eucidlatitudid").value);var	stlonact = parseFloat(document.getElementById("eucidlongitudid").value);var	stzoomact = parseInt(document.getElementById("eucidzoomid").value);var	stmarcaact = parseInt(document.getElementById("eucidmarcaid").value);var stmarcas = [];var stmarca = null;var stlat = null;var stlng = null;var stzoom = null;var stactivar = false;if(!stlatact || !stlonact || !stzoomact){stlatact = 13.771398796603483;stlonact = -88.86090086773038;stzoomact = 9;}else{stactivar = true;}if(stmarcaact == 1){stactivar = true;}stmapa = new GMap2(document.getElementById("stmapacontid"));stmapa.setCenter(new GLatLng(stlatact, stlonact), stzoomact);	stmapa.enableContinuousZoom();stmapa.enableDoubleClickZoom();GEvent.addListener(stmapa, "mousemove", function(stposs){stlat = stposs.lat();stlng = stposs.lng();});GEvent.addListener(stmapa, "zoomend", function(stposs){document.getElementById("eucidzoomid").value = stmapa.getZoom();});if(stactivar){if(stmarca){stmapa.removeOverlay(stmarca);document.getElementById("eucidmarcaid").value = 0;}var stmarcaposs = new GLatLng(stlatact,stlonact);stmarca = new GMarker(stmarcaposs, {icon:G_DEFAULT_ICON, draggable: true});stmapa.addOverlay(stmarca);stmarca.enableDragging();document.getElementById("eucidlatitudid").value = stlatactdocument.getElementById("eucidlongitudid").value = stlonact;document.getElementById("eucidzoomid").value = stzoomact;document.getElementById("eucidmarcaid").value = 1;stmarca.openInfoWindowHtml("<span>Arrastre el marcador o de click derecho<br/> sobre la posicion deseada</span>");stmarcas.push(stmarca);
GEvent.addListener(stmarca, "drag", function(stpossmarca){stmarca.closeInfoWindow();document.getElementById("eucidlatitudid").value = stpossmarca.lat();document.getElementById("eucidlongitudid").value = stpossmarca.lng();});GEvent.addListener(stmarca, "dragend", function(stdel){stmarca.openInfoWindowHtml("<input class='okbuton' type='button' onclick='stborrarmarca()' value='Borrar esta marca' />");});}GEvent.addListener(stmapa, "singlerightclick", function(){if(stmarca){stmapa.removeOverlay(stmarca);document.getElementById("eucidmarcaid").value = 0;}var stmarcaposs = new GLatLng(stlat,stlng);stmarca = new GMarker(stmarcaposs, {icon:G_DEFAULT_ICON, draggable: true});stmapa.addOverlay(stmarca);stmarca.enableDragging();document.getElementById("eucidlatitudid").value = stlat;document.getElementById("eucidlongitudid").value = stlng;document.getElementById("eucidmarcaid").value = 1;stmarca.openInfoWindowHtml("<span>Arrastre el marcador o de click derecho<br/> sobre la posicion deseada</span>");stmarcas.push(stmarca);GEvent.addListener(stmarca, "drag", function(stpossmarca){stmarca.closeInfoWindow();document.getElementById("eucidlatitudid").value = stpossmarca.lat();document.getElementById("eucidlongitudid").value = stpossmarca.lng();});GEvent.addListener(stmarca, "dragend", function(stdel){stmarca.openInfoWindowHtml("<input type='button' class='okbuton' onclick='stborrarmarca()' value='Borrar esta marca' />");});});stmapa.setUIToDefault();}}function stshowubi(){if (GBrowserIsCompatible()){var stshowlat = parseFloat(document.getElementById('stshowlatitudid').value);var stshowlon = parseFloat(document.getElementById('stshowlongitudid').value);var stshowzoom = parseInt(document.getElementById('stshowzoomid').value);if(!stshowlat||!stshowlon||!stshowzoom){stshowlat = 13.771398796603483;stshowlon = -88.86090086773038;stshowzoom = 9;}stmapashow = new GMap2(document.getElementById("stmapacontid"));stmapashow.setCenter(new GLatLng(stshowlat,stshowlon),stshowzoom);stmapashow.enableContinuousZoom();stmapashow.enableDoubleClickZoom();var stmarcapossshow = new GLatLng(stshowlat,stshowlon);stmarcashow = new GMarker(stmarcapossshow, {icon:G_DEFAULT_ICON, draggable: false});stmapashow.addOverlay(stmarcashow);stmapashow.enableDragging();
stmarcashow.openInfoWindowHtml(document.getElementById('stmapadirid').value);
GEvent.addListener(stmarcashow, "click", function(){stmarcashow.openInfoWindowHtml(document.getElementById('stmapadirid').value);});}stmapashow.setUIToDefault();}
function staddamigossol(stelement,elementid){var stsecc = 'st_4'; var Amigossol = new stformvars(stelement);stvars='stsecc='+stsecc+Amigossol.stvar;STRdatos('POST','',stvars,elementid,2);}
function stoptcuenta(stelement,elementid){
var stsecc = 'st_13';var Amigossol = new stformvars(stelement);stvars='stsecc='+stsecc+Amigossol.stvar;
STRdatos('POST','',stvars,elementid,2);}function stminiload(stconid){
document.getElementById(stconid).innerHTML = "<img src='http://www.elsalvador503.com/comunidad/contenido/cargadormini.gif' /><br/>Enviando..";}
function stsendata(stelement,stelementid,stsecc){var stenviardata = new stformvars(stelement);stvars='stsecc='+stsecc+stenviardata.stvar;STRdatos('POST','',stvars,stelementid,2);}
function stdeldata(stdelid,stvalid,stelementid,stsecc,stsub,stmsg){var stconfirm, stvars;
switch(stsub){case 'solicitud':stvars = 'stsecc='+stsecc+'&stsub='+stsub+'&stdelid='+stdelid+'&stvalid='+stvalid;STRdatos('POST','',stvars,stelementid,2);break;case 'notitas':stconfirm = confirm(stmsg);
if(stconfirm){stvars = 'stsecc='+stsecc+'&stsub='+stsub+'&stdelid='+stdelid+'&stvalid='+stvalid;STRdatos('POST','',stvars,stelementid,2);}break;case 'mensajes':stconfirm = confirm(stmsg);if(stconfirm){stvars = 'stsecc='+stsecc+'&stsub='+stsub+'&stdelid='+stdelid+'&stvalid='+stvalid;STRdatos('POST','',stvars,stelementid,2);}break;case 'blogs':stconfirm = confirm(stmsg);if(stconfirm){stvars = 'stsecc='+stsecc+'&stsub='+stsub+'&stdelid='+stdelid+'&stvalid='+stvalid;STRdatos('POST','',stvars,stelementid,2);}break;
case 'videos':stconfirm = confirm(stmsg);if(stconfirm){stvars = 'stsecc='+stsecc+'&stsub='+stsub+'&stdelid='+stdelid+'&stvalid='+stvalid;STRdatos('POST','',stvars,stelementid,2);}break;}}function stdivshow(stid,sttipo){switch(sttipo){case 'stcoment':stalto = 95;stelement = 'resp149';break;}if(document.getElementById(stelement).style.display == 'none'){document.getElementById(stelement).style.height=staltoN+"px";document.getElementById(stelement).style.display='block';stshow();}}var stalto;var stelement;var staltoN=0;var que = 8;function stshow(){if(staltoN++ < stalto){document.getElementById('resp149').style.height=staltoN+"px";dogoar = window.setTimeout ('stshow();', que);}else{window.clearTimeout(dugoar);}}function beginDrag(elementToDrag, event){
var x = parseInt(elementToDrag.style.left);var y = parseInt(elementToDrag.style.top);var deltaX = event.clientX - x;var deltaY = event.clientY - y;if(document.attachEvent){document.attachEvent("onmousemove",moveHandler);document.attachEvent("onmouseup",upHandler);}else{document.addEventListener("mousemove",moveHandler,true);document.addEventListener("mouseup",upHandler,true);}function moveHandler(event){	elementToDrag.style.left = (event.clientX - deltaX) + "px";elementToDrag.style.top = (event.clientY - deltaY) + "px";document.getElementById("dely").value = event.target.id;}function upHandler(event){if(document.detachEvent){document.detachEvent("onmousemove",moveHandler);document.detachEvent("onmouseup",upHandler);}
else{document.removeEventListener("mouseup",upHandler,true);document.removeEventListener("mousemove",moveHandler,true);}}}function checkevent(e){var obj=e.srcElement||e.target;var evento = e.type;document.getElementById("dely").value = obj.id;}var utf8 = {encode : function (string){string = string.replace(/\r\n/g,"\n");var utftext = "";for (var n = 0; n < string.length; n++) {var c = string.charCodeAt(n);
if (c < 128){utftext += String.fromCharCode(c);}else if((c > 127) && (c < 2048)) {utftext += String.fromCharCode((c >> 6) | 192);utftext += String.fromCharCode((c & 63) | 128);}else {utftext += String.fromCharCode((c >> 12) | 224);utftext += String.fromCharCode(((c >> 6) & 63) | 128);utftext += String.fromCharCode((c & 63) | 128);}}return utftext;},decode : function (utftext) {var string = "";var i = 0;var c = c1 = c2 = 0;while ( i < utftext.length ) {c = utftext.charCodeAt(i);if (c < 128) {string += String.fromCharCode(c);i++;}else if((c > 191) && (c < 224)){c2 = utftext.charCodeAt(i+1);string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));i += 2;}else {c2 = utftext.charCodeAt(i+1);c3 = utftext.charCodeAt(i+2);string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));i += 3;}}return string;}}



function stbusmem(stelement,stelemetnid,stsecc)
{

var stvars = 'stsecc='+stsecc+'&stbuscar='+document.getElementById(stelement).value;

document.getElementById(stelemetnid).innerHTML = "<div style='margin:0 auto; width:50px;'><img src='http://www.elsalvador503.com/comunidad/contenido/cargadormini.gif' /><br/>Buscando..</div>";

STRdatos('POST','',stvars,stelemetnid,2);

}


function activarradio()
{

document.getElementById('stradioid').style.display = (document.getElementById('stradioid').style.display != 'block' ? 'block' : 'none');


document.getElementById('radioesc').src = (document.getElementById('radioesc').src != 'http://www.salvatruchos.com/contenido/escucharradio.png' ? 															
'http://www.salvatruchos.com/contenido/escucharradio.png' :
'http://www.salvatruchos.com/contenido/cerrarradio.png');
	
}



function STGetTv(stelement,stelemetnid,stsecc)
{

document.getElementById(stelemetnid).innerHTML = '<div style="color:red; margin:20px auto; width:300px; font-size:16px;">'+
												  'Cargando Canal Por favor espere un momento........'+
												  '</div>';

var stvars = 'stsecc='+stsecc+'&sttvid='+stelement;

STRdatos('POST','',stvars,stelemetnid,2);
	
}



function STShowTV(sttipo,stcontid)
{

	switch(sttipo)
	{
		case 's':
		
			document.getElementById(stcontid).style.display = (document.getElementById(stcontid).style.display != 'block' ? 'block' : 'none');

		
		break;
		
		case 'm':
		
			var stnotcont = Array('sttvcontida','sttvcontidb');

			for(var i=0; i < stnotcont.length; i++)
			{
				if(stcontid == stnotcont[i])
				{
					document.getElementById(stnotcont[i]).style.display = "block";
				}
				else
				{
					document.getElementById(stnotcont[i]).style.display = "none";
				}
			}
		
		break;
	
	}
	
}


