var pageLv = {'contact' : 1,'location' : 2, 'profile' : 1,'news' : 1,'toppage' : 0}Event.observe(window, 'load', page_loaded, false);function page_loaded(evt) {	pngimgs = new pngImgs;	pages = new Pages;	Event.stop(evt);}var Pages = Class.create();Pages.prototype = {	initialize : function() {		this.closeBtn = new Object();		for (propaty in pageLv) {			if (pageLv[propaty]!=0) {				this.closeBtn[propaty] = document.createElement('div');				setClass(this.closeBtn[propaty], 'close');				this.closeBtn[propaty].innerHTML = '<a href="javascript:void(0);" onclick="javascript:pages.close(\'' + propaty + '\');" onmouseover="javascript:pages.mouseover(\'' + propaty + '\');" onmouseout="javascript:pages.mouseout(\'' + propaty + '\');"><img id="' + propaty +'closeBtn" src="shared/img/arrow_l_off.gif" width="10" height="10" alt="close" /></a>';				$$('#' + propaty + ' .header')[0].appendChild(this.closeBtn[propaty]);			}		}		movinto('topmenu', -301, 0);		movinto('profile', -401, 0);		movinto('location', -516, 0);		movinto('contact', -401, 0);		movinto('news', -401, 0);		this.page = new Object();		this.open('topmenu',0);		Event.observe(window, 'resize', this.move.bind(this), false);	},	open : function(id, lv) {		var i = 0;		for (propaty in this.page) {			if (i>=lv && propaty!=id) {				movinto(propaty, -this.page[propaty], 0);				delete this.page[propaty];			}			i++;		}		this.page[id] = parseInt(getStyle($(id), "width"))+1;		this.move();	},	close : function(id) {		var i = 0;		for (propaty in this.page) {			if (propaty == id)				i = 1;			if (i == 1) {				movinto(propaty, -this.page[propaty], 0);				delete this.page[propaty];			}		}		$(id + 'closeBtn').src = 'shared/img/arrow_l_off.gif';		this.move();	},	mouseover : function(id) {		$(id + 'closeBtn').src = 'shared/img/arrow_l_on.gif';	},	mouseout : function(id) {		$(id + 'closeBtn').src = 'shared/img/arrow_l_off.gif';	},	move : function() {		var ml = this.marginLeft();		for (propaty in this.page) {			movinto(propaty, ml, -2);			ml += this.page[propaty];		}	},	marginLeft : function() {		var w;		var tw = 0;		for (propaty in this.page) {			tw += this.page[propaty];		}		if (window.innerWidth) {			w = window.innerWidth;		} else if ((document.body) && (document.body.clientWidth)) {			w = document.body.clientWidth;		}		if (document.documentElement) {			w = document.documentElement.clientWidth;		}		var lm = Math.round(w/2-tw/2);		if (lm < 30)			lm = 30;		return lm;	}}moveobject = new Object();function movinto(id, tx, ty) {	if (!moveobject[id]) {		moveobject[id] = new moveObject;	} else {		window.clearInterval(moveobject[id].interval);	}	moveobject[id].setvalue(id, tx, ty);	moveobject[id].interval = window.setInterval(moveobject[id].loop.bind(moveobject[id]),15);}var moveObject = Class.create();moveObject.prototype = {	initialize : function() {	},	setvalue : function(id, tx, ty) {		this.tgt = id;		$(this.tgt).style.left = getStyle($(id),'left');		$(this.tgt).style.top = getStyle($(id),'top');		this.tgtx = tx - parseInt($(this.tgt).style.left);		this.tgty = ty - parseInt($(this.tgt).style.top);	},	loop : function() {		if (shift) {			var v = 1/80;		} else {			var v = 1/4;		}		if (this.tgtx > 0) {			var xspd = Math.ceil(this.tgtx*v);		} else {			var xspd = Math.floor(this.tgtx*v);		}		if (this.tgtx > 0) {			var yspd = Math.ceil(this.tgty*v);		} else {			var yspd = Math.floor(this.tgty*v);		}		var x = parseInt($(this.tgt).style.left) + xspd;		var y = parseInt($(this.tgt).style.top) + yspd;		$(this.tgt).style.left = x + 'px';		$(this.tgt).style.top = y + 'px';		this.tgtx -= xspd;		this.tgty -= yspd;		if (this.tgtx == 0 && this.tgty == 0)			window.clearInterval(this.interval);	}}var shift = false;document.onkeydown = function(e) {	shift = true;}document.onkeyup = function(e) {	shift = false;}function getStyle(obj, propName) {	if (document.defaultView){		var boxCSS = document.defaultView.getComputedStyle(obj, null);		return boxCSS.getPropertyValue(propName);	}	if (obj.currentStyle){		return obj.currentStyle.getAttribute(propName);	}}var alphaPNG = new Array;var pngImgs = Class.create();pngImgs.prototype = {	initialize : function() {		f = $$('.alpha');		for (i=0; i<f.length; i++) {			this.imgObj = f[i];			this.blankImgSrc = 'shared/img/trans.gif';			this.show();		}	},	show: function() {		if (/MSIE (5\.5|6\.)/.test(navigator.userAgent)) {			orgSrc = this.imgObj.src;			this.imgObj.src = this.blankImgSrc;			this.imgObj.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(" + "src='" + orgSrc + "', sizingMethod='scale')";		}	}}