//<script>
	_nav_xSpacing=40; // keep same as php var
	_nav_ySpacing=30; // keep same as php var
	_contentTextWidth=224;
var _visible = 'visible', _hidden = 'hidden';
var _mOverActive = null;
var _activeMenuDiv=[null,null,null,null,null];
var _mx=0;
var _my=0;
var _activeSubmenu="";
var _contentRowArray=new Array();
var _NavButtonsCoordsArray=new Array();
// ---------------
	function getWindowSize() {
		var _hey=new Array();
		_hey[0] = 0; _hey[1] = 0;
		if( typeof( window.innerWidth ) == 'number' ) {
			//Non-IE
			_hey[0] = window.innerWidth;
			_hey[1] = window.innerHeight;
			}
			else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    			//IE 6+ in 'standards compliant mode'
				_hey[0] = document.documentElement.clientWidth;
				_hey[1] = document.documentElement.clientHeight;
			}
			else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
				//IE 4 compatible
				_hey[0] = document.body.clientWidth;
				_hey[1] = document.body.clientHeight;
			}
		return (_hey);
		}
	function getDivHeight(_div) {
		if (document.getElementById) { 
			_div2=document.getElementById(_div);
			if(_div2!=null) {
				if(_div2.offsetHeight) {
					_divHeight=_div2.offsetHeight;
					}
				else if(_div2.style.pixelHeight) {
					_divHeight=_div2.style.pixelHeight;
					} 
				}
			else _divHeight=0;
			}
		else if (document.all) { 
			eval("_divHeight = document.all["+_div+"].style."+height+";");
			}
		return (_divHeight);
		}
	function adjustRowPositions(_id) {
		//alert(getProp("contentRow"+_id,"top"));
		if (getProp("contentRow"+_id,"top")!=null) {
		for (_i=_id;_i<=_contentRowArray.length;_i++) {
			hide("contentRow"+_i);
			_tmpW=parseInt(_contentRowArray[_i-1]._width[_contentRowArray[_i-1]._pos]);
			if (_tmpW<=1) { _tmpW+=parseInt(_contentTextWidth*2)+15; }
			else { 
				if (_tmpW<464) {
					_tmpW+=_contentTextWidth;
					}
				else { }
				}
			setProp("contentRow"+(_i),"width",_tmpW+"px");
			_tmpHeight=getDivHeight("contentRow"+_i);
			_tmpTop=getProp("contentRow"+_i,"top");
			_tmpTop=_tmpTop.substring(0,_tmpTop.length-2);
			// set nav mainDiv Y
			_tmpNavY=parseInt(_tmpTop)+parseInt(_contentRowArray[_i-1]._height[_contentRowArray[_i-1]._pos])-parseInt(_nav_ySpacing);
			setProp("menuNavigation"+_i,"top",_tmpNavY+"px");
			//alert(parseInt(_contentRowArray[_i]._height[_pos]));
			// set content Y 
			if (_contentRowArray[_i]) {
				_tmpTop=parseInt(_tmpTop)+parseInt(_tmpHeight)+10; // +(_i*5); (space between rows....!)
				setProp("contentRow"+(_i+1),"top",_tmpTop+"px");
				}
			// set nav buttons X
			_tmpNavX1=_contentRowArray[_i-1]._width[_contentRowArray[_i-1]._pos]-(_nav_xSpacing*2)+10;
			_tmpNavX2=_contentRowArray[_i-1]._width[_contentRowArray[_i-1]._pos]-_nav_xSpacing+10;
			setProp("menuNav"+_i+"00","left",_tmpNavX1+"px");
			setProp("menuNav"+_i+"01","left",_tmpNavX2+"px");
			// set nav-over buttons X
			setProp("menuNav"+_i+"00over","left",_tmpNavX1+"px");
			setProp("menuNav"+_i+"01over","left",_tmpNavX2+"px");

			// set new nav buttons mouseover coords
			_NavButtonsCoordsArray["menuNav"+_i+"00"]=[parseInt(_tmpNavX1),parseInt(_tmpNavY),parseInt(_tmpNavX1+_nav_xSpacing),parseInt(_tmpNavY+_nav_ySpacing)];
			_NavButtonsCoordsArray["menuNav"+_i+"01"]=[parseInt(_tmpNavX2),parseInt(_tmpNavY),parseInt(_tmpNavX2+_nav_xSpacing),parseInt(_tmpNavY+_nav_ySpacing)];
			show("contentRow"+_i);
			}
			}
		}
	function _contentRow(id, images,widths,heights,pos) {
		this._id = id;
		this._image = images;
		this._width = widths;
		this._height = heights;
		this._pos = pos;
		this.next = function() {
			if (this._image[this._pos+1]) { 
				this._pos++;
				switchImg("contentImage"+this._id, this._image[this._pos], this._width[this._pos] ,this._height[this._pos]);
				adjustRowPositions(this._id);
				//alert(this._id+":"+getProp("prevButton1","onmouseover"));
				}
			else { /*alert("no!");*/ }
			}
		this.prev = function() {
			if (this._image[this._pos-1]) { 
				this._pos--;
				switchImg("contentImage"+this._id, this._image[this._pos], this._width[this._pos] ,this._height[this._pos]);
				adjustRowPositions(this._id);
				//alert(this._id+":"+getProp("prevButton1","onmouseover"));
				}
			else { /*alert("no!");*/ }
			}
		return this;
		}
	function switchImg(_imgId, _newImg, _w ,_h) {
		changeImage2(_imgId,_newImg);
		setProp(_imgId,'width',_w+'px');
		setProp(_imgId,'height',_h+'px');
		}
