function memberAccess(){
	cookie_value = getCookie('active');
	var wos=200;//width of error/signin div
	var dim = new Array();dim=docsize();
	if(cookie_value == ' ' || cookie_value == 'undefined' || cookie_value == ''){
		var please_signin_object = document.getElementById("pls");
		please_signin_object.style.left = (dim[0]-wos*2)/2+"px";
		please_signin_object.style.top = "10px";
		var signin_pagebg = document.createElement('div');
		signin_pagebg.id = 'signin_pagebg';
		signin_pagebg.style.zIndex = 2;
		signin_pagebg.style.position = 'absolute';
		signin_pagebg.style.top = '0px';
		signin_pagebg.style.left = '0px';
		signin_pagebg.style.height = dim[1] + 'px';
		signin_pagebg.style.width = dim[0] + 'px';
		signin_pagebg.style.backgroundColor = 'black';
		signin_pagebg.style.opacity = '0.5';
		signin_pagebg.style.filter += ("progid:DXImageTransform.Microsoft.Alpha(opacity=50)");
    	document.body.appendChild(signin_pagebg); 
		please_signin_object.style.display = document.all ? "":"";
		slideup(20, 25);
		return false;
	}else{
		return true;
	}
}

function getComputedHeight(theElt){
	if(navigator.appName=='Microsoft Internet Explorer'){
		tmphght = document.getElementById(theElt).offsetHeight;
	}
	else{
		docObj = document.getElementById(theElt);
		var tmphght1 = document.defaultView.getComputedStyle(docObj, "").getPropertyValue("height");
		tmphght = tmphght1.split('px');
		tmphght = tmphght[0];
	}
	return tmphght;
}


function purefade (obj,start,end,time,ease)
{
			if(navigator.appName=='Microsoft Internet Explorer'){time=time/4;}
			var h="lop"+Math.ceil(Math.random() * 100000)
			var f="fade"+ h+ Math.ceil(Math.random() * 10000)
			eval(f+"=new Object();");
			eval(f+".id=obj;"); 
			var count=Math.ceil(time/0.04);
			var icount=1/count;
			var count2=0;var temp2342342=start;var dist726252=end-start; var interval=dist726252/count;
			eval(f+".handleSize=function(){if(ease==0){start = temp2342342 + dist726252 * count2*icount;	this.id.style.opacity=start;this.id.style.filter=('progid:DXImageTransform.Microsoft.Alpha(opacity=' + start*100 + ')');count2 ++;} else{start =temp2342342 + dist726252 * Math.sin(Math.PI * count2*(icount * 0.5));this.id.style.opacity=start;this.id.style.filter=('progid:DXImageTransform.Microsoft.Alpha(opacity=' + start*100 + ')');count2 ++;}if(count2 >count ){window.clearInterval("+f+".sid);if(obj){document.body.removeChild(obj);}}}");
			eval(f+".sid=setInterval('"+f+".handleSize()',40);");
}

