function showtip(skrip,myevent,w,h,ids) {
	var e = document.getElementById('tiphint'); 
	var myWidth = 0, myHeight = 0;
	if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  	} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  	} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  	}
	x = myevent.clientX + document.body.scrollLeft; 
	y = myevent.clientY + document.body.scrollTop + 15;
	if((x + w) > myWidth){
		x = myWidth - (w +30);
	}	
	if((y + h) > myHeight){
		y = myHeight - (h+30);
	}	
	e.style.display="block"; 
	e.style.width = w + 'px'; 
	e.style.height = 'auto'; 
	e.style.left = x + 'px'; 
	e.style.top = y + 'px'; 
	ajack = new sack(skrip);
	ajack.element = 'tiphint';
	ajack.setVar("id",ids);	
	ajack.onLoading = whenLoading;
	ajack.runAJAX();
} 

function hidetip() { 
	var e = document.getElementById('tiphint'); 
	e.style.display="none"; 
}

function getskripex(skrip,iddiv){
	ajack = new sack(skrip);
	ajack.element = iddiv;
	ajack.onLoading = whenLoading;
	ajack.runAJAX();
}

function display(n){
	if (document.getElementById(n).style.display == "none" || document.getElementById(n).style.visibility == "hidden"){
		showDisplay(n);
		document.getElementById("fsrc").kterms.focus();
	} else {
		hideDisplay(n);
	}
}

function showDisplay(n){
	document.getElementById(n).style.visibility = "visible";
	document.getElementById(n).style.display = "block";
}

function hideDisplay(n){
	document.getElementById(n).style.visibility = "hidden";
	document.getElementById(n).style.display = "none";
}


function whenLoading(){
	var e = document.getElementById('loader'); 
	e.innerHTML = '<span style="color: #FFFFFF;background-color: #CC0000;font-family:Arial, Helvetica, sans-serif;font-size:12;">&nbsp;&nbsp;&nbsp;<blink>Loading page....</blink>&nbsp;&nbsp;&nbsp;</span>';
}

function requesting(){
	var e = document.getElementById('loader'); 
	e.innerHTML = '<span style="color: #FFFFFF;background-color: #CC0000;font-family:Arial, Helvetica, sans-serif;font-size:12;">&nbsp;&nbsp;&nbsp;<blink>Requesting data....</blink>&nbsp;&nbsp;&nbsp;</span>';
}


function whenLoaded(){
	var e = document.getElementById('loader'); 
	e.innerHTML = '';
}

function whenInteractive(){
	var e = document.getElementById('loader'); 
	e.innerHTML = '<span style="color: #FFFFFF;background-color: #CC0000;font-family:Arial, Helvetica, sans-serif;font-size:12;">&nbsp;&nbsp;&nbsp;<blink>Loading page....</blink>&nbsp;&nbsp;&nbsp;</span>';
}

function whenCompleted(){
	var e = document.getElementById(ajax.element); 
	if (ajax.responseStatus){
		var string = ajax.response;
	} else {
		var string = '<span style="color: #FFFFFF;background-color: #CC0000;font-family:Arial, Helvetica, sans-serif;font-size:12;">&nbsp;&nbsp;&nbsp;<blink>Loading page....</blink>&nbsp;&nbsp;&nbsp;</span>';
	}
	e.innerHTML = string;	
	var e = document.getElementById('loader'); 
    e.innerHTML = "";
	setTimeout("refix()", 1500);
}

