/*

JS Document 

   $Version:          2.0              																												  $
   $Author:           Filezsite																		  $
   $Date Creation:    30/06/2009       																												  $
   $Date Modified:    20/07/2009       																												  $
   $Security:         VGhpcyBzaXRlIGRvZXMgbm90IGhhdmUgc2VjdXJpdHkgcmVxdWVzdGVkIGJ5IEZpbGV6U2l0ZSB3d3cuZmlsZXpzaXRlLmNvbS5hcg $
	
   $Copyright 2008-2009$

*/

var d=document, lastDiv='';

callPage('home.html');

function elementById(x)
{
	if (d.getElementById)	return d.getElementById(x);
	else if (d.all)			return d.all[x];
	else if (d.layers)		return d.layers[x];
	else return null;
}

function callPage(x){
	SendPOST(x, '', changeContent);
	return false;
}

function changeContent(x)
{
	c = elementById('onlyone');
	c.innerHTML = x;
}

function showPop(x)
{
	SendPOST(x, '', showMeTheTruth);
	return false;
}

function showMeTheTruth(x)
{
	divId  = 'pop';
	refDiv = elementById(divId);
	if(refDiv)
	{
		refDiv.innerHTML = x;
		initTrans(divId);
	}
}


function initTrans(refDiv)
{
	div = elementById(refDiv);
	div.style.display = 'block';
	div.style.visibility = 'visible';
	fadeIn(refDiv,0);
}


function outTrans()
{
	fadeOut('pop',90);
	return false;
}


function setOpacity(obj, opacity)
{
  opacity = (opacity == 100)?99.999:opacity;
  
  if (obj)
  {
	  // IE/Win
	  obj.style.filter = 'alpha(opacity:'+opacity+')';
	  
	  // Safari<1.2, Konqueror
	  obj.style.KHTMLOpacity = opacity/100;
	  
	  // Older Mozilla and Firefox
	  obj.style.MozOpacity = opacity/100;
	  
	  // Safari 1.2, newer Firefox and Mozilla, CSS3
	  obj.style.opacity = opacity/100;
  }
}

function fadeIn(objId,opacity)
{
	if(elementById)
	{
		obj = elementById(objId);
		if (opacity <= 90)
		{
			setOpacity(obj, opacity);
			opacity += 3;
			window.setTimeout('fadeIn("'+objId+'", '+opacity+')', 5);
		}
	}
}

function fadeOut(objId,opacity)
{
	if(elementById)
	{
		obj = elementById(objId);
		if(opacity < 3)
		{
			obj.style.visibility = 'hidden';
			obj.style.display = 'none';
		}
		if(opacity > 0)
		{
			setOpacity(obj, opacity);
			opacity = opacity - 4;
			window.setTimeout('fadeOut("'+objId+'", '+opacity+')', 2);
		}
	}
}

function SendPOST(url, params, callback) {
	http_request = false;
	
	if (window.XMLHttpRequest) {
		http_request = new XMLHttpRequest();
		if (http_request.overrideMimeType) {http_request.overrideMimeType('text/xml');}
	} else if (window.ActiveXObject) {
		try {
			http_request = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
				http_request = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e) {}
		}
	}
	if (!http_request) return false;
	
	url = 'pr.php?a='+encodeURIComponent(url);
	
	http_request.open('POST', url , true);
	http_request.onreadystatechange = function()
	{
		if( http_request.readyState == 4 )
		{
			switch( http_request.status )
			{
				case 200:
				{
					callback(http_request.responseText);
					break;
				}
				
				default:
					return false;
					break;
			}
		}
	}
	
   http_request.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
	http_request.send(params);

   return true;

}
//]]>
