function is_title_written() {
	if(!document.title) {
		document.title='e-kale';
	}
}
is_title_written();

function Browser() {
	var b=navigator.appName;
	if (b=="Netscape") this.b="ns";
	else if ((b=="Opera") || (navigator.userAgent.indexOf("Opera")>0)) this.b = "opera";
	else if (b=="Microsoft Internet Explorer") this.b="ie";
	if (!b) alert('Unidentified browser./nThis browser is not supported,');
	this.version=navigator.appVersion;
	this.v=parseInt(this.version);
	this.ns=(this.b=="ns" && this.v>=4);
	this.ns4=(this.b=="ns" && this.v==4);
	this.ns6=(this.b=="ns" && this.v==5);
	this.ie=(this.b=="ie" && this.v>=4);
	this.ie4=(this.version.indexOf('MSIE 4')>0);
	this.ie5=(this.version.indexOf('MSIE 5')>0);
	this.ie55=(this.version.indexOf('MSIE 5.5')>0);
	this.ie6=(this.version.indexOf('MSIE 6')>0);
	this.opera=(this.b=="opera");
	this.dom=(document.createElement && document.appendChild && document.getElementsByTagName)?true:false;
	this.def=(this.ie||this.dom); // most used browsers, for faster if loops
	var ua=navigator.userAgent.toLowerCase();
	if (ua.indexOf("win")>-1) this.platform="win32";
	else if (ua.indexOf("mac")>-1) this.platform="mac";
	else this.platform="other";
}
is = new Browser();


var leave1;
var leave2;
var leave3;
var leave4;
var leave5;
var leave6;

function mout(I) {
	moutP(I)

	if (document.getElementById) {
		obj=document.getElementById('menu0'+I);
	} else {
		obj=document.images['menu0'+I];
	}
	
	obj.src='/i/menu/menu_0'+I+'.gif';
}




function movr(I) {
	movrP(I);
	
	if (document.getElementById) {
		obj=document.getElementById('menu0'+I);
	} else {
		obj=document.images['menu0'+I];
	}
	
	obj.src='/i/menu/menu_ovr_0'+I+'.gif';
}

function moutP(I) {
	showSelect();
	showSubOptions('shortmenu');
	eval("leave"+I+"=setTimeout('hideLayer("+I+")',100)");
}

/*
function hideSelect() {
	
	if (document.getElementById('sl1')) {
		document.getElementById('sl1').style.visibility='hidden';
	}
}

function showSelect() {
	
	if (document.getElementById('sl1')) {
		document.getElementById('sl1').style.visibility='visible';
	}
}
*/
var hideselect=new Object();

function hideSelect() {
	if(hideselect.style)
		hideselect.style.visibility="hidden";
}

function showSelect() {
	if(hideselect.style)
		hideselect.style.visibility="visible";
}


function movrP(I) {
	hideAll();
	
	hideSelect()
	
	hideSubOptions('shortmenu');
	eval("clearTimeout(leave"+I+")");
	if (document.getElementById('DHTMLmenu'+I)) {
			
		document.getElementById('DHTMLmenu'+I).style.visibility='visible';
		
	
	}
}

function preload() {
	for (i=0;i<=arguments.length-1;i++) {
		
		val=arguments[i];
		
		myImg=new Image();
		myImg.src=val;
		
	}
}


function alignBottom(divid) {
	boy=44; //document.getElementById(divid).style.height;
	if (is.ns6) {
			if (parseInt(document.body.offsetHeight)>=parseInt(window.innerHeight))
				{
					document.getElementById(divid).style.top=document.body.offsetHeight+boy;
				} else {
					document.getElementById(divid).style.top=window.innerHeight+boy;					
				}
	} else {
			dist=boy;
			if (is.ie5 || is.ie55) {
				dist=-boy;
			}
			if (document.body.scrollHeight>document.body.clientHeight) {
				document.getElementById(divid).style.top=document.body.scrollHeight-dist;
			} else {
				document.getElementById(divid).style.top=document.body.clientHeight-dist;
			}
	}
}



function popUpShow(url,winWidth,winHeight,name) {
	if (!name) {
		name="pencere"+Math.floor((Math.random(0)*10000));
	}
	winPop(url,winWidth,winHeight,name);
}

function winPop(url,winWidth,winHeight,name)
{
	if(!winWidth||!winHeight)
	{
		winWidth=550;	
		winHeight=450;
	}
	
	if(!name)
	{
		name="";
	}
	
	popupWin = window.open("",name,"toolbar=0,width=" + winWidth + ",height=" + winHeight + ",location=0,left=10,top=10,directories=0,status=0,scrollbars=1,menubar=0,resizable=0,copyhistory=0"); 
	popupWin.location.href = url;
	popupWin.focus();
	
}