function carilah(skrip,iddiv,frm){
	var ajax = new sack();
   var form = document.getElementById(frm);
   document.getElementById('psearch').style.visibility='hidden';
   document.getElementById('psearch').style.display = "none";
   ajax.setVar("teks",form.kterms.value); 
   if (form.checkbox1.checked)
     {
	   ajax.setVar("cbxa",1); 
    }
   if (form.checkbox2.checked)
     {
	   ajax.setVar("cbxb",1); 
    }
   if (form.checkbox3.checked)
     {
	   ajax.setVar("cbxc",1); 
    }
   if (form.checkbox4.checked)
     {
	   ajax.setVar("cbxd",1); 
    }

   if (form.checkbox5.checked)
     {
	   ajax.setVar("cbxe",1); 
    }

	ajax.requestFile = skrip;
	ajax.element = iddiv;
	ajax.onLoading = whenLoading;
	ajax.onLoaded = whenLoaded; 
	ajax.onInteractive = whenInteractive;
	ajax.onCompletion = whenCompleted;
	ajax.runAJAX();
}



function getskripmenu(skrip,iddiv,hm){
	var ajax = new sack();
	requesting();
	ajax.requestFile 	= skrip;
	ajax.element 		= iddiv;
	ajax.onLoading 		= whenLoading;
	ajax.onLoaded 		= whenLoaded; 
	ajax.onInteractive 	= whenInteractive;
	ajax.onCompletion 	= whenCompleted;
	ajax.runAJAX();
	getskripex(hm,'menu');
}

function getskrip(skrip,iddiv){
	var ajax = new sack();
	requesting();
	ajax.requestFile = skrip;
	ajax.element = iddiv;
	ajax.onLoading = whenLoading;
	ajax.onLoaded = whenLoaded; 
	ajax.onInteractive = whenInteractive;
	ajax.onCompletion = whenCompleted;
	ajax.runAJAX();
}

function getskripsch(skrip,iddiv,tgl){
	var ajax = new sack();
	requesting();
	ajax.requestFile = skrip;
	ajax.element = iddiv;
	ajax.onLoading = whenLoading;
	ajax.onLoaded = whenLoaded; 
	ajax.onInteractive = whenInteractive;
	ajax.onCompletion = whenCompleted;
	ajax.setVar("id",tgl); // alternate method of setting data to be parsed.
	ajax.runAJAX();
}



function pdetail(skrip,iddiv,tgl){
	var ajax = new sack();
	var dv = document.getElementById("idet");  
	var dva = document.getElementById("thumbs");  
	dva.style.display ="none";
	dv.style.display ="block";
	ajax.requestFile = skrip;
	ajax.element = iddiv;
	ajax.onLoading = whenLoading;
	ajax.onLoaded = whenLoaded; 
	ajax.onInteractive = whenInteractive;
	ajax.onCompletion = whenCompleted;
	ajax.setVar("id",tgl); // alternate method of setting data to be parsed.
	ajax.runAJAX();
}

function pdetailback(){
	var dv = document.getElementById("idet");  
	var dva = document.getElementById("thumbs");  
	dva.style.display ="block";
	dv.style.display ="none";
}



function submitrcv(){
	var ajax = new sack();
	ajax.requestFile = '/gf_pviewer/search.php';
	ajax.element = 'view_detail';
	ajax.onLoading = whenLoading;
	ajax.onLoaded = whenLoaded; 
	ajax.onInteractive = whenInteractive;
	ajax.onCompletion = whenCompleted;
	ajax.runAJAX();
 }

function dosearch(){
	var ajax = new sack();
   var form = document.getElementById('fsrc');
   psearch.style.visibility='hidden';
   ajax.setVar("teks",form.kterms.value); 
   if (form.checkbox1.checked)
     {
	   ajax.setVar("cbxa",1); 
    }
   if (form.checkbox2.checked)
     {
	   ajax.setVar("cbxb",1); 
    }
   if (form.checkbox3.checked)
     {
	   ajax.setVar("cbxc",1); 
    }
   if (form.checkbox4.checked)
     {
	   ajax.setVar("cbxd",1); 
    }
	requesting();
	ajax.requestFile = '/gf_pviewer/search.php';
	ajax.element = 'view_detail';
	ajax.onLoading = whenLoading;
	ajax.onLoaded = whenLoaded; 
	ajax.onInteractive = whenInteractive;
	ajax.onCompletion = whenCompleted;
	ajax.runAJAX();


}
function getskripschex(skrip,iddiv,tgl,bln){
	var ajax = new sack();
	requesting();
	ajax.setVar("id",tgl); // alternate method of setting data to be parsed.
	ajax.setVar("idx",bln); // alternate method of setting data to be parsed.
	ajax.requestFile = skrip;
	ajax.element = iddiv;
	ajax.onLoading = whenLoading;
	ajax.onLoaded = whenLoaded; 
	ajax.onInteractive = whenInteractive;
	ajax.onCompletion = whenCompleted;
	ajax.runAJAX();
}

