// JavaScript Document

var xmlHttp
var n_div
//var n_file



function loading(){


var strloading = '<table width="350" border="0" align="center" cellpadding="0" cellspacing="0">  <tr>    <td width="319"><div align="right" class="style1">XXX</div></td>    <td width="31"><div align="center"><img src="icon.gif" width="16" height="16" /></div></td>  </tr></table>';

}

function showUser(str,div1,n_file,n_txtfind)
{ 
n_div=div1;
loading();

xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }

var url=n_file
url=url+"?"+ n_txtfind +"="+str


//url=url+"?txtfind="+str
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.setRequestHeader('Content-Type', 'text/html; charset:windows-1256');
xmlHttp.send(null)

}


function calc_loans( mony_lonas,addprecent)
{

var vmony_lonas=document.getElementById(mony_lonas).value ;
var vaddprecent=document.getElementById(addprecent).value;
var vprcect =((vmony_lonas * vaddprecent))/100;




vprcect=parseInt(vprcect);
vmony_lonas=parseInt(vmony_lonas);

var vprcectFull = (vmony_lonas + vprcect);
	
return vprcectFull;
}


function myidold(x,id_out,tool_select)
{
xx=document.getElementById(tool_select).value
document.getElementById(id_out).value = xx ;



}


function mouseOver()
{
document.getElementById("b1").src="images/tree.bmp"
}

function mouseOut()
{
document.getElementById("b1").src="images/ok.jpg"
}










function validation_addtransloans(strmsg)
{

var xbool;

xbool=true;
if (document.getElementById('client_id').value==0)
{
xbool=false;	
alert(strmsg);
return xbool;

}

if (document.getElementById('trans_title').value=='')
{
xbool=false;
alert(strmsg);
return xbool;
}

}



function validation_addtransloans_deteals(strmsg)
{

var xbool;

xbool=true;
if (document.getElementById('mony_part').value<=0)
{
xbool=false;	
alert(strmsg);
return xbool;
}

var vala=document.getElementById('loans_monyFullHave').value
var valb=document.getElementById('mony_part').value
var valc=document.getElementById('loans_monyFull').value
var vmax=parseInt(vala)+parseInt(valb);


if (parseInt(vmax)>parseInt(valc))
{
xbool=false;	
alert(strmsg);
return xbool;
}


}


function validation_addpayedtrans(strmsg)
{

var xbool;

xbool=true;
if (document.getElementById('Mony_pyed').value=='')  
{
xbool=false;	
alert(strmsg);
return xbool;

}

if (document.getElementById('Mony_pyed').value<=0)  
{
xbool=false;	
alert(strmsg);
return xbool;

}

}



function blockshowhide (tableblock)
{


if ( document.getElementById(tableblock).style.display=='none')
{
return 'block';
}

else
{
return 'none';
}
	

}





function return_value(Elementname,inVal) {
opener.document.getElementById(Elementname).value = inVal;
}


/*
function validation(){
 
	var errormsg = "";
	
	if(document.formdatatransmain.fee_value.value == ""){
	errormsg += '?????? \n';
	}
*/








function stateChanged() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
// alert(xmlHttp.responseText );

 document.getElementById(n_div).innerHTML=xmlHttp.responseText 
 xmlHttp = null ;
 } 
}

function GetXmlHttpObject()
{
var xmlHttp=null;
try
 {
 // Firefox, Opera 8.0+, Safari
 xmlHttp=new XMLHttpRequest();
 }
catch (e)
 {
 //Internet Explorer
 try
  {
  xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
  }
 catch (e)
  {
  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
 }
return xmlHttp;
}






function Window_pop(UrlPage) {
        //call Script To Any Text
        //TextBox1.Attributes.Add("ondblclick", "javascript:Window_pop('login.aspx');")
        //call Script To Any Text 
       // postion windows pop window After dblclick ;
        popWidth = 400;
        popHeight = 450;
        popscreenWidth = screen.width;
        popscreenHeight = screen.Height;

        posL = (popscreenWidth - popWidth) / 2;
        posT = (popscreenHeight - popHeight) / 2;
        popLeftPosition = posL;
        popTopPosition = posT;
	 
window.open(UrlPage, "traveler", "toolbar=no,scrollbars = yes,width=" + popWidth + ",height=" + popHeight + ",top=" + popTopPosition + ",left=" + (popLeftPosition) + "");
//window.open(UrlPage);

 
   }