var highlightcolor="#D5E0E7"
var ns6=document.getElementById&&!document.all
var previous=''
var eventobj

//Regular expression to highlight only form elements
var intended=/INPUT|TEXTAREA|SELECT|OPTION/

//Function to check whether element clicked is form element
function checkel(which){
if (which.style&&intended.test(which.tagName)){
if (ns6&&eventobj.nodeType==3)
eventobj=eventobj.parentNode.parentNode
return true
}
else
return false
}

//Function to highlight form element
function highlight(e){
eventobj=ns6? e.target : event.srcElement
if (previous!=''){
if (checkel(previous))
previous.style.backgroundColor=''
previous=eventobj
if (checkel(eventobj))
eventobj.style.backgroundColor=highlightcolor
}
else{
if (checkel(eventobj))
eventobj.style.backgroundColor=highlightcolor
previous=eventobj
}
}


function sec(xx)
{	
	var dt=new Date();
	nocach=dt.getTime();
	var url = 'aracara.asp?'+'MARKANO='+xx+''+'&nocach='+nocach+'';	
	window.location=(url);		
}


function Amount_onkeypress() {	
	
	if(navigator.appName == "Netscape")
	{
		if (e.which <48 || e.which>57)
			return false;
	}
	else
	{
		if (window.event.keyCode<48 || window.event.keyCode>57)
			return false;
	}
	return true;
}

// --harf girişi engelliyor..

function KeyPress(what,e,max,action) {
    if (document.layers) {
        if (e.target.value.length>= max)
            eval(action);
    }
    else if (document.all) {
        if (what.value.length> (max-1))
            eval(action);
    }
}

///tezt box 3 rakamdabir .koyuyor.

function Amount_onkeyup(thisis) {
	//alert(thisis.value);
	var tempstr,newstr,str,i,str2 ;
	var commapos,aftercomma,commacount;
	i=0;
	str = thisis.value;
	if (str.indexOf(",")<0){// çalışma
	//alert(str);
	//str = str.replace(".","");
	//alert(str);
	
	while ( 15 > i) {
		str = str.replace(".","");
		i=i+1;
		}
	commacount=0;
	commapos=str.indexOf(";");
	
	if (commapos>=0) 
	{
		aftercomma=str.substr(commapos);
		str=str.substr(0,commapos);
	}
	else
		aftercomma="";
	
	if (str.length > 3) 
	{
		tempstr=str;
		newstr="";
		while (tempstr.length>3)
		{
			newstr="."+tempstr.substr(tempstr.length-3)+newstr; 
			tempstr=tempstr.substr(0,tempstr.length-3);
		}
		thisis.value = tempstr+newstr+aftercomma;
	}
	}//indexOf
	return true;
}


function Amount_onkeyupd(thisis) {
	//alert(thisis.value);
	var tempstr,newstr,str,i,str2 ;
	var commapos,aftercomma,commacount;
	i=0;
	str = thisis.value;
	if (str.indexOf(",")<0){// çalışma
	//alert(str);
	//str = str.replace(".","");
	//alert(str);
	
	while ( 15 > i) {
		str = str.replace(".","");
		i=i+1;
		}
	commacount=0;
	commapos=str.indexOf(";");
	
	if (commapos>=0) 
	{
		aftercomma=str.substr(commapos);
		str=str.substr(0,commapos);
	}
	else
		aftercomma="";
	
	if (str.length > 2) 
	{
		tempstr=str;
		newstr="";
		while (tempstr.length>2)
		{
			newstr="."+tempstr.substr(tempstr.length-2)+newstr; 
			tempstr=tempstr.substr(0,tempstr.length-2);
		}
		thisis.value = tempstr+newstr+aftercomma;
	}
	}//indexOf
	return true;
}

function chck(){
document.frm.submit();
}

function Color(nesne) 
{
	nesne.style.backgroundColor = '#DEF3EF'; nesne.style.cursor="";
}
function Colorout(nesne) 
{
	nesne.style.backgroundColor = '#FFFFFF'; nesne.style.cursor="";
}

function chck2(){

  if (document.frm.adsoyad.value == ""){
	alert( "Lütfen Adınızı ve Soyadınız Giriniz! ..." );
	document.frm.adsoyad.focus();
  }

/*
  else if ( document.frm.email.value == "" && document.frm.irtnum.value == "" ){
	alert ("Lütfen E-mail yada İrtibat Numaranızı Giriniz! ... " );
	document.frm.email.focus();
  }
*/
  
else if ( document.frm.email.value == "" ){
	alert ("Lütfen E-mail Adresinizi Giriniz! ... " );
	document.frm.email.focus();
  }

  else if ( document.frm.irtnum.value == "" ){
	alert ("Lütfen İrtibat Numaranızı Giriniz! ... " );
	document.frm.irtnum.focus();
  }


  else if ( document.frm.notlar.value == ""){
	alert ("Lütfen Bize Ulaştırmak İstediğiniz Notunuzu Giriniz! ... " );
	document.frm.notlar.focus();
  }


 else {
	document.frm.submit();
    }

}

