/********************************************

 ** ESPACIO.YA.COM v2.0 **

    $Revision: 1.51 $

    Last update: $Date: 2009/05/28 14:20:46 $

	(c) Ya.com Internet Factory, S.A.U.

	T-Online International AG Group

********************************************/



/* publicity */

function paint_ZoneXPub(){

sz = "468x60";

 st = "erotica.ya.com";

 pd = "e34espacio_X";

 isnt = "dcopt=ist";

 vartext = "tile=1";

 std = "http://ad.es.doubleclick.net/";



var chechkm8inactive=false;

var time = new Date();

randnum= (time.getTime());



if (document.cookie.length > 0) {

cookies=unescape(document.cookie);

offset = cookies.indexOf("YAKEYS=");

if (offset != -1) {

offset = cookies.indexOf("P1=");

if (offset != -1) {

end =cookies.indexOf("|", offset);

vartext=cookies.substring(offset, end);}}}



if (navigator.appName && navigator.appName.indexOf("Netscape")>=0 && navigator.appVersion.substring(0,1)>=5) {

document.write ('<a href="'+std+'jump/'+st+'/'+pd+';sz='+sz+'">');

document.write ('<img src="'+std+'ad/'+st+'/'+pd+';sz='+sz+'" width="468" height="60" border="0"></a>'); }

else {

document.write ('<SCR'+'IPT language="JavaScript" SRC="'+std+'adj/'+st+'/'+pd+';'+isnt+';sz='+sz+';'+vartext+';ord='+randnum+'?"></SCR'+'IPT>');}

}

function paint_pub1(){

sz = "468x60";

st = "es.espacioya.com";

pd = pubCode;//"e15home"

var isnt = "";

if (pubCode != "e19servicios_herramientas"){

  isnt = "dcopt=ist";

}  

vartext = "tile=1";

std = "http://ad.es.doubleclick.net/";

var time = new Date();

randnum= (time.getTime());

if (document.cookie.length > 0) {

cookies=unescape(document.cookie);

offset = cookies.indexOf("YAKEYS=");

if (offset != -1) {

offset = cookies.indexOf("P1=");

if (offset != -1) {

end =cookies.indexOf("|", offset);

vartext=cookies.substring(offset, end);

}

}

}

if (navigator.appName && navigator.appName.indexOf("Netscape")>=0 && navigator.appVersion.substring(0,1)>=5) {

document.write ('<a href="'+std+'jump/'+st+'/'+pd+';sz='+sz+'">');

document.write ('<img src="'+std+'ad/'+st+'/'+pd+';sz='+sz+'" width="468" height="60" border="0"></a>');

} else {

document.write ('<SCR'+'IPT language="JavaScript" SRC="'+std+'adj/'+st+'/'+pd+';'+isnt+';sz='+sz+';'+vartext+';ord='+randnum+'?"></SCR'+'IPT>');

}

}

function paint_pub2(){

sz = "200x200";

st = "es.espacioya.com";

pd = pubCode;//"e15home"

vartext = "tile=2";

std = "http://ad.es.doubleclick.net/";

var time = new Date();

randnum= (time.getTime());

if (document.cookie.length > 0) {

cookies=unescape(document.cookie);

offset = cookies.indexOf("YAKEYS=");

if (offset != -1) {

offset = cookies.indexOf("P1=");

if (offset != -1) {

end =cookies.indexOf("|", offset);

vartext=cookies.substring(offset, end);

}

}

}	

if (navigator.appName && navigator.appName.indexOf("Netscape")>=0 && navigator.appVersion.substring(0,1)>=5) {

document.write ('<a href="'+std+'jump/'+st+'/'+pd+';sz='+sz+'">');

document.write ('<img src="'+std+'ad/'+st+'/'+pd+';sz='+sz+'" width="200" height="200" border="0"></a>');

} else {

document.write ('<SCR'+'IPT language="JavaScript" SRC="'+std+'adj/'+st+'/'+pd+';sz='+sz+';'+vartext+';ord='+randnum+'?"></SCR'+'IPT>');

}

}

