   var ie=document.all;
   var dom=document.getElementById;
   var ns4=document.layers;
   var tarih=new Date();
   var CurrencyDigit=",";
   var DateFormat="7";   
   var PersonelId="70";
   var NotFoundStr=" BULUNAMADI!";
   var TrMouseOnMoveColor="#CCFFCC";
   var AutoSaveTimeMinute="10";
   
function dsOpenClose(){
		if(document.all.DetailSearch.style.display == 'block'){
			document.all.DetailSearch.style.display='none';
			document.getElementById("DetailSearchImage").src = 'images/down.gif';			

		}else{		
			document.all.DetailSearch.style.display='block';
			document.getElementById("DetailSearchImage").src = 'images/up.gif';
		}	
}






function PopUp(whatURL,uz,yu) {
        var win = window.open( whatURL,"ProjView","scrollbars=no,toolbar=no,status=no,width="+uz+",height="+yu+"");
					if(window.focus)
				{
					win.focus()
				}	
}
function PopUp2(whatURL,uz,yu) {
        var win = window.open( whatURL,"ProjView","scrollbars=yes,toolbar=no,status=no,width="+uz+",height="+yu+"");
					if(window.focus)
				{
					win.focus()
				}	
}

function pop(res,w,h,a){
	if(win){
	win.close();
	}
        LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
        TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
        settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars=no,resizable=no';
       var win = window.open('',"win",settings);
        var html = "<html><head><title>"+ a +"</title><META HTTP-EQUIV=imagetoolbar CONTENT=no></head><body onload='resizeto(document.all.resim.width,document.all.resim.height)' leftmargin=0 topmargin=0 marginwidth=0 marginheight=0 scroll=no><img style='cursor:pointer;' src="+ res +" width="+ w +" height="+ h +" onclick='self.close()' id='resim' alt='Kapatmak İçin Tıklayın' GALLERYIMG='no' onerror='alert(\"Hata Resim Yuklenemiyor.Lütfen Tekrar Deneyin Yada Sistem Adminleri İle İrtibata Geçin.Pencere Kapatılacak\");window.close();'>";
		html += "</body></html>";
		win.document.open();
		win.document.write(html);
		win.document.close();
}

function popup2(res,w,h,a){
	if(win){
	win.close();
	}
        LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
        TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
        settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars=no,resizable=no';
        var win = window.open('',"win",settings);
        var html = "<html><head><title>"+ a +"</title><META HTTP-EQUIV=imagetoolbar CONTENT=no></head><body onload='resizeto("+w+","+h+")' leftmargin=0 topmargin=0 marginwidth=0 marginheight=0 scroll=no>";
		html += "</body></html>";
		win.document.open();
		win.document.write(html);
		win.document.close();
}














var n;
var p;
var p1;
function ValidatePhone(n){
p=p1.value
if(p.length==3){
	//d10=p.indexOf('(')
	pp=p;
	d4=p.indexOf('(')
	d5=p.indexOf(')')
	if(d4==-1){
		pp="("+pp;
	}
	if(d5==-1){
		pp=pp+")";
	}
	//pp="("+pp+")";
	p1.value="";
	p1.value=pp;
}
if(p.length>3){
	d1=p.indexOf('(')
	d2=p.indexOf(')')
	if (d2==-1){
		l30=p.length;
		p30=p.substring(0,4);
		//alert(p30);
		p30=p30+")"
		p31=p.substring(4,l30);
		pp=p30+p31;
		//alert(p31);
		p1.value="";
		p1.value=pp;
	}
	}
if(p.length>7){
	p11=p.substring(d1+1,d2);
	if(p11.length>3){
	p12=p11;
	l12=p12.length;
	l15=p.length
	//l12=l12-3
	p13=p11.substring(0,3);
	p14=p11.substring(3,l12);
	p15=p.substring(d2+1,l15);
	p1.value="";
	pp="("+p13+")"+p14+p15;
	p1.value=pp;
	//obj1.value="";
	//obj1.value=pp;
	}
	l16=p.length;
	p16=p.substring(d2+1,l16);
	l17=p16.length;
	if(l17>3&&p16.indexOf('-')==-1){
		p17=p.substring(d2+1,d2+4);
		p18=p.substring(d2+4,l16);
		p19=p.substring(0,d2+1);
		//alert(p19);
	pp=p19+p17+"-"+p18;
	p1.value="";
	p1.value=pp;
	
	//obj1.value="";
	//obj1.value=pp;
	}
	//p1.value= p1.value.substring(5,5);
}
//}
setTimeout(ValidatePhone,100)
}

function getIt(m){

n=m.name;
//p1=document.forms[0].elements[n]
p1=m
ValidatePhone(n)

}



/***********************************************
* Switch Menu script- by Martial B of http://getElementById.com/
* Modified by Dynamic Drive for format & NS4/IE4 compatibility
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

var persistmenu="yes" //"yes" or "no". Make sure each SPAN content contains an incrementing ID starting at 1 (id="sub1", id="sub2", etc)
var persisttype="sitewide" //enter "sitewide" for menu to persist across site, "local" for this page only

if (document.getElementById){ //DynamicDrive.com change
document.write('<style type="text/css">\n')
document.write('.submenu{display: none;}\n')
document.write('</style>\n')
}

function SwitchMenu(obj){
	if(document.getElementById){
	var el = document.getElementById(obj);
	var ar = document.getElementById("masterdiv").getElementsByTagName("span"); //DynamicDrive.com change
		if(el.style.display != "block"){ //DynamicDrive.com change
			for (var i=0; i<ar.length; i++){
				if (ar[i].className=="submenu") //DynamicDrive.com change
				ar[i].style.display = "none";
			}
			el.style.display = "block";
		}else{
			el.style.display = "none";
		}
	}
}

function get_cookie(Name) { 
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) { 
offset += search.length
end = document.cookie.indexOf(";", offset);
if (end == -1) end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}

function onloadfunction(){
if (persistmenu=="yes"){
var cookiename=(persisttype=="sitewide")? "switchmenu" : window.location.pathname
var cookievalue=get_cookie(cookiename)
if (cookievalue!="")
document.getElementById(cookievalue).style.display="block"
}
}

function savemenustate(){
var inc=1, blockid=""
while (document.getElementById("sub"+inc)){
if (document.getElementById("sub"+inc).style.display=="block"){
blockid="sub"+inc
break
}
inc++
}
var cookiename=(persisttype=="sitewide")? "switchmenu" : window.location.pathname
var cookievalue=(persisttype=="sitewide")? blockid+";path=/" : blockid
document.cookie=cookiename+"="+cookievalue
}





function check() {
  var ext = document.f.pic.value;
  ext = ext.substring(ext.length-3,ext.length);
  ext = ext.toLowerCase();
  if(ext != 'jpg') {
    alert('You selected a .'+ext+
          ' file; please select a .jpg file instead!');
    return false; }
  else
    return true; }

