// JavaScript Document
$(document).ready(function() 
{
	//Pull Weather Script
	$.ajax({
		type: "POST",
		url: "/ajax/get-weather.php",
		success: function(msg){
			if(msg)
			{
				document.getElementById('weather').innerHTML = msg;
			}
			else
			{
				document.getElementById('weather').innerHTML = "Weather cannot be displayed at this time";
			}
		}
	});
});


function get_url(url)
{
	window.location = url;	
}
function confirm_action(action,url)
{
	var ans = confirm(action);
	if(ans){ window.location = url; }
}
function open_popup(url,width,height)
{
	window.open (url,"mywindow","status=1,width="+width+",height="+height+""); 	
}

function itemFocus(field,val)
{
	var el = document.getElementById(field);
	if (el.value == val) {
		el.value = '';
	}
}

function itemFocusOut(field,val)
{
	var el = document.getElementById(field);
	if (el.value == '') {
		el.value = val;
	}
}

$(document).ready(function() {
    $('#slideshow').cycle({
		fx: 'fade' // choose your transition type, ex: fade, scrollUp, shuffle, etc...
	});
});


function isIE()
{
	if(navigator.userAgent.match(/MSIE \d\.\d+/))
        return true;
    return false;
}

function isIE7()
{
	var ua = navigator.userAgent;
    var re  = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
    if (re.exec(ua) != null)
	{
       rv = parseFloat( RegExp.$1 );
	}
	if(rv == 7){ return true; }

}

$(document).ready(function()
{
    // If the browser is IE,
    if(isIE())
    {
		/*
        ** For each div with class menu (i.e.,
        ** the thing we want to be on top),
        */
        $("ul.sub_3").parents().each(function() {
            var p = $(this);
            var pos = p.css("position");

            // If it's positioned,
            if(pos == "relative" ||
               pos == "absolute" ||
               pos == "fixed")
            {
                /*
                ** Add the "on-top" class name when the
                ** mouse is hovering over it, and remove
                ** it when the mouse leaves.
                */
                p.hover(function() {
                        $(this).addClass("on-top");
                    },
                    function() {
                        $(this).removeClass("on-top");
                    });
            }
        });
    }
});



