/*

	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
    ================================ */

thunder.client.project.pageLoaded = 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(940, 8000, 700);
	thunder.client.workarounds.alphaImages();
	thunder.client.workarounds.labelAsBrowser();
	
	$('.nav-dropdown').each(function(){
		$('.thunder-nav:last', this).css("background", "#333");
	 });
	
	$('.loginNav').click(function(){
		if($('.loginForm').css("display") == "block"){
			$('.loginForm').css("display", "none");
		} else {
			$('.loginForm').css("display", "block");
		}
	});
	
	if($('.leftNav').length){
		$('.leftNav .active').prepend('<img src="images/leftNav-arrow.jpg">');
		$('.leftNav a:last').css('border', 'none');
	}
}

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: ''
			}
		}
	);
}

$(thunder.client.project.pageLoaded);