noticeReq=request();noticedelReq=request();
function callNotice(obj, al1, al2)
{
	var o=obj;
	this.callfade=function(){o.closefxn(al1, al2, obj);}
	this.callclose=function(){o.closefxn_recur(al1, al2);}
}
function noticeShow(obj, id)
{
	var width=600;
	var height=280;var closebtnheight=30;var height2=75;
	var al=''; var al2='';var gap=0;this.div1='';this.div2='';
	var myself=this;
	var color='#FFF';
	var color4close='#CCC';
	var test=0;
	var miniobj='';
	var internalpad=6;
	
	this.init = function()
	{
		if(test == 0)
		{
			test=1;
			var internalmargin=10;var t=100+getScrollXY();dim=docsize();
			al=document.createElement('div');al.style.position = 'absolute';
			al.style.width=width+'px';al.style.height=height2+'px';al.style.backgroundColor='#000000';
			al.style.opacity = 0.6;al.style.filter = ("progid:DXImageTransform.Microsoft.Alpha(opacity=60)");
			al.style.left = (dim[0]-width)/2+"px";al.style.top=t+'px';al.style.zIndex = 6;
			al2=document.createElement('div');al2.style.position = 'absolute';al2.style.backgroundColor=color;
			
			al2.style.margin=internalmargin+'px';al2.style.padding=internalpad+'px';gap=(internalmargin+internalpad)*2;al2.style.width=(width-gap)+'px';al2.style.height=(height2-gap)+'px';al2.style.left = (((dim[0]-width)/2))+"px";al2.style.top=t+'px';al2.style.lineHeight="20px";al2.style.fontSize="18px";al2.style.fontFamily='Verdana';al2.style.zIndex = 7;al2.innerHTML='Loading Notices';
			
			myself.div1=document.body.appendChild(al);myself.div2=document.body.appendChild(al2);
			
			if(noticeReq.readyState == 4 || noticeReq.readyState == 0)
			{
				if(id>0)
				{
					noticeReq.open("GET", 'notice_process.php?id='+id, true);
					noticeReq.onreadystatechange = handleNotice;
					noticeReq.send(null);
				}
			}
		}
	}
	
	function handleNotice()
	{
		if(noticeReq.readyState == 4)
		{
			var xmldoc = noticeReq.responseXML;
			var msg = xmldoc.getElementsByTagName('parcel');
			var no_node = msg[0].getElementsByTagName('no');
			var no = no_node[0].firstChild.nodeValue;
			if(no > 0)
			{
				al.style.height=height+'px'; al2.style.backgroundColor=color4close; al2.style.overflow="auto"; al2.style.height=(height-gap)+'px';al2.style.lineHeight="15px";al2.style.fontSize="10px";al2.innerHTML='';al2.style.padding='0px';al2.style.width=((width-gap)+internalpad*2)+'px';al2.style.height=((height-gap)+internalpad*2)+'px';
				var innerflow=document.createElement('div');innerflow.style.height=height-(gap+closebtnheight)+'px';innerflow.style.overflow="auto";innerflow.style.backgroundColor=color;innerflow.style.padding=internalpad+'px';
				var msg_node = msg[0].getElementsByTagName('message');
				var txt = msg_node[0].firstChild.nodeValue;
				var id_node = msg[0].getElementsByTagName('ids');
				var id = id_node[0].firstChild.nodeValue;
				var pic_node = msg[0].getElementsByTagName('pic');
				var pic = pic_node[0].firstChild.nodeValue;
				var dt_node = msg[0].getElementsByTagName('date_sent');
				var dt = dt_node[0].firstChild.nodeValue;
				
				var msg_arr=txt.split('^_~');
				var id_arr=id.split('^_~');
				var pic_arr=pic.split('^_~');
				var dt_arr=dt.split('^_~');
				
				var uls=document.createElement('ul');uls.setAttribute('class', 'noticeul');uls.setAttribute('className', 'noticeul');
				
				for(var i=0;i<no;i++)
				{
					var lis=document.createElement('li');
					lis.setAttribute('class', 'noticeli');lis.setAttribute('className', 'noticeli');
					var imgs=new Image;imgs.src=pic_arr[i];imgs.width='40';imgs.height='40';imgs.hspace=3;imgs.align="left";
					var spm=document.createElement('span');spm.innerHTML=msg_arr[i];
					var emd=document.createElement('em');emd.innerHTML=dt_arr[i];emd.style.marginTop="0px";emd.style.display="block";
					var spr=document.createElement('span');spr.setAttribute('class', 'noticerem_span');spr.setAttribute('className', 'noticerem_span');var ra=document.createElement('a');ra.setAttribute('class', 'noticeremove_a');ra.setAttribute('className', 'noticeremove_a');ra.setAttribute('href', 'javascript:;');ra.setAttribute('id', 'nre5189_'+id_arr[i]);ra.onclick=function(){remnotice(this);};ra.appendChild(document.createTextNode('Remove'));miniobj=spr.appendChild(ra);
					lis.appendChild(spr);lis.appendChild(imgs);lis.appendChild(spm);	lis.appendChild(emd);  uls.appendChild(lis);
				}
				var sp=document.createElement('div');sp.setAttribute('class', 'noticeli2');sp.setAttribute('className', 'noticeli2');
				var anch2=document.createElement('a');anch2.setAttribute('class', 'alertbtns');anch2.setAttribute('className', 'alertbtns');anch2.setAttribute('href', 'javascript:;');anch2.innerHTML='Close Notice Board';anch2.onclick=function(){document.body.removeChild(al);document.body.removeChild(al2);};
				sp.appendChild(anch2);/*uls.appendChild(sp);*/innerflow.appendChild(uls);al2.appendChild(innerflow);al2.appendChild(sp);document.getElementById('notice-no524').innerHTML='0';
			}
			else
			{
				al2.innerHTML='No notice at the moment';var caller=new callNotice(myself, myself.div1, myself.div2);
				setTimeout(function(){caller.callfade();}, 3000);
			}
			test=0;
		}
	}
	
	this.closefxn =function(al1, al2, myself)
	{
		purefade2(al1,0.5,0,.5,0);
		purefade2(al2,0.5,0,.5,0);
		var caller=new callNotice(myself, al1, al2);
		setTimeout(function(){caller.callclose();}, 2000);
	}
	
	this.closefxn_recur=function(al1, al2)
	{
		document.body.removeChild(al);document.body.removeChild(al2);
	}
	
	var remid='';
	function remnotice(param)
	{
		miniobj=param;remid = miniobj.id.substring(8); addnorm(miniobj, 'Removing');
		if(noticedelReq.readyState == 4 || noticedelReq.readyState == 0)
		{
			noticedelReq.open("GET",'notice_process.php?deleteid='+remid, true);
			noticedelReq.onreadystatechange = handleRemNotice;
			noticedelReq.send(null);
		}
	}
	
	function handleRemNotice()
	{
		if(noticedelReq.readyState == 4)
		{
			var xmldoc = noticedelReq.responseXML;
			var msg = xmldoc.getElementsByTagName('parcel');
			var response_node = msg[0].getElementsByTagName('done');
			var response = response_node[0].firstChild.nodeValue;
			if (response == 0){	var alerth=new customalert(360, 90, '', 'Ok', '#FFFFFF', 'Oops, we ran into some issues, Please try again','',  '',''); alerth.init();addlink(miniobj);	}else{rementirep();}
		}
	}

	function rementirep(){ miniobj.parentNode.parentNode.style.display="none";}

}

