//-------------------------------------------------------------------------------------
// Function : Pre-value search box
// Author: Wilson
// Date: 27 August 2008
//------------------------------------------------------------------------------------
function focus_text(e,warna,text)
{
	if(e.value==text)
	{
		e.style.color=warna;
		e.value="";
	}
}
function blur_text(e,warna,text)
{
	if(e.value=="")
	{
		e.style.color=warna;
		e.value=text;
	}
}

//-------------------------------------------------------------------------------------
// Function : table ROW mousehover for IE
// Author: Google :D
// Date: 13 Jan 2009
//------------------------------------------------------------------------------------
//create arrays to store original colours of rows
var originalColour = new Array();
var previousColour = new Array();
 
//change the row on hover
function switchColour(row, i) {
  //check if original colour of the row is stored yet
	if(originalColour[i] == null) {
		originalColour[i] = row.className;
	}

  //record the current colour
	previousColour[i] = row.className;

  //highlight row
	row.className = "hover";
}
 
//change row colour back to it's original
function switchBack(row, i) {
	row.className = previousColour[i];
}

function openWindow(url){
eval('document.location.href=url');
}

// Count characters left in textarea
function counter(TheText,TheCounter, Limit)
{
	TextString = document.getElementById(TheText).value;
	Text = TextString.length;

	if (Text>Limit)
	{
		document.getElementById(TheCounter).innerHTML = "0 karakter tersisa";
		document.getElementById(TheText).value = TextString.substr(0, Limit);
	}
	else
	{
		document.getElementById(TheCounter).innerHTML = Limit-Text+" karakter tersisa";
	}
}

function tooltipHover(str) {
	document.getElementById(str).style.display='block';
}
function tooltipOut(str) {
	document.getElementById(str).style.display='none';
}