// JavaScript Document
onerror=handleErr
var txt=""

function handleErr(msg,url,l)
{
txt="There was an error on this page.\n\n"
txt+="Error: " + msg + "\n"
txt+="URL: " + url + "\n"
txt+="Line: " + l + "\n\n"
txt+="Click OK to continue.\n\n"
//salert(txt)
return true
}


	function AddNewTrue(id,id2) {
		$('TabCont').innerHTML = '<center><img src="/emanage/Img/ajaxloader.GIF"> <strong>Yükleniyor</strong></center>';
		$('Cont').style.display ='none';
		$('TabCont').style.display ='';
		var my = new Ajax.Updater('TabCont','/Ajax/Ajax_Ecom.php?Progress=comment&id='+id+'&true='+id2 , {method:'get'}); 
	}
	
	function AddNewFalse(id,id2) {
		$('TabCont').innerHTML = '<center><img src="/emanage/Img/ajaxloader.GIF"> <strong>Yükleniyor</strong></center>';
		$('Cont').style.display ='none';
		$('TabCont').style.display ='';
		my = new Ajax.Updater('TabCont','/Ajax/Ajax_Ecom.php?Progress=comment&id='+id+'&false='+id2 , {method:'get'}); 
	}
	
	function AddNewCom() {
		//alert($('seloy').value);
		oylar = $('seloy').value;
		title = $('title').value
		msgbody = $('body').value;
		urun_id = $('urun').value;
		$('TabCont').innerHTML = '<center><img src="/emanage/Img/ajaxloader.GIF"> <strong>Yükleniyor</strong></center>';
		my = new Ajax.Updater('TabCont','/Ajax/Ajax_Ecom.php?Progress=addnewcom&id='+urun_id+"&oylar="+oylar+"&title="+title+"&msgbody="+msgbody , {method:'get'}); 
	}
	function promtSipList() {
		return GB_showPage('Siparişlerim', '/Ajax/Siparislerim.php');
	}
	
	function getRover() {
		return GB_showPage('Alışveriş Tamamlandı', '/Ajax/OrderComplate.php');
	}
	
	
	function promtSipSor() {
		GB_showPage('Sipariş Sorgulama', '/Ajax/Siparisler2.php');
	}
	
	function CallGet(current_request,obj,action_param) {
	if(current_request.readyState == 4 && current_request.status == 200){	
                  $('polls').innerHTML=current_request.responseText;
                }
	}
	
	function PollSend() {
		new ajaxSend('/Ajax/PollSave.php','polls','','polls2','','','');

	}
	function GetData(id,prog) {
		$('TabCont').innerHTML = '<center><img src="/emanage/Img/ajaxloader.GIF"> <strong>Yükleniyor</strong></center>';
		$('Cont').style.display ='none';
		$('TabCont').style.display ='';
		var my = new Ajax.Updater('TabCont','/Ajax/Ajax_Ecom.php?Progress='+prog+'&id='+id , {method:'get'}); 
	}
	function onSearchTo() {
		document.location='/Search/'+$('search').value;
	}
	function eBulten() {
		//var my = new Ajax.Request('/Ajax/Ajax_Bulten.php?mail='+ , {method:'get'});
		 
		if($('mail_add').value.length > 0) { 
			if($('ekle').checked) {
			 	alert("E-posta listesine eklendiniz.");
			 	var my = new Ajax.Request('/Ajax/Ajax_Bulten.php?type=1&mail='+$('mail_add').value , {method:'get'});
			 }
			 
			  if($('ekle1').checked) {
			 	alert("E-posta listesinden çıktınız.");
			 	var my = new Ajax.Request('/Ajax/Ajax_Bulten.php?type=2&mail='+$('mail_add').value , {method:'get'});

			 }
		} else {
			alert("Litfen E-Posta adresi giriniz.");
		}
	}
	
		function Goon(target,url) {
			if(target != 2) {		
				document.location = url;
			} else {
				window.open(url)
			}
	}
	
	function OrderStart() {
		setTimeout("OrderForm();",300);
		
	}
	
	function OrderForm() {
		return GB_showPage('Alışverişi Tamamla', '/Ajax/OrderForm.php?Progress=SelectAddress');
	}
	
	function LogoutUser() {
		document.location = '/logout';
	}
	
	function LostPass() {
		return GB_showPage('Alışverişi Tamamla', '/Ajax/ForgotPassword.php');
	}
	var contFiled = new Array();
	function addBasket(id) {
		var ext = "";
		if(contFiled) {
			if(contFiled.length > 0) {
				
				for(i=0;i< contFiled.length;i++) {
					//alert(contFiled[i]);
					r_id = contFiled[i].replace("special_","");
					ext +="&extfield["+r_id+"]=" + $(contFiled[i]).value;
				
				}
			}
		}
		//alert(ext);
		return GB_showCenter('Sepet', '/Ajax/BasketInto.php?id='+id+ext, 400, 520);
	}
	
	function Tabs(Show) {
		for(i=2;i<6;i++) {
			if(i != Show) {
				
				if($('tab'+i)) {
					$('tab'+i).style.borderTop = "0px none";
					$('tab'+i).style.borderLeft = "0px none";
					$('tab'+i).style.borderRight = '1px solid #CC0001';
					$('tab'+i).style.borderBottom='1px solid #CC0001';
					$('tab'+i).style.backgroundColor = '#CC0001';
					$('tab'+i).style.color = '#ffffff';
				}
			
			}
			
		}
		
		$('tab'+Show).style.border='1px solid #CC0001';
		$('tab'+Show).style.borderBottom='none';
		$('tab'+Show).style.color = '#000000';
		 if(Show != 2) {
		 	 $('tab'+Show).style.borderLeft='none';
		 }
		 $('tab'+Show).style.backgroundColor = '#FFFFFF';
	}