/*

	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();
    //thunder.client.modify.selfLabelFields();
    //thunder.client.modify.requireFields();
    //thunder.client.workarounds.alphaImages();
    cleanNav();
    if ($(".leftCol")) {
        if ($(".leftCol").height() > $(".rightCol").height()) {
            $(".rightCol").height($(".leftCol").height())
        }
    }
    $('.articles').vTicker({
        speed: 500,
        pause: 8000,
        showItems: 1,
        animation: 'fade',
        mousePause: false,
        height: 15,
        direction: 'up'
    });
    $('.rotatingPic').cycle({fx: 'fade', timeout: 8000, delay: -1000, sync: true, pause: true});
}

$(document).ready(function(){
    $(thunder.client.project.pageLoaded);
});

$(window).load(function(){
    $('.rotatingPic').css("visibility", "visible");
});

function cleanNav(){
	if($(".subNav")){ 
		$(".dropdown").each(function(){
			$("li > a:last", this).css("border", "none");
		});
		$(".flyout").each(function(){
			$("li > a:last", this).css("border", "none");
		});
	}
	
	if($(".sideFly")){ 
	    $(".sideFly").each(function(){
	        $(this).css("border", "none"); 
	        $("li:last", this).css("border", "none");
	    });
		
		
	}
}
