var SiteClass = new Class({

	initialize: function(){
	
		hs.lang.cssDirection = lang.cssDirection;
		hs.lang.loadingText = lang.loadingText;
		hs.lang.loadingTitle = lang.loadingTitle;
		hs.lang.focusTitle = lang.focusTitle;
		hs.lang.fullExpandTitle = lang.fullExpandTitle;
		hs.lang.previousText = lang.previousText;
		hs.lang.nextText = lang.nextText; 
		hs.lang.moveText = lang.moveText;
		hs.lang.closeText = lang.closeText; 
		hs.lang.closeTitle = lang.closeTitle; 
		hs.lang.resizeTitle = lang.resizeTitle;
		hs.lang.playText = lang.playText;
		hs.lang.playTitle = lang.playTitle;
		hs.lang.pauseText = lang.pauseText;
		hs.lang.pauseTitle = lang.pauseTitle;
		hs.lang.previousTitle = lang.previousTitle;
		hs.lang.nextTitle = lang.nextTitle;
		hs.lang.moveTitle = lang.moveTitle;
		hs.lang.fullExpandText = lang.fullExpandText;
		hs.lang.number = lang.number;
		hs.lang.restoreTitle = lang.restoreTitle;			
		hs.graphicsDir = 'public/images/highslide/';
		hs.align = 'center';
		hs.transitions = ['expand', 'crossfade'];
		hs.outlineType = 'rounded-white';
		hs.fadeInOut = true;
		//hs.dimmingOpacity = 0.75;
		
		hs.addSlideshow({
			//slideshowGroup: 'group1',
			interval: 5000,
			repeat: false,
			useControls: true,
			fixedControls: 'fit',
			overlayOptions: {
				opacity: .75,
				position: 'bottom center',
				hideOnMouseOut: true
			}
		});
				
	}, // initialize

	domReady: function() {
		
		$$('a#goback').each(function(a){
			a.addEvent('click', function(){ window.history.go(-1); });
		});
		
		if($('gotop')) {
			$('gotop').addEvent('click', function() {
				var scrollFx = new Fx.Scroll(window, {
					transition: Fx.Transitions.Quad.easeInOut
				});
				scrollFx.toTop();
			});
		}
		//if(typeof sIFR == "function"){
		//	sIFR.replaceElement(named({sSelector:"ul.gallery h2", sFlashSrc:"public/flash/myriadpro.swf", sColor:"#fff2e2", sLinkColor:"#fff2e2", sBgColor:"#FFFFFF", sHoverColor:"#fff2e2", sWmode:"transparent"}));
		//}

		Cufon.replace('.cufon', { hover: true });
		
		$$('div#menu > ul > li > a, div#menu ul ul a, div#bottom-menu ul a').each(function(a){
			var link = window.location.pathname.substr(1);
			if(a.get('href') == link) {
				a.getParent().addClass('active');
			}
			if(a.id == 'menu_04' || a.id == 'menu_05') { 
				a.getParent().addEvent('mouseenter', function(){ this.addClass('hover'); this.getParent().addClass('over'); });	
				a.getParent().addEvent('mouseleave', function(){ this.removeClass('hover'); this.getParent().removeClass('over'); });
			}
		});

	}, // domReady
	
	showMail: function(user, domain, country, attr, text) {
		var start = "<a href=\"mailto:" + user + "@" + domain + "." + country + "\"" + attr + ">";
		var end = "</a>";
		if(text) {
			document.write(start + user + '@' + domain + '.' + country + end);
		} else {
			document.write(start + end);
		}
		return false;
	} // showMail
	
});

var Site = new SiteClass();
window.addEvent('domready', function(){ Site.domReady(); });
