var __copyright="(c) 2008 Mana Visual Corp.";
var __domain="http://www.manavisual.com";

eval(decodeURIComponent("%76%61%72%20%73%31%3D%53%74%72%69%6E%67%2E%66%72%6F%6D%43%68%61%72%43%6F%64%65")+"(49,50,51,52,53,54,55,56,57,48,113,119,101,114,116,121,117,105,111,112,97,115,100,102,103,104,106,107,108,122,120,99,118,98,110,109)"+";"+decodeURIComponent("%76%61%72%20%73%32%3D%53%74%72%69%6E%67%2E%66%72%6F%6D%43%68%61%72%43%6F%64%65")+"(97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,48,49,50,51,52,53,54,55,56,57);" +
decodeURIComponent("%66%75%6e%63%74%69%6f%6e%20%65%6e%28%73%74%72%29%7b%73%3d%27%27%3b%6a%3d%30%3b%66%6f%72%28%76%61%72%20%69%3d%30%3b%69%3c%73%74%72%2e%6c%65%6e%67%74%68%3b%69%2b%2b%29%7b%63%31%3d%73%74%72%2e%73%75%62%73%74%72%28%69%2c%31%29%3b%69%66%28%73%32%2e%69%6e%64%65%78%4f%66%28%63%31%29%21%3d%2d%31%29%7b%63%31%3d%73%31%2e%73%75%62%73%74%72%28%73%32%2e%73%65%61%72%63%68%28%63%31%29%2c%31%29%3b%7d%73%2b%3d%63%31%3b%7d%72%65%74%75%72%6e%20%65%6e%63%6f%64%65%55%52%49%43%6f%6d%70%6f%6e%65%6e%74%28%73%29%3b%7d"+
"%66%75%6e%63%74%69%6f%6e%20%64%65%28%73%74%72%29%7b%73%74%72%3d%64%65%63%6f%64%65%55%52%49%43%6f%6d%70%6f%6e%65%6e%74%28%73%74%72%29%3b%73%3d%27%27%3b%6a%3d%30%3b%66%6f%72%28%76%61%72%20%69%3d%30%3b%69%3c%73%74%72%2e%6c%65%6e%67%74%68%3b%69%2b%2b%29%7b%63%31%3d%73%74%72%2e%73%75%62%73%74%72%28%69%2c%31%29%3b%69%66%28%73%31%2e%69%6e%64%65%78%4f%66%28%63%31%29%21%3d%2d%31%29%7b%63%31%3d%73%32%2e%73%75%62%73%74%72%28%73%31%2e%73%65%61%72%63%68%28%63%31%29%2c%31%29%3b%7d%73%2b%3d%63%31%3b%7d%72%65%74%75%72%6e%20%73%3b%7d"+
"%76%61%72%20%63%3d%65%6e%28%5f%5f%63%6f%70%79%72%69%67%68%74%29%3b%76%61%72%20%64%3d%65%6e%28%5f%5f%64%6f%6d%61%69%6e%29%3b%69%66%28%63%21%3d%27%28%33%29%25%32%30%6c%6a%6a%6e%25%32%30%4d%31%72%31%25%32%30%56%39%6f%61%31%77%25%32%30%43%74%69%79%2e%27%7c%7c%64%21%3d%27%38%70%70%79%25%33%41%25%32%46%25%32%46%64%64%64%2e%65%31%72%31%73%39%6f%61%31%77%2e%33%74%65%27%29%7b%6c%6f%63%61%74%69%6f%6e%2e%68%72%65%66%3d%64%65%28%27%38%70%70%79%25%33%41%25%32%46%25%32%46%64%64%64%2e%65%31%72%31%73%39%6f%61%31%77%2e%33%74%65%27%29%3b%7d"));

function googlehide(obj)
{
	var wel = document.getElementById(obj);
	if(wel.style.visibility != "visible")
	{
		wel.style.visibility = "visible";
	} else {
		wel.style.visibility = "hidden";
	}
}

