/********************************************************************************/
/*                                                                              */
/*  Copyright (c) 2007 Masters                                                  */
/*                                                                              */
/*  Powered By Orhan POLAT                                                      */
/*                                                                              */
/********************************************************************************/

function layer(status,dialog,w,h,t,buttons){if(!document.getElementById(dialog)){alert('Dialog bulunamadı!');return false;}var modalDialogId='modalDialog';if(status=="show"){if(!w|| !h|| !t){alert('Dialog verileri eksik!');return false;}document.body.style.overflow='hidden';if(!document.getElementById('shadow')){var shadow=document.createElement('div');shadow.id='shadow';shadow.style.position='absolute';shadow.style.top='0';shadow.style.left='0';shadow.style.zIndex='1000';shadow.style.textAlign='center';shadow.style.backgroundColor='#000000';shadow.style.width=document.body.clientWidth+'px';shadow.style.height=document.body.clientHeight+'px';if(navigator.appName=="Microsoft Internet Explorer"){shadow.style.filter='alpha(opacity=60)';}else{shadow.style.opacity='0.6';shadow.style.mozOpacity='0.6';}document.body.appendChild(shadow);}if(!document.getElementById(modalDialogId)){var modalDialog=document.createElement('div');modalDialog.id=modalDialogId;modalDialog.className='dialog';modalDialog.style.position='absolute';modalDialog.style.zIndex='1001';modalDialog.style.width=w;modalDialog.style.height=h;var modalDialogHeader=document.createElement('div');modalDialogHeader.id=modalDialogId+'Header';modalDialogHeader.className='dialogheader';modalDialogHeader.style.position='relative';modalDialogHeader.style.height='25px';modalDialogHeader.style.overflow='hidden';modalDialogHeader.style.textAlign='left';var modalDialogHeaderMove=document.createElement('div');modalDialogHeaderMove.onmouseover=new Function('dragover=true;');modalDialogHeaderMove.onmouseout=new Function('dragover=false;');modalDialogHeaderMove.style.position='absolute';modalDialogHeaderMove.style.cursor='move';modalDialogHeaderMove.style.top='0';modalDialogHeaderMove.style.left='0';modalDialogHeaderMove.style.width=(w-35)+'px';modalDialogHeaderMove.style.height='25px';var modalDialogHeaderTitle=document.createElement('span');modalDialogHeaderTitle.style.paddingLeft='10px';modalDialogHeaderTitle.style.lineHeight='25px';modalDialogHeaderTitle.innerHTML=t;var modalDialogHeaderClose=document.createElement('div');modalDialogHeaderClose.style.position='absolute';modalDialogHeaderClose.style.top='5px';modalDialogHeaderClose.style.right='10px';modalDialogHeaderClose.innerHTML='<a href="javascript:void(0);" onclick="layer(\'hide\', \''+dialog+'\')"><img src="objects/sysicons/close.gif" width="16" height="16" align="absmiddle" border="0" hspace="0" alt="Kapat"/></a>';modalDialogHeader.appendChild(modalDialogHeaderMove);modalDialogHeader.appendChild(modalDialogHeaderTitle);modalDialogHeader.appendChild(modalDialogHeaderClose);var modalDialogBody=document.createElement('div');modalDialogBody.id=modalDialogId+'Body';modalDialogBody.style.position='relative';modalDialogBody.style.height=(h-(buttons?(buttons.height?buttons.height:40)+25:25))+'px';modalDialogBody.style.textAlign='left';var modalDialogBodyHTML=document.createElement('div');modalDialogBodyHTML.style.position='absolute';modalDialogBodyHTML.style.top='5px';modalDialogBodyHTML.style.left='5px';modalDialogBodyHTML.style.borderTop='2px solid #FFFFFF';modalDialogBodyHTML.style.borderLeft='2px solid #FFFFFF';modalDialogBodyHTML.style.borderRight='2px solid #999999';modalDialogBodyHTML.style.borderBottom='2px solid #999999';modalDialogBodyHTML.style.width=(w-14)+'px';modalDialogBodyHTML.style.height=((h-(buttons?(buttons.height?buttons.height:40)+25:25))-14)+'px';modalDialogBodyHTML.style.overflow='auto';modalDialogBodyHTML.appendChild(document.getElementById(dialog));modalDialogBody.appendChild(modalDialogBodyHTML);if(buttons){var modalDialogFooter=document.createElement('div');modalDialogFooter.id=modalDialogId+'Footer';;modalDialogFooter.style.position='relative';modalDialogFooter.style.height=(buttons.height?buttons.height:40)+'px';modalDialogFooter.style.overflow='hidden';var h='<table width="100%" border="0" cellpadding="5" cellspacing="0">\n';h+='<tr><td align="'+(buttons.align?buttons.align:'right')+'" height="100%">\n';switch(buttons.type){case 'YESNO':h+='<input type="button" id="'+modalDialogId+'BtnYes" name="'+modalDialogId+'BtnYes" value="'+(buttons.labelYES?buttons.labelYES:'Evet')+'" onclick="'+((buttons.functionYES)?buttons.functionYES:'')+'">\n';h+='<input type="button" id="'+modalDialogId+'BtnNo" name="'+modalDialogId+'BtnNo" value="'+(buttons.labelNO?buttons.labelNO:'Hayır')+'" onclick="'+((buttons.functionNO)?buttons.functionNO:'')+'">\n';break;case 'YESNOCANCEL':h+='<input type="button" id="'+modalDialogId+'BtnYes" name="'+modalDialogId+'BtnYes" value="'+(buttons.labelYES?buttons.labelYES:'Evet')+'" onclick="'+((buttons.functionYES)?buttons.functionYES:'')+'">\n';h+='<input type="button" id="'+modalDialogId+'BtnNo" name="'+modalDialogId+'BtnNo" value="'+(buttons.labelNO?buttons.labelNO:'Hayır')+'" onclick="'+((buttons.functionNO)?buttons.functionNO:'')+'">\n';h+='<input type="button" id="'+modalDialogId+'BtnCancel" name="'+modalDialogId+'BtnCancel" value="'+(buttons.labelCANCEL?buttons.labelCANCEL:'İptal')+'" onclick="'+((buttons.functionCANCEL)?buttons.functionCANCEL:'')+'">\n';break;case 'OKCANCEL':h+='<input type="button" id="'+modalDialogId+'BtnOK" name="'+modalDialogId+'BtnOK" value="'+(buttons.labelOK?buttons.labelOK:'Tamam')+'" onclick="'+((buttons.functionOK)?buttons.functionOK:'')+'">\n';h+='<input type="button" id="'+modalDialogId+'BtnCancel" name="'+modalDialogId+'BtnCancel" value="'+(buttons.labelCANCEL?buttons.labelCANCEL:'İptal')+'" onclick="'+((buttons.functionCANCEL)?buttons.functionCANCEL:'')+'">\n';break;case 'SAVECANCEL':h+='<input type="button" id="'+modalDialogId+'BtnSave" name="'+modalDialogId+'BtnSave" value="'+(buttons.labelSAVE?buttons.labelSAVE:'Kaydet')+'" onclick="'+((buttons.functionSAVE)?buttons.functionSAVE:'')+'">\n';h+='<input type="button" id="'+modalDialogId+'BtnCancel" name="'+modalDialogId+'BtnCancel" value="'+(buttons.labelCANCEL?buttons.labelCANCEL:'İptal')+'" onclick="'+((buttons.functionCANCEL)?buttons.functionCANCEL:'')+'">\n';break;case "OK":h+='<input type="button" id="'+modalDialogId+'BtnOK" name="'+modalDialogId+'BtnOK" value="'+(buttons.labelOK?buttons.labelOK:'Tamam')+'" onclick="'+((buttons.functionOK)?buttons.functionOK:'')+'">\n';break;default:h+=buttons.html?buttons.html:'';}h+='</td></tr>\n';h+='</table>\n';modalDialogFooter.innerHTML=h;}modalDialog.appendChild(modalDialogHeader);modalDialog.appendChild(modalDialogBody);if(buttons)modalDialog.appendChild(modalDialogFooter);document.body.appendChild(modalDialog);document.getElementById(dialog).style.display='block';}centerModalDialog();}else{document.body.style.overflow='auto';if(document.getElementById('shadow')){document.body.removeChild(document.getElementById('shadow'));}if(document.getElementById(modalDialogId)){document.getElementById(dialog).style.display='none';document.body.appendChild(document.getElementById(dialog));document.body.removeChild(document.getElementById(modalDialogId));}resetform(dialog+'form');}hideshowbehind(null,'shadow');showall(dialog);if(status=='show'){setfocus(modalDialogId);}};function centerModalDialog(){if(document.getElementById('modalDialog')){var shadow=document.getElementById('shadow');shadow.style.width=document.body.clientWidth;shadow.style.height=document.body.clientHeight;var w=document.getElementById('modalDialog').style.width;var h=document.getElementById('modalDialog').style.height;w=w.replace('px','');h=h.replace('px','');document.getElementById('modalDialog').style.left=(document.body.clientWidth/2)-(w/2)+document.body.scrollLeft;document.getElementById('modalDialog').style.top=(document.body.clientHeight/2)-(h/2)+document.body.scrollTop;}};function setfocus(dialog){if(document.getElementById(dialog)&&(document.getElementById(dialog).style.display!='none')){var el=document.getElementById(dialog).getElementsByTagName('input');for(var i=(el.length-1);i> -1;i--){if((el[i].type=='button')||(el[i].type=='submit')){el[i].focus();break;}}}};function messageDialog(message,properties,act){if(act&&(act=='hide')){if(document.getElementById('messageDialog')){layer('hide','messageDialog');document.body.removeChild(document.getElementById('messageDialog'));}return false;}if(document.getElementById('messageDialog'))document.body.removeChild(document.getElementById('messageDialog'));var im=(properties.icon?'<img src="objects/sysicons/'+properties.icon+'" width="32" height="32" alt="Simge" align="absmiddle" border="0" hspace="5"/>':'');var h='<table width="100%" height="100%" border="0" cellpadding="5" cellspacing="0">\n';h+='<tr>\n';h+='<td align="center">'+im+message+'</td>\n';h+='</tr>\n';h+='</table>\n';var el=document.createElement('div');el.id='messageDialog';el.innerHTML=h;document.body.appendChild(el);switch(properties.type){case "YESNO":layer('show','messageDialog',400,160,(properties.title?properties.title:'Mesaj'),{type:'YESNO',labelYES:(properties.labelYES?properties.labelYES:'Evet'),labelNO:(properties.labelNO?properties.labelNO:'Hayır'),height:35,align:'center',functionYES:'layer(\'hide\', \'messageDialog\');'+(properties.functionYES?' '+properties.functionYES:''),functionNO:'layer(\'hide\', \'messageDialog\');'+(properties.functionNO?' '+properties.functionNO:'')});break;default:layer('show','messageDialog',400,160,(properties.title?properties.title:'Mesaj'),{type:'OK',labelOK:(properties.labelOK?properties.labelOK:'Tamam'),height:35,align:'center',functionOK:'layer(\'hide\', \'messageDialog\');'+(properties.functionOK?' '+properties.functionOK:'')});}};function processingModalDialog(status,text){if(!document.getElementById("processModalDialog")){var processDialog=document.createElement('div');processDialog.id='processModalDialog';processDialog.style.display='none';processDialog.style.textAlign='center';processDialog.style.fontWeight='bold';processDialog.innerHTML=result;document.body.appendChild(processDialog);}if(document.getElementById("processModalDialog")){if(status=="show"){var result='<table width="100%" height="95" border="0" cellpadding="0" cellspacing="0">\n';result+='<tr><td align="center">\n';if(text){result+=text;}else{result+='<img src="objects/sysicons/indicator.gif" width="16" height="16" alt="Yükleniyor" border="0" align="absmiddle" vspace="5" hspace="5"/> İşlem yapılıyor..';result+='<div style="color:#FF0000; font-weight:bold; line-height:30px">Lütfen bekleyin</div>';}result+='</td></tr>\n';result+='</table>';document.getElementById("processModalDialog").innerHTML=result;if(document.getElementById("processModalDialog").style.display=='none'){layer('show','processModalDialog',350,120,'İşlem Yapılıyor..');}}else{if(document.getElementById('processModalDialog')&&(document.getElementById("processModalDialog").style.display=='block')){layer('hide','processModalDialog');}}}};function warningModalDialog(status,type,message){if(status=='show'){switch(type){case "warning":var color='#FF0000';break;case "caution":var color='#5eb500';break;default:var color='#999999';}var target=document.getElementById('warningDialog');if(!target){var el=document.createElement('div');el.id='warningDialog';el.style.position='absolute';el.style.backgroundColor=color;el.style.width='300px';el.style.height='50px';el.style.left=(document.body.clientWidth/2)-150+document.body.scrollLeft;el.style.top=(document.body.clientHeight/2)-25+document.body.scrollTop;el.style.overflow='hidden';el.style.border='2px outset #999999';el.style.zIndex='100';var r='<table width="100%" border="0" cellpadding="5" cellspacing="0">\n';r+='<tr><td id="warningDialogText" align="center" style="height:50px; color:#FFFFFF; font-weight:bold; font-size:12px">\n';r+=message;r+='</td></tr>\n';r+='</table>';el.innerHTML=r;document.body.appendChild(el);}else{document.getElementById('warningDialogText').innerHTML=message;document.getElementById('warningDialogText').style.backgroundColor=color;}}else{var target=document.getElementById('warningDialog');if(target){document.body.removeChild(target);}}hideshowbehind('content','warningDialog');};function showall(dialog){var source=document.getElementById(dialog);if(source){var tags=new Array('applet','iframe','select');for(var k=0;k<tags.length;k++){var ar=source.getElementsByTagName(tags[k]);var cc=null;for(var i=0;i<ar.length;i++){cc=ar[i];cc.style.visibility='visible';}}}};function resetform(formname){if(document.forms[formname]){document.forms[formname].reset();}};function hideshowbehind(sourcename,targetname){var tags=new Array('object','applet','iframe','select');var source=document.getElementById(sourcename);var target=document.getElementById(targetname);if(navigator.appName!="Microsoft Internet Explorer"){return false;}if(target){var p=getposition(target);var EX1=p.x;var EX2=target.offsetWidth+EX1;var EY1=p.y;var EY2=target.offsetHeight+EY1;}else{var EX1=0;var EX2=0;var EY1=0;var EY2=0;}for(var k=0;k<tags.length;k++){if(source){var ar=source.getElementsByTagName(tags[k]);}else{var ar=document.getElementsByTagName(tags[k]);}var cc=null;for(var i=0;i<ar.length;i++){cc=ar[i];p=getposition(cc);var CX1=p.x;var CX2=cc.offsetWidth+CX1;var CY1=p.y;var CY2=cc.offsetHeight+CY1;if((CX1>EX2)||(CX2<EX1)||(CY1>EY2)||(CY2<EY1)){cc.style.visibility='visible';}else{cc.style.visibility='hidden';}}}};function getposition(el){var r={x:el.offsetLeft,y:el.offsetTop};if(el.offsetParent){var tmp=getposition(el.offsetParent);r.x+=tmp.x;r.y+=tmp.y;}return r;};N=(document.all)?0:1;var ob;var dragover=false;function MD(e){if(dragover){if(N){ob=document.getElementById('modalDialog');X=e.layerX;Y=e.layerY;return false;}else{ob=document.getElementById('modalDialog');ob=ob.style;X=event.offsetX;Y=event.offsetY;}}};function MM(e){if(ob){if(N){ob.style.top=e.pageY-Y;ob.style.left=e.pageX-X;}else{ob.pixelLeft=event.clientX-X+document.body.scrollLeft;ob.pixelTop=event.clientY-Y+document.body.scrollTop;return false;}}};function MU(){ob=null;};if(window.addEventListener){window.addEventListener('mousedown',MD,false);window.addEventListener('mousemove',MM,false);window.addEventListener('mouseup',MU,false);}else if(document.attachEvent){document.attachEvent('onmousedown',MD);document.attachEvent('onmousemove',MM);document.attachEvent('onmouseup',MU);} 
