<!--
// trim string empty
function trimstring(v){
	v = v.replace( /^\s+/g, "" );
	v = v.replace( /\s+$/g, "" );
	return v
  	}
// opend window style log page
function opened(width,height,modal,task,option,id){	
	var links = 'index2.php?option='+option+'&task='+task+'&id='+id;
	var tbparam = '&TB_iframe=true&width='+width+'&height='+height+'&modal='+modal;						
	tb_show(null,links+tbparam,false);		
	//parent.tb_remove();
	return;	
}  
//action
function mouseover(name){
	document.getElementById(name).style.textDecoration ='underline';
	document.getElementById(name).style.cursor ='pointer';
	return;
}
function mouseout(name){
	document.getElementById(name).style.textDecoration ='none';
	return;	
}
function clearvalue(name){	
	document.getElementById(name).value ='';
	
	return;	
}
// a single submit form wiith formname objectId and value
function submitForm(Formname, Objid, val){
	var form  = eval("document."+Formname);
	var Obj = eval("document."+Formname+"."+Objid+".value ='"+val+"'");
	form.submit();
	return;	
}
function submitbutton(pressbutton) {
		submitform( pressbutton );
}
// a single submit form wiith formname objectId and value
function twsubmitForm(Formname, Objid, val){
	var form  = eval("document."+Formname);
	var Obj = eval("document."+Formname+"."+Objid+".value ='"+val+"'");
	form.submit();
	return;	
}

function optiontick(typetext, optionname, messalert ){
	
	var textobj = document.getElementById(typetext);
	var optionobj = document.getElementById(optionname);
	if(optionobj.checked == true && trimstring(textobj.value) ==''){
		 alert(messalert);
		 textobj.focus();
		 optionobj.checked =false;
	}
	return;
}
function twsubstr(string, start, length ){
		var indexsub = string.substr(start, length);
		return indexsub;				
}

function addLoadEvent(func) {
	  var oldonload = window.onload;
	  if (typeof window.onload != 'function') {
		window.onload = func;
	  } else {
		window.onload = function() {
		  if (oldonload) {
			oldonload();
		  }
		  func();
		}
	  }
	}

//-->