function sfocus1(){
 	document.frm.adsoyad.focus();
}


function newwin(url,width,height)
{
	day = new Date();
	id = day.getTime();
	PageName="Page"+id
	PageName = window.open(url,id,"toolbar=0,top=0,left=0,width="+width+",height="+height+",location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=1,copyhistory=0"); 
}

function newFreeWindow(url) 
{
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(url, '" + id + "');");
	window.close();
}

function pmove(x)
{
	window.opener.location.href=x;
	window.close();
}	


function Color(nesne) {nesne.style.backgroundColor = '#DEF3EF'; nesne.style.cursor="";}
function Colorout(nesne) {nesne.style.backgroundColor = '#FFFFFF'; nesne.style.cursor="";}

function loadchart(selection , chart){
		yer = selection.options[selection.selectedIndex].value
		if (yer!="")
			document.images[chart].src = yer
			document.images[chart].width = 206
	}

//--IFrame gidiş için 

function secifrm(xx)
{	
	
	var dt=new Date();
	nocach=dt.getTime();
	var url = 'doclist.asp?'+'KategoriId='+xx+''+'&nocach='+nocach+'';	

	document.ifrm.window.location=(url);		
}



//bir textbox buyuk harfe çevirir

function convert() {
	
    document.frm.SinavAdi.value = document.frm.SinavAdi.value.toUpperCase();
}

function recchk() {

	var dt=new Date();
	nocach=dt.getTime();
	
	//alert (document.cpsw.oldpassword.value);
	
	var sifre1=document.frm.sifre1.value;
	var sifre2=document.frm.sifre2.value;

	
	if (document.frm.email.value == ""){
		alert( "Lütfen E-Mail Bilginizi Giriniz! ..." );
		document.frm.email.focus();
	}
	
	else if (sifre1 != sifre2){
		alert( "Şifrenizi Hatalı Girdiniz...Lütfen Tekrar Deneyiniz!" );
	}

	else if (sifre1 == "") {
		alert( "Lütfen Şifrenizi Giriniz ..." );
	}

	else if (sifre2 == "") {
		alert( "Lütfen Yeni Şifrenizi Giriniz ..." );
	}
	
	else if (document.frm.adsoyad.value == ""){
		alert( "Lütfen Adınızı ve Soyadınız Giriniz! ..." );
		document.frm.adsoyad.focus();
	}
	
	else if (document.frm.telefonlar.value == ""){
		alert( "Lütfen Telefon Bilgilerinizi Giriniz! ..." );
		document.frm.telefonlar.focus();
	}
	
	else if (document.frm.sehir.value == "0"){
		alert( "Lütfen Şehir Bilgisini Giriniz! ..." );
		document.frm.sehir.focus();
	}
	else{
		//alert ("ok");
		//var url = 'uyesave.asp?'+'npswrd='+npswrd+''+'&nocach='+nocach+'';
		//window.location=(url);	
		document.frm.submit();
	}
	
}

function ChkEMail(TmpStr) 
{
	if (TmpStr=="")
	{
		return true;
	}
	else
	{
		var i, atPos, atPos2, InvalidChars=" üÜğĞışŞİçÇöÖ!#/*{[()]}";

		for (i=0; i<InvalidChars.length; i++)
			if (TmpStr.indexOf(InvalidChars.charAt(i)) != -1) {
				return false;
			}
		atPos = TmpStr.indexOf("@");
		atPos1 = TmpStr.indexOf(".");
		atPos2 = TmpStr.indexOf("@", atPos+1);
		if ((atPos < 1) || (atPos1 < 1) || (atPos2 != -1)) {
			return false;
		}
	}
}


//window kapanırken çalışan script
//<frameset rows="*,94" onUnload="showLogOffWindow()">

function showLogOffWindow() {
	var mConquerChatLogOut = window.open(
	"logout.asp?userId=<%= userId %>",
	null,
	"toolbar=no,width=380,height=80,resizable=0"
	);
			
			mConquerChatLogOut.focus();
}
// Sadece numara girişi sağlar
function onliNumber() { 
var Number=event.keyCode;
if(((Number==8)||(Number==46)||(Number==9)) || ((Number>95&&Number<106)||(Number>47&&Number<58))) {
event.returnValue=true; }
else { event.returnValue=false; }
}

function collapseac(id) {
	var el = document.all[id]
	//alert (el);
	var st = el.style
	st.display = ""	
}

function collapsekapa(id) {
	var el = document.all[id]
	var st = el.style
	
	st.display = "none"
}

