/**
 * Genel Fonksiyonlar
 * Author: Orhan POLAT
 * Powered By: Masters 2008
 */
self.name="masters";
function overRow(obj,cl){var target=obj.parentNode.getElementsByTagName('td');for(var i=0;i<target.length;i++){target[i].className=cl;}}
function paging(pos,totalRec,start,limit,fn,target,extra){var result='';var total=parseInt(totalRec);var x=parseInt(start);var y=parseInt(limit);var sy=(pos=='top')?'y1':'y2';var labels={'first':((extra&&extra.first)?extra.first:'Ýlk'),'previous':((extra&&extra.previous)?extra.previous:'Önceki'),'next':((extra&&extra.next)?extra.next:'Sonraki'),'last':((extra&&extra.last)?extra.last:'Son'),'total':((extra&&extra.total)?extra.total:'Toplam')};var first_id=0;var prev_id=x-y;var next_id=x+y;var last_id=total-(((total%y)==0)?y:(total%y));if(first_id==x){var show_first='<span style="color:#CCCCCC">'+labels.first+'</span>\n';}else{var show_first='<a href="javascript:void(0)" title="'+labels.first+'" onclick="'+fn+'({x:0, y:document.getElementById(\''+sy+'\').options[document.getElementById(\''+sy+'\').selectedIndex].value}'+(target?', \''+target+'\'':'')+')">'+labels.first+'</a>\n';}if(x>0){var show_prev='<a href="javascript:void(0)" title="'+labels.previous+'" onclick="'+fn+'({x:'+prev_id+', y:document.getElementById(\''+sy+'\').options[document.getElementById(\''+sy+'\').selectedIndex].value}'+(target?', \''+target+'\'':'')+')">'+labels.previous+'</a>\n';}else{var show_prev='<span style="color:#CCCCCC">'+labels.previous+'</span>\n';}if(x<(total-y)){var show_next='<a href="javascript:void(0)" title="'+labels.next+'" onclick="'+fn+'({x:'+next_id+', y:document.getElementById(\''+sy+'\').options[document.getElementById(\''+sy+'\').selectedIndex].value}'+(target?', \''+target+'\'':'')+')">'+labels.next+'</a>\n';}else{var show_next='<span style="color:#CCCCCC">'+labels.next+'</span>\n';}if((x>=(total-y))||(y>=total)){var show_last='<span style="color:#CCCCCC">'+labels.last+'</span>\n';}else{var show_last='<a href="javascript:void(0)" title="'+labels.last+'" onclick="'+fn+'({x:'+last_id+', y:document.getElementById(\''+sy+'\').options[document.getElementById(\''+sy+'\').selectedIndex].value}'+(target?', \''+target+'\'':'')+')">'+labels.last+'</a>\n';}var position=(x+1)+' - '+(x+y);var pages_keys=new Array();var pages_values=new Array();for(i=0;i<Math.ceil(total/y);i++){pages_keys[i]=(i*y);pages_values[i]=(i+1);}if(pos=='top'){result+='<table width="100%" border="0" cellpadding="5" cellspacing="0">\n'+'<tr>\n'+'<td width="33%">\n'+'<select id="'+sy+'" name="'+sy+'" onchange="'+fn+'({x:0, y:document.getElementById(\''+sy+'\').options[document.getElementById(\''+sy+'\').selectedIndex].value}'+(target?', \''+target+'\'':'')+')">\n'+'<option value="10"'+(y==10?' selected':'')+'>10<\/option>\n'+'<option value="20"'+(y==20?' selected':'')+'>20<\/option>\n'+'<option value="30"'+(y==30?' selected':'')+'>30<\/option>\n'+'<option value="50"'+(y==50?' selected':'')+'>50<\/option>\n'+'<\/select>\n'+'<\/td>\n'+'<td width="34%" align="center">\n'+labels.total+': '+total+' | '+position+'<\/td>\n'+'<td width="33%" align="right">\n'+show_first+' | '+show_prev+' | '+show_next+' | '+show_last+'<\/td>\n'+'<\/tr>\n'+'<\/table>\n';}else{result+='<table width="100%" border="0" cellpadding="5" cellspacing="0">\n'+'<tr>\n'+'<td width="33%">\n'+'<select id="'+sy+'" name="'+sy+'" onchange="'+fn+'({x:0, y:document.getElementById(\''+sy+'\').options[document.getElementById(\''+sy+'\').selectedIndex].value}'+(target?', \''+target+'\'':'')+')">\n'+'<option value="10"'+(y==10?' selected':'')+'>10<\/option>\n'+'<option value="20"'+(y==20?' selected':'')+'>20<\/option>\n'+'<option value="30"'+(y==30?' selected':'')+'>30<\/option>\n'+'<option value="50"'+(y==50?' selected':'')+'>50<\/option>\n'+'<\/select>\n'+'<\/td>\n'+'<td width="34%" align="center">\n'+'<select id="ypaging" name="ypaging" onchange="'+fn+'({x:this.options[this.selectedIndex].value, y:document.getElementById(\''+sy+'\').options[document.getElementById(\''+sy+'\').selectedIndex].value}'+(target?', \''+target+'\'':'')+')">\n';for(var t=0;t<pages_keys.length;t++){result+='<option value="'+pages_keys[t]+'"'+(pages_keys[t]==x?' selected':'')+'>'+pages_values[t]+'<\/option>\n';}result+='<\/select>\n'+'<\/td>\n'+'<td width="33%" align="right">\n'+show_first+' | '+show_prev+' | '+show_next+' | '+show_last+'<\/td>\n'+'<\/tr>\n'+'<\/table>\n';}return result;}
function bubble(status,tx,wi,he,obj){var targetID='bubble';if(status&&(status=='hide')){if(document.getElementById(targetID)){document.body.removeChild(document.getElementById(targetID));}hideshowbehind('content',targetID);return false;}if(document.getElementById(targetID))document.body.removeChild(document.getElementById(targetID));var pos=getPosition(obj);var w=(wi)?wi:200;var h=(he)?he:50;var html='<table width="100%" border="0" cellpadding="0" cellspacing="0">\n'+'<tr>\n'+'<td width="6"><img src="objects/sysicons/bubble/bubble_left_top.gif" border="0" width="6" height="6" alt=""><\/td>\n'+'<td style="background:url(objects/sysicons/bubble/bubble_top.gif)"><img src="objects/sysicons/bubble/spacer.gif" border="0" width="1" height="6" alt=""><\/td>\n'+'<td width="6"><img src="objects/sysicons/bubble/bubble_right_top.gif" border="0" width="6" height="6" alt=""><\/td>\n'+'<\/tr>\n'+'<tr>\n'+'<td width="6" style="background:url(objects/sysicons/bubble/bubble_left.gif)"><img src="objects/sysicons/bubble/spacer.gif" border="0" width="6" height="1" alt=""><\/td>\n'+'<td style="background-color:#ffffe1" align="center" height="'+h+'">\n'+tx+'\n'+'<\/td>\n'+'<td width="6" style="background:url(objects/sysicons/bubble/bubble_right.gif)"><img src="objects/sysicons/bubble/spacer.gif" border="0" width="6" height="1" alt=""><\/td>\n'+'<\/tr>\n'+'<tr>\n'+'<td width="6"><img src="objects/sysicons/bubble/bubble_left_bottom.gif" border="0" width="6" height="6" alt=""><\/td>\n'+'<td style="background:url(objects/sysicons/bubble/bubble_bottom.gif)"><img src="objects/sysicons/bubble/spacer.gif" border="0" width="1" height="6" alt=""><\/td>\n'+'<td width="6"><img src="objects/sysicons/bubble/bubble_right_bottom.gif" border="0" width="6" height="6" alt=""><\/td>\n'+'<\/tr>\n'+'<\/table>\n'+'<div style="position:absolute; right:15px; bottom:-20px"><img src="objects/sysicons/bubble/bubble_pointer.gif" border="0" width="20" height="21" alt=""><\/div>\n';var dv=document.createElement('div');dv.id=targetID;dv.style.cssText='position:absolute; z-index:100002; width:'+w+'px;';dv.style.left=(pos.x-w+15)+'px';dv.style.top=(pos.y-h-25)+'px';dv.innerHTML=html;document.body.appendChild(dv);hideshowbehind('content',targetID);return true;}
function listRow(listname,action,oldclass){switch(action){case"out":if(oldclass=="gridRowOver"){var a="gridRow";}else{var a=oldclass;}break;case"select":if(oldclass=="rowSelected"){var a="gridRow";}else{var a="rowSelected";}break;default:if(oldclass=="rowSelected"){var a="rowSelected";}else{var a="gridRowOver";}}for(var i=1;i<10;i++){if(document.getElementById(listname+'-'+i)){document.getElementById(listname+'-'+i).className=a;}else{break;}}}
function changeAction(formName,newAction){var x=eval('document.'+formName);x.action=newAction;}
function trim(pString){pString=pString.replace(/^[\s]+/,'');pString=pString.replace(/[\s]+$/,'');return pString;}
function buyut(formName){if(document.forms[formName]){var f=document.forms[formName];for(var i=0;i<f.elements.length;i++){tempObject=f.elements[i];if(tempObject&&tempObject.type&&(tempObject.type.toLowerCase()=='text'||tempObject.type.toLowerCase()=='textarea')){tempObject.value=trim(tempObject.value);tempObject.value=tempObject.value.replace(/i/g,"ï¿½");tempObject.value=tempObject.value.toUpperCase();}}}}
function onlyNum(e){var numbers=new Array(12);numbers[8]=8;numbers[9]=9;numbers[46]=46;numbers[48]=48;numbers[49]=49;numbers[50]=50;numbers[51]=51;numbers[52]=52;numbers[53]=53;numbers[54]=54;numbers[55]=55;numbers[56]=56;numbers[57]=57;var k=e.keyCode?e.keyCode:e.charCode;if(!numbers[k]){return false;}else{return true;}}
function hideshowbehind(sourcename,targetname){var tags=new Array('object','applet','iframe');var source=document.getElementById(sourcename);var target=document.getElementById(targetname);if(navigator.appName=="Microsoft Internet Explorer"){tags.push('select');}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 popup(url,width,height){window.open(url,"popup","width="+width+",height="+height+",resizable=no,status=no,scrollbars=yes")}
function popup2(url,width,height){window.open(url,"popup","width="+width+",height="+height+",resizable=yes,status=no,scrollbars=yes")}
function dialog(url,width,height){showModalDialog(url,window.dialogArguments,"dialogWidth: "+width+"px; dialogHeight: "+height+"px; help: 0; status: 0; resizable:0; center:1")}
function checkthis(checkbox,listname){if(checkbox.checked){for(var i=1;i<10;i++){if(document.getElementById(listname+'-'+i)){document.getElementById(listname+'-'+i).className="rowSelected";}else{break;}}}else{for(var i=1;i<10;i++){if(document.getElementById(listname+'-'+i)){document.getElementById(listname+'-'+i).className="gridRow";}else{break;}}}}
function checkAll(all,formName){if(document.forms[formName]){var path=document.forms[formName];}else{return false;}var y=1;for(var i=0;i<path.elements.length;i++){if((i>0)&(path.elements[i].type=="checkbox")&(path.elements[i].name!=all.name)){if(all.checked){path.elements[i].checked=true;listname=formName+y;for(var t=1;t<10;t++){if(document.getElementById(listname+'-'+t)){document.getElementById(listname+'-'+t).className="rowSelected";}else{break;}}}else{path.elements[i].checked=false;listname=formName+y;for(var t=1;t<10;t++){if(document.getElementById(listname+'-'+t)){document.getElementById(listname+'-'+t).className="gridRow";}else{break;}}}y++;}}return true;}
function checkIfAll(all,formName){if(document.forms[formName]){var path=document.forms[formName];}else{return false;}var x=0;var y=0;for(var i=0;i<path.elements.length;i++){if(path.elements[i].type=="checkbox"){if((path.elements[i].checked)&(path.elements[i].id!="checkall")){x++;}if((path.elements[i].id!="checkall")){y++;}}}if(y==x){document.getElementById("checkall").checked=true;}else{document.getElementById("checkall").checked=false;}return true;}
function checkFields(formName){var path=formName;for(var i=0;i<path.elements.length;i++){if(path.elements[i].type=="checkbox"){if(path.elements[i].checked){if(confirm('Silmek istediï¿½inize emin misiniz?')){return true;}else{return false;}}}}alert('Seï¿½im yapmalï¿½sï¿½nï¿½z!');return false;}
function html2hidden(hiddenName,editName){var h=document.getElementById(hiddenName);h.value=eval(editName).getHTMLBody();}var calendar=null;
function selected(cal,date){cal.sel.value=date;}
function closeHandler(cal){cal.hide();Calendar.removeEvent(document,"mousedown",checkCalendar);}
function checkCalendar(ev){var el=Calendar.is_ie?Calendar.getElement(ev):Calendar.getTargetElement(ev);for(;el!=null;el=el.parentNode)if(el==calendar.element||el.tagName=="A")break;if(el==null){calendar.callCloseHandler();Calendar.stopEvent(ev);}}
function showCalendar(id){var el=document.getElementById(id);if(calendar!=null){calendar.hide();calendar.parseDate(el.value);}else{var cal=new Calendar(true,null,selected,closeHandler);calendar=cal;cal.setRange(1900,2070);calendar.create();}calendar.sel=el;calendar.showAtElement(el);Calendar.addEvent(document,"mousedown",checkCalendar);return false;}
function textCounter(obj,target,maxlimit){var total=obj.value.length;var countfield=document.getElementById(target);countfield.innerHTML=total;if(total>maxlimit){obj.value=obj.value.substr(0,maxlimit);}}
function checkDate(obj){var delimChar='-';obj.value=obj.value.replace(/\./g,delimChar);obj.value=obj.value.replace(/\//g,delimChar);var mo,day,yr;var entry=obj.value;var re=/\b\d{1,2}[\/-]\d{1,2}[\/-]\d{4}\b/;if(entry.length==0){return true;}if(re.test(entry)){var delim1=entry.indexOf(delimChar);var delim2=entry.lastIndexOf(delimChar);day=parseInt(entry.substring(0,delim1));mo=parseInt(entry.substring(delim1+1,delim2));yr=parseInt(entry.substring(delim2+1));var testDate=new Date(yr,mo-1,day);if((testDate.getDate()==day)&&(testDate.getMonth()+1==mo)&&(testDate.getFullYear()==yr)){return true;}}return false;}
function commafy(inpValue){var re=/(\d+)(\d{3})/;while(re.test(inpValue)){inpValue=eval('inpValue.replace(re, "$1.$2")');}return inpValue;}
function deCommafy(inpValue){var re=eval('/\\./g');return inpValue.replace(re,'');}
function formatCurrency(inpObj){inpValue=inpObj.value;var fromIndex=0;var toIndex=0;ytlVal=inpValue;var unformattedString=deCommafy(ytlVal);if(unformattedString.length>9){unformattedString=unformattedString.substring(0,9);}if(!isNaN(parseInt(unformattedString,10))){unformattedString=parseInt(unformattedString,10).toString();}else{inpObj.value='';inpObj.focus();return;}inpObj.value=commafy(unformattedString);}
function parseUri(str){var o={strictMode:false,key:["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],q:{name:"queryKey",parser:/(?:^|&)([^&=]*)=?([^&]*)/g},parser:{strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/}},m=o.parser[o.strictMode?"strict":"loose"].exec(str),uri={},i=14;while(i--)uri[o.key[i]]=m[i]||"";uri[o.q.name]={};uri[o.key[12]].replace(o.q.parser,function($0,$1,$2){if($1)uri[o.q.name][$1]=$2;});return uri;};
function getEl(id){return document.getElementById(id);}