$ektron(document).ready(function() {
	if ($ektron.browser.version != '6.0' && $ektron.browser.version != '7.0') { 
	$ektron('#nav ul ul li:first-child').corner('round tl bl');
	$ektron('#nav ul ul li:last-child').corner('round tr br');
	}

	$ektron('#gastretch').width(($ektron(document).width()-990)/2); 
	$ektron('#fmessage-body').width((685+($ektron(document).width()-990)/2)); 	
	function chkarrows() { cp =$("#carousel").position();
				if (cp.left<0) {$("#goleft img").show();}  
				if (cp.left>-1) {$("#goleft img").hide();}  
				if (cp.left<-1914) {$("#goright img").hide();}  
				if (cp.left>-1913) {$("#goright img").show();}  
				}
	$ektron('#goright').hover(
		function() {
		thep = $ektron("#carousel").position();
		theo = thep.left + 9000;
		$ektron("#carousel").animate({
			left: "-2100px"
			}, theo);
		},
		function() {
		$ektron("#carousel").stop();
		chkarrows();
		});
	$ektron('#goleft').hover(
		function() {
		thep = $ektron("#carousel").position();
		theo = thep.left * -3;		
		$ektron("#carousel").animate({
			left: "0px"
			}, theo);
		},
		function() {
		$ektron("#carousel").stop();
		chkarrows();
		});		
	//Preload images
	var xx=new Array();
	$ektron("#carousel li img").each( function(i) {
		xx[i] = $ektron('<img/>').attr('src',this.src.replace('_off','_on'));
		});
		
	$ektron('#carousel li img').hover(
		function() {
		this.src= this.src.replace(/_off/,"_on");
		},
		function () {
		this.src= this.src.replace(/_on/,"_off");
		});
		
	$('.trigger').bind("click", function(e) {
			$(".indent-hide").hide().css('color','white')
			$(".trigger").css({color:'#00457a',fontWeight:'normal',display:'block',backgroundColor:'#fff',height:'15px',padding:'2px'}).hover(function(){$(this).css('color','blue');},function(){$(this).css('color','#00457a');});
			$(this).next().toggle('fast', function () {$(this).prev().height($(this).height()+12);$(this).css({marginTop:(($(this).height())*-1)-15,color:'black'}); });
			$(this).css({color:'#00457c',fontWeight:'bold',display:'list-item',listStylePosition:'inside',listStyleType:"none",backgroundColor:'#CaDaea',padding:'5px',marginBottom:'5px'});
			});
			
	dice=Math.ceil(Math.random()*3);
	$("#homepicWrap img").attr("src","/images/homepic"+dice+".jpg");
	msgs = Array("No Message","We deliver customized marketing solutions through<br/>superior implementation and dedicated client service.",
					 "We create functional and easy-to-navigate websites<br/>that achieve your company's goals.",
					 "Our dedicated team of experts utilizes a comprehensive, yet<br/>creative approach to maximize your online marketing investment.");
	if (dice==3) {$("#fmessage-body").css('fontSize','20px');}
	$("#fmessage-body").html(msgs[dice]);		


});		