


function login()
{
	$('susr').value=$('usr').value;
	$('spass').value=$('pass').value;
	
	document.forms.logn.submit();
}

function imgload(source,check)
{
	if(!check) check=0;
	if(check==1)
	{
		var img=new Image;
		img.src=''+source;
	}
	else
		window.setTimeout('imgload("'+source+'",1)',250);
}

if(parent!=window) parent.location.replace("http://sme6no.net/");

imgload("http://static.sme6no.net/sme6no/images/rotate.gif");
imgload("http://static.sme6no.net/sme6no/images/ne_sme6no_button.gif");
imgload("http://static.sme6no.net/sme6no/images/ne_sme6no_button_sm.gif");
imgload("http://static.sme6no.net/sme6no/images/next_sme6no_button.gif");
imgload("http://static.sme6no.net/sme6no/images/next_sme6no_button_sm.gif");
imgload("http://static.sme6no.net/sme6no/images/dai_smqh_button.gif");
imgload("http://static.sme6no.net/sme6no/images/sme6no_button.gif");
imgload("http://static.sme6no.net/sme6no/images/sme6no_button_sm.gif");
imgload("http://static.sme6no.net/sme6no/images/rot_small.gif");
imgload("http://static.sme6no.net/sme6no/images/fav_rem.gif");


Event.observe(window, 'load', function() {

if(location.host!='sme6no.net')
{
   $$('form').each(function(elem){
		
		elem.action="http://sme6no.net/";

    });
}
});

var chatOpen = false;

function FS()
{
	el=$('dusk2');
	el.style.height=((document.documentElement.scrollHeight>document.documentElement.clientHeight)?document.documentElement.scrollHeight:document.documentElement.clientHeight) + 'px';
	el.style.width=document.documentElement.scrollWidth +'px';
	el.style.display='block';

	var center = findVisiblePageCenter();

	var pre = $('duskPreContent');
	var cpre = pre.getDimensions();

	pre.show();
	
	pre.style.top=(center.y-cpre.height/2)+'px';
	pre.style.left=(center.x-cpre.width/2)+'px';


	var dim=$('duskContent');
	var csize = dim.getDimensions();	

	dim.show();
	
	dim.style.top=(center.y-csize.height/2)+'px';
	dim.style.left=(center.x-csize.width/2)+'px';
		
	function ss(r)
	{
		$('chatContent').innerHTML=r.responseText;
		r.responseText.evalScripts();
	}
	
	new Ajax.Request("/ajax/chat/loadchat.aj.php",{
	method:'POST',
	onSuccess: ss
	});
	
	chatOpen=true;
	
}


function findVisiblePageCenter() {
var x1,y1,x2,y2,d=document,coords={};
  if(self.innerHeight) { // all except Explorer
	x1 = self.innerWidth;
	y1 = self.innerHeight;
  }
  else if(d.documentElement && d.documentElement.clientHeight) {
	// Explorer 6 Strict Mode
	x1 = d.documentElement.clientWidth;
	y1 = d.documentElement.clientHeight;
  }
  else if(d.body) { // other Explorers
	x1 = d.body.clientWidth;
	y1 = d.body.clientHeight;
  }

  if(self.pageYOffset) { // all except Explorer
	x2 = self.pageXOffset;
	y2 = self.pageYOffset;
  }
  else if(d.documentElement && d.documentElement.scrollTop) {
	// Explorer 6 Strict
	x2 = d.documentElement.scrollLeft;
	y2 = d.documentElement.scrollTop;
  }
  else if(d.body) { // all other Explorers
	x2 = d.body.scrollLeft;
	y2 = d.body.scrollTop;
  }

  if(!isNaN(y2) && !isNaN(x2)) {
	coords.x = Math.floor(x1/2 + x2);
	coords.y = Math.floor(y1/2 + y2);
	coords.left=x2;
	coords.top=y2;
  } else {
	coords.x = Math.floor(x1/2);
	coords.y = Math.floor(y1/2);
	coords.left=x2;
	coords.top=y2;
  }

  return coords;
}
var checkChatsInt;
var loadChattersInt;
var lastid;
var divScroll;

var remIds=new Array();
var remLen=0;

function trem()
{
	var str="";
	for(var i=0;i<remIds.length;i++)
	{
		str+=remIds[i].id+", ";
	}
	
	alert(str);
	alert(remLen);
}

function HFS()
{
	$('dusk2').hide();	
	$('duskPreContent').hide();

	$('chatContent').innerHTML='<img src="http://static.sme6no.net/sme6no/images/rotate.gif" style="margin-top:210px;" />';
	$('duskContent').hide();
	
	if(checkChatsInt) clearInterval(checkChatsInt);
	if(loadChattersInt) clearInterval(loadChattersInt);
}