function paint_chechkm8(){

var chechkm8inactive=false;

var cm8cat= checkM8Code;//'espacio.home'

if (!chechkm8inactive) { 

document.write('<SCR'+'IPT language="javascript" src="http://ad.ya.com/multiplescript/checkm8_init_1.js"></SC'+'RIPT>');

}

}

/* end publicity */

function doOnKeyPress(e, func) {

if (window.event.keyCode == 13) {

return eval(func);

}

return false;

}

/* Tricks & Advice  functions */

function selectCode(id) {

var copied = false;

var obj = document.getElementById(id);

obj.focus();

obj.select();

if (window.clipboardData) { //Only for MSIE

copied = window.clipboardData.setData("Text",obj.value);

}

}

/* end Tricks & Advice  functions */



/* File Administrator functions */

function CreateDir(f, idtonav) {

f.M.value = 'admindir1';

f.CD.value = idtonav;

f.AC.value = 1;

f.submit();

}

function RenameDir(f, type) {

var idtonav = SelectId(f, type);

if (idtonav=='') return false;

f.M.value = 'admindir1';

f.CD.value = idtonav;

f.AC.value = 2;

f.submit();

}

function DeleteDir(f, type) {

var a = 0;

var len = f.elements.length;

var idtonav = "";

for (var i = 0; i < len; i++) {

var e = f.elements[i];

if ((e.name == "checkfile") && (e.checked == true) && (e.value.indexOf(type) > 0)) {

if (idtonav=="") {

idtonav = e.value.substring (0, e.value.indexOf(type))

} else {

idtonav = idtonav + ',' + e.value.substring (0, e.value.indexOf(type))

}

}

}

if (idtonav=='') return false;

f.M.value = 'admindir1';

f.CD.value = idtonav;

f.AC.value = 3;

f.submit();

}

function OpenDir(f, type) {

var idtonav = SelectId(f, type);

if (idtonav=='') return false;

f.M.value = 'adminhome';

f.CD.value = idtonav;

f.submit();

}

function OpenDirSelect(f) {

f.M.value = 'adminhome';

f.CD.value = f.CDOP.value;

f.submit();

}				

function CloseDir(f, idtonav) {  

f.M.value = 'adminhome';

f.CD.value = idtonav;

f.submit();

}

function DoReloadOrder(order, idtonav, f) {    

f.M.value = 'adminhome';

f.CD.value = idtonav;

f.OD.value = order;

f.submit();

}

function DoReload(f) {    

f.M.value = 'adminhome';

f.submit();

}

function SelectId (f, type) {

var a = 0;

var len = f.elements.length;

var idtonav = "";

for (var i = 0; i < len; i++) {

var e = f.elements[i];

if ((e.name == "checkfile")&&(e.checked==true)&&(e.value.indexOf(type)>0)) {

a++;

}

}

if (a==0) {

if (type == 'file') {

alert('Debes seleccionar un archivo');

} else if (type == 'directory') {

alert('Debes seleccionar un directorio');

} else {

alert('No hay elmentos seleccionados');

}

return '';

} else if (a>1) {

alert('Sólo puede haber un elemento seleccionado');

return '';

} else {

for (var i = 0; i < len; i++) {

var e = f.elements[i];

if ((e.name == "checkfile")&&(e.checked==true)&&(e.value.indexOf(type)>0)) {

idtonav = e.value.substring (0, e.value.indexOf(type))

}

}

}

return (idtonav);

}

function DeselectAll() {

f = document.forms['filelist'];

var len = f.elements.length;

for (var i = 0; i < len; i++) {

var e = f.elements[i];

if (e.name == "checkfile") {

e.checked = false;

}

}

}

function SelectAll() {

f = document.forms['filelist'];

var len = f.elements.length;

for (var i = 0; i < len; i++) {

var e = f.elements[i];

if (e.name == "checkfile") {

e.checked = true;

}

}

}

function CopyFile(f, type) {

var a = 0;

var len = f.elements.length;

var idtonav = "";

for (var i = 0; i < len; i++) {

var e = f.elements[i];

if ((e.name == "checkfile")&&(e.checked==true)&&(e.value.indexOf(type)>0)) {

if (idtonav=="") {

idtonav = e.value.substring (0, e.value.indexOf(type))

} else {

idtonav = idtonav + ',' + e.value.substring (0, e.value.indexOf(type))

}

}

}

if (idtonav=='') return false;

f.M.value = 'adminfile1';

f.CD.value = idtonav;

f.AC.value = 1;

f.submit();

}

