/*
#***********************************************************************************************#
#
#	bakwan : andi.ridwan@gmail.com
#	ibnu hazim : ibnuhazim1981@yahoo.com
#
#***********************************************************************************************#
#
#	function openw
#	function opennew
#	function jumpTo
#	function jumper
#	function cofirm
#	function delete_confirm_main
#	function delete_cofirm
#	function buttonact
#	function onbluralert
#	function onunloadalert
#	function radio_value
#	function printpage
#	function visiblebox
#	function blink
#
#***********************************************************************************************#
#
#	bakwan : 20060615 : (+) create this file
#	bakwan : 20060616 : (+) ubah function cofirm agar lebih reuseable
#	bakwan : 20060720 : (+) tambah function delete_confirm_main
#
#***********************************************************************************************#
*/

// ------------------------------------- begin : window function --------------------------------- //

// bakwan : open new window with strip option //
function openw(namafilecontact) 
{ 
	window.open(namafilecontact,'windowsbaru1','toolbar=0,location=0,directories=0,status=0,menubar=1,scrollbars=1,width=850 height=500,resizable=1');
}

// bakwan : open new window with normal option //
function opennew(param) 
{ 
	window.open(param,'windowsbaru2','toolbar=1,location=1,directories=0,status=0,menubar=1,scrollbars=1,width=850 height=500,resizable=1');
}

// ------------------------------------- end : window function ---------------------------------- //
	 
// ------------------------------------- begin : redirect function ------------------------------ //

// bakwan : change page depend from option value //
function jumpTo(optionchange)
{
	var optchange = optionchange.options[optionchange.selectedIndex].value;
	window.location.href = optchange;
}

// bakwan : change page depend from parameter value //
function jumper(param1,param2)
{
	window.location = param1+param2;
}

// ------------------------------------- end : redirect function -------------------------------- //

// ------------------------------------- begin : action function -------------------------------- //

// bakwan : show confirmation messege //
function cofirm(param1, param2, param3)	
{
	if (confirm(param3))
	{
		window.location = param1+"&"+param2;
	}
}

//bakwan : show main confirmation message //
function delete_confirm_main(param1)
{
	var is_confirmed= confirm(param1);
	if (is_confirmed){return false;}
	return false;
}

//ibnu : show confirmation message //
function delete_confirm()
{
	var is_confirmed= confirm("Are you sure to remove this?");
	if (is_confirmed){return true;}
	return false;
}

function send_confirm()
{
	var is_confirmed= confirm("Are you sure, your data is correct!!!");
	if (is_confirmed){return true;}
	return false;
}

// bakwan : action in button //
function buttonact(param1,param2)	
{
	url = param1+param2;
	window.location = url;
}

// bakwan : alert messege when mouse remove //
function onbluralert(param1,param2)
{
	if (param1)
	{
		alert(param2);
	}
}

// bakwan : alert messege when html page closed //
function onunloadalert(param1,param2)
{
	if (param1 == "" || param1 == null)
	{
		alert(param2);
	}
}

// bakwan : send selected radio input value //
function radio_value(param1,param2)
{
	for (var i=0; i <= document.radiofrm.id.length; i++)
	{
   		if (document.radiofrm.id[i].checked)
    	{
      		var rad_val = document.radiofrm.id[i].value;
			window.location = param1+"&"+rad_val;
      	}
   	}
}

// ------------------------------------- end : action function ---------------------------------- //

// ------------------------------------- begin : print function ------------------------------- //

function printpage() 
{
	window.print();  
}

// ------------------------------------- end : print function --------------------------------- //

// ------------------------------------- begin : visibleBox function ------------------------------- //

function visiblebox(id, skipopenclose)
{
	elm1 = document.getElementById("open"+id);
	elm2 = document.getElementById("close"+id);
	elm3 = document.getElementById("box"+id);
	if (skipopenclose) 
	{
		if (elm3.style.display == "") 
		{
			elm3.style.display = "none";
		} 
		else 
		{
			elm3.style.display = "";
		}
	}
	else 
	{
		if (elm1.style.display == "") 
		{
			elm1.style.display = "none";
			elm2.style.display = "";
			elm3.style.display = "none";
		}
		else 
		{
			elm1.style.display = "";
			elm2.style.display = "none";
			elm3.style.display = "";
		}
	}
}

// ------------------------------------- end : visibleBox function --------------------------------- //

// ------------------------------------- begin : set row pointer --------------------------------------- //
// create by Ibnu Hazim
function setPointer(theRow, thePointerColor)
{
    if (thePointerColor == '' || typeof(theRow.style) == 'undefined') {
        return false;
    }
    if (typeof(document.getElementsByTagName) != 'undefined') {
        var theCells = theRow.getElementsByTagName('td');
    }
    else if (typeof(theRow.cells) != 'undefined') {
        var theCells = theRow.cells;
    }
    else {
        return false;
    }

    var rowCellsCnt  = theCells.length;
    for (var c = 0; c < rowCellsCnt; c++) {
        theCells[c].style.backgroundColor = thePointerColor;
    }

    return true;
} 
// ------------------------------------- end : set row pointer --------------------------------------- //


// ------------------------------------- begin :Swap Image --------------------------------------- //
// --> Create by aRoeL (reference by mambo)

	function MM_swapImgRestore() 
	{ //v3.0
		var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
	}
	
	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_swapImage()
	{ //v3.0
		var i,j=0,x,a=MM_swapImage.arguments;
		document.MM_sr=new Array;
		for(i=0;i<(a.length-2);i+=3)
		if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x;
		if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
	}

// ------------------------------------- end :Swap Image --------------------------------------- //

function doBlink() {
	var blink = document.all.tags("BLINK")
	for (var i=0; i<blink.length; i++)
		blink[i].style.visibility = blink[i].style.visibility == "" ? "hidden" : "" 
}

function startBlink() {
	if (document.all)
		setInterval("doBlink()",500)
}
window.onload = startBlink;
