window.onload = function() {   
	if($j("#slideshow").length > 0) {
		$j("#slideshow").html("");
		//$j("#slideshow").html('<object width="710" height="280"><param name="movie" value="_media/slideshow.swf"><param name="wmode" value="opaque" /><embed src="_media/preloader.swf" width="710" height="280" wmode="opaque"></embed></object>');
		$j("#slideshow").html('<a href="?p=financial-planning-reporting"><img src="_assets/images/slide-1.jpg" border="0" /></a><a href="?p=financial-planning-reporting"><img src="_assets/images/slide-2.jpg" border="0" /></a><a href="?p=financial-planning-reporting"><img src="_assets/images/slide-3.jpg" border="0" /></a><a href="?p=financial-planning-reporting"><img src="_assets/images/slide-4.jpg" border="0" /></a><a href="?p=financial-planning-reporting"><img src="_assets/images/slide-5.jpg" border="0" /></a><a href="?p=financial-planning-reporting"><img src="_assets/images/slide-6.jpg" border="0" /></a><a href="?p=financial-planning-reporting"><img src="_assets/images/slide-7.jpg" border="0" /></a>');
		
		var so = new SWFObject("_media/preloader.swf", "slideshow", "710", "280", "9.0.0", "");
		so.addVariable("variable", "slideshow");
		so.addParam("wmode", "opaque");
		so.write("slideshow");
		
		if (navigator.mimeTypes ["application/x-shockwave-flash"] == undefined) {
			$j("#slideshow").cycle();
		}
	}
};

$j(document).ready(function() {
	
	$j(".accordion").accordion({
		autoHeight: false
	});
	
	// # Modal Window
	//$j("a.modal").fancybox({
		//'modal' : true
	//	scrolling: 'no',
	//	autoScale: 'true'
	//});
		
	if ($j('.quoteshow').length > 0) {
		$j('.quoteshow').cycle({
			'cleartype':true,
			'cleartypeNoBg':true
		});
	}
	
	$j("ul").prev("p").addClass("last");
	
	//$j('._widgets ._sub-nav').parent().addClass('_featurebox');
	
	// # IE Helpers
	$j('#nav>li:last-child').addClass('_last-child');
	$j('._featurebox:last-child').addClass('_last-child'); 
	$j('fieldset:last-child').addClass('_last-child'); 
	
	//$j("ul.List-dot li").addClass("List-dot").parent().removeClass("List-dot");
	//$j("ul.List-checkbox li").addClass("List-checkbox").parent().removeClass("List-checkbox");
	
	//$j('a.button, #wrapper input._submit').each(function(i){
	//	if ($j(this).hasClass('_submit') == true) {
			//$j(this).wrap('<span class="button-wrap"><span class="button-right"></span></span>');
	//	} else {
 	//		//$j(this).wrapInner('<span class"">');
 	//	}
	//});
	$j('a.submit').unbind();
	$j('a.submit').click(function(e){
		e.preventDefault();
		var href = $j(this).attr('href');
		var form = $j(this).parents('form');
		if (href != '' && href != '#') {
			form.attr('action',href);
		}
		form.submit();		
	});
	
	//$j('._widgets ._sub-nav li a').prepend('&raquo; ');	
	
	if ($j.browser.msie == true && $j.browser.version.substr(0,1) == 7) {
		$j("#main select").each(function(){
			width = $j(this).width();
			$j(this).attr('rel', width)
		});
		//$j("#xmain select").click(function(){
	//		$j(this).css("width", "auto");			
	 //      // $j(this).data("origWidth", $j(this).css("width")).css("width", "auto");
	   // }).blur(function(){
	   // 	width = $j(this).attr('rel');
	 //   	$j(this).width(width);
	        //$j(this).css("width", $j(this).data("origWidth"));
	  //  });
    }
    if ($j.browser.msie == true) {
    	$j('._text img[style], ._featurebox img[style]').each(function(i){
    		//var styles = $j(this).attr('style');
    		//$j(this).attr('style',styles+';margin: 0 10px 5px 10px;');
    	});
    	
    	$j('._text img, ._featurebox img').filter('[style*="float"]').each(function(i){
    		if ($j(this).hasClass('nofloat') == false) {
				var styles = $j(this).attr('style');
				$j(this).attr('style',styles+';margin: 0 10px 5px 10px;');
			}    		
    	});
    }
    
    $j('select[name*=country]').addClass('selectCountry');

	$j(".Highlight-Red-Arrow").wrap('<span class="red-arrow-wrap"></span>');
	
	$j("#keypoints a.btn").click(function(e){
		e.preventDefault();
		$j(this).siblings(".desc").toggleClass("hidden");
	});
});