function getskripschexx(skrip,iddiv,ida,idb,idc){
	var ajax = new sack();
	requesting();
	ajax.setVar("ida",ida); // alternate method of setting data to be parsed.
	ajax.setVar("idb",idb); // alternate method of setting data to be parsed.
	ajax.setVar("idc",idc); // alternate method of setting data to be parsed.
	ajax.requestFile = skrip;
	ajax.element = iddiv;
	ajax.onLoading = whenLoading;
	ajax.onLoaded = whenLoaded; 
	ajax.onInteractive = whenInteractive;
	ajax.onCompletion = whenCompleted;
	ajax.runAJAX();
}
function togel(nodeObject,imgObject)
{
 div = document.getElementById(nodeObject);
 icon = document.getElementById(imgObject);
 if(div.style.display=='block')
 {
  div.style.display ='none';
  icon.src="/gf_navi/plus_node.gif" ;
 } else {
   div.style.display = 'block';
   icon.src = '/gf_navi/collapse_all.gif';
  }
}

function togela(nodeObject,imgObject)
{
 div = document.getElementById(nodeObject);
 icon = document.getElementById(imgObject);
 if(div.style.display=='none')
  {
   div.style.display = 'block';
   icon.src = '/gf_navi/collapse_all.gif';
  }
}

function togelc(nodeObject)
{
 div = document.getElementById(nodeObject);
 if(div.style.display=='none')
  {
   div.style.display = 'block';
  }
}
function togeld(nodeObject)
{
 div = document.getElementById(nodeObject);
 if(div.style.display=='block')
  {
   div.style.display = 'none';
  }
}
function jam(){
	var Digital = new Date();
	var hours = Digital.getHours();
	var minutes = Digital.getMinutes();
	dn = "AM";
	if ((hours >= 12) && (minutes >= 1) || (hours >= 13)) {
	dn = "PM";
	hours = hours-12;
	}
	if (hours == 0)
	hours = 12;
  	ajax = new jamer("/event.php");
  	ajax.element = "jam";
  	ajax.runAJAX();
	setTimeout("jam()", 60000);
}
function submit_form(wnd) {
	window.open('', 'foo', wnd);
	document.specform.submit();
}

function refix(){
var d   = document.getElementById("wrap");  
var dv  = document.getElementById("midpan");  
var dva = document.getElementById("lpan");  
var dvb = document.getElementById("rpan");
var dvc = document.getElementById("rpantop");
var dvd = document.getElementById("rpanbott");
var dve = document.getElementById("lpantop");
var dvf = document.getElementById("lpanbott");
var myWidth = 0, myHeight = 0, mpanw = 0, rw = 0, lw = 0, mh = 0,lh=0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
  
//if(myWidth <= 782){
	myWidth = d.offsetWidth;	
//}
if(myWidth <= 880){
 myHeight=myHeight - 18;
} else {
 myHeight=myHeight - 2;
}
d.height=myHeight+"px";
myHeight = myHeight -80;
mh = myHeight - 6;
mpanw = myWidth - 12;
lw = dva.offsetWidth;
rw = myWidth - 18 - lw;
dv.style.height  = myHeight + "px"; 
dv.style.width   = mpanw +"px"
if(dva!=null){
dva.style.height = mh + "px"; 
}

if(dvb!=null){
dvb.style.height = mh + "px"; 
dvb.style.width = rw+"px";
}
if(dvc!=null){
	lh = dvb.offsetHeight - dvc.offsetHeight-1;
	dvd.style.height = lh + "px"; 
}

if(dve!=null){
	lh = dva.offsetHeight - dve.offsetHeight;
	dvf.style.height = lh + "px"; 
}
}


