<!--
//****************************************
function SetRowCol(Row,bgColor) 
{
	var RowCnt;
	RowCnt = Row.cells.length;

	for(var i=0;i<RowCnt;i++) 
	{
		Row.cells[i].style.backgroundColor = bgColor;
	}
}

//****************************************
//open a browser
function MM_openBrWindow(theURL,winName,features) 
{ //v2.0
  window.open(theURL,winName,features);
}

//****************************************
function toggleDiv(divName) 
{
	thisDiv = document.getElementById(divName);
	if (thisDiv)
	{
		if (thisDiv.style.display == "none")
		{
			thisDiv.style.display = "block";
		}
		else
		{
			thisDiv.style.display = "none";
		}
	}
	else 
	{
		errorString = "Error: Could not locate div with id: " + divName;
		alert(errorString);
	}
}//end of function toggleDiv(divName) 

//****************************************
function toggleCheckbox(checkboxName)
{
	thisCheckbox = document.getElementById(checkboxName);
	
	if (thisCheckbox.checked == true)
	{
		thisCheckbox.checked = false;
		//if unchecked need to set the value of 
		//$search->search_vars['adv_search']  to 0
		//by calling the this js function in ../js/search.js 
		check_adv(window.search_hidden_form,0); 
	}
	else 
	{
		thisCheckbox.checked = true;
		//if unchecked need to set the value of 
		//$search->search_vars['adv_search']  to 1
		//by calling the this js function in ../js/search.js 
		check_adv(window.search_hidden_form,1);
	}

}

//**************************************
//function used to add check the checkbox of adv_search in XXX_form_search.php
//where XXX is a table name. Example: "cikalst" or  any folder "search"
//the 1st argument: hiddenFormObj is the object of hidden frame. Example: window.search_hidden_form
//the 2nd argumnet: adv_value is 0 when we don't want to display the adv. search 
// 				    adv_value is 1 when we want to display the adv. search
function check_adv(hiddenFormObj,adv_value)
{
		//if the hidden form frame existis
		if (hiddenFormObj)
		{
			//alert(hiddenFormObj);
			//alert(adv_value);
			
			//get the form of the hidden frame 
			//which is in the file search_hidden_form.php
			var frm = hiddenFormObj.document.formHidden;
			
			//set the value of the hidden field of the frame with the value of the adv_search passed . 
			//Either 0 or 1
			//the hidden field is called adv_search
			frm.adv_search.value = adv_value;
			
			//alert(frm.adv_value.value); or 
			//alert(hiddenFormObj.formHidden.adv_search.value);
			frm.submit();
		}
}




//****************************************
//function used toggle the checkbox for hide_inf
//when clicked on the link of "hide this information"

function toggleCheckboxHideInf(checkboxName)
{
	thisCheckbox = document.getElementById(checkboxName);
	
	if (thisCheckbox.checked == true)
	{
		thisCheckbox.checked = false;
		//if unchecked need to set the value of 
		//$table_search->hide_inf  to 0
		//by calling the this js function in ../js/general.js 
		check_hide_inf(window.search_hidden_form,0); 
	}
	else 
	{
		thisCheckbox.checked = true;
		//if unchecked need to set the value of 
		//$table_search->hide_inf  to 1
		//by calling the this js function in ../js/general.js 
		check_hide_inf(window.search_hidden_form,1);
	}

}



//****************************************
//function used tocheck the checkbox of hide_inf in XXX_form.php
//where XXX is a table name. Example: "cikalst" or  any folder "search"
//Example: "quotationmain_form.php" to hide_inf the information of the quotationmain
//the 1st argument: hiddenFormObj is the object of hidden frame. Example: window.search_hidden_form
//the 2nd argumnet: hide_inf_value is 0 when we don't want to hide_inf the information 
// 				    hide_inf_value is 1 when we want to hide_inf the information
function check_hide_inf(hiddenFormObj,hide_inf_value)
{
		
		//if the hidden form frame existis
		if (hiddenFormObj)
		{
			//alert(hiddenFormObj);
			//alert(hide_inf_value);
			
			//get the form of the hidden frame 
			//which is in the file search_hidden_form.php
			var frm = hiddenFormObj.document.formHidden;
			
			//set the value of the hidden field of the frame with the value of the hide_inf_value passed . 
			//Either 0 or 1
			//the hidden field is called hide_inf
			frm.hide_inf.value = hide_inf_value;
			
			//alert(frm.hide_inf.value); or 
			//alert(hiddenFormObj.formHidden.hide_inf.value);
			frm.submit();
		}
}


//****************************************

//function used in "XXX_new_form.php"
//where XXX is the table name Ex: "cikalst" or "user" which is the printer friendly of "co_login"
//to increase the input size of a text field when
//the focus is in the input text box
//that way we don't have to scroll the bar when inserting a new record
//1st argument thisTextInput: gives the input box name object
//2nd argument size:gives the real size of the field from <?php echo mysql_field_len($fields,$i); ?> 
//gotten from "XXXX_new_form.php"
function incTextInputSize(thisTextInput,size)
{
	//alert(thisTextInput.value);-->gives the input box name. 
	//Example: SERNO, BRAND
	if (thisTextInput)
	{
		thisTextInput.size = size;
	}
}

//****************************************
//function used in "XXX_new_form.php"
//where XXX is the table name Ex: "cikalst" or "user" which is the printer friendly of "co_login"
//to decrease the input size of a text field when
//the focus leaves the input text box
//that way we don't have to scroll the bar when inserting a new record
//1st argument thisTextInput: gives the input box name object
//2nd argument size:gives the an arbitrary fixed size of the field.
//In this case I'm using 5 as an arbitray number
function decTextInputSize(thisTextInput,fixedsize)
{
	
	//alert(thisTextInput.value);
	//alert(fixedsize);
	//Example: SERNO, BRAND
	if (thisTextInput)
	{
		thisTextInput.size = fixedsize;
	}
}


//****************************************
//function used to insert a character into a text box for input
//pass the 1st argument as the object of the text box object
//the 2nd argument is the value to be inputed
function addAccent(textbox,val)
{
	
	var add = val;
	
	textbox.value = textbox.value + add;
	
	textbox.focus();
}
//-->