newnoticeReq=request();
function newNotice()
{
	if(newnoticeReq.readyState == 4 || newnoticeReq.readyState == 0)
	{
		var id=getCookie('active');if(id!=''){
		newnoticeReq.open("GET", 'notice_process.php?refreshid='+id, true);
		newnoticeReq.onreadystatechange = handleNewNotice;
		newnoticeReq.send(null);}
	}
}

function handleNewNotice()
{
	if(newnoticeReq.readyState == 4)
	{
		var xmldoc = newnoticeReq.responseXML;
		var msg = xmldoc.getElementsByTagName('parcel');
		var no_node = msg[0].getElementsByTagName('no');var no=no_node[0].firstChild.nodeValue;document.getElementById('notice-no524').innerHTML=no;
		setTimeout("newNotice()", 12000);
	}
}
function purefade2 (obj,start,end,time,ease)
{
			if(navigator.appName=='Microsoft Internet Explorer'){time=time/4;}
			var h="lop"+Math.ceil(Math.random() * 100000)
			var f="fade"+ h+ Math.ceil(Math.random() * 10000)
			eval(f+"=new Object();");
			eval(f+".id=obj;"); 
			var count=Math.ceil(time/0.04);
			var icount=1/count;
			var count2=0;var temp2342342=start;var dist726252=end-start; var interval=dist726252/count;
			eval(f+".handleSize=function(){if(ease==0){start = temp2342342 + dist726252 * count2*icount;	this.id.style.opacity=start;this.id.style.filter=('progid:DXImageTransform.Microsoft.Alpha(opacity=' + start*100 + ')');count2 ++;} else{start =temp2342342 + dist726252 * Math.sin(Math.PI * count2*(icount * 0.5));this.id.style.opacity=start;this.id.style.filter=('progid:DXImageTransform.Microsoft.Alpha(opacity=' + start*100 + ')');count2 ++;}if(count2 >count ){window.clearInterval("+f+".sid);}}");
			eval(f+".sid=setInterval('"+f+".handleSize()',40);");
}

function switchregpages (initp, finalp)
{
	var ip=document.getElementById(initp);var fp=document.getElementById(finalp);
	purefade2(ip,0.5,0,.5,0); setTimeout(function(){closereplace(ip, fp);}, 2000);	
}
function closereplace(obj, newobj){closeafter(obj);newobj.style.display=document.all ? "":"";}
function closeafter(obj){obj.style.display='none';obj.style.opacity=1;obj.style.filter=('progid:DXImageTransform.Microsoft.Alpha(opacity=100)');}