function refixscroll(){
	CSBfleXcroll('lpanbott');
}

function sack(file){
	this.AjaxFailedAlert = "Your browser does not support the enhanced functionality of this website, and therefore you will have an experience that differs from the intended one.\n";
	this.requestFile = file;
	this.method = "POST";
	this.URLString = "";
	this.encodeURIString = true;
	this.execute = false;

	this.onLoading = function() { };
	this.onLoaded = function() { };
	this.onInteractive = function() { };
	this.onCompletion = function() { };

	this.createAJAX = function() {
		try {
			this.xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
				this.xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (err) {
				this.xmlhttp = null;
			}
		}
		if(!this.xmlhttp && typeof XMLHttpRequest != "undefined")
			this.xmlhttp = new XMLHttpRequest();
		if (!this.xmlhttp){
			this.failed = true; 
		}
	};
	
	this.setVar = function(name, value){
		if (this.URLString.length < 3){
			this.URLString = name + "=" + value;
		} else {
			this.URLString += "&" + name + "=" + value;
		}
	}
	
	this.encVar = function(name, value){
		var varString = encodeURIComponent(name) + "=" + encodeURIComponent(value);
	return varString;
	}
	
	this.encodeURLString = function(string){
		varArray = string.split('&');
		for (i = 0; i < varArray.length; i++){
			urlVars = varArray[i].split('=');
			if (urlVars[0].indexOf('amp;') != -1){
				urlVars[0] = urlVars[0].substring(4);
			}
			varArray[i] = this.encVar(urlVars[0],urlVars[1]);
		}
	return varArray.join('&');
	}
	
	this.runResponse = function(){
		eval(this.response);
	}
	
	this.runAJAX = function(urlstring){
		this.responseStatus = new Array(2);
		if(this.failed && this.AjaxFailedAlert){ 
			alert(this.AjaxFailedAlert); 
		} else {
			if (urlstring){ 
				if (this.URLString.length){
					this.URLString = this.URLString + "&" + urlstring; 
				} else {
					this.URLString = urlstring; 
				}
			}
			if (this.encodeURIString){
				var timeval = new Date().getTime(); 
				this.URLString = this.encodeURLString(this.URLString);
				this.setVar("rndval", timeval);
			}
			if (this.element) { this.elementObj = document.getElementById(this.element); }
			if (this.xmlhttp) {
				var self = this;
				if (this.method == "GET") {
					var totalurlstring = this.requestFile + "?" + this.URLString;
					this.xmlhttp.open(this.method, totalurlstring, true);
				} else {
					this.xmlhttp.open(this.method, this.requestFile, true);
				}
				if (this.method == "POST"){
  					try {
						this.xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded')  
					} catch (e) {}
				}

				this.xmlhttp.send(this.URLString);
				this.xmlhttp.onreadystatechange = function() {
					switch (self.xmlhttp.readyState){
						case 1:
							self.onLoading();
						break;
						case 2:
							self.onLoaded();
						break;
						case 3:
							self.onInteractive();
						break;
						case 4:
							self.response = self.xmlhttp.responseText;
							self.responseXML = self.xmlhttp.responseXML;
							self.responseStatus[0] = self.xmlhttp.status;
							self.responseStatus[1] = self.xmlhttp.statusText;
							self.onCompletion();
							if(self.execute){ self.runResponse(); }
							if (self.elementObj) {
								var elemNodeName = self.elementObj.nodeName;
								elemNodeName.toLowerCase();
								if (elemNodeName == "input" || elemNodeName == "select" || elemNodeName == "option" || elemNodeName == "textarea"){
									self.elementObj.value = self.response;
								} else {
									self.elementObj.innerHTML = self.response;
								}
							}
							self.URLString = "";
							refixscroll();
						break;
					}
				};
			}
		}
	};
this.createAJAX();
}

