// JavaScript Document from http://phpjs.org thanks very much guys!





function rawurldecode( str ) {
    
    var histogram = {};
    var ret = str.toString(); 

    var replacer = function(search, replace, str) {
        var tmp_arr = [];
        tmp_arr = str.split(search);
        return tmp_arr.join(replace);
    };



	histogram['&']   = '&amp;';

    for (replace in histogram) {
        search = histogram[replace]; 
        ret = replacer(search, replace, ret) 
    }

 
    ret = decodeURIComponent(ret);

    return ret;
}

function rawurlencode( str ) {

 
    var histogram = {}, tmp_arr = [];
    var ret = str.toString();

    var replacer = function(search, replace, str) {
        var tmp_arr = [];
        tmp_arr = str.split(search);
        return tmp_arr.join(replace);
    };

   

	histogram['&']   = '&amp;';

    
    ret = encodeURIComponent(ret);

    
    ret = replacer('%20', ' ', ret); 

    for (search in histogram) {
        replace = histogram[search];
        ret = replacer(search, replace, ret) 
    }


    return ret.replace(/(\%([a-z0-9]{2}))/g, function(full, m1, m2) {
        return "%"+m2.toUpperCase();
    });

    return ret;
}

function setCookie(c_name,value,expiredays)
{
var exdate=new Date();
exdate.setDate(exdate.getDate()+expiredays);
document.cookie=c_name+ "=" +escape(value)+
((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
}

var xmlHttp

function newmsg()
{

xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
  {
  alert ("Browser does not support HTTP Request")
  return
  } 
  var ispublic=document.getElementById('public').checked
var str=document.getElementById('longurl').value
str = rawurlencode(str)
if (str.length > 3) { Effect.toggle('maintd1', 'slide'); }

var url="shorturl.php?"
url=url+"longurl="+str
url=url+"&public="+ispublic

xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
} 

function stateChanged() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 {
	 
 document.getElementById("result").innerHTML=xmlHttp.responseText 

 } 
}

function GetXmlHttpObject()
{
var xmlHttp=null;
try
 {
 // Firefox, Opera 8.0+, Safari
 xmlHttp=new XMLHttpRequest();
 }
catch (e2)
 {
 // Internet Explorer
 try
  {
  xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
  }
 catch (e2)
  {
  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
 }
return xmlHttp;
}

//update user list




function updateuserlist()
{

xmlHttp2=GetXmlHttpObject()
if (xmlHttp2==null)
  {
  alert ("Browser does not support HTTP Request")
  return
  } 
var url2="st.php"
url2=url2+"?act=updateuserlist"
xmlHttp2.onreadystatechange=stateChanged2 
xmlHttp2.open("GET",url2,true)
xmlHttp2.send(null)
} 

function stateChanged2() 
{ 
if (xmlHttp2.readyState==4 || xmlHttp2.readyState=="complete")
 { 
 document.getElementById('maintd1').style.display='none'; 
  document.getElementById('result').style.display='none';
  document.getElementById('maintd2').style.display='block'; 
document.getElementById('maintd2').style.height = '700px';
document.getElementById('maintd3').style.display='none';
document.getElementById('maintd4').style.display='none';
 document.getElementById("maintd2").innerHTML=xmlHttp2.responseText 
document.getElementById('tab2').style.backgroundColor = '#4f7ac8'; 
	document.getElementById('tab1').style.backgroundColor = '#5a8ce5';
		document.getElementById('tab3').style.backgroundColor = '#5a8ce5';
		document.getElementById('tab4').style.backgroundColor = '#5a8ce5';
 } 
}

function GetXmlHttpObject2()
{
var xmlHttp2=null;
try
 {
 // Firefox, Opera 8.0+, Safari
 xmlHttp2=new XMLHttpRequest();
 }
catch (e4)
 {
 // Internet Explorer
 try
  {
  xmlHttp2=new ActiveXObject("Msxml2.XMLHTTP");
  }
 catch (e4)
  {
  xmlHttp2=new ActiveXObject("Microsoft.XMLHTTP");
  }
 }
return xmlHttp2;
}


//update msglist

function updatemsglist()
{

xmlHttp3=GetXmlHttpObject()
if (xmlHttp3==null)
  {
  alert ("Browser does not support HTTP Request")
  return
  } 
    var textshortfield=document.getElementById('textshortfield').value
  var mailtext=document.getElementById('mailtext').value
document.getElementById('textshort').style.display='none';

textshortfield = rawurlencode(textshortfield.replace(/\n\r?/g, 'j0m1z'));


var url3="stajax.php"
url3=url3+"?text="+textshortfield
url3=url3+"&mail="+mailtext
xmlHttp3.onreadystatechange=stateChanged3 
xmlHttp3.open("GET",url3,true)
xmlHttp3.send(null)
} 

function stateChanged3() 
{ 
if (xmlHttp3.readyState==4 || xmlHttp3.readyState=="complete")
 { 
 document.getElementById('maintd2').style.height='200px';
 document.getElementById('maintd2').innerHTML=xmlHttp3.responseText;

 } 
}

function GetXmlHttpObject3()
{
var xmlHttp3=null;
try
 {
 // Firefox, Opera 8.0+, Safari
 xmlHttp3=new XMLHttpRequest();
 }
catch (e5)
 {
 // Internet Explorer
 try
  {
  xmlHttp3=new ActiveXObject("Msxml2.XMLHTTP");
  }
 catch (e5)
  {
  xmlHttp3=new ActiveXObject("Microsoft.XMLHTTP");
  }
 }
return xmlHttp3;
}

function tab1()
{
document.getElementById('tab1').style.backgroundColor='#4f7ac8';
document.getElementById('tab2').style.backgroundColor = '#5a8ce5';
document.getElementById('tab3').style.backgroundColor = '#5a8ce5';
document.getElementById('tab4').style.backgroundColor = '#5a8ce5';
document.getElementById('maintd2').style.display='none';
document.getElementById('maintd1').style.display='block'; 
document.getElementById('result').innerHTML='';
document.getElementById('result').style.display='block';
document.getElementById('maintd3').style.display='none';
document.getElementById('maintd4').style.display='none';
}

function tab3()
{
document.getElementById('tab3').style.backgroundColor='#4f7ac8';
document.getElementById('tab2').style.backgroundColor = '#5a8ce5';
document.getElementById('tab1').style.backgroundColor = '#5a8ce5';
document.getElementById('tab4').style.backgroundColor = '#5a8ce5';
document.getElementById('maintd2').style.display='none';
document.getElementById('maintd1').style.display='none';
document.getElementById('maintd4').style.display='none';
document.getElementById('result').style.display='none';
document.getElementById('maintd3').style.display='block';
document.getElementById('result').innerHTML='';


}

function tab4()
{
	
document.getElementById('tab4').style.backgroundColor='#4f7ac8';
document.getElementById('tab2').style.backgroundColor = '#5a8ce5';
document.getElementById('tab1').style.backgroundColor = '#5a8ce5';
document.getElementById('tab3').style.backgroundColor = '#5a8ce5';
document.getElementById('maintd2').style.display='none';
document.getElementById('maintd1').style.display='none';
document.getElementById('result').style.display='none';
document.getElementById('maintd3').style.display='none';
document.getElementById('maintd4').style.display='block';
document.getElementById('result').innerHTML='';


}

function updateyourlinks()
{

xmlHttp7=GetXmlHttpObject()
if (xmlHttp7==null)
  {
  alert ("Browser does not support HTTP Request")
  return
  } 



var url7="otherlinks.php"
var nocache = Math.random();
url7=url7+"?nocache = "+nocache

xmlHttp7.onreadystatechange=stateChanged7 
xmlHttp7.open("GET",url7,true)
xmlHttp7.send(null)
} 

function stateChanged7() 
{ 
if (xmlHttp7.readyState==4 || xmlHttp7.readyState=="complete")
 { 
 document.getElementById('maintd4').innerHTML=xmlHttp7.responseText;

 } 
}

function GetXmlHttpObject7()
{
var xmlHttp7=null;
try
 {
 // Firefox, Opera 8.0+, Safari
 xmlHttp7=new XMLHttpRequest();
 }
catch (e5)
 {
 // Internet Explorer
 try
  {
  xmlHttp7=new ActiveXObject("Msxml2.XMLHTTP");
  }
 catch (e5)
  {
  xmlHttp7=new ActiveXObject("Microsoft.XMLHTTP");
  }
 }
return xmlHttp7;
}



function update56() 
{



document.getElementById("profilediv").innerHTML = "<span>" + "" + "Καλωσήρθατε, <fb:name uid='loggedinuser' useyou='false'></fb:name>." + "</span>"; 

document.getElementById('login56').style.display='inline';

FB.XFBML.Host.parseDomTree(); 
	
}