function DeleteFile(f, type) {

var a = 0;

var len = f.elements.length;

var idtonav = "";

for (var i = 0; i < len; i++) {

var e = f.elements[i];

if ((e.name == "checkfile")&&(e.checked==true)&&(e.value.indexOf(type)>0)) {

if (idtonav=="") {

idtonav = e.value.substring (0, e.value.indexOf(type))

} else {

idtonav = idtonav + ',' + e.value.substring (0, e.value.indexOf(type))

}

}

}

if (idtonav=='') return false;

f.M.value = 'adminfile1';

f.CD.value = idtonav;

f.AC.value = 3;

f.submit();

}

function ViewFile(f, type) {

var frm = document.forms['goto'];

var idtonav = SelectId(f, type)

if (idtonav=='') return false;

frm.action = f.URI.value + '/' + idtonav;

frm.rnd.value = new Date().getTime();

frm.submit();

}

function RenameFile(f, type) {

var idtonav = SelectId(f, type);

if (idtonav=='') return false;

f.M.value = 'adminfile1';

f.CD.value = idtonav;

f.AC.value = 4;

f.submit();

}

function MoveFile(f, type) {

var a = 0;

var len = f.elements.length;

var idtonav = "";

for (var i = 0; i < len; i++) {

var e = f.elements[i];

if ((e.name == "checkfile")&&(e.checked==true)&&(e.value.indexOf(type)>0)) {

if (idtonav=="") {

idtonav = e.value.substring (0, e.value.indexOf(type))

} else {

idtonav = idtonav + ',' + e.value.substring (0, e.value.indexOf(type))

}

}

}

if (idtonav=='') return false;

f.M.value = 'adminfile1';

f.CD.value = idtonav;

f.AC.value = 2;

f.submit();

}

/* end File Administrator functions */



var mac = false;

if (navigator.appVersion.toLowerCase().indexOf("mac") != -1) {

mac = true;

}



function Trim(s)

{

  if (s==null) return null;

  var r = s;

  while (r.length>0 && (r.charAt(0)==' '||r.charAt(0)=='\r'||r.charAt(0)=='\n'||r.charAt(0)=='\t')) {

    r = r.substring(1, r.length);

  }

  while (r.length>0 && (r.charAt(r.length-1)==' '||r.charAt(r.length-1)=='\r'||r.charAt(r.length-1)=='\n'||r.charAt(r.length-1)=='\t')) {

    r = r.substring(0, r.length-1);

  }

  return r;

}



function disconnectSpace(){

  var cookies = document.cookie.split(";");

  if (cookies!=null) {

    var length = cookies.length;

    if (length>0) {

      var pos;

      for(var i=0; i<length; i++) {

        pos = cookies[i].indexOf("=");

        if (pos!=-1) {

          CookieDelete(Trim(cookies[i].substring(0, pos)));

		}  

      }

    }

  }

  window.location.reload(true);

}



function ComprobarCaracteres(cadena) {

var caracteres = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_-.@"; for(i=0;i<cadena.length;i++) { if (caracteres.indexOf(cadena.charAt(i)) == -1) return false; } return true;

}

  

function paint_BlogSpacePub(){

	sz = "200x200";

	st = "es.espacioya.com";

	pd = "e22servicios_utilidades";

	vartext = "tile=2";

	std = "http://ad.es.doubleclick.net/";

	

	var time = new Date();

	randnum= (time.getTime());

	

	if (document.cookie.length > 0) {

		cookies=unescape(document.cookie);

		offset = cookies.indexOf("YAKEYS=");

		if (offset != -1) {

			offset = cookies.indexOf("P1=");

			if (offset != -1) {

				end =cookies.indexOf("|", offset);

				vartext=cookies.substring(offset, end);

			}

		}

	}

	if (navigator.appName && navigator.appName.indexOf("Netscape")>=0 && navigator.appVersion.substring(0,1)>=5) {

		document.write ('<a href="'+std+'jump/'+st+'/'+pd+';sz='+sz+'">');

		document.write ('<img src="'+std+'ad/'+st+'/'+pd+';sz='+sz+'" width="200" height="200" border="0"></a>'); 

	}

	else {

		document.write ('<SCR'+'IPT language="JavaScript" SRC="'+std+'adj/'+st+'/'+pd+';sz='+sz+';'+vartext+';ord='+randnum+'?"></SCR'+'IPT>'); 

	}

}



