var startTime = $time();
var myWidth = 0, myHeight = 0;
var govdeH = 0;
var x9bottom = 0;
function startList(){
	//code only for IE
//	if(!document.body.currentStyle) return;
//	var subs = document.getElementsByName('submenu');
//	for(var i=0; i<subs.length; i++) {
//		var xx = subs[i].parentNode;
//		if(xx && xx.lastChild.style) {
//			xx.onmouseover = function() {
//				this.lastChild.style.visibility = 'visible';
//			}
//			xx.onmouseout = function() {
//				this.lastChild.style.visibility = 'hidden';
//			}
//		}
//	}
	if(!document.body.currentStyle) return;
	var subs = document.getElementsByName('submenu');
	for(var i=0; i<subs.length; i++) {
		var li = subs[i].parentNode;
		if(li && li.lastChild.style) {
			li.onmouseover = function() {
				this.lastChild.style.visibility = 'visible';
			}
			li.onmouseout = function() {
				this.lastChild.style.visibility = 'hidden';
			}
		}
	}
}
function getObject(obj) {
  var theObj;
  if(document.all) {
    if(typeof obj=="string") {
      return document.all(obj);
    } else {
      return obj.style;
    }
  }
  if(document.getElementById) {
    if(typeof obj=="string") {
      return document.getElementById(obj);
    } else {
      return obj.style;
    }
  }
  return null;
}

function wSize(){
var azalt=400;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
    var azalt = 480;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
govdeH = myHeight;
x9bottom = ((myHeight-400)/2) + 40;
getObject("govde").style.height = (myHeight-6)+'px' ;
getObject("myGallery").style.height = (myHeight-76)+'px' ;

if (document.getElementById('x9')){
getObject("x9").style.bottom = x9bottom + 'px';
}
getObject("pKapa").style.bottom = x9bottom + 385 + 'px';

    if (document.getElementById('menu')){
        getObject("menu").style.top = ((myHeight - x9bottom) - 400) + 10 +'px' ;
        getObject("menu").style.left = (((myWidth-850)/2)+10)+'px' ;
    }

}
// moo kaydırma :)
//getObject('pKapa').style.bottom = x9bottom + 390 + 'px';
//getObject('pKapa').style.display='block';
window.addEvent('domready', function(){
			Fx.Morph = Fx.Styles.extend({
			
				start: function(className){
					var to = {};
					
					$each(document.styleSheets, function(style){
					
						var rules = style.rules || style.cssRules;
						$each(rules, function(rule){
							if (!rule.selectorText.test('\.' + className + '$')) return;
							Fx.CSS.Styles.each(function(style){
								if (!rule.style || !rule.style[style]) return;
								var ruleStyle = rule.style[style];
								to[style] = (style.test(/color/i) && ruleStyle.test(/^rgb/)) ? ruleStyle.rgbToHex() : ruleStyle;
							});
						});
					});
					return this.parent(to);
					
				}
				
			});
			Fx.CSS.Styles = ["backgroundColor", "backgroundposition", "color", "width", "height", "left", "top", "bottom", "right", "fontSize", "letterSpacing", "lineHeight", "textIndent", "opacity", "display"];
			
			Fx.CSS.Styles.extend(Element.Styles.padding);
			Fx.CSS.Styles.extend(Element.Styles.margin);
			
			Element.Styles.border.each(function(border){
				['Width', 'Color'].each(function(property){
					Fx.CSS.Styles.push(border + property);
				});
			});
			
		}); 		
function icerikAc(sayfa) {
    var myMorph = new Fx.Morph('x9', {wait: false});
    myMorph.start('morph2');
    getObject('x9').style.background = '#222 url(resimler/loader.gif) no-repeat center center;';
    getObject('sayfaGoster').src = sayfa;
    //getObject('x9').style.overflow= 'auto';
  }
function yuklendi(){
try{
//getObject('header').style.display='block';
getObject('govde').style.display='block';
getObject('yukleniyor').style.display='none';
getObject('footer').style.display='block';
getObject('bar').style.display='block';
getObject('pKapa').style.display='block';

getObject('x9').style.bottom = x9bottom + 'px';
getObject('x9').style.display='block';

if (document.getElementById('menu')){
getObject('menu').style.display='block';
}
}
catch(err){
//Handle errors here
}
}
window.addEvent('load', function() {
	var total = $time() - startTime;
	yuklendi();
});

function ac(menuadi) {
	document.getElementById(menuadi).style.display = "";
}
function kapa(menuadi) {
	document.getElementById(menuadi).style.display = "none";
}

function onlineKatalog(adres)
 {
   mywindow = window.open (adres,"mywindow","location=0,status=0,scrollbars=0,width=920,height=690");
  mywindow.moveTo(15,2);
 } 
