var ctrl=0;
function gc(w,h){
var l=(screen.width-w)/2;
var t=(screen.height-h)/2;
return 'toolbar=0,scrollbars=0,location=0,status=1,menubar=0,resizable=0,width='+w+',height='+h+',left='+l+',top='+t;}

function gcr(w,h){
var l=(screen.width-w)/2;
var t=(screen.height-h)/2;
return 'toolbar=0,scrollbars=1,location=0,status=1,menubar=0,resizable=1,width='+w+',height='+h+',left='+l+',top='+t;}

function editFis(fid,action){
var param="editFisDetayPop.htm?a="+action+"&fid="+fid;
var wh=window.open(param,'_blank',gcr(800,580));
wh.focus();return false;}

function editBloke(bid,action){
var param="editBlokePop.htm?a="+action+"&bid="+bid;
var wh=window.open(param,'_blank',gcr(800,280));
wh.focus();return false;}

function toggleDiv(el){
if(!el)return false;
if(el.style.display=='none')el.style.display='block';else el.style.display='none';
return false;}

function fmtParaShow(f,force){
if(!f){if(!force)return '';else return '0,00';}
if(f<=0)return '0,00';
var str=f+'';
if(str.indexOf('.')==-1)str=str.concat('.00');
if(str.indexOf('.')==str.length-2)str=str.concat('0');
if(str.indexOf('.')<str.length-3)str=str.substr(0,str.indexOf('.')+3);
str=str.replace('.',',');
var g=str.indexOf(',');
var x=parseInt((g-1) / 3);
for(var i=x;i>0;i--){
	str=str.substr(0,g-3*i) + '.' + str.substr(g-3*i,100);
	g++;}
return str;}

function hizliAra(){
var wh=window.open(null,'hizli',gc(230,145))
wh.document.write('<html><head><title>Hizli Ara</title></head><body>')
wh.document.write('<form name=h method=post onsubmit="if(opener){if(this.f.value.length>0)opener.editFis(this.f.value,8);else if(this.y.value.length>0)opener.editFis(this.y.value,9);}window.close();return false;"><table border=0 cellspacing=2 cellpadding=3 width=100%>')
wh.document.write('<tr><th>Fis No</th><td><input name=f size=12></td></tr><tr><th>Yevmiye No</th><td><input name=y size=12></td></tr><tr height=5><td colspan=2></td></tr>')
wh.document.write('<tr><th> </th><td><input type=submit value=Tamam>&nbsp;<input type=button value=Iptal onClick="window.close()"></td></tr></table></form></body></html>')
wh.document.close()
wh.focus()
wh.document.h.f.focus()
return false;}

function _onKeyUP(){ // body icin
if(event.keyCode==17)ctrl=0;
}

function _onKeyDOWN(){ // body icin
if(event.keyCode==17)ctrl=1;
if(ctrl && event.keyCode==89){ctrl=0;return editFis();}
}

var cmbs=[['[Hepsi]','Mahsup','Tahsil','Tediye','Kapanis','Acilis'],['[Hepsi]','Onaysiz','Onayli','Muhasebelesmis','Gecersiz'],['Fis No','Yevmiye No','Tarih','Durum, Fis No','Tutar'],['25','50','100','250']];

function ld_CMB(box, num, sel){
var ser=cmbs[num];
var i=0,j=ser.length;
while(i<j){
box.options[i-1]=new Option(ser[i],i);
if(sel==i)box.options.selectedIndex=i;i++;}}

function ld_CMB2(box, ser, sel){
var i=0,j=ser.length-1;
while(i<j){
box.options[i-1]=new Option(ser[i][1],ser[i][0]);
if(sel==ser[i][0])box.options.selectedIndex=i;i++;}}

function showHesapPlan(){
var wh=window.open("hesapPlan.htm","hp",gcr(640,480));
wh.focus();return false;}

function showHelp(hlp,toc){
toc=!toc?'':'#'+toc
window.open('../help/'+hlp+'Help.html'+toc,'mva_help',gcr(450,480)).focus()
return false}
