function okeyindex(){
	var t;
	if (document.form1.product_id.length>1){
		for (var i=0; i<document.form1.product_id.length;i++) {
			if (document.form1.product_id[i].checked == true)
				t = 'ok';
		}
	}
	else { 
		if (document.form1.product_id.checked == true)
			t = 'ok';
	}
	if (t == 'ok'){
		document.form1.mode.value='add';
		document.form1.submit();
	}
}

function okeyilet(){
	var t;
	if (document.form1.product_id.length>1){
		for (var i=0; i<document.form1.product_id.length;i++) {
			if (document.form1.product_id[i].checked == true)
				t = 'ok';
		}
	}
	else { 
		if (document.form1.product_id.checked == true)
			t = 'ok';
	}
	if (t == 'ok'){
		document.form1.mode.value='iletisim';
		document.form1.submit();
	}
}

function selectallindex() {
	if (document.form1.product_id.length>1){
		for (var i=0; i<document.form1.product_id.length;i++) {
			document.form1.product_id[i].checked=true;
		}
	}
	else 
		document.form1.product_id.checked=true;
}

function selectallatalep() {
	if (document.form1.visit_offer.length>1){
		for (var i=0; i<document.form1.visit_offer.length;i++) {
			document.form1.visit_offer[i].checked=true;
		}
	}
	else 
		document.form1.visit_offer.checked=true;
}

function step_check(form, check){
	if (check == false){
		form.tpkod.value = "";
		form.tadres.value = "";
		form.ttelkod.value = "";
		form.ttel.value = "";
	} else {
		form.tpkod.value = form.fpkod.value;
		form.tadres.value = form.fadres.value;
		form.ttelkod.value = form.ftelkod.value;
		form.ttel.value = form.ftel.value;
	}
}

function popup(URL,w,h,Top,sbars,resizable)
{
 var  _width  = screen.width;
 var  _height = screen.height;
 var  _top  = 0;
 var  _left = 0;
 var  _scrollbars = sbars;
 day = new Date();
 id = day.getTime();
 eval("page" + id + " = window.open(URL, 'prod_window', 'toolbar=1,scrollbars=1,location=1,left='+_left+',top='+_top+',statusbar=1,menubar=1,resizable='+resizable+',width='+_width+',height='+_height+'');");
}

function popupu(URL,w,h,Top,sbars,resizable)
{
 var  _width  = w;
 var  _height = h;
 var  _top  = 0;
 var  _left = 0;
 var  _scrollbars = sbars;
 day = new Date();
 id = day.getTime();
 eval("page" + id + " = window.open(URL, 'prod_window', 'toolbar=1,scrollbars=1,location=1,left='+_left+',top='+_top+',statusbar=1,menubar=1,resizable='+resizable+',width='+_width+',height='+_height+'');");
}

function popuptkst(URL,w,h,Top,sbars,resizable)
{
 var  _width  = w;
 var  _height = h;
 var  _top  = 0;
 var  _left = 0;
 var  _scrollbars = sbars;
 day = new Date();
 id = day.getTime();
 eval("page" + id + " = window.open(URL, 'taksit_hesapla', 'toolbar=0,scrollbars=1,location=0,left='+_left+',top='+_top+',statusbar=0,menubar=0,resizable='+resizable+',width='+_width+',height='+_height+'');");
}



function check_search(inpObj,fname) {
	if(inpObj.value.length<2 && inpObj.value!='' && fname.urun_kodu.value=='') {
		inpObj.value='';
		alert("Aranacak Kelime en az 2 karakterli olmalıdır.");
	} else if (inpObj.value=='' && fname.urun_kodu.value=='') {
		alert("Aranacak Kelimeyi girmelisiniz.");
	} else {
		fname.submit();
	}
} 

function showhide()
{
    for(var I=0;I<arguments.length;I++)
    {
        var obj=document.getElementById(arguments[I]);
        if (obj.style.display == 'none') {obj.style.display = '';} else {obj.style.display = 'none';}
    }
}