function Browser(){
	var ua = navigator.userAgent.toLowerCase(); 
	this.Gecko = (ua.indexOf('gecko') != -1 && ua.indexOf('safari') == -1);
	this.Safari = (ua.indexOf('safari') != - 1);
	this.IE = (ua.indexOf('msie') != -1 && !this.Opera && (ua.indexOf('webtv') == -1) ); 
	this.Firefox = ( (ua.indexOf('firebird/') != -1) || (ua.indexOf('firefox/') != -1) );
	this.IECompatible = ( (ua.indexOf('msie') != -1) && !this.IE);
	this.NSCompatible = ( (ua.indexOf('mozilla') != -1) && !this.NS && !this.Mozilla);
	this.geckoVersion = ( (this.Gecko) ? ua.substring( (ua.lastIndexOf('gecko/') + 6), (ua.lastIndexOf('gecko/') + 14) ) : -1 );
	this.equivalentMozilla = ( (this.Gecko) ? parseFloat( ua.substring( ua.indexOf('rv:') + 3 ) ) : -1 );
	this.versionMinor = parseFloat(navigator.appVersion); 
	if (this.Gecko && !this.Mozilla) this.versionMinor = parseFloat( ua.substring( ua.indexOf('/', ua.indexOf('gecko/') + 6) + 1 ) );
	else if (this.Mozilla) this.versionMinor = parseFloat( ua.substring( ua.indexOf('rv:') + 3 ) );
	else if (this.IE && this.versionMinor >= 4) this.versionMinor = parseFloat( ua.substring( ua.indexOf('msie ') + 5 ) );
	else if (this.Safari) this.versionMinor = parseFloat( ua.substring( ua.lastIndexOf('safari/') + 7 ) );
	this.versionMajor = parseInt(this.versionMinor); 
	this.DOM1 = (document.getElementById);
	this.DOM2Event = (document.addEventListener && document.removeEventListener);
	this.mode = document.compatMode ? document.compatMode : 'BackCompat';
	this.Win = (ua.indexOf('win') != -1);
	this.Mac = (ua.indexOf('mac') != -1);
	this.NS6up = (this.NS && this.versionMajor >= 6);
	this.NS7up = (this.NS && this.versionMajor >= 7);
	this.IE4 = (this.IE && this.versionMajor == 4);
	this.IE5 = (this.IE && this.versionMajor == 5);
	this.IE55 = (this.IE && this.versionMinor == 5.5);
	this.IE5up = (this.IE && this.versionMajor >= 5);
	this.IE6x = (this.IE && this.versionMajor == 6);
	this.IE6up = (this.IE && this.versionMajor >= 6);
}
var is = new Browser();

