
function iletisim_kontrol(formobj){
	// Enter name of mandatory fields

	var fieldRequired = Array("kullanici","sifre","firma","adres","sehir","telefon","yetkili","yetkili_gsm","email","isim");
	// Enter field description to appear in the dialog box
	var fieldDescription = Array("Kullanici Adi","Sifre","Firma Adi","Adres Bilgileri","Semt - Sehir","Telefon","Yetkili Adi","Yetkili GSM","Email bilgileri","Isim Soyisim" );
	// dialog message
	var alertMsg = "Lütfen gerekli alanları doldurun :\n";
	
	var l_Msg = alertMsg.length;
	
	for (var i = 0; i < fieldRequired.length; i++){
		var obj = formobj.elements[fieldRequired[i]];
		if (obj){
			switch(obj.type){
			case "select-one":
				if (obj.selectedIndex == -1 || obj.options[obj.selectedIndex].text == ""){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
				break;
			case "select-multiple":
				if (obj.selectedIndex == -1){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
				break;
			case "text":
			case "textarea":
			case "password":
				if (obj.value == "" || obj.value == null){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
				break;
			case "checkbox":
				if (obj.checked == false){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
				break;
			default:
			}
			if (obj.type == undefined){
				var blnchecked = false;
				for (var j = 0; j < obj.length; j++){
					if (obj[j].checked){
						blnchecked = true;
					}
				}
				if (!blnchecked){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
			}
		}
	}

	if (alertMsg.length == l_Msg){
		return true;
	}else{
		alert(alertMsg);
		return false;
	}
}


function formCheck2(formobj){
	// Enter name of mandatory fields
	var fieldRequired = Array("kullanici","sifre","firma","adres","semt_sehir","telefon","yetkili","yetkili_gsm","email","kayit_tarihi","iskonto");
	// Enter field description to appear in the dialog box
	var fieldDescription = Array("Kullanici Adi","Sifre","Firma Adi","Adres Bilgileri","Semt - Sehir","Telefon","Yetkili Adi","Yetkili GSM","Email bilgileri","Kayit Tarihi","Istonto Orani" );
	// dialog message
	var alertMsg = "Lütfen gerekli alanları doldurun :\n";
	
	var l_Msg = alertMsg.length;
	
	for (var i = 0; i < fieldRequired.length; i++){
		var obj = formobj.elements[fieldRequired[i]];
		if (obj){
			switch(obj.type){
			case "select-one":
				if (obj.selectedIndex == -1 || obj.options[obj.selectedIndex].text == ""){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
				break;
			case "select-multiple":
				if (obj.selectedIndex == -1){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
				break;
			case "text":
			case "textarea":
			case "password":
				if (obj.value == "" || obj.value == null){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
				break;
			case "checkbox":
				if (obj.checked == false){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
				break;
			default:
			}
			if (obj.type == undefined){
				var blnchecked = false;
				for (var j = 0; j < obj.length; j++){
					if (obj[j].checked){
						blnchecked = true;
					}
				}
				if (!blnchecked){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
			}
		}
	}

	if (alertMsg.length == l_Msg){
		return true;
	}else{
		alert(alertMsg);
		return false;
	}
}




function girilen_kontrol(formobj){

	if(formobj.parca_arama.value.length < 3){
	
		alert("Girdiğiniz parça adi veya numarasi en az 3 karakter olmali");
		formobj.ara.focus();
		return false;
	
	}
	
}


function select_kutusu(selectobj,aranan,marka){
window.location = "stock.php?as="+selectobj.value+"&aranan="+aranan+"&marka="+marka;
}

function iletisim_kutusu(selectobj){
	if (selectobj.value == "iletisim")
	{
		window.location = "iletisim.php";
	}
	else
	{
window.location = "iletisim.php?kullanici_talep=arrecvbcsxcGDHIB54654654.FFGAdxsxcxaashgfhgTYJhg6565DFDFVdf";
	}
}


function git(veri,aranan,sayfagoruntule)
{
		//sayfaci.value > veri ||
		if( sayfaci.value < 1)
		{
			alert("Girdiginiz deger: "+sayfaci.value);
			alert("Lütfen 1 ile "+veri+" arasinda bir deger giriniz...");
		}
		else
		{
			if (sayfagoruntule == "")
			{
					sayfagoruntule = 20;
			}
				window.location = "stock.php?lim="+sayfaci.value+"&aranan="+aranan+"&as="+sayfagoruntule;
		}

}