function ConectarVentana2(formulario) { 

	try {

		top.name="full";

	} catch (e) {

	

	}

	var f;

	f = document.forms["FORMPRINCIPA"];

	var host = "validacion.ya.com";    

	//f.URL_VOLVER.value = window.location.href;

	if (f.URL_VOLVER_ERROR != null) {

		if (f.URL_VOLVER_ERROR.value == "")

			f.URL_VOLVER_ERROR.value = window.location.href;

	}

	if(window.location.href.indexOf("chueca")>0){        

		f.SITE.value = "chueca";

		f.URL_VOLVER.value = "http://blogs.chueca.com";

		fError = "http://blogs.chueca.com";

	}else{

		f.SITE.value = "ya";

		//f.URL_VOLVER.value = "http://blogs.ya.com";

		//fError = "http://blogs.ya.com";

	} 

	//window.open("http://" + host + "/SConnectWindowNoPopup?URL_VOLVER=" + f.URL_VOLVER.value + "&SITE=" + f.SITE.value + "&TIPO=" + f.TIPO.value+ "&ESTATICO=" + f.ESTATICO.value + "&USU_NICK=" + f.USU_NICK.value + "&URL_VOLVER_ERROR=" + fError + "&USU_PASSWORD=" + f.USU_PASSWORD.value,"full","");   

	f.action = "http://" + host + "/SConnectWindowNoPopup";
	
	f.target="validate-user";
	
	//f.target = "_top";

	f.submit();		

  //self.close();

}

  

function ConectarVentana(formulario) { 

	try {

		top.name="full";

	} catch (e) {

	

	}

	var f;

	f = document.forms["FORMPRINCIPA"];

	var host = "validacion.ya.com";    

	//f.URL_VOLVER.value = window.location.href;

	if (f.URL_VOLVER_ERROR != null) {

		if (f.URL_VOLVER_ERROR.value == "")

			f.URL_VOLVER_ERROR.value = window.location.href;

	}

	if(window.location.href.indexOf("chueca")>0){        

		f.SITE.value = "chueca";

		f.URL_VOLVER.value = "http://blogs.chueca.com";

		fError = "http://blogs.chueca.com";

	}else{

		f.SITE.value = "ya";

		f.URL_VOLVER.value = "http://blogs.ya.com";

		fError = "http://blogs.ya.com";

	} 

	window.open("http://" + host + "/SConnectWindowNoPopup?URL_VOLVER=" + f.URL_VOLVER.value + "&SITE=" + f.SITE.value + "&TIPO=" + f.TIPO.value+ "&ESTATICO=" + f.ESTATICO.value + "&USU_NICK=" + f.USU_NICK.value + "&URL_VOLVER_ERROR=" + fError + "&USU_PASSWORD=" + f.USU_PASSWORD.value,"full","");   

	//f.action = "http://" + host + "/SConnectWindowNoPopup";

	//f.submit();		



}	

	

function DesconectarVentana(formulario) { 



	var f;

	f = document.forms["FORMDESCONECTA"];

	var host = "validacion.ya.com";    

	if(window.location.href.indexOf("chueca")>0){        

		f.SITE.value = "chueca";

		f.URL_VOLVER.value = "http://blogs.chueca.com";

		fError = "http://blogs.chueca.com";

	}else{

		f.SITE.value = "ya";

		f.URL_VOLVER.value = "http://blogs.ya.com";

		fError = "http://blogs.ya.com";

	} 

	if (f.URL_VOLVER_ERROR != null) {

		if (f.URL_VOLVER_ERROR.value == "")

			f.URL_VOLVER_ERROR.value = window.location.href;

	}

	if(window.location.href.indexOf("chueca")>0){        

		f.SITE.value = "chueca";

	}else{

		f.SITE.value = "ya";

	}    

	f.action = "http://" + host + "/SDisconnectWindowNoPopup";

	f.submit();	



}



