function createObject() {
	var object;
	var browser = navigator.appName;
		if(browser == "Microsoft Internet Explorer"){
			object = new ActiveXObject("Microsoft.XMLHTTP");
		}else{
			object = new XMLHttpRequest();
	}
	return object;
}

function doItPost(divID,process,data){
	postHttp = createObject();

	postDiv = divID;
	postPro = process;
	
	var datax = "process=" + process + "&data=" + data;
	postHttp.open('POST', '/ajax.php');
	postHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=utf-8");
	postHttp.onreadystatechange = answerPostFunction;
	postHttp.send(datax);

}

function answerPostFunction() {
	if(postHttp.readyState == 4){
		document.getElementById(postDiv).innerHTML = postHttp.responseText;
	}
}

//sagdan soldan bosluklari almak
function trim(stringToTrim) {
	return stringToTrim.replace(/^\s+|\s+$/g,"");
}

function openDiv(id){
	document.getElementById(id).style.display = 'block';
}

function closeDiv(id){
	document.getElementById(id).style.display = 'none';
}

function openL(){
	document.getElementById('loadingBar').style.display = 'block';
}

function openDS(id){
	new Effect.SlideDown(id,{duration:0.4});
}

function closeDS(id){
	new Effect.SlideUp(id,{duration:0.4});
}

function divToggle(id){
	new Effect.toggle(id,'blind');
}

function scrollToDiv(id){
	setTimeout("Effect.ScrollTo('"+id+"');",500);
}

function url(link){
	location.href=link;
}

function addText(id,value){
	document.getElementById(id).value += "\n\n"+value;
}

function setValue(id, text){
	document.getElementById(id).value = text;
}

function setInner(id, text){
	document.getElementById(id).innerHTML = text;
}

function setInnerHTML(id, text, plus){

	if(!plus)
		plus = 0;

	if(plus == 0)
		document.getElementById(id).innerHTML = text;
	else
		document.getElementById(id).innerHTML += text;
}

function formSubmit(form_id){
	document.forms[form_id].submit();
}
function resetFrom(form_id){
	document.forms[form_id].reset();
}

function forDate(value){
	var word = new String();
	var numbers = "0123456789";
	var chars = value.value.split("");
	for (i = 0; i < chars.length; i++) {
		if (numbers.indexOf(chars[i]) != -1)
			word += chars[i];
	}
	if (value.value != word)
		value.value = word;
}

