function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}



function explorechild(tanda,anak,gambar)
{

var signa = eval("document.form1."+tanda+".value");
if(signa == 1){
document.getElementById(anak).style.display='';
//eval("document.all."+anak+".style.display =''") ;
eval("document."+gambar+".src='images/minus.gif'");
eval("document.form1."+tanda+".value = '2'");
}
if(signa == 2)
{
document.getElementById(anak).style.display='none';
//eval(" document.all."+anak+".style.display ='none'") ;
eval("document."+gambar+".src='images/plus.gif'");
eval("document.form1."+tanda+".value ='1'");
}

}







var popUpWin;
function bukawindow(URLStr,lebar,tinggi)
{
var simpan = readCookie("psw");
if(simpan == "true"){
alert("Please, refresh or close this Page!");
}else{
var width=lebar, height=tinggi;
var left = (screen.width/2) - width/2;
var top = (screen.height/2) - height/2;
if (!popUpWin || popUpWin.closed){
 popUpWin = window.open(URLStr, '_blank', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbar=no,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+',top='+top+',screenX='+left+',screenY='+top+'');
}else
{
	//alert("Chat room is already opened");
	popUpWin.focus();
}

}
}

// Example:
// alert( readCookie("myCookie") );
function readCookie(name)
{
  var cookieValue = "";
  var search = name + "=";
  if(document.cookie.length > 0)
  { 
    offset = document.cookie.indexOf(search);
    if (offset != -1)
    { 
      offset += search.length;
      end = document.cookie.indexOf(";", offset);
      if (end == -1) end = document.cookie.length;
      cookieValue = unescape(document.cookie.substring(offset, end))
    }
  }
  return cookieValue;
  }
// Example:
// writeCookie("myCookie", "my name", 24);
// Stores the string "my name" in the cookie "myCookie" which expires after 24 hours.
function writeCookie(name, value, hours)
{
  var expire = "";
  if(hours != null)
  {
    expire = new Date((new Date()).getTime() + hours * 3600000);
    expire = "; expires=" + expire.toGMTString();
  }
  document.cookie = name + "=" + escape(value) + expire;
}



function puttext()
{
var simpan = readCookie("psw");
if(simpan == "true")
{
//document.getElementById("button").innerHTML = "<a href=\"partnerlogout.php\" ><img border=\"0\" src=\"images/part-buttonout.jpg\" onMouseOver=\"toolTip('Sign out for Partner', '#FFFFff', '#447777');\" onMouseOut=\"toolTip();\"></a>";
document.getElementById("button").innerHTML = "<a href=\"partnerlogout.php\" ><img border=\"0\" src=\"images/part-buttonout.jpg\" ></a>";

}else
{
//document.getElementById("button").innerHTML = "<a href=\"#\" onclick=\"bukawindow('partnerlogin.php','400','400');\"><img  border=\"0\" src=\"images/part-button.jpg\" onMouseOver=\"toolTip('Sign in for Partner', '#FFFFff', '#447777');\" onMouseOut=\"toolTip();\" ></a>";
document.getElementById("button").innerHTML = "<a href=\"javascript:void(0)\" onclick=\"bukawindow('partnerlogin.php','400','400');\"><img  border=\"0\" src=\"images/part-button.jpg\" style=\"z-index:-1\"></a>";

}



}

//mengulung menu kiri
//var tanda =0;
//var cnt=0;
function moveCar() 
{
	
 if(document.all) 
 {
  document.all("car").style.pixelLeft=5;

 document.all("car").style.pixelTop= 10;
  document.all("car").style.display= '';
 }else
  
 {
 
 document.getElementById("car").style.pixelTop=10;
   document.getElementById("car").style.display = '';
 }
//tanda = 100;	
//}//end if
	//}//end if
};

function tutup_iklan()
{
document.getElementById("car").style.display='none'; 
 
};

function addOnloadEvent(fnc){
if ( typeof window.addEventListener != "undefined" )
window.addEventListener( "load", fnc, false );
else if ( typeof window.attachEvent != "undefined" ) {
window.attachEvent( "onload", fnc );
}
else {
if ( window.onload != null ) {
var oldOnload = window.onload;
window.onload = function ( e ) {
oldOnload( e );
window[fnc]();
};
}
else
window.onload = fnc;
}
}




