// JavaScript Document
function createRand(maxInt){
	return Math.round(Math.random()*maxInt);
}

$(document).ready(function(){
var l=window.location.toString();													 
if(l.match('services')){
$('.buttons').animate({marginLeft:"+6em"},'slow');
$('.main').one('click',function(){$('.scales').animate({right:"1.1em"},1000).delay(800).fadeTo(1000,0);});
$('#mainContent').css('backgroundImage','none');
$('.main').bind('click',function(e){	
$('.selected').css('background','#ebebeb').css('border','outset 2px white').css('color','#17293b').removeClass('selected');													
$(this).css('background','#373737').css('border','inset 2px #333').css('color','#fff').addClass('selected');							
$(this).siblings('li').find('ul').add('li').fadeTo('normal',0);
$(this).find('ul').add('li').fadeTo('slow',1);
$('.rightSide').find('span').not('.notshowing').fadeTo('fast',0,function(){
$(this).css('display','none');																$(this).removeClass('showing');
$(this).addClass('notshowing');	
$('.notshowing').eq(Math.abs(createRand(4)-createRand(3))).fadeTo(1000,1,function(){
$(this).removeClass('notshowing');			
$(this).addClass('showing');
$(this).siblings('span').css('display','none');
});
});});}

	
$('.left').find('img').bind('mousedown mouseover mouseup mouseout',function(evt,source,evstring,newsource){
evt=evt.type;
source=$(this).attr('id');
evstring=evt.toString().slice(5);
if(evstring=='out'){
newsource='/imgs/'+source+'.png';
}
else if (evstring=='up'){
newsource='/imgs/'+source+'.png';
}
else
{
newsource='/imgs/'+source+evstring+".png";
}
$(this).attr('src',newsource);
});

});
