<!--
//**************************************
//for the default fields in 
//$table_var->def_copy_fields where table could be any table "cikalst" or "user"(printer friendly version of "co_login")
//to have a checkbox in the td header to do COPY ALL functionality
//this javascript function is called from fns/display_td_fns.php

//the 1st argument: thisform is the object  of the form. Ex:document.cikalst_main
//the 2nd argument: columnname is the name of the column field. Ex: AWBL
//the 3rd argument: limit  is the number of rows in that page to be copied to
function copyall(thisform,columnname,limit)
{
	//alert(thisform);
	//alert(columnname);
	//alert(limit);
	
	var i = 0;
	
	firstfieldname = columnname + i;
	//Example:AWBL0
	
	while (i < limit)
	{
		fieldname = columnname + i;
		thisform.elements[fieldname].value = thisform.elements[firstfieldname].value;
		i = i+1;
	}
}


//**************************************
//return a true value if  we need to check the checkbox
//of "transfer" action column in "XXX_form_main.php
//Ex: the action in search_form_main.php is "quote"
//if any of the checkbox is already checked, then we display a check in the "transfer_header" checkbox
function transfer_ischeck(thisform,columnname,limit)
{
	//alert(thisform);
	//alert(columnname);
	//alert(limit);
	
	//*******************************
	//part to check all the checks in the checkbox
	//Example: columname = quote
	//Example: limit = 10
	var i = 0;
	//boolean variable to determine if we need to display a check in the header of
	//column "quote" of action column. 
	//It defaults to "false"
	
	var ischeck=false;
	//go through all the wait0,wait1.... of that page
	while (i < limit)
	{
		//Ex: wait0,wait1....wait4
		//Ex: quote0....quote4
		fieldname = columnname + i;
		
		//Ex: for folder "search"
		//check if any of the quote0,quote1 are checked
		//if checked then return true
		if(thisform.elements[fieldname].checked == true)
		{
			//alert(thisform.elements[fieldname].checked);
			ischeck = true;	
		}
		i = i+1;
	}
	
	//alert(thisform.elements['transfer_header'].checked);
	//check if we need to check the "transfer_header" checkbox or not
	//if yes, we check the checkbox of name ="transfer_header' displayed in
	// the function disptdorderby_reg_transf($table_var,$table_pageinfo,$table_order,$table_language,$table_query,$pk_field="",$hiddenFormName="",$image_path= "../")
	//of ../fns/display_td_fns.php
	if(ischeck == true)
	{
		thisform.elements['transfer_header'].checked = true;
	}
}



//**************************************
//function used to add a new selected value of primary key  to the $table_var->selected_transfers
//used in "XXX_form_main.php
//when a checkbox that belongs to an transfer action is checked
//Ex: action "quote" of application search

//where XXX is a table name(Ex: cikalst)or 
//folder name( Ex: "search"). 

//the 1st argument: hiddenFormObj is the object of hidden frame. Example: window.search_form_main_hidden
//the 2nd argumnet: pkvalue is the value of the prim. key that is selected. Example "011004"
function add_transfer(hiddenFormObj,pkvalue)
{
		//if the hidden form frame existis
		if (hiddenFormObj)
		{
			//alert(hiddenFormObj);
			//alert(pkvalue);
			
			//get the form of the hidden frame 
			//which is in the file XXX_form_main_hidden.php
			//where XXX is a name of table ("cikalst" or "user"-->printer friendly version of "co_login")
			//or XXX could be the name of a folder (Ex: "search")
			var frm = hiddenFormObj.document.formHidden;
			
			//set the value of the hidden field of the frame with the value of the primary key selected
			//the hidden field is called add_transfer
			frm.add_transfer.value = pkvalue;
			
			//alert(frm.add_transfer.value); 
			//or 
			//alert(hiddenFormObj.formHidden.add_action.value);
			frm.submit();
		}
}//end of function add_transfer(hiddenFormObj,pkvalue)



