function tresimg(width,height)
{

  if (document.frm.marka.value == "0"){
	alert( "Lütfen Marka Bilgisini Seçiniz! ..." );
	document.frm.marka.focus();
  }

  else if (document.frm.model_grup.value == "0"){
	alert( "Lütfen Model Bilgisini Seçiniz! ..." );
	document.frm.model_grup.focus();
  }

  else {

	marka = (document.frm.marka.value);
	model = (document.frm.model_grup.value);
	var dt=new Date();
	nocach=dt.getTime();

	//var url = 'OTOSAMPLE.ASP?'+'ma='+xx+''+'&nocach='+nocach+'';	
	var url = 'OTOSAMPLE.ASP?'+'marka='+marka+''+'&model='+model+''+'&nocach='+nocach+'';	
	//url = "otopics/"+marka+"-"+model+".jpg"	
	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=0,menubar=0,scrollbars=0,resizable=1,copyhistory=0"); 

    }	
}	
	

function resimsec(xx)
{	
	if (xx == "2"){
	collapseac('Dock31');
	collapsekapa('Dock32');
	}
	else if (xx == "1"){
	collapsekapa('Dock31');
	collapseac('Dock32');
	}
	else {
	collapsekapa('Dock31');
	collapsekapa('Dock32');
	}
	
}

function rentacar(xx)
{	
	if (xx == "3"){
	collapseac('Dock39');
	}
	else {
	collapsekapa('Dock39');
	}
	
}
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 telkontrol() {
	if ((document.frm.evtel1.value!='') && (document.frm.evtel2.value!=''))
	return true;
	if ((document.frm.ceptel1.value!='') && (document.frm.ceptel2.value!=''))
	return true;
	if ((document.frm.istel1.value!='') && (document.frm.istel2.value!=''))
	return true;
	//alert('Ev,Cep,İş telefonlarından en az bir tanesinin girilmesi zorunludur !!!');
	return false;
}



function SecModel(xx)
{	
	var dt=new Date();
	nocach=dt.getTime();
	var url = 'OTOILANEKLE.ASP?'+'MARKANO='+xx+''+'&nocach='+nocach+'';	
	window.location=(url);		
}


function git()
{
		x = (document.ifrm.kcount.value);
		//alert (x);
	var i;	
	var d=0;
	var cvalu='0'
	var cvall=''
	var icnt =((x-0)+1);	
    for (i = 1; i<icnt; i++) 
	{			
		eval("cvall=document.ifrm.chk" + i + ".checked");
	
		if ( cvall==true )
		{	
			d=d+1;
			eval("cvalu=cvalu+'#'+document.ifrm.chk" + i + ".value;");
			
			document.frm.hval.value=cvalu;
		}		
	}	
	document.frm.kkcount.value=d;
	//alert(d);
	//git2();
	//alert (document.frm.hval.value);
	
	if (document.frm.hval.value == "")
	{
	//alert ("gggggg");
	return false;
	}
	return true ;
	//document.frm.submit();
	
}


function convert() {
	
    document.frm.SinavAdi.value = document.frm.SinavAdi.value.toUpperCase();
}



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;
}

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);
    }
}


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 gitb()
{
		
		p = (document.ifrm2.gcount.value);
		//alert (p);
	var i;	
	var t=0;
	var cvalu2='0'
	var cvall2=''
	var icnt =((p-0)+1);	
    for (i = 1; i<icnt; i++) 
	{			
		eval("cvall2=document.ifrm2.chk2" + i + ".checked");
	
		if ( cvall2==true )
		{	
			t=t+1;
			eval("cvalu2=cvalu2+'#'+document.ifrm2.chk2" + i + ".value;");
			
			document.frm.hval2.value=cvalu2;
		}		
	}	
	document.frm.gkcount.value=t;
	
}


function chckAdd(){


  if (document.frm.marka.value == "0"){
	alert( "Lütfen Marka Seçiniz! ..." );
	document.frm.marka.focus();
  }

  else if ( document.frm.model_grup.value == "0"){
	alert ("Lütfen Model Seçiniz! ... " );
	document.frm.model_grup.focus();
  }

  else if ( document.frm.TUR.value == "0"){
	alert ("Lütfen Araç Türünü Seçiniz! ... " );
	document.frm.TUR.focus();
  }

  else if ( document.frm.MODELYILI.value == "0"){
	alert ("Lütfen Model Yılı Bilgisini Seçiniz! ... " );
	document.frm.MODELYILI.focus();
  }

 else if ( document.frm.ARACTIP.value == "0"){
	alert ("Lütfen Araç Tipini Seçiniz! ... " );
	document.frm.ARACTIP.focus();
  }

 else if ( document.frm.KAROSER.value == "0"){
	alert ("Lütfen Karoser Tipini Seçiniz! ... " );
	document.frm.KAROSER.focus();
  }


 else if ( document.frm.RENK.value == "0"){
	alert ("Lütfen Renk Bilgisini Seçiniz! ... " );
	document.frm.RENK.focus();
  }


 else if ( document.frm.IL.value == "0"){
	alert ("Lütfen Araç İl Bilgisini Seçiniz! ... " );
	document.frm.IL.focus();
  }

 else if ( document.frm.YAKITTIPI.value == "0"){
	alert ("Lütfen Yakıt Tipi Bilgisini Seçiniz! ... " );
	document.frm.YAKITTIPI.focus();
  }

 else if (document.frm.FIYAT.value == ""){
	alert( "Lütfen Fiyat Bilgisini Giriniz ..." );
	document.frm.FIYAT.focus();
  }

 else if ( document.frm.BIRIMF.value == "0"){
	alert ("Lütfen Birim Bilgisini Seçiniz! ... " );
	document.frm.BIRIMF.focus();
 }
	
 else if ( document.frm.adsoyad.value == ""){
	alert ("Lütfen Ad Soyad Bilgisini Giriniz! ... " );
	document.frm.adsoyad.focus();
 }


else if (( document.frm.email.value != "") && ( ChkEMail(document.frm.email.value) == false))
{
   alert ("Lütfen E-Mail Adres Bilginizin Doğruluğunu Kontrol Ediniz!..");  
   document.frm.email.focus();
  
}


 else {
	!gitb();
	document.frm.submit();
    }
}