function jamer(file){
	this.AjaxFailedAlert = "Your browser does not support the enhanced functionality of this website, and therefore you will have an experience that differs from the intended one.\n";
	this.requestFile = file;
	this.method = "POST";
	this.URLString = "";
	this.encodeURIString = true;
	this.execute = false;

	this.onLoading = function() { };
	this.onLoaded = function() { };
	this.onInteractive = function() { };
	this.onCompletion = function() { };

	this.createAJAX = function() {
		try {
			this.xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
				this.xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (err) {
				this.xmlhttp = null;
			}
		}
		if(!this.xmlhttp && typeof XMLHttpRequest != "undefined")
			this.xmlhttp = new XMLHttpRequest();
		if (!this.xmlhttp){
			this.failed = true; 
		}
	};
	
	this.setVar = function(name, value){
		if (this.URLString.length < 3){
			this.URLString = name + "=" + value;
		} else {
			this.URLString += "&" + name + "=" + value;
		}
	}
	
	this.encVar = function(name, value){
		var varString = encodeURIComponent(name) + "=" + encodeURIComponent(value);
	return varString;
	}
	
	this.encodeURLString = function(string){
		varArray = string.split('&');
		for (i = 0; i < varArray.length; i++){
			urlVars = varArray[i].split('=');
			if (urlVars[0].indexOf('amp;') != -1){
				urlVars[0] = urlVars[0].substring(4);
			}
			varArray[i] = this.encVar(urlVars[0],urlVars[1]);
		}
	return varArray.join('&');
	}
	
	this.runResponse = function(){
		eval(this.response);
	}
	
	this.runAJAX = function(urlstring){
		this.responseStatus = new Array(2);
		if(this.failed && this.AjaxFailedAlert){ 
			alert(this.AjaxFailedAlert); 
		} else {
			if (urlstring){ 
				if (this.URLString.length){
					this.URLString = this.URLString + "&" + urlstring; 
				} else {
					this.URLString = urlstring; 
				}
			}
			if (this.encodeURIString){
				var timeval = new Date().getTime(); 
				this.URLString = this.encodeURLString(this.URLString);
				this.setVar("rndval", timeval);
			}
			if (this.element) { this.elementObj = document.getElementById(this.element); }
			if (this.xmlhttp) {
				var self = this;
				if (this.method == "GET") {
					var totalurlstring = this.requestFile + "?" + this.URLString;
					this.xmlhttp.open(this.method, totalurlstring, true);
				} else {
					this.xmlhttp.open(this.method, this.requestFile, true);
				}
				if (this.method == "POST"){
  					try {
						this.xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded')  
					} catch (e) {}
				}

				this.xmlhttp.send(this.URLString);
				this.xmlhttp.onreadystatechange = function() {
					switch (self.xmlhttp.readyState){
						case 1:
							self.onLoading();
						break;
						case 2:
							self.onLoaded();
						break;
						case 3:
							self.onInteractive();
						break;
						case 4:
							self.response = self.xmlhttp.responseText;
							self.responseXML = self.xmlhttp.responseXML;
							self.responseStatus[0] = self.xmlhttp.status;
							self.responseStatus[1] = self.xmlhttp.statusText;
							self.onCompletion();
							if(self.execute){ self.runResponse(); }
							if (self.elementObj) {
								var elemNodeName = self.elementObj.nodeName;
								elemNodeName.toLowerCase();
								if (elemNodeName == "input" || elemNodeName == "select" || elemNodeName == "option" || elemNodeName == "textarea"){
									self.elementObj.value = self.response;
								} else {
									self.elementObj.innerHTML = self.response;
								}
							}
							self.URLString = "";
						break;
					}
				};
			}
		}
	};
this.createAJAX();
}