function ortala() {
//window.moveTo(5,100);

	var ah = screen.availHeight + 30;
	var aw = screen.availWidth - 30;
	var xc = (aw - document.body.clientWidth) / 2;
	var yc = (ah - document.body.clientHeight) / 2;

	window.moveTo(xc,yc);
}

function PopupPic(sPicURL) { 

	window.open("popup.html?"+sPicURL, "", "resizable=0,HEIGHT=200,WIDTH=200");

}
function popstd(linka,wwidth,wheight) {
	window.open(linka,"","toolbar=no,scrollbars=no,height="+wheight+",width="+wwidth+",directories=no,resizeable=yes");
}

function popstds(linka,wwidth,wheight) {
	window.open(linka,"","toolbar=no,scrollbars=yes,height="+wheight+",width="+wwidth+",directories=no,resizeable=yes");
}

function checkanket(m) {
	poll_sel = 0;
	
	for(i=0;i<AnketFormu.anket_secenek.length;i++) {
		if( AnketFormu.anket_secenek[i].checked == true ) {
			poll_sel = 1;
			AnketFormu.anket_secenek_id.value = AnketFormu.anket_secenek[i].value;
		}
	}
	
	if( poll_sel == 0 ) {
		alert("Lütfen anket seçeneklerinden birini seçiniz !");
		return;
	}

	window.open("anket_cevap.php?anket_id="+ m+ "&anket_secenek_id="+ AnketFormu.anket_secenek_id.value,"anket_window","width=400, height=300, scrollbars=no");
	
}

function sonucanket(a) {
	window.open("anket_cevap.php?anket_id="+ a,"cevap_window","width=400, height=300, scrollbars=no");
}

function sendPost(formId,spanId)
{
	var form = document.getElementById('projectId');
	var span = document.getElementById(spanId);
	var postRequest = new String("");
	
	document.getElementById('projectId').contentname.value = formId;
	
	var n,v;// n -> name , v -> value
	//göndereceğimiz bilgiyi hazır edelim.
	for(var i=0;i<form.elements.length;i++)
	{
		n = form.elements[i].name;
		v = form.elements[i].value;
		postRequest += escape(n) + '=' + escape(v) + '&';
	}
	
	// Loading olayı start
		//form.send.value = "Lütfen Bekleyiniz";
		//form.send.disabled = true;
		//span.innerHTML = "<center><img src='img/ajax-loader.gif'/></center>";
	// Loading olayı end
	
	var xmlhttp = new_xmlhttp();
	xmlhttp.open("POST","fatihcad_act.php",true);
	xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded;charset=iso-8859-9");
	xmlhttp.send(postRequest);
	//document.write("TrafficForm")
	//alert("sendpost")
	xmlhttp.onreadystatechange = function() {
		if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
			span.innerHTML = xmlhttp.responseText;
		}
		else
		{
			//span.innerHTML = '<h1>hata</h1>';
		}
	}
	return false;//formu yollama
}

function new_xmlhttp()
{
	var xmlHttp=null;
	try
	{
		// Firefox, Opera 8.0+, Safari
		xmlHttp=new XMLHttpRequest();
	}
	catch (e)
	{
		// Internet Explorer
		try
		{
			xmlHttp=new ActiveXObject('Msxml2.XMLHTTP');
		}
		catch (e)
		{
			xmlHttp=new ActiveXObject('Microsoft.XMLHTTP');
		}
	}
	return xmlHttp;
}