var flashVersion = 4;
function getFlashVersion() {
	var latestFlashVersion = 20;
	var agent = navigator.userAgent.toLowerCase(); 
	if (navigator.plugins != null && navigator.plugins.length > 0) {
		var flashPlugin = navigator.plugins['Shockwave Flash'];
		if (typeof flashPlugin == 'object'){ 
			for (var i = latestFlashVersion; i >= 3; i--){
	            if (flashPlugin.description.indexOf(i + '.') != -1){
	               flashVersion = i;
	               break;
	            }
			}
		}
	}
	else if (agent.indexOf("msie") != -1 && parseInt(navigator.appVersion) >= 4 && agent.indexOf("win")!=-1 && agent.indexOf("16bit")==-1) {
		var doc = ''+
			'<scr' + 'ipt language="VBScript"\> \n'+
			'On Error Resume Next \n'+
			'Dim obFlash \n'+
			'For i = ' + latestFlashVersion + ' To 3 Step -1 \n'+
			'	Set obFlash = CreateObject("ShockwaveFlash.ShockwaveFlash." & i) \n'+
			'	If IsObject(obFlash) Then \n'+
			'		flashVersion = i \n'+
			'		Exit For \n'+
			'	End If \n'+
			'Next \n'+
			'</scr' + 'ipt\> \n';
		document.write(doc);
	} else {flashVersion = flashVersion_DONTKNOW; }
return flashVersion;
}
var flashVersion_DONTKNOW = -1;
function FlashObject(){
	this.ID=this.ID;
	this.maxVersion=this.maxVersion;
	this.SwfFile;
	this.minVersion;
	this.altSwfFile;
	this.altImage;
	this.altImageAddAtribute;
	this.altImageHTML;
	this.width;
	this.height;
	this.menu;
	this.background;
	this.wmode;
	this.flashvars;
	this.scale;
	this.salign;
}
FlashObject.prototype.rnd=function(){
	this.ranNum= Math.random()*255;
    return this.ranNum;
}
FlashObject.prototype.embed=function(){
	var buff;
	if(getFlashVersion()>=this.maxVersion){
		
		buff=''+
			'<OBJECT ID="'+this.ID+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" WIDTH='+this.width+' HEIGHT='+this.height+'><PARAM NAME=movie VALUE="'+this.SwfFile+'"><PARAM NAME=menu VALUE='+this.menu+'><param name="wmode" value="'+this.wmode+'"><PARAM NAME="quality" VALUE="high"><PARAM NAME="flashvars" VALUE="'+ this.flashvars +'"><PARAM NAME="bgcolor" VALUE="'+this.background+'"><PARAM NAME="scale" VALUE="'+this.scale+'"><PARAM NAME="salign" VALUE="'+this.salign+'">'+
				'<EMBED name="'+this.ID+'" src="'+this.SwfFile+'" menu="'+this.menu+'" wmode="'+this.wmode+'" quality="high" bgcolor="'+this.background+'"  WIDTH="'+this.width+'" HEIGHT="'+this.height+'" scale="'+this.scale+'" salign="'+this.salign+'" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" swLiveConnect="true"></EMBED>'+
			'</OBJECT>';
	}else if((getFlashVersion()> this.minVersion) && (getFlashVersion()< this.maxVersion) && this.altSwfFile){
		
		buff=''+
			'<OBJECT ID="'+this.ID+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" WIDTH='+this.width+' HEIGHT='+this.height+'><PARAM NAME=movie VALUE="'+this.altSwfFile+'"><PARAM NAME=menu VALUE='+this.menu+'<param name="wmode" value="'+this.wmode+'">><PARAM NAME="quality" VALUE="high"><PARAM NAME="bgcolor" VALUE='+this.background+'>'+
				'<EMBED flashvars="'+ this.flashvars +'" name="'+this.ID+'" src="'+this.altSwfFile+'" menu="'+this.menu+'" wmode="'+this.wmode+'" quality=high bgcolor='+this.background+'  WIDTH='+this.width+' HEIGHT='+this.height+' TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" swLiveConnect="true"></EMBED>'+
			'</OBJECT>';
	}else{
		this.altImageAddAtribute ? (buff='<img src="'+this.altImage+'" width="'+this.width+'" height="'+this.height+'" border="0" '+this.altImageAddAtribute+' />'+this.altImageHTML) : (buff='<img src="'+this.altImage+'" width="'+this.width+'" height="'+this.height+'" border="0" />');
	}
	document.write(buff);
}

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='/en/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='/en/i/menu/menu_ovr_0'+I+'.gif';
}

function moutP(I) {
	if (I==5) {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';
	}
}

