function CreateAjax(){ var xmlhttp; if(!xmlhttp && typeof XMLHttpRequest != 'undefined'){ try { xmlhttp = new XMLHttpRequest(); } catch (e) { alert("Your browser is not supporting XMLHTTPRequest"); xmlhttp = false; } }else{ xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } return xmlhttp; } function CallServer(mthd,www,str,func){ request.open(mthd,www,true); if(mthd=='POST'){ request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset:UTF-8'); } request.onreadystatechange=function(){ if(request.readyState == 1){ func(0); AjaxLoading(true); } if(request.readyState == 4){ var answer = request.responseText; func(answer); AjaxLoading(false); } }; request.send(str); } var request = CreateAjax(); function AjaxLoading(bl){ var elm; if(document.getElementById('AjaxLoadingLbl')) { elm=document.getElementById('AjaxLoadingLbl'); } else { elm=document.createElement("span"); elm.id='AjaxLoadingLbl'; elm.style.position='absolute'; elm.style.background='blue'; elm.style.color='white'; elm.style.padding='2px'; elm.innerHTML='Connecting server ...'; document.body.appendChild(elm); } elm.style.top=0 + document.body.scrollTop; elm.style.left=screen.width/2 - 100 - document.body.scrollLeft; if(bl){ elm.style.display='block'; }else{ elm.style.display='none'; } } function OW(page,a,b){ X=(screen.width-a)/2; Y=(screen.height-b)/2; var winO=window.open(page,'popup','scrollbars=2,addressbar=1,resizable=1,width='+a+',height='+b+',left='+X+',top='+Y);winO.focus(); } function CheckSearchLenght() { if (frmSearch.qsearch.value.length < 2) { window.alert("Search keyword should be more than 1 charachter!"); return false; } else return true; } function ChangeColor(val1,val2){ obj=document.getElementById('CLM_'+val1+'_'+val2); obj.background = '../images/template/BCA_over.gif'; } function ChangeColorBack(val1,val2){ obj=document.getElementById('CLM_'+val1+'_'+val2); obj.background = '../images/template/BCA_normal.gif'; }