/*
	Copyright DTDigital         :: www.dtdigital.com.au ::
	Unauthorised modification / use is a criminal offence, and
	will be prosecuted to the fullest extent permitted by law.
	All Rights Reserved
*/




// jQuery functions that run on "dom ready"

var _jQueryLoaded = (typeof(jQuery) == "function");

if (_jQueryLoaded)
{
	$(document).ready(function()
	{	
		ButtonsInit();
		HoverSwapInit();
		
		// Makes links open in new window when they have rel=external
		$("a[rel=external]").attr("target", "_blank");
		// Use below method if using thickbox, matches class rather than rel
		$("a.external-link").attr("target", "_blank");

	});
}

function ButtonsInit()
{
    if ($.browser.msie && $.browser.version<7) {
        function BtnMouseOver()
        {
            $(this).addClass("btn-hover");
        }
        function BtnMouseOut()
        {
            $(this).removeClass("btn-hover");
        }
        $("input.btn").mouseover(BtnMouseOver).mouseout(BtnMouseOut);
    }
}

function HoverSwapInit()
{
	if (_jQueryLoaded)
	{
	    $(".hoverswap").mouseover(function () {
	        var ctl = $(this);
	        var src = ctl[0].src;
	        ctl[0].src = ctl.next('img')[0].src;
	        ctl.next('img')[0].src = src;
	    }).mouseout(function () {
	        var ctl = $(this);
	        var src = ctl[0].src;
	        ctl[0].src = ctl.next('img')[0].src;
	        ctl.next('img')[0].src = src;
	    });
	}
}


