﻿
var visitedValue = "0";
jQuery(document).ready(function() {
	try {
		jQuery('#mycarousel').jcarousel({
			scroll: 3,
			animation: "slow",
            initCallback: updateHPContainerBGImage
		});
	} catch (err) {

	}
	jQuery('#dvFooter').css('background-repeat', 'repeat-x');

});

function updateHPContainerBGImage() {    
//   var DefaultHeight = jQuery("#dvContainer").height();
//    if (jQuery(window).height() >= DefaultHeight) {
//        jQuery("#dvContainer").css('height', jQuery(window).height());
//    } else {
//        jQuery("#dvContainer").css('height', DefaultHeight);
    //    }
     var DefaultHeight = jQuery("#dvMainBodyOverLay").height();
     
     if ((jQuery("#dvMainBodyOverLay").height() + 300) < jQuery("#dvContainer").height()) {
         jQuery("#dvContainer").height(DefaultHeight);
     }
     if (jQuery("#dvContainer").height() < jQuery(window).height()) {
         jQuery("#dvContainer").height(jQuery(window).height());
     }

     jQuery(window).resize();

}
//TODO pass in var to show if user has viewed the flash  movie so it does not play again. need to use JS cookie and make sure flash movie actually works correctly with the var

visitedValue = getCookie("visitedValue");
if (visitedValue != "0" && visitedValue != "1") {
	visitedValue = 0;
}
//expire in 1 day
setCookie("visitedValue", "1", 1);

var flashvars = { visited: visitedValue, xmlToLoad: "/layouts/Godfrey/Homepage%20Flash%20XML.aspx" }; //"/includes/flash/godfrey.xml" };
//var flashvars = { xmlToLoad: "/includes/flash/godfrey.xml" };
var params = { wmode: 'transparent' };
var attributes = { quality: "high", allowScriptAccess: "sameDomain", wmode: "transparent" };

swfobject.embedSWF("/includes/flash/9999-1110_HomepageFlash_D7.swf", "dvHomePageFlash", "930", "340", "10.0.0", "/includes/flash/expressInstall.swf", flashvars, params, attributes);


