// ç &#231; i& #305; g& #287; ö &#246; s &#351; ü &#252; Ç &#199; I &#304; G &#208; Ö &#214; S &#350; Ü &#220; 
$(document).ready(function(){
//$(document).ajaxStart(function(){ $("#cvp").html("<img src='js/res/uloading.gif' width='16' height='16' border='0' />"); });
$(".lightbox").lightbox();					   
$('.combobox').selectbox();

$("#bigIMAGE").load(function(){
							 bigImageShow();
							 });

$().mousemove(function(e){
	   var ymouse = e.pageY;
	   if(ymouse > 100 && ymouse < 900){
	   	$("#geriBTN").css("margin-top",ymouse-100+"px").show('normal');
	   }
					   });

$("#marka").click(function(){
						var str = $("#marka").serialize();
						$.ajax({
								url:"ajax.php",
								type:"POST",
								dataType: "html",
								data:"modelINC=true&"+str,
								success:function(msg){
									//alert(msg);
									$("#model").html('').html("<select name='ara[1]' id='model' style='width:200px;'><option value='0' selected='selected'>Hepsi</option>"+msg+"</select>"); 
									$('#modell').selectbox();
									}
								});
						
						});



$("#bigIMAGE").load(function(){ divBoyut();  });

var $klas;
var $ids;
$("tr [title=Liste]").mouseover(function(){
								    $klas = $(this).attr("class");
								    $ids = $(this).attr("id");
									$("#"+$ids+" td").addClass("sec");
									$(this).click(function(){
									    location.href="?p=arac&ids="+$ids;
														   });
									 });
$("tr [title=Liste]").mouseout(function(){ $("#"+$ids+" td").removeClass(); });


$("#hemenaraBOX #ic").click(function(){
								 var $boyut = $("#hemenara").height();
								 if($boyut < 190){ $("#hemenara").animate({ height:'190px'},1500); }
								 else{ $("#hemenara").animate({ height:'35px'},1500); }
									 
								 });



});

banner = function(){
				$klas = $("#banner").attr("class");
				if($klas == 'bannerKAPALI'){
		   	 	$("#banner").animate({ height: "290px" },1000);
				$("#banner").removeClass().addClass("bannerACIK");
				$("#bannerBTN").html("G&#304;ZLE X");
				}else{
				$("#banner").animate({ height: "0px" },1000);
				$("#banner").removeClass().addClass("bannerKAPALI");
				$("#bannerBTN").html("G&#214;STER !");
				}
}


bigIMAGE = function(adres){
	bigImageHide();
	$("#bigIMAGE").attr("src",adres);
	this.location.href="#tepe";
	divBoyut();
}

divBoyut = function(){
	$boy = $("#bigIMAGE").height();
	if($boy > 400){
	$("#buyukIMG").animate({ height: $boy },1000);
	}
};

bigImageShow = function(){
	$("#bigIMAGE").fadeIn('normal');
}

bigImageHide = function(){
	$("#bigIMAGE").fadeOut('normal');
}


optionBAS = function(data){
deger = $("#renkESKI").attr("selectedIndex");
bul = document.getElementById('renkESKI').options[deger].text;
}

onay = function(){
var cvp=window.confirm('Secili kayitlari silmek istediginize emin misiniz ?');
if(cvp){ return true; }else{ return false; }
}


tavsiyeet=function($ids){
	var b1 = $("#arkadasAD2").val();
	var b2 = $("#arkadasAD").val();
	var b3 = $("#arkadasEPOSTA").val();
	var b4 = $("#tavsiyeMESAJ").val();
$.ajax({
	url:"ajax.php",
	type:"POST",
	dataType:"html",
	data:"tavsiyeet="+$ids+"&b1="+b1+"&b2="+b2+"&b3="+b3+"&b4="+b4,
	success:function(msg){
	 $("#tavsiyeCVP").addClass("mesaj").html(msg).fadeIn('normal');
	}
});
	
}


teklifver=function($ids){
	var b1 = $("#teklifAD").val();
	var b2 = $("#teklifEPOSTA").val();
	var b3 = $("#teklifTEL").val();
	var b4 = $("#teklifMESAJ").val();
$.ajax({
	url:"ajax.php",
	type:"POST",
	dataType:"html",
	data:"teklifver="+$ids+"&b1="+b1+"&b2="+b2+"&b3="+b3+"&b4="+b4,
	success:function(msg){
	 $("#teklifCVP").addClass("mesaj").html(msg).fadeIn('normal');
	}
});
	
}

aracPrint=function(ids){
	window.open("yazdir.php?secim=arac&ids="+ids,"","width=617,scrollbars,location,resizable");
}


iletisim = function(){
	var b1 = $("#iletisimAD").val();
	var b2 = $("#iletisimPOSTA").val();
	var b3 = tinyMCE.get('mesaj').getContent();
$.ajax({
	url:"ajax.php",
	type:"POST",
	dataType:"html",
	data:"iletisim=true&b1="+b1+"&b2="+b2+"&b3="+b3,
	success:function(msg){
	 $("#iletisimCVP").addClass("mesaj").html(msg).fadeIn('normal');
	}
});


}

elisteDevam = function(){
$("#pages").animate({ left: '-202' },1000);
}
elisteGeri = function(){
$("#pages").animate({ left: '0' },1000);
}

eliste = function(){
var b1 = $("#eAD").val();
var b2 = $("#eEPOSTA").val();
var b3 = $("input[name='gonderim']:checked").val(); 
$.ajax({
	url:"ajax.php",
	type:"POST",
	dataType:"html",
	data:"elist=true&b1="+b1+"&b2="+b2+"&b3="+b3,
	success:function(msg){
	 alert(msg);
	}
});

}//end function


tinyMCE.init({
	mode : "exact",
	elements : "mesaj",
	theme : "simple",
	skin : "o2k7",
	language : "tr"
});

jprint = function(gelen){
	$.jPrintArea(gelen);
}