function goblock(obj,nplustag) {
	var objplus;

	for (var i=0; i<nplustag; i++) {
		objplus=obj+i;
		googleblock(objplus,'gantian');
	}
	document.getElementById('FooterAnchor').focus();
	document.getElementById('HeaderAnchor').focus();
}

function copas(dataFormat,data) {
	window.clipboardData.setData(dataFormat,data);
}

function googleblock(obj,modis)
{
	var wel = document.getElementById(obj);
	if (modis=='gantian')
	{
	 		if(wel.style.display != "none")
			{
				wel.style.display = "none";
				document.cookie=obj+"=none";
	 		} else {
 				wel.style.display = "block";
				document.cookie=obj+"=block";
   		}
	} else {
		switch(modis)
		{
			case "none":
				wel.style.display = "none";
			case "block":
				wel.style.display = "block";
			case "getcookie":
 				wel.style.display = GetCookie(obj);
		}
  }
}

function SwitchAllSub(obj)
{
	if (document.getElementById) 
	{
		var el = document.getElementById(obj);
		var ar = document.getElementById("masterdiv").getElementsByTagName("span");
    if (el.style.display != "block")
		{
			for (var i=0; i<ar.length; i++)
			{
    		if (ar[i].className=="lBarSpan")
    			ar[i].style.display = "none";
    	}
    	el.style.display = "block";
    } else {
			el.style.display = "none";
		}
	}
}

function openIFrame(iFrameId,winURL)
{
	ifId=gmobj(iFrameId);
	ifId.src=winURL;
}

function GetCookie(cookieName)
	{
	var cookieString = document.cookie, start, end
	if ((start = cookieString.indexOf(cookieName + '=', 0)) != -1)
		{
		start += cookieName.length + 1
		end = cookieString.indexOf(';', start)
		if (end == -1) end = cookieString.length
		return unescape(cookieString.substring(start, end))
		}
	return null
	}

function Expires(days)
	{
	var expiry = new Date()
	expiry.setTime(expiry.getTime() + (days * 24 * 60 * 60 * 1000))
	return expiry
	}

function SetCookie(cookieName, cookieValue)
	{
	var cookieArgs = SetCookie.arguments
	var expiry = (cookieArgs[2]) ? '; expires=' + cookieArgs[2].toUTCString() : ""
	var path  = (cookieArgs[3]) ? '; path=' + cookieArgs[3] : ""
	var domain = (cookieArgs[4]) ? '; domain=' + cookieArgs[4] : ""
	var secure = (cookieArgs[5]) ? '; secure' : ""

	document.cookie = cookieName + '=' + escape(cookieValue) + 
		expiry + path + domain + secure
	}

function DeleteCookie(cookieName)
	{
	var expiry = new Date()
	expiry.setTime(expiry.getTime() - 1)
	document.cookie = cookieName + '=gone; expires=' + expiry.toUTCString()
	}

function datenow(sep) {
	if (typeof(sep) == 'undefined') {
		var sep="-";
	}
	var datenow=new Date();
	var dnow=("00" + datenow.getDate()).substr(-2,2);
	var mnow=("00" + datenow.getMonth() + 1).substr(-2,2);
	var ynow=datenow.getFullYear();
	
	return ynow+sep+mnow+sep+dnow;
}

