var SiteClass = new Class({

	initialize: function(){
	
	}, // initialize

	domReady: function() {

		$$('ul#menu a').each(function(a){
			var link = window.location.pathname.substr(1);
			if(a.get('href') == link || (a.get('href') == '/' && link == '')) {
				a.getParent('li').addClass('active');
				var next;
				if(next = a.getParent('li').getNext()) {
					next.getFirst().getFirst().setStyle('background', 'none');
				}
			}
		});

		Cufon.replace('.cufon', { hover: true });
		Cufon.now();
		
		$$('a#gotop').each(function(a){
			a.addEvent('click', function() {
				var scrollFx = new Fx.Scroll(window, { transition: Fx.Transitions.Quad.easeInOut });
				scrollFx.toTop();
			});
		});
		$$('a#goback').each(function(a){
			a.addEvent('click', function(){ window.history.go(-1); });
		});

		if($('gmap')) this.loadMap();
	}, // domReady
	
	map: null,
	loadMap: function() {
		
		var myLatlng = new google.maps.LatLng(49.995454, 20.299658);
		var myOptions = {
		zoom: 11,
		center: myLatlng,
		mapTypeId: google.maps.MapTypeId.ROADMAP
		}
		
		this.map = new google.maps.Map($('gmap'), myOptions);
		
		var marker = new google.maps.Marker({
			position: myLatlng, 
			map: this.map
		});
		
	}, // loadMap
	
	showMail: function(user, domain, contry, attr) {
		var start = "<a href=\"mailto:" + user + "@" + domain + "." + contry + "\"" + attr + ">"+user+'@'+domain+'.'+contry;
		var end = "</a>";
		document.write(start + end);
		return false;
	} // showMail
	
});

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