// ---------------	
	function showSubmenu(_id) {
		if (_activeSubmenu!="") { hide(_activeSubmenu); }
		_activeSubmenu=_id;
		show(_activeSubmenu);
		}
	function spawn(_url) {
		window.open(_url,'_blank');
		}
	function sendFrontpage(_url,_selectItem) {
		if (_selectItem.value!="") {
			location = _url + _selectItem.value;
			}
		}
	function setActMO(_d) {
		if (_mOverActive!=null) { hide(_mOverActive); }
		_mOverActive = _d; 
		if (_mOverActive!=null) { show(_mOverActive); }
		}
	function getPropertyDOM(_id,_property) {
		var _obj=document.getElementById(_id);
		if (_obj!=null) {
			_obj=_obj.style;
			if (_obj[_property]) {
				return _obj[_property];
				}
			}
		return (_obj!=null) ? _obj[_property] : null;
		}
	function setPropertyDOM(_id,_property,_value) {
		var _obj = document.getElementById(_id);
		if (_obj!=null) {
			//alert(_value);
			_obj=_obj.style;
			_obj[_property]=_value;
			//eval("document.getElementById('"+_id+"').style."+_property+"='"+_value+"'");
			}
		}
	function getProp(_id,_property) {
		if (document.getElementById) { result = getPropertyDOM(_id,_property); }
		else if (document.all) { eval("result = document.all["+_id+"].style."+_property+";"); }
		else { result = null; alert("getprop error"); }
		return result;
		}
	function setProp(_id,_property,_value) {
		if (document.getElementById) { setPropertyDOM(_id,_property,_value); }
		else if (document.all) { eval("document.all["+_id+"].style."+_property+"="+_value+";"); }
		else { alert("setprop error"); }
		}
	var _preloadCnt=0;
	function preload(_name, _path) {
		if (_name==null) { _name="img"+_preloadCnt; _preloadCnt++; }
		eval(_name + ' = new Image()'); eval(_name + '.src = "' + _path + '"');
		}
	function changeImage(_layer,_image1,_image2) {
		if (document.getElementById) { document.getElementById(_image1).src = eval(_image2+'.src'); }
		else { document.images[_image1].src = eval(_image2+'.src'); }
		}
	function changeImage2(_imageId,_src) {
		if (document.getElementById) { document.getElementById(_imageId).src = _src; }
		else { document.images[_image1].src = _src; }
		}
	function hide(_id) { setProp(_id,"visibility",_hidden); }
	function show(_id) { setProp(_id,"visibility",_visible); }
	function moveObj(_id,_x,_y,_add) {
		var _oldX = parseInt(getProp(_id, "left")); var _oldY = parseInt(getProp(_id, "top"));
		if (_add) { if (_x) { setProp(_id, "left", _oldX + _x); } if (_y) { setProp(_id, "top", _oldY + _y); } }
		else { if (_x) { setProp(_id, "left", _x+"px"); } if (_y) { setProp(_id, "top", _y+"px"); } }
		}

