
var setDel=0;

var topBool=true;
var botBool=true;
var pgeload=false;
var flwMse=false;
var whchSlde="recentDiv";
var cnSlde=true;
var sendReq=new Array();
sendReq[0]=(document.all)?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest();
var Timer=new Array();
var mvVars=new Array();
mvVars[0]=0;
mvVars[1]=0;
mvVars[2]=0;


var sideHeight=230;

function $(item){
	return document.getElementById(item);
}

function setLoads() {

var logilnk=($('logilnk'))?$('logilnk'):$('logolnk');
var homelnk=$('homelnk');

if(!$('shdOv')){

var shdOv=document.createElement('div');
shdOv.setAttribute('id','shdOv');
document['body'].appendChild(shdOv);

var spOver=document.createElement('div');
spOver.setAttribute('id','spOver');
document['body'].appendChild(spOver);

}

if(!$('topAr')){
var tpAr=document.createElement('img');
tpAr.className="ars";
tpAr.src="http://singleparadox.com/images/layout/arrow_tp.gif";
tpAr.setAttribute('id','topAr');
tpAr.style.top=homelnk.offsetTop+2+"px";
tpAr.style.left=homelnk.offsetLeft+"px";
document['body'].appendChild(tpAr);

var btAr=document.createElement('img');
btAr.className="ars";
btAr.src="http://singleparadox.com/images/layout/arrow_bt.gif";
btAr.setAttribute('id','botAr');
btAr.style.top=logilnk.offsetTop+31+"px";
btAr.style.left=logilnk.offsetLeft+"px";
document['body'].appendChild(btAr);

$('recentHdr').src="http://singleparadox.com/images/leftnav_recent_on.png";
$('recentDiv').style.height=sideHeight+"px";
$('chatDiv').style.height=0+"px";
$('blogDiv').style.height=0+"px";

}else{
$('topAr').style.top=homelnk.offsetTop+2+"px";
$('topAr').style.left=homelnk.offsetLeft+"px";
$('botAr').style.top=logilnk.offsetTop+31+"px";
$('botAr').style.left=logilnk.offsetLeft+"px";
}
pgeload=true;
}

function setOver(infoline){
if(setDel<20){
document.body.style.overflow="hidden";
$('shdOv').style.display='block';
$('spOver').style.display='block';
$('spOver').innerHTML="<div id=\"info\">"+infoline+"</div>";
setDel++;
}else{
document.body.style.overflow="auto";
$('shdOv').style.display='none';
$('spOver').style.display='none';
clearTimeout(Timer[0]);
}
Timer[0]=setTimeout(function(){setOver(infoline)},100);
}

function arFlw(e){
var mosX=(document.all)?event.clientX:e.pageX;
var mosY=(document.all)?event.clientY:e.pageY;
var homelnk=$('homelnk');
var portlnk=$('portlnk');
var logilnk=($('logilnk'))?$('logilnk'):$('logolnk');
var biolnk=($('biolnk'))?$('biolnk'):$('biolnk2');
if(topBool==true&&mosX>(homelnk.offsetLeft+7)&&mosX<(portlnk.offsetLeft+74)&&mosY>homelnk.offsetTop&&mosY<(homelnk.offsetTop+44)){
$('topAr').style.left=mosX-8+"px";
}else if(botBool==true&&mosX>(logilnk.offsetLeft+7)&&mosX<(biolnk.offsetLeft+68)&&mosY>logilnk.offsetTop&&mosY<(logilnk.offsetTop+43)){
$('botAr').style.left=mosX-8+"px";
}
}

function sldAr(e){
var mosX=(document.all)?event.clientX:e.pageX;
var ar=$('topAr');
if(mosX>=ar.style.left){
mvVars[2]++;
ar.style.left=parseInt(ar.style.left)+(mvVars[2])+"px";
}else{
clearTimeout(Timer[2]);
}
Timer[2]=setTimeout(function(){sldAr(e)},10);
}

function submitPage(){
if(document.all){
if(event.keyCode==13){
$('loginFrm').submit();
}
}
}

function chngInp(whch,pos){
$(whch).style.backgroundPosition="0px "+pos+"px";
}

function returnInp(whch){
$(whch).style.backgroundPosition="0px 0px";
}

function shwLog(){
var biolnk=$('biolnk');
var biolnk2=$('biolnk2');

if(biolnk){
biolnk.setAttribute('id','biolnk2');
$('botRow').style.backgroundPosition="0px -43px";
var logbox=document.createElement('div');
logbox.setAttribute('id','logBox');
logbox.style.left=biolnk.offsetLeft+75+"px";
logbox.style.top=biolnk.offsetTop+3+"px";
logbox.innerHTML="<form action=\"login.php\" id=\"loginFrm\" method=\"post\"><input type=\"text\" id=\"user\" name=\"user\" onkeydown=\"submitPage();\" /><input type=\"password\" id=\"pass\" name=\"pass\" onkeydown=\"submitPage();\" /><input type=\"submit\" style=\"display:none;\" /></form>";
document['body'].appendChild(logbox);
$('user').focus();
}else{
biolnk2.setAttribute('id','biolnk');
$('botRow').style.backgroundPosition="0px 0px";
document['body'].removeChild($('logBox'))
}
}

function slidenav(whichopn,blr){
if(cnSlde==true){
setSlide(whichopn,blr);
}
}


function setSlide(whichopn,blr){
var imgsrc=blr.src.split('_');
var imgcls=whchSlde.split('D');
var imgsrc2=$(imgcls[0]+'Hdr').src.split('_');
var imgcls2=whichopn.split('D');
var cntTabs=$('cntTbs');

	blr.parentNode.blur();
	if(parseInt($(whichopn).style.height)<=sideHeight-5&&imgcls[0]!=imgcls2[0]){
		cnSlde=false;
		mvVars[0]++;
		$(whchSlde).style.height=sideHeight-(mvVars[0]*23)+"px";
		$(whchSlde).style.opacity=(100-(mvVars[0]*10))/100;
		$(whichopn).style.height=(mvVars[0]*23)+"px";
		$(whichopn).style.opacity=(mvVars[0]*10)/100;
		Timer[1]=setTimeout(function(){setSlide(whichopn,blr)},0);
	}else if(parseInt($(whichopn).style.height)>=sideHeight-4&&imgcls[0]!=imgcls2[0]){
		clearTimeout(Timer[1]);
		blr.src=imgsrc[0]+"_"+imgsrc[1]+"_on.png";
		document.cookie="slide="+whichopn;
		$(imgcls[0]+'Hdr').src=imgsrc2[0]+"_"+imgsrc2[1]+"_of.png";
		cnSlde=true;
		whchSlde=whichopn;
		mvVars[0]=0;
	}
}
	
window.onload=function(){setLoads()
};
window.onresize=setLoads;
document.onmousemove=function(e){if(pgeload==true){arFlw(e)}};