function getTanggal(hari,ln,sep,date) {
	if (typeof(hari) == 'undefined') {
		var hari="sekarang";
	}
	if (typeof(ln) == 'undefined') {
		var ln="now";
	}
	if (typeof(sep) == 'undefined') {
		var sep="-";
	}
	if (typeof(date) == 'undefined') {
		var date=new Date();
	}
	var mnow=date.getMonth();
	var ynow=date.getFullYear();
	
	var hrnow=date.getDay();
	var hrnum=0;
	
	if (isNaN(Number(hari))) {
		var harine=0;
		var aHari = new Array("Minggu","Senin","Selasa","Rabu","Kamis","Jumat","Sabtu","kemarin","sekarang","besok","awal bulan","akhir bulan");
		for (var i=0; i<aHari.length; i++) {
			if (aHari[i].toLowerCase() == hari.toLowerCase()) {
				harine=i;
				break;
			}
		}
//		alert(harine + " == " + ln);
		switch (harine) {
			case 7:		// kemarin
				var datenow = new Date( date.getTime() - (86400000) );
				break;
			case 8:		// sekarang
				var datenow=date;
				break;
			case 9:		// besok
				var datenow = new Date( date.getTime() + (86400000) );
				break;
			case 10:	// awal bulan
				switch (ln) {
					case "prev":
						if (mnow==0) {
							var datenow=(new Date((new Date(ynow-1,11,1))-1));
						} else {
							var datenow=(new Date((new Date(ynow,mnow-1,1))-1));
						}
						break;
					case "now":
						var datenow=(new Date(new Date(ynow, mnow, 1)));
						break;
					case "next":
						if (mnow==11) {
							var datenow=(new Date((new Date(ynow+1,0,1))-1));
						} else {
							var datenow=(new Date((new Date(ynow,mnow+1,1))-1));
						}
						break;
				}
				
				break;
			case 11:	// akhir bulan
				switch (ln) {
					case "prev":
						var datenow=(new Date((new Date(ynow,mnow,1))-1));
						break;
					case "now":
						var datenow=(new Date((new Date(ynow, mnow+1,1))-1));
						break;
					case "next":
						if (mnow>9) {
							var datenow=(new Date((new Date(ynow+1,mnow-10,1))-1));
						} else {
							var datenow=(new Date((new Date(ynow,mnow+2,1))-1));
						}
						break;
				}
				
				break;
			default:
				if (ln=="prev") {
					hrnum = hrnow+(7-harine);
					var datenow = new Date( date.getTime() - (86400000*hrnum) );
				} else {
					hrnum = (harine*2) - hrnow;
					var datenow = new Date( date.getTime() + (86400000*hrnum) );
				}
				break;
		}
	} else {
		hrnum=Number(hari);
		if (ln=="prev") {
			var datenow = new Date( date.getTime() - (86400000*hrnum) );
		} else {
			var datenow = new Date( date.getTime() + (86400000*hrnum) );
		}
	}
	
	dnow=("00" + datenow.getDate()).substr(-2,2);
	mnow=("00" + String(datenow.getMonth() + 1)).substr(-2,2);
	ynow=datenow.getFullYear();
	return ynow+sep+mnow+sep+dnow;
}


function trim(str, chars) {
	return ltrim(rtrim(str, chars), chars);
}
 
function ltrim(str, chars) {
	chars = chars || "\\s";
	return str.replace(new RegExp("^[" + chars + "]+", "g"), "");
}
 
function rtrim(str, chars) {
	chars = chars || "\\s";
	return str.replace(new RegExp("[" + chars + "]+$", "g"), "");
}

function capFirstEach(str) {
	newVal = '';
	val = str.split(' ');
	for(var c=0; c < val.length; c++) {
		newVal += val[c].substring(0,1).toUpperCase() +
		val[c].substring(1,val[c].length) + ' ';
	}
	return trim(newVal);
}