function newspop(url,winWidth,winHeight,scr){
	if(!winWidth||!winHeight){
		winWidth=550;	
		winHeight=450;
	}
	
	if(scr==1){
		winWidth=winWidth+20;
		popupWin = window.open("",name,"toolbar=0,width=" + winWidth + ",height=" + winHeight + ",location=0,left=10,top=10,directories=0,status=0,scrollbars=1,menubar=0,resizable=0,copyhistory=0"); 
	}
	else{
		popupWin = window.open("",name,"toolbar=0,width=" + winWidth + ",height=" + winHeight + ",location=0,left=10,top=10,directories=0,status=0,scrollbars=0,menubar=0,resizable=0,copyhistory=0"); 
	}
	
	popupWin.location.href = url;
	popupWin.focus();
	
}


function winPopNoScroll(url,winWidth,winHeight,name)
{
	if(!winWidth||!winHeight)
	{
		winWidth=550;	
		winHeight=450;
	}
	
	if(!name)
	{
		name="";
	}
	
	popupWin = window.open("",name,"toolbar=0,width=" + winWidth + ",height=" + winHeight + ",location=0,left=10,top=10,directories=0,status=0,scrollbars=0,menubar=0,resizable=0,copyhistory=0"); 
	popupWin.location.href = url;
	popupWin.focus();
	
}

function openPopUp(url,winWidth,winHeight,name) {
	winPop(url,winWidth,winHeight,name);
}

function objMagicCheckBox(cbName) {
	this.uncheckImage='/urunlerimiz/i/cb_pas.gif';
	this.checkImage='/urunlerimiz/i/cbKoleksiyon_act.gif';
	this.create(cbName);
}


objMagicCheckBox.prototype.create=function(cbName) {
	var txtInput='<input id="'+cbName+'" type="hidden" name="'+cbName+'" value="false">';
	
	onclickFunction='_'+cbName+'.clickOn(\''+cbName+'\')';
	var txtImage='<img align="absMiddle" id="MagicCheckbox'+cbName+'" src="'+this.uncheckImage+'" border="0" onClick="'+onclickFunction+'">';
	document.write(txtInput+txtImage);
}

objMagicCheckBox.prototype.clickOn=function (cbName) {
	var val=document.getElementById(cbName).value;
		
	if (val=='false') {
		document.getElementById(cbName).value='true';
		document.getElementById('MagicCheckbox'+cbName).src=this.checkImage;
	} else {
		document.getElementById(cbName).value='false';
		document.getElementById('MagicCheckbox'+cbName).src=this.uncheckImage;
	}
}


function MagicCheckBox(cbName,checkImage) {
	objName='_'+cbName;
	eval(objName+'= new objMagicCheckBox("'+cbName+'")');
	if (checkImage) {
		eval(objName+'.checkImage="'+checkImage+'"');
	}
}

function goSelect(val) {
	if (val!="#") {
		location.href=val;
	}
}

function showSubOptions(lyrName) {
	if (document.getElementById(lyrName)) {
		document.getElementById(lyrName).style.visibility='visible';
	}
}

function hideSubOptions(lyrName) {
	if (document.getElementById(lyrName)) {
		document.getElementById(lyrName).style.visibility='hidden';
		
	}
}
function activate(obj) {

	obj.style.backgroundColor='#BC7C3C';
	obj.style.hand='cursor';
	obj.childNodes[1].childNodes[0].style.color='#EAD5BD';
}

function disactivate(obj) {

	obj.style.backgroundColor='#CA9E63';
	obj.childNodes[1].childNodes[0].style.color='#FFFFFF';
	obj.style.cursor='hand';
}

function getLink(obj) {
	
	if (obj.childNodes[1].childNodes[0].href=='/tr/urunler/katalog/seramik/katalogseramik.asp') {
		myt=0;
	} else {
		if (obj.childNodes[1].childNodes[0].target=='') {
		
			location.href=obj.childNodes[1].childNodes[0].href;
	
		} else {
			myt=0;
		}
	}
}

function hideLayer(I) {
	
	if (document.getElementById('DHTMLmenu'+I)) {
		document.getElementById('DHTMLmenu'+I).style.visibility='hidden';
		
	}
	
}

function hideAll() {
	for (i=1;i<=6;i++) {
		if (document.getElementById('DHTMLmenu'+i)) {
			document.getElementById('DHTMLmenu'+i).style.visibility='hidden';
			
		}
	}
	
}
//

//

preload('/i/05.gif','/i/04.gif','/i/03.gif','/i/02.gif','/i/01.gif','/i/05omo.gif','/i/04omo.gif','/i/03omo.gif','/i/02omo.gif','/i/01omo.gif');


function rndredirect(page){
	if(page.indexOf('?') <= 0){
		return (document.location.href= page + "?rnd=" + Math.random(0) + "&ref=" + document.location.pathname);
	}else{
		return (document.location.href= page + "&rnd=" + Math.random(0) + "&ref=" + document.location.pathname);
	}
}


function rndPop(page){
	if(page.indexOf('?') <= 0){
		return (winPopNoScroll(page + "?rnd=" + Math.random(0) + "&ref=" + document.location.pathname,440,300));
	}else{
		return (winPopNoScroll(page + "&rnd=" + Math.random(0) + "&ref=" + document.location.pathname,440,300));
	}
}