$(function(){	
		  
		  

	 
/*---- MAIN MENU DROPDOWNS FOR IE6 ---*/
 if (jQuery.browser.msie && jQuery.browser.version == "6.0") {
	$('#nav li').hover(function(){
		if ($(this).parent().attr('id') == 'nav') {
			$(this).addClass('currnav');
			$(this).find('a:eq(0)').css('color','#746548');
		}
	},function(){
		if ($(this).parent().attr('id') == 'nav') {
			$(this).removeClass('currnav');
			$(this).find('a:eq(0)').css('color','#fff');
		}
	});	
}


/*---- OPEN .EXTERNAL LINKS IN NEW WINDOW ---*/
$('.external').click( function() {
 if (!$(this).hasClass('movie1')) {							   
	window.open($(this).attr('href'));					   
	return false;
	}
});
							   
function openSizedExternal(width,height,resize) {
}
	


/*---------- WHAT'S NEW SLIDER ---------*/

$('#whatsNew').append('<a href="" class="leftArrow"><img src="index_images10/arrowleft.gif" alt="previous" width="24" height="24" /></a><a href="" class="rightArrow"><img src="index_images10/arrowright.gif" alt="next" width="24" height="24" /></a>	');

var maxLength = $('#whatsNew ul li').length;
var slideCounter = 1;
$('#whatsNew .leftArrow').click( function() {
	if (slideCounter != 1) {													  
		var position = $(this).parent().find('ul').position();
		$(this).parent().find('ul').animate({ left: position.left + 250 + "px"}, 600 );
		slideCounter--;
	} else if (slideCounter == 1) {	
		$(this).parent().find('ul').animate({ left: -((maxLength-1) * 250) + "px"}, 400 );
		slideCounter = maxLength;
	}
	return false;
});

$('#whatsNew .rightArrow').click( function() {
	if (slideCounter != maxLength) {									   
		var position = $(this).parent().find('ul').position();
		$(this).parent().find('ul').animate({ left: position.left - 250 + "px"}, 600 );
		slideCounter++;
	} else if (slideCounter == maxLength) {	
		$(this).parent().find('ul').animate({ left: "0px"}, 400 );
		slideCounter = 1;
	}
	return false;
});



/*---------- VIDEO SHOW/HIDE ---------*/

	var showmovie = '<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" width="480" height="280" codebase="http://www.apple.com/qtactivex/qtplugin.cab"><param name="src" value="http://mfile.akamai.com/17525/mov/colonialwil.download.akamai.com/17525/HanksPSA/TomHanksPSA_512k.mov"><param name="autoplay" value="true"><param name="controller" value="true"><param name="loop" value="false"><param name="bgcolor" value="#000000"><embed src="http://mfile.akamai.com/17525/mov/colonialwil.download.akamai.com/17525/HanksPSA/TomHanksPSA_512k.mov" width="480" height="280" bgcolor="#000000" autoplay="true" controller="true" loop="false" pluginspage="http://www.apple.com/quicktime/download/"></embed></object>';

	
$('#aboutCW .movieThumb').click( function() {
if (jQuery.browser.msie && jQuery.browser.version == "6.0") {
	$('#movieSpot').replaceWith(showmovie);
 } 
	$('#movieLayer').toggle();
 
	return false;
/*	if ($('#movieLayer').css('left') != '150px') {
		$('#movieLayer').css('left','150px');	
	} else {
		$('#movieLayer').css('left','-9999px');
	}*/
});

$('#movieLayer a').click ( function() {
	if ($(this).hasClass('movieClose')) {
		$('#movieLayer').hide();
		//$('#movieLayer').css('left','-9999px');
		return false; 
	} 
});

		  
		  

//---------------------- image rotation script now called from /cwf_scripts/rotator.js --------------------------//




});	  
