




/***** Jquery swfobject *****/

(function(F,C){var D=function(H){var G,I=[];for(G in H){if(/string|number/.test(typeof H[G])&&H[G]!==""){I.push(G+'="'+H[G]+'"')}}return I[A]("")},E=function(I){var G,K,J=[],H;if(typeof I=="object"){for(G in I){if(typeof I[G]=="object"){H=[];for(K in I[G]){H.push([K,"=",encodeURIComponent(I[G][K])][A](""))}I[G]=H[A]("&amp;")}if(I[G]){J.push(['<param name="',G,'" value="',I[G],'" />'][A](""))}}I=J[A]("")}return I},B=false,A="join";F[C]=(function(){try{var G="0,0,0",H=navigator.plugins["Shockwave Flash"]||ActiveXObject;G=H.description||(function(){try{return(new H("ShockwaveFlash.ShockwaveFlash")).GetVariable("$version")}catch(J){}}())}catch(I){}G=G.match(/^[A-Za-z\s]*?(\d+)[\.|,](\d+)(?:\s+[d|r]|,)(\d+)/);return{available:G[1]>0,activeX:H&&!H.name,version:{major:G[1]*1,minor:G[2]*1,release:G[3]*1},hasVersion:function(K){var N=this.version,L="major",M="minor",J="release";K=(/string|number/.test(typeof K))?K.toString().split("."):K||[0,0,0];K=[K[L]||K[0]||N[L],K[M]||K[1]||N[M],K[J]||K[2]||N[J]];return(K[0]<N[L])||(K[0]==N[L]&&K[1]<N[M])||(K[0]==N[L]&&K[1]==N[M]&&K[2]<=N[J])},expressInstall:"expressInstall.swf",create:function(J){if(!F[C].available||B||!typeof J=="object"||!J.swf){return false}if(J.hasVersion&&!F[C].hasVersion(J.hasVersion)){J={swf:J.expressInstall||F[C].expressInstall,attrs:{id:J.id||"SWFObjectExprInst",name:J.name,height:Math.max(J.height||137),width:Math.max(J.width||214)},params:{flashvars:{MMredirectURL:location.href,MMplayerType:(F[C].activeX)?"ActiveX":"PlugIn",MMdoctitle:document.title.slice(0,47)+" - Flash Player Installation"}}};B=true}else{J=F.extend(true,{attrs:{id:J.id,name:J.name,height:J.height||180,width:J.width||320},params:{wmode:J.wmode||"opaque",flashvars:J.flashvars}},J)}if(F[C].activeX){J.attrs.classid=J.attrs.classid||"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000";J.params.movie=J.params.movie||J.swf}else{J.attrs.type=J.attrs.classid||"application/x-shockwave-flash";J.attrs.data=J.attrs.data||J.swf}return["<object ",D(J.attrs),">",E(J.params),"</object>"][A]("")}}}());F.fn[C]=function(G){if(typeof G=="object"){this.each(function(){var I=document.createElement(C);var H=F[C].create(G);if(H){I.innerHTML=H;if(I.childNodes[0]){this.appendChild(I.childNodes[0])}}})}else{if(typeof G=="function"){this.find("object").andSelf().filter("object").each(function(){var I=this,H="jsInteractionTimeoutMs";I[H]=I[H]||0;if(I[H]<660){if(I.clientWidth||I.clientHeight){G.call(this)}else{setTimeout(function(){F(I)[C](G)},I[H]+66)}}})}}return this}}(jQuery,"flash"));








/***** Functions *****/

boxSlide = function(){
	$('.box2, .box3, .box4').mouseenter(function(){
		$(this).find('.hiddenbox, .hiddenbox3, .hiddenbox4').stop().animate({ height: $(this).find('.spacing, .spacing3, .spacing4').outerHeight() }, 600, 'easeOutQuint');
	}).mouseover(function(){
		$(this).find('.hiddenbox, .hiddenbox3, .hiddenbox4').stop().animate({ height: $(this).find('.spacing, .spacing3, .spacing4').outerHeight() }, 600, 'easeOutQuint');
	});
	$('.box2, .box3, .box4').mouseleave(function(){
		$(this).find('.hiddenbox, .hiddenbox3, .hiddenbox4').stop().animate({ height: 0 }, 400, 'easeOutQuint');
	}).mouseout(function(){
		$(this).find('.hiddenbox, .hiddenbox3, .hiddenbox4').stop().animate({ height: 0 }, 400, 'easeOutQuint');
	});
}

