// Get Screen Topmost Position
function posTop() {return typeof window.pageYOffset != 'undefined' ?  window.pageYOffset : document.documentElement && document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop ? document.body.scrollTop : 0;}

// Sroll Page Up Smoothly
function pageScroll() 
{
	if (posTop() > 199)
	{
	window.scrollBy(0,-20); 
	scrolldelay = setTimeout('pageScroll()',20); 
	setTimeout('clearTimeout(scrolldelay)', 1000);
	}
}

// Open APPFORM
function openwindow(){
window.open("appform.html","Requests","top=50,left=50', menubar=0,resizable=0,scrollbars=1,width=600,height=600");
}

// Open Outform
function openwindowOUT(){
window.open("outform.html","Requests","top=50,left=50', menubar=0,resizable=0,scrollbars=1,width=600,height=600");
}

// Open Msnwin
function openmsnWin(){
window.open("msnwin.html","Requests","top=50,left=50', menubar=0,resizable=0,scrollbars=1,width=540,height=440");
}

// Dynamic Menu Functions
function onswap(id)
{
document.getElementById('l'+id).src="decoirs/LP0" + id + "B.jpg"
}
function offswap(id)
{
document.getElementById('l'+id).src="decoirs/LP0" + id + "A.jpg"
}
function showpict(source)
{
document.getElementById('domsze').innerHTML="<div id=\"floatz\"><a href=\"javascript:closepict();\"><img src=\"fileshack/pictures/A"+source+".jpg\"></a></div>";
}
function closepict()
{
document.getElementById('domsze').innerHTML="<div id=\"floatz\" style=\"width:0px; padding: 0px;\"></div>";
}

// AJAX TOPIC FETCHER
function ajaxTopic(a)
  { 
  var target;
  target = "fetchtopics.php?parent="+a;
  var xmlHttp;
  try
    {
    // Firefox, Opera 8.0+, Safari
    xmlHttp=new XMLHttpRequest();
    }
  catch (e)
    {
    // Internet Explorer
    try
      {
      xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
      }
    catch (e)
      {
      try
        {
        xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
        }
      catch (e)
        {
        alert("Your browser does not support AJAX!");
        return false;
        }
      }
    }
    xmlHttp.onreadystatechange=function()
      {
      if(xmlHttp.readyState==4)
        {
        document.getElementById('topics').innerHTML=xmlHttp.responseText;
        }
      }
    xmlHttp.open("GET",target,true);
    xmlHttp.send(null);
  }
// AJAX CONTENT FETCHER

function ajaxFetch(a,b)
  { 
  document.getElementById('ajax').innerHTML='<br /><div class=\"post\">Lütfen Bekleyin...</div>';
  
	var target;
	target = "fetchcontent.php?parent="+a+"&entry="+b;
  
  var xmlHttp;
  try
    {
    // Firefox, Opera 8.0+, Safari
    xmlHttp=new XMLHttpRequest();
    }
  catch (e)
    {
    // Internet Explorer
    try
      {
      xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
      }
    catch (e)
      {
      try
        {
        xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
        }
      catch (e)
        {
        alert("Your browser does not support AJAX!");
        return false;
        }
      }
    }
    xmlHttp.onreadystatechange=function()
      {
      if(xmlHttp.readyState==4)
        {
        document.getElementById('ajax').innerHTML=xmlHttp.responseText;
        }
      }
    xmlHttp.open("GET",target,true);
    xmlHttp.send(null);
    
pageScroll();
  }
  
  // AJAX ENTRY FETCH
  
  function ajaxEntry(b)
  { 
    document.getElementById('ajax').innerHTML='<br /><div class=\"post\">Lütfen Bekleyin...</div>';
    
	var target;
	target = "fetchcontent.php?entry="+b;
  
  var xmlHttp;
  try
    {
    // Firefox, Opera 8.0+, Safari
    xmlHttp=new XMLHttpRequest();
    }
  catch (e)
    {
    // Internet Explorer
    try
      {
      xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
      }
    catch (e)
      {
      try
        {
        xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
        }
      catch (e)
        {
        alert("Your browser does not support AJAX!");
        return false;
        }
      }
    }
    xmlHttp.onreadystatechange=function()
      {
      if(xmlHttp.readyState==4)
        {
        document.getElementById('ajax').innerHTML=xmlHttp.responseText;
        }
      }
    xmlHttp.open("GET",target,true);
    xmlHttp.send(null);
 pageScroll();
  }
  

// AJAX SEND FRIEND FORM

function ajaxSendf(a,b)
  { 
  document.getElementById('ajax').innerHTML='<br /><div class=\"post\">Lütfen Bekleyin...</div>';
  
	var target;
	target = "fetchmailform.php?parent="+a+"&entry="+b;
  
  var xmlHttp;
  try
    {
    // Firefox, Opera 8.0+, Safari
    xmlHttp=new XMLHttpRequest();
    }
  catch (e)
    {
    // Internet Explorer
    try
      {
      xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
      }
    catch (e)
      {
      try
        {
        xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
        }
      catch (e)
        {
        alert("Your browser does not support AJAX!");
        return false;
        }
      }
    }
    xmlHttp.onreadystatechange=function()
      {
      if(xmlHttp.readyState==4)
        {
        document.getElementById('ajax').innerHTML=xmlHttp.responseText;
        }
      }
    xmlHttp.open("GET",target,true);
    xmlHttp.send(null);
  pageScroll();
  }
  
function ajaxReview(cls)
  { 
  document.getElementById('ajax').innerHTML='<br /><div class=\"post\">Lütfen Bekleyin...</div>';
  
	var target;
	target = "fetchreview.php?class="+cls;
  
  var xmlHttp;
  try
    {
    // Firefox, Opera 8.0+, Safari
    xmlHttp=new XMLHttpRequest();
    }
  catch (e)
    {
    // Internet Explorer
    try
      {
      xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
      }
    catch (e)
      {
      try
        {
        xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
        }
      catch (e)
        {
        alert("Your browser does not support AJAX!");
        return false;
        }
      }
    }
    xmlHttp.onreadystatechange=function()
      {
      if(xmlHttp.readyState==4)
        {
        document.getElementById('ajax').innerHTML=xmlHttp.responseText;
        }
      }
    xmlHttp.open("GET",target,true);
    xmlHttp.send(null);
  pageScroll();
  }
  


//change the opacity for different browsers
function changeOpac(opacity, id) {
    var object = document.getElementById(id).style;
    object.opacity = (opacity / 100);
    object.MozOpacity = (opacity / 100);
    object.KhtmlOpacity = (opacity / 100);
    object.filter = "alpha(opacity=" + opacity + ")";
}

