var Site = {
	start: function(){
		
			if($('kwick')) Site.parseKwicks();
			if ($('menu-page')){
			  	
				//Site.createOverMenuPage();
				
//				if (!window.ie6) Site.makeShadow();
			}
	},
	
	
	createOverMenuPage: function(){
	  		
	  		var sideblocks = $$('#menu-page li');
	  		
	  		sideblocks.each(function(el,i){
	  			
	  			var first = el.getFirst();
	  			if (!first || first.getTag() != "a") {
				    return;		    
				}
				var overfxs = new Fx.Styles(first,{duration:200, wait:false});
				
				var tocolor = "A81E39";
			    var fromcolor = "535c73";
			    
			    el.mouseouted = true;
			    el.addEvent("mouseenter", function (e) {overfxs.start({color:tocolor, 'margin-left':10});});
			    el.addEvent("mouseleave", function (e) {overfxs.start({color:fromcolor, 'margin-left':0});});
			    
			}, this);
	  
	},
	
	
	parseKwicks: function(){
	  	
	  	var kwincksWidth = 22;
	  	
		var kwicks = $$('#kwick .kwick');
		var fx = new Fx.Elements(kwicks, {wait: false, duration: 200, transition: Fx.Transitions.quadOut});
		kwicks.each(function(kwick, i){
			kwick.addEvent('mouseover', function(e){
				e = new Event(e).stop();
				var obj = {};
				obj[i] = {
					'width': [kwick.getStyle('width').toInt(), 80]
				};
				kwicks.each(function(other, j){
					if (other != kwick){
						var w = other.getStyle('width').toInt();
						if (w != kwincksWidth) obj[j] = {'width': [w, kwincksWidth]};
					}
				});
				fx.start(obj);
			});
		});
		
		document.addEvent('mouseover', function(e){
			e = new Event(e);
			var rel = e.relatedTarget;
			if (!rel) return;
			if (rel.hasClass && (rel.hasClass('kwicks') || rel.hasClass('kwick') || rel.id == 'kwick')){
				var obj = {};
				kwicks.each(function(other, j){
					obj[j] = {'width': [other.getStyle('width').toInt(), kwincksWidth]};
				});
				fx.start(obj);
			};
		});
	}
	
	
	
};


window.addEvent('load', Site.start);

