// Javascript para Clan 8> por Jaime Oliva aka Zweimann 2009 j.oliva@europelogic.com
// Copiar es mas facil que aprender, todos lo sabemos, anda copia...

function hp_minmax(ident)
{
	if ( getID(ident).style.display == "block" ) 
	{
		getID(ident).style.display = "none";
		getID(ident + "icon").src="gfx/maximize.gif";
	}
	else
	{
		getID(ident).style.display = "block";
		getID(ident + "icon").src="gfx/minimize.gif";		
	}
}

function hp_salvar()
{
	var servidor_x, servidor_y, servidor_s;
	var post_x, post_y, post_s;
	var news_x, news_y, news_s;
	var ts_x, ts_y, ts_s;
	servidor_x = document.getElementById('SERVIDOR').style.left;
	servidor_y = document.getElementById('SERVIDOR').style.top;
	servidor_s = document.getElementById('SERVIDORdiv').style.display;
	post_x = document.getElementById('POSTS').style.left;
	post_y = document.getElementById('POSTS').style.top;
	post_s = document.getElementById('POSTSdiv').style.display;
	news_x = document.getElementById('NOTICIAS').style.left;
	news_y = document.getElementById('NOTICIAS').style.top;
	news_s = document.getElementById('NOTICIASdiv').style.display;
	ts_x = document.getElementById('TS').style.left;
	ts_y = document.getElementById('TS').style.top;
	ts_s = document.getElementById('TSdiv').style.display;
	cb_x = document.getElementById('menu').style.left;
	cb_y = document.getElementById('menu').style.top;
	
	var pars = "?sx=" + servidor_x + "&sy=" + servidor_y + "&ss=" + servidor_s;
	var pars = pars + "&px=" + post_x + "&py=" + post_y + "&ps=" + post_s;
	var pars = pars + "&nx=" + news_x + "&ny=" + news_y + "&ns=" + news_s;
	var pars = pars + "&tx=" + ts_x + "&ty=" + ts_y + "&ts=" + ts_s;
	var pars = pars + "&cx=" + cb_x + "&cy=" + cb_y;


	var xml = null;
    try{
    xml = new ActiveXObject("Microsoft.XMLHTTP");
    }
	catch(expeption)
	{
         xml = new XMLHttpRequest();
    }
     xml.open("GET","save.php" + pars, false);
     xml.send(null);
     if(xml.status == 404) alert("Error de Conexión a " + url + vars);
    
	 alert("Tu configuración ha sido guardada!");
}
function hp_borrar()
{
	var xml = null;
    try{
    xml = new ActiveXObject("Microsoft.XMLHTTP");
    }
	catch(expeption)
	{
         xml = new XMLHttpRequest();
    }
     xml.open("GET","delete.php" , false);
     xml.send(null);
     if(xml.status == 404) alert("Error de Conexión a " + url + vars);
}
function gorcon()
{
	document.getElementById("RCON").style.display="block";
	document.rcf.submit();
}
function closercon()
{
	// Helipollos powah!
	document.getElementById("RCON").style.display="none";
	document.getElementById('user').value = "";
	document.getElementById('pass').value = "";
}
function getID(id){return document.getElementById(id);}function Browser() {  var ua, s, i;  this.isIE    = false;  this.isNS    = false;  this.version = null;  ua = navigator.userAgent;  s = "MSIE";  if ((i = ua.indexOf(s)) >= 0) {    this.isIE = true;    return;  }  s = "Netscape6/";  if ((i = ua.indexOf(s)) >= 0) {    this.isNS = true;    return;  }  s = "Gecko";  if ((i = ua.indexOf(s)) >= 0) { this.isNS = true; return;}} var browser = new Browser();var dragObj = new Object();function dragStart(event, id) { var x, y;  dragObj.elNode = getID(id); if (browser.isIE) { x = window.event.clientX + document.documentElement.scrollLeft + document.body.scrollLeft; y = window.event.clientY + document.documentElement.scrollTop + document.body.scrollTop; } if (browser.isNS) { x = event.clientX + window.scrollX; y = event.clientY + window.scrollY;}  dragObj.cursorStartX = x;  dragObj.cursorStartY = y;  dragObj.elStartLeft  = parseInt(dragObj.elNode.style.left, 10);  dragObj.elStartTop   = parseInt(dragObj.elNode.style.top,  10);  if (isNaN(dragObj.elStartLeft)) dragObj.elStartLeft = 0;  if (isNaN(dragObj.elStartTop))  dragObj.elStartTop  = 0;  if (browser.isIE) { document.attachEvent("onmousemove", dragGo);    document.attachEvent("onmouseup",   dragStop); window.event.cancelBubble = true;window.event.returnValue = false;}  if (browser.isNS) {   document.addEventListener("mousemove", dragGo,   true); document.addEventListener("mouseup",   dragStop, true); event.preventDefault();}}function dragGo(event) { var x, y;if (browser.isIE) {x = window.event.clientX + document.documentElement.scrollLeft + document.body.scrollLeft; y = window.event.clientY + document.documentElement.scrollTop + document.body.scrollTop;} if (browser.isNS) { x = event.clientX + window.scrollX; y = event.clientY + window.scrollY;} dragObj.elNode.style.left = (dragObj.elStartLeft + x - dragObj.cursorStartX) + "px"; dragObj.elNode.style.top  = (dragObj.elStartTop  + y - dragObj.cursorStartY) + "px"; if (browser.isIE) {window.event.cancelBubble = true;window.event.returnValue = false;}if (browser.isNS) event.preventDefault();} function dragStop(event) { if (browser.isIE) { document.detachEvent("onmousemove", dragGo); document.detachEvent("onmouseup",   dragStop); } if (browser.isNS) { document.removeEventListener("mousemove", dragGo,   true); document.removeEventListener("mouseup",   dragStop, true);}}