regjoin766ghf78='';grouplist8565=request();
function regjoinclass( n , param )
{
	var chk=document.getElementsByName(n);var chk2=new Array();var chkstat=new Array();
	var l=chk.length;for(var i=0;i<l; i++){if(chk[i].checked){chk2.push(chk[i].value);chkstat.push(chk[i].alt);}}var id=chk2.join('-');var stat=chkstat.join('-');
	var obj=param['obj'];var mem=param['member'];regjoin766ghf78=obj;addnorm(obj, 'Joining Classes');
	var who=0;
	var im=new Image;im.src='pics/reload.gif';im.hspace=5;im.align='absmiddle';regjoin766ghf78.parentNode.appendChild(im);
	if(grouplist8565.readyState == 4 || grouplist8565.readyState == 0){
		grouplist8565.open("GET", 'enlist.php?cids='+id+'&member='+mem+'&whois='+who+'&stat='+stat, true);
		grouplist8565.onreadystatechange = handleregjoin;	grouplist8565.send(null)
	}
}

function handleregjoin ()
{
	if(grouplist8565.readyState == 4)
	{
		var xmldoc = grouplist8565.responseXML;
		if(xmldoc != null)
		{
			var msg = xmldoc.getElementsByTagName('parcel');
			var dn = msg[0].getElementsByTagName('done');
			var d = dn[0].firstChild.nodeValue;
			var m7657 = msg[0].getElementsByTagName('curr');
			var mn = m7657[0].firstChild.nodeValue;
			if(d==1){if(mn=='skoola'){submitViaGet('confirm.php');}else if(mn=='fb'){submitViaGet('viewprofile.php');}}else{var alerth=new customalert(400, 100, '', 'Ok', '#FFFFFF', 'There was an error joining selected classes.','',  '',''); alerth.init();}addlink(regjoin766ghf78);
		}
	}
}

function anyChecked ()
{
	var is = 0; var checks = document.getElementsByTagName('input');
	for (var i =0; i < checks.length; i++){	if(checks[i].type == "checkbox" && checks[i].checked){ is = 1; }}
	if(is == 1){return true;}else{return false;}
}

function submitViaGet(page)
{
	window.location.href=page;
}

function customalert(width, height, oktxt, canceltxt, color, msg, func1, func2, param)
{
	var oktext='';
	var canceltext='';
	var myself=this;
	var al, al2 ='';
	this.response=function(obj)
	{
		
		purefade (document.getElementById("cov254867"),0.8,0,.5,0);purefade (al,0.8,0,.5,0);purefade (al2,0.8,0,.5,0)
		if(obj.innerHTML==oktext&&func1!=''){eval(func1+"(param)");}else if(obj.innerHTML==canceltext&&func2!=''){eval(func2+"(param)");}
	}
	
	this.init=function()
	{
		var internalpad=6;var internalmargin=10;var t=100+getScrollXY();
		oktext=oktxt;canceltext=canceltxt;dim=docsize();
		//please_signin_object.style.left = (dim[0]-wos*2)/2+"px";
		//	please_signin_object.style.top = "10px";
		var d = document.createElement('div');
		d.id = 'cov254867';d.style.zIndex = 20;d.style.position = 'absolute';d.style.top = '0px';d.style.left = '0px';
		d.style.height = dim[1] + 'px';	d.style.width = dim[0] + 'px';d.style.backgroundColor = '#FFFFFF';d.style.opacity = '0.6';
		d.style.filter += ("progid:DXImageTransform.Microsoft.Alpha(opacity=60)"); 	document.body.appendChild(d);
		al=document.createElement('div');al.style.position = 'absolute';
		//al.setAttribute('class', 'alertdiv');al.setAttribute('className', 'alertdiv');
		al.style.width=width+'px';al.style.height=height+'px';al.style.backgroundColor='#000000';
		al.style.opacity = 0.6;al.style.filter = ("progid:DXImageTransform.Microsoft.Alpha(opacity=60)");
		al.style.left = (dim[0]-width)/2+"px";al.style.top=t+'px';al.style.zIndex = 21;
		al2=document.createElement('div');al2.style.position = 'absolute';al2.style.backgroundColor=color;
		//al2.style.opacity = 1;al2.style.filter = ("progid:DXImageTransform.Microsoft.Alpha(opacity=100)");
		al2.style.margin=internalmargin+'px';al2.style.padding=internalpad+'px';var gap=(internalmargin+internalpad)*2;al2.style.width=(width-gap)+'px';al2.style.height=(height-gap)+'px';al2.style.left = (((dim[0]-width)/2))+"px";al2.style.top=t+'px';al2.style.lineHeight="20px";
		/*al2.appendChild(document.createTextNode(msg));*/
		al2.innerHTML=msg;
		al2.style.zIndex = 22;al2.style.fontSize='12px';al2.style.fontFamily='Verdana';
		var sp=document.createElement('span');sp.setAttribute('class', 'alertspan');sp.setAttribute('className', 'alertspan');
		if(canceltxt!=''){var anch2=document.createElement('a');anch2.setAttribute('class', 'alertbtns');anch2.setAttribute('className', 'alertbtns');anch2.setAttribute('href', 'javascript:;');anch2.innerHTML=canceltxt;anch2.onclick=function(){myself.response(this);};sp.appendChild(anch2);}
		if(oktxt!=''){var anch=document.createElement('a');anch.setAttribute('class', 'alertbtns');anch.setAttribute('href', 'javascript:;');anch.setAttribute('className', 'alertbtns');anch.innerHTML=oktxt;anch.onclick=function(){myself.response(this);};sp.appendChild(anch); }
		
		al2.appendChild(sp);
		document.body.appendChild(d);document.body.appendChild(al);document.body.appendChild(al2);
	}
}