function movrP(I) {
	hideAll();
	
	if (I==5) {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('/en/i/05.gif','/en/i/04.gif','/en/i/03.gif','/en/i/02.gif','/en/i/01.gif','/en/i/05omo.gif','/en/i/04omo.gif','/en/i/03omo.gif','/en/i/02omo.gif','/en/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 (winPop(page + "?rnd=" + Math.random(0) + "&ref=" + document.location.pathname,457,500));
	}else{
		return (winPop(page + "&rnd=" + Math.random(0) + "&ref=" + document.location.pathname,457,500));
	}
}

function getWindowHeight(){
	var windowHeight = 0;
	if(typeof(window.innerHeight) == 'number'){
		windowHeight = window.innerHeight;
	}else{
		if(document.documentElement && document.documentElement.clientHeight){
			windowHeight = document.documentElement.clientHeight;
		}else{
			if(document.body && document.body.clientHeight){
				windowHeight = document.body.clientHeight;
			}
		}
	}
	return windowHeight;
}


function setFooter(){

	if (document.getElementById){
		var windowHeight=getWindowHeight();
		
		if (windowHeight>0){
			
			var contentHeight=document.getElementById('main').offsetHeight;		
			var footerElement=document.getElementById('footer');
			var footerHeight =footerElement.offsetHeight;
			
			if (windowHeight - (contentHeight + footerHeight)>=0) footerElement.style.marginTop=(windowHeight-(contentHeight+footerHeight))+'px';
			else footerElement.style.marginTop='1px';
		}
	}
}

function setFooterHome(){

	if (document.getElementById){
		var windowHeight=getWindowHeight();
		
		if (windowHeight>0){
			
			var contentHeight=document.getElementById('main_anasayfa').offsetHeight;	
				
			var footerElement=document.getElementById('footer');
			
			var footerHeight =footerElement.offsetHeight;
			
			if (windowHeight - (contentHeight + footerHeight)>=0)footerElement.style.marginTop=(windowHeight-(contentHeight+footerHeight))+'px';			
			else footerElement.style.marginTop='1px';
		}
	}
}

window.onload = function() {
	setFooter();
}

window.onresize = function() {
	setFooter();
}

function newspop(sayfa,wit,het,scrbar){
	var sene = window.open(sayfa,'','height='+het+',width='+wit+',status=yes,toolbar=no,menubar=no,location=no,scrollbars='+scrbar);
	sene.focus();
}


function getCenter(pwidth,pheight){
	wwidth=screen.width;
	wheigth=screen.height;
	lpos= (wwidth - pwidth)/2;
	tpos= (wheigth - pheight)/2;
	return lpos, tpos;
}

function PopItUp(src,w,h,s) {
	if(s) w=w+17;
	getCenter(w,h);
	Popwin = window.open(src,"pop_up","toolbar=0,width=" + w + ", height=" + h + ", left="+ lpos +", top="+ tpos +"; location=0, directories=0, status=1, scrollbars="+s+", menubar=0, resizable=1, copyhistory=0");
	Popwin.focus();
	//return false;
}


function PopItUpBlank(src) {
	Popwin = window.open(src,"pop_up_blank");
	Popwin.focus();
}



var oldMenu=""

function PopupPic(sPicURL) {
		window.open( "/kalescope/popup.htm?"+sPicURL, "", "resizable=0,HEIGHT=400,WIDTH=400");
	}

function showMenu(gelen){


if (oldMenu!=""){

	if (gelen.substring(0, oldMenu.length) != oldMenu){

		var ArrOldMenu = oldMenu.split("_");

		sil=0
		for (i=1;i<ArrOldMenu.length-1;i++){
		
			if (oldMenu.substring(0,  oldMenu.length - sil) != gelen.substring(0,  gelen.length - sil)){
				exmenu=document.getElementById(oldMenu.substring(0,  oldMenu.length - sil)).getElementsByTagName('ul')[0]
				if (exmenu != undefined){
					exmenu.style.display="none";
				}			
				sil += 2;
			}
		}
	}
}

selectedLi=document.getElementById(gelen);
if (selectedLi.getElementsByTagName('ul')[0] != undefined) {
	selMenu=selectedLi.getElementsByTagName('ul')[0]
	if (selMenu.style.display == "block"){
		selMenu.style.display = "none"
	}
	else{
		selMenu.style.display = "block"
	}
	
	
if (document.getElementById('menudivindex')) {
	document.getElementById('menudivindex').className="secildi";
	setFooter();
}	
	
	
}


oldMenu=gelen;
}



