/*

	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.modify.rollImages();
	//thunder.client.modify.linkOptions();
	//thunder.client.modify.tabSet();
	//thunder.client.modify.treeMenu(false, true);
	//thunder.client.modify.selfLabelFields();
	//thunder.client.modify.requireFields();
	thunder.client.workarounds.alphaImages();
	if($('#video').length > 0)
	{
		var so = new SWFObject("http://www.youtube.com/v/qaElm_h9KpU&hl=en_US&fs=1&rel=0&hd=1", "video-swf", "640", "385", "9", "");
		so.addParam("quality", "high");
		so.addParam("wmode", "transparent");
		so.addParam("allowFullScreen", "true");
		so.addParam("allowScriptAccess", "always");
		so.write("video");
	}
	if($('.dyktf-text').length>0) $("ul#banner").jBanner({height:263,width:195,caption:false,speed:2000,delay:6000});
	if($('.dyktf-home').length>0) setInterval(thunder.client.project.rotateHomeFacts, 6000);
	thunder.client.project.homeFacts = $('.fact').children('p');
}

thunder.client.project.currentHomeFact = 0;

thunder.client.project.rotateHomeFacts = function()
{
	$(thunder.client.project.homeFacts[thunder.client.project.currentHomeFact]).removeClass('visible-fact');
	if(thunder.client.project.currentHomeFact >= thunder.client.project.homeFacts.length - 1) thunder.client.project.currentHomeFact = 0; else thunder.client.project.currentHomeFact ++;
	$(thunder.client.project.homeFacts[thunder.client.project.currentHomeFact]).addClass('visible-fact');
}

$(thunder.client.project.pageLoaded);