//**************************************
//for "transfer" action column
//displayed in the disptdorderby_reg_transf($table_var,$table_pageinfo,$table_order,$table_language,$table_query,$pk_field="",$hiddenFormName="",$image_path= "../") 
//of ../fns/display_td_fns.php
//it checks all the checkboxes of the "transfer" column in that page
//Ex: action "quote" of application search

//used in "XXX_form_main.php
//where XXX is a table name(Ex: cikalst)or 
//folder name( Ex: "search"). 

//the 1st argument: thisform 
//		document.XXX where XXX is the name of the form
//		Example: document.cikalst_main		 	
//the 2nd argument: hiddenFormObj is the object of hidden frame. Example: window.search_form_main_hidden
//		passed from the function 
//		disptdorderby_reg_transf($table_var,$table_pageinfo,$table_order,$table_language,$table_query,$pk_field="",$hiddenFormName="",$image_path= "../")
//		of ../fns/display_td_fns.php
//the 3rd argumnet: columname is the name of the transfer action
//		Ex: "quote" for the ezample of folder "search"
//the 4th argument: limit. Num of records in tha specific page
function copyall_transfer(thisform,hiddenFormObj,columnname,limit)
{
	
	//alert(thisform);
	//alert(columnname);
	//alert(limit);
	
	//part to check all the checks in the checkbox
	//Example for folder "search"
	
	//Example: columname = "quote"
	//Example: limit = 10
	var i = 0;
	
	//arrays that need to be passed to the "XXX_form_main_hidden.php"
	//with all the values of the primary keys that have been selected
	var pkvalues_array= new Array(limit); 

	
	//check all the checkboxes of action "transfer"
	while (i < limit)
	{
		//Example for application search
		//Ex: "quote0",...."quote4"
		fieldname = columnname + i;
		
		thisform.elements[fieldname].checked = true;
		//save to an array of Javascript all the values of primaty key
		pkvalues_array[i] = thisform.elements[fieldname].value;
		//alert(thisform.elements[fieldname].value);
		i = i+1;
	}
	
	
	//now pass the array "pkvalues_array" of all the selected primaty keys to the "XXX_form_main_hidden.php"
	//to save the data into $XXX_var->$selected_transfers
	//ATTENTION: when passed "pkvalues_array" to the hidden form "add_transfer_all" element
	//we are passing the string(ex: "10987,29873")
	//if the hidden form frame existis
	if (hiddenFormObj)
	{
		//alert(hiddenFormObj);
		//get the form of the hidden frame 
		//which is in the file XXX_form_main_hidden.php
		//where XXX is a name of table ("cikalst" or "user"-->printer friendly version of "co_login")
		//or XXX could be the name of a folder (Ex: "search")
		var frm = hiddenFormObj.document.formHidden;
		
		//set the value of the hidden field of the frame with the value of the array of primary key selected
		//the hidden field is called add_transfer_all
		frm.add_transfer_all.value = pkvalues_array;
		//alert(hiddenFormObj.formHidden.add_transfer_all.value);
		frm.submit();
	}

}//end of function copyall_transfer(thisform,hiddenFormObj,columnname,limit)

//**************************************
//for "transfer" action column
//displayed in the disptdorderby_reg_transf($table_var,$table_pageinfo,$table_order,$table_language,$table_query,$pk_field="",$hiddenFormName="",$image_path= "../")
//of ../fns/display_td_fns.php
//it unchecks all the checkboxes of the "transfer" column in that page
//Ex: action "quote" of application search

//used in "XXX_form_main.php
//where XXX is a table name(Ex: cikalst)or 
//folder name( Ex: "search"). 

