var highlightcolor="#AD3018"
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 = '#eeeeee'; 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 = '#eeeeee'; 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 adevam()
{
	var dt=new Date();
	nocach=dt.getTime();
	var url = 'MAIN6.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);
}