function JSFX_FloatTopDiv()
{
	var startX = 16,
	startY = 0;
	var ns = (navigator.appName.indexOf("Netscape") != -1);
	var d = document;
	function ml(id)
	{
		var el=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id];
		if(d.layers)el.style=el;
		el.sP=function(x,y){ this.style.left=x;this.style.top=y; };
		el.x = startX; el.y = 20;	 el.y -= startY;
		return el;
	}
	window.stayTopLeft=function()
	{
	  var pY = ns ? ((pageYOffset>111) ? pageYOffset : pageYOffset+1) + ((innerHeight<331) ? 20 : 20) : ((document.body.scrollTop>111) ? document.body.scrollTop : document.body.scrollTop+1) + ((document.body.clientHeight<331) ? 20 : 20);
	  ftlObj.y += (pY - startY - ftlObj.y)/8;
		ftlObj.sP(ftlObj.x, ftlObj.y);
		setTimeout("stayTopLeft()", 10);
	}
	ftlObj = ml("divStayTopLeft");
	stayTopLeft();
}

// function to serve options switch for main page search form
function mpSwitchSearchOptions(opt){
  document.getElementById("searchopt").value=opt;
  if (opt==1) {
    document.getElementById("sopt1").className="optsel";
    document.getElementById("sopt2").className="optdesel";
    document.getElementById("sopt3").className="optdesel";
  } else if (opt==2) {
    document.getElementById("sopt1").className="optdesel";
    document.getElementById("sopt2").className="optsel";
    document.getElementById("sopt3").className="optdesel";
  } else {
    document.getElementById("sopt1").className="optdesel";
    document.getElementById("sopt2").className="optdesel";
    document.getElementById("sopt3").className="optsel";
  }
}

function mpCheckSearchQuery(){
  var sq=document.getElementById("sq").value;
  if (sq=='') {
    alert("You can't search empty query");
    return;
  } else {
    document.searchform.submit();
  }
}

function pagesReportContent(){
  $.post("/ls_post/report.php", "act=rpage&thr="+escape(location.href),
  function(data){
  }, "script");
}
function pagesReportContentOk(purl){  
  var rtype=escape($('#rep-type').val());
  var rtext=escape($('#rep-text').val());
  var remail=escape($('#remail').val());
  //alert(rtype);
  if ($('#rep-type').val()!="Wrong Category" && $('#rep-type').val()!="Bug Report" && $('#remail').val()==""){
    alert("Error: Please enter your email address so we could contact you back.");
    return;
  }
  $.post("/ls_post/report.php", "act=rpage&subact=ok&thr="+purl+"&rtype="+rtype+"&rtext="+rtext+"&remail="+remail,
  function(data){
  }, "script");
}
function pagesReportTypeSwitch(){
  if ($('#rep-type').val()=="Bug Report" || $('#rep-type').val()=="Wrong Category") { 
    $("#repemail").hide();
  } else {
    $("#repemail").show();
  }
}


function pagesRefreshCommonData(){
  $.post("/ls_get/refresh.php", "", function(data){ }, "script");
}
setInterval("pagesRefreshCommonData();",120000);