function collapse(id) {
	// This function popups the window or redisplays the content
	var el = document.all[id]
	//alert (el);
	var st = el.style
		if (st.display=="none") {
			// Redisplay the content
			st.display = ""	
			// Be sure to close the undocked window
			//document.all[id + 'col'].innerHTML=Collapse1(id)
			
			//document.all[id + 'det'].innerHTML=Detach1(id)
		}
		else {
			// Hide the old contents
			st.display = "none"
			//document.all[id + 'col'].innerHTML=Expand1(id)
			//document.all[id + 'det'].innerHTML=DisabledDetach1(id)
		}
}


function emlakilanara()
{
	var dt=new Date();
	nocach=dt.getTime();
	var url = 'EMLAKARA.ASP?'+'nocach='+nocach+'';
	window.location=(url);
}

function ypara()
{
	var dt=new Date();
	nocach=dt.getTime();
	var url = 'YEDEKPARCA.ASP?'+'nocach='+nocach+'';
	window.location=(url);
}

function jobsrc()
{
	var dt=new Date();
	nocach=dt.getTime();
	var url = 'JOBSEARCH.ASP?'+'nocach='+nocach+'';
	window.location=(url);
}

function YY_checkform() { //v4.66
//copyright (c)ByBuRCUVA maxasp.org
  var args = YY_checkform.arguments; var myDot=true; var myV=''; var myErr='';var addErr=false;var myReq;
  for (var i=1; i<args.length;i=i+4){
    if (args[i+1].charAt(0)=='#'){myReq=true; args[i+1]=args[i+1].substring(1);}else{myReq=false}
    var myObj = MM_findObj(args[i].replace(/\[\d+\]/ig,""));
    myV=myObj.value;
    if (myObj.type=='text'||myObj.type=='password'||myObj.type=='hidden'){
      if (myReq&&myObj.value.length==0){addErr=true}
      if ((myV.length>0)&&(args[i+2]==1)){ //fromto
        var myMa=args[i+1].split('_');if(isNaN(myV)||myV<myMa[0]/1||myV > myMa[1]/1){addErr=true}
      } else if ((myV.length>0)&&(args[i+2]==2)){
          var rx=new RegExp("^[\\w\.=-]+@[\\w\\.-]+\\.[a-z]{2,4}$");if(!rx.test(myV))addErr=true;
      } else if ((myV.length>0)&&(args[i+2]==3)){ // date
        var myMa=args[i+1].split("#"); var myAt=myV.match(myMa[0]);
        if(myAt){
          var myD=(myAt[myMa[1]])?myAt[myMa[1]]:1; var myM=myAt[myMa[2]]-1; var myY=myAt[myMa[3]];
          var myDate=new Date(myY,myM,myD);
          if(myDate.getFullYear()!=myY||myDate.getDate()!=myD||myDate.getMonth()!=myM){addErr=true};
        }else{addErr=true}
      } else if ((myV.length>0)&&(args[i+2]==4)){ // time
        var myMa=args[i+1].split("#"); var myAt=myV.match(myMa[0]);if(!myAt){addErr=true}
      } else if (myV.length>0&&args[i+2]==5){ // check this 2
            var myObj1 = MM_findObj(args[i+1].replace(/\[\d+\]/ig,""));
            if(myObj1.length)myObj1=myObj1[args[i+1].replace(/(.*\[)|(\].*)/ig,"")];
            if(!myObj1.checked){addErr=true}
      } else if (myV.length>0&&args[i+2]==6){ // the same
            var myObj1 = MM_findObj(args[i+1]);
            if(myV!=myObj1.value){addErr=true}
      }
    } else
    if (!myObj.type&&myObj.length>0&&myObj[0].type=='radio'){
          var myTest = args[i].match(/(.*)\[(\d+)\].*/i);
          var myObj1=(myObj.length>1)?myObj[myTest[2]]:myObj;
      if (args[i+2]==1&&myObj1&&myObj1.checked&&MM_findObj(args[i+1]).value.length/1==0){addErr=true}
      if (args[i+2]==2){
        var myDot=false;
        for(var j=0;j<myObj.length;j++){myDot=myDot||myObj[j].checked}
        if(!myDot){myErr+='* ' +args[i+3]+'\n'}
      }
    } else if (myObj.type=='checkbox'){
      if(args[i+2]==1&&myObj.checked==false){addErr=true}
      if(args[i+2]==2&&myObj.checked&&MM_findObj(args[i+1]).value.length/1==0){addErr=true}
    } else if (myObj.type=='select-one'||myObj.type=='select-multiple'){
      if(args[i+2]==1&&myObj.selectedIndex/1==0){addErr=true}
    }else if (myObj.type=='textarea'){
      if(myV.length<args[i+1]){addErr=true}
    }
    if (addErr){myErr+='* '+args[i+3]+'\n'; addErr=false}
  }
  if (myErr!=''){alert('Hata Bulundu !!!:\t\t\t\t\t\n\n'+myErr)}
  document.MM_returnValue = (myErr=='');
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}