//the 1st argument: thisform 
//		document.XXX where XXX is the name of the form
//		Example: document.cikalst_main		 	
//the 2nd argument: hiddenFormObj is the object of hidden frame. Example: window.search_form_main_hidden
//		passed from the function 
//      disptdorderby_reg_transf($table_var,$table_pageinfo,$table_order,$table_language,$table_query,$pk_field="",$hiddenFormName="",$image_path= "../")
//		of ../fns/display_td_fns.php
//the 3rd argumnet: columname is the name of the transfer action
//		Ex: "quote" for the ezample of folder "search"
//the 4th argument: limit. Num of records in tha specific page

function decheckall_transfer(thisform,hiddenFormObj,columnname,limit)
{
	
	//alert(thisform);
	//alert(columnname);
	//alert(limit);
	
	//part to check all the checks in the checkbox
	//Example for folder "search"
	
	//Example: columname = "quote"
	//Example: limit = 10
	var i = 0;
	
	//arrays that need to be passed to the "XXX_form_main_hidden.php"
	//with all the values of the primary keys that have been selected
	var pkvalues_array= new Array(limit); 

	
	//check all the checkboxes of action "transfer"
	while (i < limit)
	{
		//Example for application search
		//Ex: "quote0",...."quote4"
		fieldname = columnname + i;
		
		thisform.elements[fieldname].checked = false;
		//save to an array of Javascript all the values of primaty key
		pkvalues_array[i] = thisform.elements[fieldname].value;
		//alert(thisform.elements[fieldname].value);
		i = i+1;
	}
	
	
	//now pass the array "pkvalues_array" of all the selected primaty keys to the "XXX_form_main_hidden.php"
	//to save the data into $XXX_var->$selected_transfers
	//ATTENTION: when passed "pkvalues_array" to the hidden form "add_transfer_all" element
	//we are passing the string(ex: "10987,29873")
	//if the hidden form frame existis
	if (hiddenFormObj)
	{
		//alert(hiddenFormObj);
		//get the form of the hidden frame 
		//which is in the file XXX_form_main_hidden.php
		//where XXX is a name of table ("cikalst" or "user"-->printer friendly version of "co_login")
		//or XXX could be the name of a folder (Ex: "search")
		var frm = hiddenFormObj.document.formHidden;
		
		//set the value of the hidden field of the frame with the value of the array of primary key selected
		//the hidden field is called add_transfer_all
		frm.del_transfer_all.value = pkvalues_array;
		//alert(hiddenFormObj.formHidden.add_transfer_all.value);
		frm.submit();
	}


}


//**************************************
//function used to removed a selected value of primary key  from the $table_var->selected_transfers
//used in "XXX_form_main.php
//when a checkbox that belongs to an transfer action is checked
//Ex: action "quote" of application search

//where XXX is a table name(Ex: cikalst)or 
//folder name( Ex: "search"). 

//the 1st argument: hiddenFormObj is the object of hidden frame. Example: window.search_form_main_hidden
//the 2nd argumnet: pkvalue is the value of the prim. key that is selected. Example "011004"

function del_transfer(hiddenFormObj,pkvalue)
{
		//if the hidden form frame existis
		if (hiddenFormObj)
		{
			//alert(hiddenFormObj);
			//alert(pkvalue);
			
			//get the form of the hidden frame 
			//which is in the file XXX_form_main_hidden.php
			//where XXX is a name of table ("cikalst" or "user"-->printer friendly version of "co_login")
			//or XXX could be the name of a folder (Ex: "search")
			var frm = hiddenFormObj.document.formHidden;
			
			//set the value of the hidden field of the frame with the value of the primary key selected
			//the hidden field is called add_transfer
			frm.del_transfer.value = pkvalue;
			
			//alert(frm.add_transfer.value); 
			//or 
			//alert(hiddenFormObj.formHidden.add_action.value);
			frm.submit();
		}
}//end of function del_transfer(hiddenFormObj,pkvalue)




//**************************************
//function used to simulate a button click to update the information
//the 1st argumnet: button is the actual button that we want to simulate the click. Ex: this.form.save
function simulate_click(button)
{
	button.click(); 
}//function simulate_click(button)
//**************************************




//-->