var req;
function Initialize(){
	try{req=new ActiveXObject("Msxml2.XMLHTTP");}
	catch(e){try{req=new ActiveXObject("Microsoft.XMLHTTP");}
	catch(oc) {req=null;}
	}
	if(!req&&typeof XMLHttpRequest!="undefined") {
		req= new
		XMLHttpRequest();
	}
} 


// xml page general

function xmlpage(url,containerid,param){
	if(param){
			url=url+'&s='+param.value
	}

	if(containerid=="account"){
		document.getElementById(containerid).innerHTML="<table><tr><td><img src=images/beklet.gif hspace=5></td><td><b><font class=process>Lütfen bekleyiniz..</font></b></td></tr></table>";
	}

		var page_request = false
		if (window.XMLHttpRequest) 
				page_request = new XMLHttpRequest()
		else if (window.ActiveXObject){
			try {
					page_request = new ActiveXObject("Msxml2.XMLHTTP")
				} 
			catch (e){
				try{
				page_request = new ActiveXObject("Microsoft.XMLHTTP")
				}
				catch (e){}
			}
		}
		else
			return false
			page_request.onreadystatechange=function(){
					loadpage(page_request, containerid)
				}
			page_request.open('GET', url, true)
			page_request.send(null)
}

function loadpage(page_request, containerid){
if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1))
	document.getElementById(containerid).innerHTML=unescape(page_request.responseText)
}


function openTools(kac){
		document.getElementById(kac).style.display="";
}


// Period Extension

function periodextension(taleptarih,policeId){
	if (taleptarih=='dd.mm.yyyy') {
		alert("Lütfen Talep Tarihinizi belirtiniz!");
	}else if (taleptarih=='') {
		alert("Lütfen Talep Tarihi alanını boş bırakmayınız!");
	}else {
		Initialize(); 
		var url="periodextension.asp?detail=newdemand&taleptarih="+ taleptarih +"&id="+ policeId +"&random="+ Math.random();
		if(req!=null){
			document.getElementById("account"+policeId).innerHTML="<font class='alert'>Talebiniz iletildi! Değerlendirme sonrasında sizi e-Posta ile bilgilendireceğiz.</font>";
			req.open("POST" ,url, true);
			req.send(null);
		}
	}
}


// Div sakla aç scripti

function openClose(kac){
	if (document.getElementById(kac).style.display==""){
		document.getElementById(kac).style.display="none";
	}else{
		document.getElementById(kac).style.display="";
	}
}

function categoryMenu(sira,kayit_sayisi){
	for (i=1;i<kayit_sayisi+1;i++ )
	{
		document.getElementById('category_bottom_'+i).className="category_bottom_close";	
	}
	document.getElementById('category_bottom_'+sira).className="category_bottom_open";	
}