function addnorm(obj, txt){var sp=document.createElement('span');sp.innerHTML=txt;obj.parentNode.appendChild(sp);obj.style.display='none';	}
function addlink(obj){var temp=new Array();var par=obj.parentNode.childNodes;var xp=par.length; for(var i=0;i<xp;i++){if(par[i].nodeName=='img' || par[i].nodeName=='IMG' || par[i].nodeName=='SPAN' || par[i].nodeName=='span'){temp.push(par[i]);}}var tl=temp.length;for(var k=0;k<tl;k++){obj.parentNode.removeChild(temp[k]);}obj.style.display=document.all ? "":"";}
function slideup ( value, interval )
{
	if(getScrollXY() > 10){
		window.scrollBy(0, '-'+value);
		setTimeout("slideup("+value+")", interval);	
	}
}

function slidedown ( end, inc, value, interval )
{
	if( inc <=end){
		window.scrollBy(0, '+'+value);inc+=value;
		setTimeout(function(){slidedown ( end, inc, value, interval );}, interval);	
	}
}

function currentYPos() {  
 if (document.body && document.body.scrollTop)  
   return document.body.scrollTop;  
 if (document.documentElement && document.documentElement.scrollTop)  
   return document.documentElement.scrollTop;  
 if (window.pageYOffset)  
   return window.pageYOffset;  
 return 0;  
}

function docsize()
{
	var body = document.body,
    html = document.documentElement;
	var height = Math.max( body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight );	
	var width = Math.max( body.scrollWidth, body.offsetWidth, html.clientWidth, html.scrollWidth, html.offsetWidth );
	return [width, height];
}

function ok_button(){
	purefade (document.getElementById("signin_pagebg"),0.5,0,.5,0);document.getElementById("pls").style.display = "none";
	//document.getElementById("username").focus();
}

function getScrollXY() {
 scrOfY = 0;
  if( typeof( window.pageYOffset ) == 'number' ) {//Netscape compliant
    scrOfY = window.pageYOffset;
  } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) { //DOM compliant
    scrOfY = document.body.scrollTop;
  } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
    //IE6 standards compliant mode
    scrOfY = document.documentElement.scrollTop;
  }
  return scrOfY;
}

function getPageSize()
{
	var x,y=0;
	if (self.innerHeight) // all except Explorer
	{
		x = self.innerWidth;
		y = self.innerHeight;
	}
	else if (document.documentElement && document.documentElement.clientHeight)
		// Explorer 6 Strict Mode
	{
		x = document.documentElement.clientWidth;
		y = document.documentElement.clientHeight;
	}
	else if (document.body) // other Explorers
	{
		x = document.body.clientWidth;
		y = document.body.clientHeight;
	}
	return [x, y];
}

//checks  the database for users online
usersReq=request();refreshReq=request();
function usersOnline(id)
{
	if(usersReq.readyState == 4 || usersReq.readyState == 0)
	{
		var id=getCookie('active');if(id!=''){
		usersReq.open("GET", 'online.php?idfn='+id, true);
		usersReq.onreadystatechange = handleOnline;
		usersReq.send(null);}
	}
}

