/*
document.write("<script type=\"text/javascript\" src=\"js/lib-php.js\"></script>");
*/

//---pertama kali aja, menghapus yang sebelumnya sudah bersarang
deleteCookie('ct');
//-- redirect
function gt(x){
	if(x) window.location='?'+x;
}

/* -------------------------------------------------------------------------------------------------------- nora: tambahan */
//use browser sniffing to determine if IE or Opera (ugly, but required)
var isOpera, isIE = false;
if(typeof(window.opera) != 'undefined'){isOpera = true;}
if(!isOpera && navigator.userAgent.indexOf('Internet Explorer')){isIE = true;}

//fix both IE and Opera (adjust when they implement this method properly)
if(isOpera || isIE){
  document.nativeGetElementById = document.getElementById;
  //redefine it!
  document.getElementById = function(id){
    var elem = document.nativeGetElementById(id);
    if(elem){
      //verify it is a valid match!
      if(elem.id == id){
        //valid match!
        return elem;
      } else {
        //not a valid match!
        //the non-standard, document.all array has keys for all name'd, and id'd elements
        //start at one, because we know the first match, is wrong!
        for(var i=1;i<document.all[id].length;i++){
          if(document.all[id][i].id == id){
            return document.all[id][i];
          }
        }
      }
    }
    return null;
  };
}
/* -------------------------------------------------------------------------------------------------------- nora: tambahan */




function getCookie(Name) { 
var re=new RegExp(Name+"=[^;]+", "i"); //construct RE to search for target name/value pair
if (document.cookie.match(re)) //if cookie found
return document.cookie.match(re)[0].split("=")[1] //return its value
return null
}

function setCookie(name, value, days) {
var expireDate = new Date()
//set "expstring" to either future or past date, to set or delete cookie, respectively
var expstring=(typeof days!="undefined")? expireDate.setDate(expireDate.getDate()+parseInt(days)) : expireDate.setDate(expireDate.getDate()-5)
document.cookie = name+"="+value+"; expires="+expireDate.toGMTString()+"; path=/";
}

function deleteCookie(name){
setCookie(name, "moot")
}
 
 
function get(myString) {
	
		 
		
		
		
		
		var a = myString.split("|");
		var url = a[0];
		var cssid = a[1];
 			
			if(a[2]) write_object_id(a[2],a[3]);
			if(a[4]) write_object_id(a[4],a[5]);
			if(a[6]) write_object_id(a[6],a[7]);
 	
	
	if(cssid=='cnt'){ 			var preloader = '<div><img src=img/ajax-loader-big.gif title=loading style=margin-top:10px;><div>';
 	}else if(cssid=='cal_day'){ var preloader = '<div align=center style=background-color:white;padding:4px 10px;><img src=img/ajax-loader.gif title=loading></div>';
	}else 							var preloader = '<img src=img/ajax-loader.gif title=loading>';
		
		
			
			
		var ngelut=false;
		if (window.XMLHttpRequest) { ngelut = new XMLHttpRequest();} 
		else if (window.ActiveXObject) { ngelut = new ActiveXObject("Microsoft.XMLHttp");}
		
		
			
			if (ngelut) {
				var obj = document.getElementById(cssid);
				
				ngelut.open("GET", '_ajax_pager_wojo.php?'+url); //--- disinilah letak halam-per halaman  di gelar
				
				ngelut.onreadystatechange = function() {
					if (ngelut.readyState == 1) {obj.innerHTML = preloader;}
						if (ngelut.readyState == 4 && ngelut.status == 200) { 
													
						obj.innerHTML = ngelut.responseText;
												 
						//if(targetid_1=='printme')Print();
						}
				}
				ngelut.send(null);
			}
    }//func
 
 
function write_object_id(a,b){
				if(a && b ){
 					 var ob = document.getElementById(b);
 						
						//var str = str_replace('_',' ',a);
						//var str = str_replace(' ','&nbsp;',str);
						
						if(a == '[bunder]') ob.innerHTML = '<img src="img/bunder.png" border="0">';
					 	else ob.innerHTML = a;
 					}
	}// func
 
  
function printme(ts){ //--  
		
		
  		this.get('printme='+ts+'|printme');
 }//func
 
 
/***********************************************
* Disable Text Selection script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

function disableSelection(target){
if (typeof target.onselectstart!="undefined") //IE route
	target.onselectstart=function(){return false}
else if (typeof target.style.MozUserSelect!="undefined") //Firefox route
	target.style.MozUserSelect="none"
else //All other route (ie: Opera)
	target.onmousedown=function(){return false}
target.style.cursor = "default"
}

 

 