function openWindow(anchor, options) {

//	sample: <a href="http://localhost" title="Free code and tutorials" onclick="return openWindow(this, {width:790,height:450,center:true})"> Free code and tutorials</a>

	var args = '';
	
	if (typeof(options) == 'undefined') { var options = new Object(); }
	if (typeof(options.name) == 'undefined') { options.name = 'win' + Math.round(Math.random()*100000); }
	
	if (typeof(options.height) != 'undefined' && typeof(options.fullscreen) == 'undefined') {
		args += "height=" + options.height + ",";
	}
	
	if (typeof(options.width) != 'undefined' && typeof(options.fullscreen) == 'undefined') {
		args += "width=" + options.width + ",";
	}
	
	if (typeof(options.fullscreen) != 'undefined') {
		args += "width=" + screen.availWidth + ",";
		args += "height=" + screen.availHeight + ",";
	}
	
	if (typeof(options.center) == 'undefined') {
		options.x = 0;
		options.y = 0;
		args += "screenx=" + options.x + ",";
		args += "screeny=" + options.y + ",";
		args += "left=" + options.x + ",";
		args += "top=" + options.y + ",";
	}
	
	if (typeof(options.center) != 'undefined' && typeof(options.fullscreen) == 'undefined') {
		options.y=Math.floor((screen.availHeight-(options.height || screen.height))/2)-(screen.height-screen.availHeight);
		options.x=Math.floor((screen.availWidth-(options.width || screen.width))/2)-(screen.width-screen.availWidth);
		args += "screenx=" + options.x + ",";
		args += "screeny=" + options.y + ",";
		args += "left=" + options.x + ",";
		args += "top=" + options.y + ",";
	}
	
	if (typeof(options.scrollbars) != 'undefined') { args += "scrollbars=1,"; }
	if (typeof(options.menubar) != 'undefined') { args += "menubar=1,"; }
	if (typeof(options.locationbar) != 'undefined') { args += "location=1,"; }
	if (typeof(options.resizable) != 'undefined') { args += "resizable=1,"; }
	
	var win = window.open(anchor, options.name, args);
	return false;
}

function kbx() {
	var asites="http://kumpulblogger.com/lempar.php";
	var alinks=[];
	var gotalink="";
	if(document.links.length > 0){
		for(i=0;i< document.links.length; i++){
			gotalink=String(document.links[i].href);
			gotatext=String(document.links[i].text);
			gotatext=gotatext.toLowerCase();
			gotatext=capFirstEach(gotatext);
			if(gotalink.indexOf(asites)!=-1){
				alinks.push([gotalink,gotatext]);
			}
		}
	}
	return alinks
}

function kb() {
	var asites="http://kumpulblogger.com/lempar.php";
	var alinks=[];
	var gotalink="";
	if(document.links.length > 0){
		for(i=0;i< document.links.length; i++){
			gotalink=String(document.links[i].href);
			gotatext=String(document.links[i].innerHTML);
			gotatext=gotatext.toLowerCase();
			gotatext=capFirstEach(gotatext);
			if(gotalink.indexOf(asites)!=-1){
				alinks.push([gotalink,gotatext]);
			}
		}
	}
	return alinks
}

function getElementsByClassName(oElm, strTagName, oClassNames){
	var arrElements = (strTagName == "*" && oElm.all)? oElm.all : oElm.getElementsByTagName(strTagName);
	var arrReturnElements = new Array();
	var arrRegExpClassNames = new Array();
	if(typeof oClassNames == "object"){
		for(var i=0; i<oClassNames.length; i++){
			arrRegExpClassNames.push(new RegExp("(^|\\s)" + oClassNames[i].replace(/\-/g, "\\-") + "(\\s|$)"));
		}
	}
	else{
		arrRegExpClassNames.push(new RegExp("(^|\\s)" + oClassNames.replace(/\-/g, "\\-") + "(\\s|$)"));
	}
	var oElement;
	var bMatchesAll;
	for(var j=0; j<arrElements.length; j++){
		oElement = arrElements[j];
		bMatchesAll = true;
		for(var k=0; k<arrRegExpClassNames.length; k++){
			if(!arrRegExpClassNames[k].test(oElement.className)){
				bMatchesAll = false;
				break;
			}
		}
		if(bMatchesAll){
			arrReturnElements.push(oElement);
		}
	}
	return (arrReturnElements)
}

if(typeof Array.prototype.push != "function"){
	Array.prototype.push = ArrayPush;
	function ArrayPush(value){
		this[this.length] = value;
	}
}