//gets the users online, appends it to an anchor element that is displayed on screen
//runs a function that displays a signin message if user is offline and the chat request if user is online.
function handleOnline()
{
	onlineUsersArray = new Array();
	//var sender_cookie = getCookie('active');
	var page='viewprofile.php';
	if(usersReq.readyState == 4 || usersReq.readyState == 0)
	{
		var onlineUsersContainer = document.getElementById("onlinebox");
		var xmldoc = usersReq.responseXML;
		var msg = xmldoc.getElementsByTagName('message');
		if(msg.length > 0)
		{
			var names_node = msg[0].getElementsByTagName('names');
			var names = names_node[0].firstChild.nodeValue;
			var ids_node = msg[0].getElementsByTagName('ids');
			var ids = ids_node[0].firstChild.nodeValue;
			onlineUsersContainer.innerHTML = " ";
			if(names != 0)
			{
				onlineUsersArray = names.split('!-');
				idarray = ids.split('!-');
				for(var i = 0; i < onlineUsersArray.length; i++)
				{
					createLink = document.createElement('a');
					createLink.setAttribute('id', idarray[i]);
					createLink.setAttribute('href', page+'?id='+idarray[i]);
					createLink.style.textDecoration='none';
					createText = document.createTextNode(onlineUsersArray[i]);
					var diff = Math.random() * 4;
					diff = diff + 10;
					diff_font = Math.floor(diff);
					createLink.style.fontSize = diff_font + "px";
					createLink.appendChild(createText);
					onlineUsersContainer.appendChild(createLink);
					onlineUsersContainer.appendChild(document.createTextNode(' '));
				}
			}
			else
			{
				onlineUsersContainer.innerHTML='You have no friend or group member online'; 
			}
		}
	setTimeout('usersOnline()', 10000);
	}
}

function refreshOnline()
{
	if(refreshReq.readyState == 4 || refreshReq.readyState == 0)
	{
		var id=getCookie('active');if(id!=''){
		refreshReq.open("GET", 'online.php?refreshid='+id, true);
		refreshReq.onreadystatechange = handleRefresh;
		refreshReq.send(null);}
	}
}

function handleRefresh()
{
	if(refreshReq.readyState == 4)
	{
		var xmldoc = refreshReq.responseXML;
		var msg = xmldoc.getElementsByTagName('message');
		if(msg.length > 0)
		{
			var stat_node = msg[0].getElementsByTagName('status');
			var stat = stat_node[0].firstChild.nodeValue;
		}
		setTimeout("refreshOnline()", 12000);
	}
}

function printDiv(pd, frame)
{
	var copyto = document.getElementById(frame);
	var content = document.getElementById(pd).innerHTML;
	var doc = (copyto.contentWindow || copyto.contentDocument);
	if (doc.document) { doc = doc.document; }
	doc.write("<head><title>Skoola</title></head><body onload='this.focus(); this.print();'>" + content + "</body>");
	doc.close();
}

function printDiv2 (pd)
{
	var content=document.getElementById(pd).innerHTML
  	var pwin=window.open('','Skoola Print','width=100,height=100');
  	pwin.document.open();
  	pwin.document.write('<html><title>Skoola</title><body onload="window.print()">'+content+'</body></html>');
  	pwin.document.close();
  	setTimeout(function(){pwin.close();},1000);
}

function request(){	if(window.XMLHttpRequest){return new XMLHttpRequest();}	else if(window.ActiveXObject){return new ActiveXObject("Microsoft.XMLHttp");}else{	document.getElementById("status").innerHTML = 'Your browser does not support this chat facility.' + ' Consider upgrading your browser.';}}

function getCookie(name){if(document.cookie.length>0){start=document.cookie.indexOf(name + "=");if(start==-1){return "";}else{start=start + name.length+1;end=document.cookie.indexOf(";", start);if(end==-1) {end=document.cookie.length;}return document.cookie.substring(start,end);	}}else{return "";	}}

function setCookie(name, value){var ExpireDate=new Date();ExpireDate.setTime(ExpireDate.getTime() + (2 * 3600 * 1000));	document.cookie = name + "=" + value + "; expires=" + ExpireDate.toGMTString();}

function delCookie(name){if(getCookie(name)!=""){var ExpireDate=new Date();	ExpireDate.setTime(ExpireDate.getTime() - (2 * 3600 * 1000));		document.cookie=name + "=" + "; expires=" + ExpireDate.toGMTString(); }}
 
function runload3()
{
	 if(co!=0){setCookie('active',co);}
	if(typeof logged === 'undefined' ){}else{if(logged==2){delCookie('active');}}
	var i=getCookie('active');if(i!=''){if(typeof document.getElementById('onlinebox') == 'undefined' || document.getElementById('onlinebox') == null ){}else{usersOnline(i);}}refreshOnline();
	if(i != ''){newNotice();}
}

function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
}

addLoadEvent(runload3);