boxFade = function(){
	$('.fade').mouseenter(function(){
		$(this).stop().animate({ backgroundColor: "#231F20;" }, 1000, 'easeOutQuint');
	}).mouseover(function(){
		$(this).stop().animate({ backgroundColor: "#231F20;" }, 1000, 'easeOutQuint');
	});
	$('.fade').mouseleave(function(){
		$(this).stop().animate({ backgroundColor: "#FFFFFF" }, 1000, 'easeOutQuint');
	}).mouseout(function(){
		$(this).stop().animate({ backgroundColor: "#FFFFFF" }, 1000, 'easeOutQuint');
	});
	$('.fadeGrey').mouseenter(function(){
		$(this).stop().animate({ backgroundColor: "#EBEBEB" }, 1000, 'easeOutQuint');
	}).mouseover(function(){
		$(this).stop().animate({ backgroundColor: "#EBEBEB" }, 1000, 'easeOutQuint');
	});
	$('.fadeGrey').mouseleave(function(){
		$(this).stop().animate({ backgroundColor: "#FFFFFF" }, 1000, 'easeOutQuint');
	}).mouseout(function(){
		$(this).stop().animate({ backgroundColor: "#FFFFFF" }, 1000, 'easeOutQuint');
	});
}

imageFade = function(){
	$('.imageFade img').animate({ opacity: 0.4 }, 0);
	$('.imageFade').mouseenter(function(){
		$(this).find('img').stop().animate({ opacity: 1 }, 1000, 'easeOutQuint');
	}).mouseover(function(){
		$(this).find('img').stop().animate({ opacity: 1 }, 1000, 'easeOutQuint');
	});
	$('.imageFade').mouseleave(function(){
		$(this).find('img').stop().animate({ opacity: 0.4 }, 1000, 'easeOutQuint');
	}).mouseout(function(){
		$(this).find('img').stop().animate({ opacity: 0.4 }, 1000, 'easeOutQuint');
	});
}

ourServices = function(){
	$('#topNav > ul > li:contains("Our Services")').not('#topNav > ul > li.nojava').addClass('ourServices');
	var navWidth = $('#topNav ul').width() - 18;
	if(navWidth < 350){
		navWidth = 350;
	}
	$('#topNav').append('<div id="ourServices"><div class="col1"></div><div class="col2"></div></div>');
	$('.footerbox1, .footerbox3').clone().appendTo('#ourServices .col1');
	$('.footerbox2').clone().appendTo('#ourServices .col2');
	$('#ourServices').width(navWidth);
	$('.ourServices, #ourServices').mouseenter(function(){
		$('.ourServices').addClass('navup');
		$('#ourServices').stop().animate({ height: $('#ourServices > div').outerHeight() }, 600, 'easeOutQuint');
	}).mouseover(function(){
		$('.ourServices').addClass('navup');
		$('#ourServices').stop().animate({ height: $('#ourServices > div').outerHeight() }, 600, 'easeOutQuint');
	});
	$('.ourServices, #ourServices').mouseleave(function(){
		$('#ourServices').stop().animate({ height: 0 }, 400, function(){
			$('.ourServices').removeClass('navup');
		});
	}).mouseout(function(){
		$('#ourServices').stop().animate({ height: 0 }, 400, function(){
			$('.ourServices').removeClass('navup');
		});
	});
}

shuffle = function(o){
	for(var j, x, i = o.length; i; j = parseInt(Math.random() * i), x = o[--i], o[i] = o[j], o[j] = x);
	return o;
};

var holdTime = 4000;
var scrollSpeed = 1400;
var scrollDistance = 436;
var number = 0;
var showcaseDir = '/static/images/showcase/';
var showcaseArray = new Array();
imageSlider = function(){
	$('#container2 *:first').animate({
		marginLeft: '-='+scrollDistance
	}, scrollSpeed, 'easeOutQuint', function() {
		if(showcaseArray.length == 0){
			number += 1;
			$('#numbers span').removeClass('on');
			if(number >= $('#container2 img').size()){
				number = 0;
			}
			$('#numbers span:eq(' + number + ')').addClass('on');
			$('#container2 img:first').appendTo('#container2 > *:first');
			$('#container2 > *:first').animate({marginLeft: '+='+scrollDistance}, 0);
		}
		else{
			$('#container2 > *:first').animate({width: '+='+scrollDistance}, 0);
			$('#showcase').append('<img src="' + showcaseDir + showcaseArray[0] + '" />');
			showcaseArray.splice(0,1);
		}
	});
}



function flashElements(){
	if($.flash.hasVersion(8)){
		$('#box5').empty().flash({swf:"/static/flash/home_insideww.swf", width:"715", height:"257", expressInstaller:'/static/flash/expressInstall.swf', params:{wmode:'transparent'}});
		$('#homeFlash').empty().flash({swf:"/static/flash/banners.swf", width:"960", height:"330", expressInstaller:'/static/flash/expressInstall.swf', params:{wmode:'transparent'}});
	}
}



$(document).ready(function(){
 	
	boxSlide();
	boxFade();
	
	});


