/*

	Filename             sitewide.js
	Detail               Site functionality
	Author:              thunder::tech inc.
	License:             CLIENT is defined as the owner of online property from which this file resides or this code is referenced in.
						 ADDITIONAL PARTY is defined as anyone other than thunder::tech or CLIENT.
						 No right is granted to ADDITIONAL PARTY to sell, distribute, modify or otherwise transfer the following source code without explicit written permission by CLIENT or thunder::tech.

*/

/*  ================================
     Sitewide JavaScript
    ================================ */

$(document).ready(function () {
    //thunder.client.project.flashReplace();
    thunder.client.modify.rollImages();
    //thunder.client.modify.linkOptions();
    //thunder.client.modify.tabSet();
    //thunder.client.modify.treeMenu(false);
    thunder.client.modify.treeMenu(false, [thunder.client.modes.separatorTreeMenu]);
    //thunder.client.modify.treeMenu(false, [thunder.client.modes.imageTreeMenu]);
    //thunder.client.modify.selfLabelFields();
    //thunder.client.modify.requireFields();
    //thunder.client.modify.dropSelector(true);
    //thunder.client.modify.scrollFeature(640, 3000, 500);
    thunder.client.workarounds.alphaImages();
    thunder.client.workarounds.labelAsBrowser();
    //$(window).bind("resize", fixFooter); 
    $(window).load(function () { fixFooter(); });
    $(".nav-dropdown").each(function () {
        $(".thunder-nav:last", this).css("border", "none");
    });

    try {
        $('.slider').scrollIt({
            menuHeight: 104,
            menuWidth: 326,
            itemHeight: 104,
            itemWidth: 104,
            initialItem: 0
        });

    } catch (e) { }

});

function fixFooter(){
    
	//if($(window).height() > $(".layout").height()){
		$(".footer").css("height", ($(window).height() - $(".layout").height() + 50) + "px");
		//alert("Window: " + $(window).height() + "\n Layout: " + $(".layout").height() + "\n Difference + 50: " + $(".footer").css("height"));
	//}
}

thunder.client.project.flashReplace = function()
{
	$('.flash-billboard').flash(
		{
			swf: 'flash/billboard.swf',
			height: 200,
			width: 800,
			allowFullScreen: true,
			allowScriptAccess: 'always',
			hasVersion: 9,
			wmode: 'transparent',
			flashvars: {
				basePath: ''
			}
		}
	);
}

//$(document).ready(function(){ thunder.client.project.pageLoaded });
