// JavaScript Document
window.ajx = (window.ActiveXObject) ? function(){return new ActiveXObject("Microsoft.XMLHTTP");}:function(){return new XMLHttpRequest();};
window.domParser = (window.ActiveXObject) ? function(){return new ActiveXObject;}:function(){return document.implementation.createDocument("","",null);}
document.write('<link href="http://www.cemsan.com.tr/scripts/ajax.css" rel="stylesheet" type="text/css" />');
function l(e,a,t){e.innerHTML=a.responseText;}
function e(e,a,t){e.innerHTML="eror loading:" +a.status;}
function ld(id,title,url,f,nf){	
    var a=ajx();
	var e=document.getElementById(id);
	a.onreadystatechange=function(){
		if(a.readyState==4){
			if(a.status==200){
				e.removeChild(document.getElementById("loading_" + e.id));
				if(typeof f=="function"){f(e,a);}else{l(e,a);}
			}
			else{
				if(typeof nf=="function"){nf(e,a);}else{e.innerHTML="eror loading:" +a.status;}
			}
		}
	}
	a.open("GET",url);
	oLoading = document.createElement("table");
	oLoading.insertRow(0);
	oLoading.rows[0].insertCell(0);
	oLoading.rows[0].cells[0].style.verticalAlign = "middle";
    oLoading.rows[0].cells[0].style.textAlign = "center";
	oLoading.id = "loading_" + e.id;
	oImg = document.createElement("img");
	oImg.src="http://www.veito.com/images/ajax-loader.gif";
	oImg.align = "center";
	oLoading.rows[0].cells[0].appendChild(oImg);
	oLoading.rows[0].cells[0].innerHTML += "&nbsp;YÜKLENİYOR...";
	e.appendChild(oLoading);
	a.send(null);
}
function fadein(oElement,x,y,interval){
	var oElement = document.getElementById(oElement);
	oElement.style.filter = "alpha(opacity=" + x +")";
	oElement.style.opacity = (x/100);
	x += 10;
	if (x<y) setTimeout("fadein('glassDiv',"+x+","+y+","+interval+")",interval);
	}
function fadeout(oElement,x,y,interval,rm){
	var oElement = document.getElementById(oElement);
	oElement.style.filter = "alpha(opacity=" + x +")";
	oElement.style.opacity = (x/100);
	x -= 10;
	if (x>y) setTimeout("fadeout('glassDiv',"+x+","+y+","+interval+","+rm+")",interval);
	else if (rm) oElement.parentNode.removeChild(oElement);
	}

function openInnerWindow(w,h,url){
	var oElement = document.createElement("table");
	oElement.id="glassDiv";
	oElement.insertRow(0);
	oElement.rows[0].insertCell(0);
	oElement.rows[0].cells[0].appendChild(document.createElement("center"));
	document.body.appendChild(oElement);
	fadein("glassDiv",30,80,1);
	oElement = document.createElement("table");
	oElement.insertRow(0);
	oElement.rows[0].insertCell(0);
	oElement.rows[0].cells[0].appendChild(document.createElement("center"));
	oElement.id="glassDivBg";
	var oInnerElement = document.createElement("div")
	oInnerElement.id = "innerDiv";
	oInnerElement.innerHTML = "";
	with (oInnerElement.style){
		position = "relative";
		if (w) width = "700px";
		if (h) height = "600px";
		}
	var oCenterElement = oElement.rows[0].cells[0].childNodes[0];
	oCenterElement.appendChild(oInnerElement);
	document.body.appendChild(oElement);
	ld("innerDiv",null,url);
	return false;
	}
function closeInnerWindow(){
	var oElement = document.getElementById("glassDivBg");
	if (oElement) {
		document.body.removeChild(oElement);
	    fadeout("glassDiv",50,0,1,true);
		}
	return false;
	}
function loadMenu(e,a,t){
	e.innerHTML = a.responseText;
	}
function getOpacity(e){
	if (!window.ActiveXObject) {return e.style.opacity;}
	else{
		d = e.style.filter;
		return d.slice(d.indexOf("=")+1,d.indexOf(")"))/100;
	}
}
function setOpacity(e,v){
	v = (v>1)?1:v;
	v = (v<0)?0:v;
	if (!window.ActiveXObject){e.style.opacity = v;}
	else{
		e.style.filter = "alpha(opacity=" + (v*100) + ")";
	}
}
function playSlide(index){
	imgs = document.getElementById("banner_images").getElementsByTagName("img");
	index = index % imgs.length;
	j = (index+1) % imgs.length;
	setOpacity(imgs[index],getOpacity(imgs[index])-0.05);
	setOpacity(imgs[j],1-getOpacity(imgs[index]));
	index = (getOpacity(imgs[j])==1)?j:index;
	timer = (j==index)?5000:100;
	setTimeout("playSlide(" + index + ")",timer);
}
function slideImages(e,a,t){
	e.innerHTML = a.responseText;
	oImgs = e.getElementsByTagName("img");
	for(i=1;i<oImgs.length;i++){
		setOpacity(oImgs[i],0);
	}
	setOpacity(oImgs[0],1);
	if(oImgs.length>1) setTimeout("playSlide(0)",5000);
}
function loadContent(e,a,t){
	e.innerHTML = a.responseText;
	if(document.getElementById("iller")){
		param = "";
		if (document.location.href.indexOf("?saticilar&")>-1) param = "?link=saticilar";
		//alert(param);
		ld("iller",null,"dynamics/iller.asp" + param);
	}
}