/**
 * @author Hardy
 */
var body_height;
var Client;

	//get the window dimensions
	Client = {
	  viewportWidth: function() {
	    return self.innerWidth || (document.documentElement.clientWidth || document.body.clientWidth);
	  },

	  viewportHeight: function() {
	    return self.innerHeight || (document.documentElement.clientHeight || document.body.clientHeight);
	  },

	  viewportSize: function() {
	    return { width: this.viewportWidth(), height: this.viewportHeight() };
	  }
	};

	//MAIN PRELOADING METHOD
$(document).ready(function() {

	body_height=$("#body_container").height();

	$(".main_nav_list li").hover(
		function() {
			$(this).addClass("main_nav_list_over");
		},
		function() {
			$(this).removeClass("main_nav_list_over");
		}
	).click(function() {
		var ref=$(this).find("a").attr("href");
		document.location.href=ref;
	});

	//sub navigation rollovers

	$(".sub_nav_list li").hover(
		function() {
			$(this).addClass("sub_nav_list_over");
		},
		function() {
			$(this).removeClass("sub_nav_list_over");
		}
	).click(function() {
		var ref=$(this).find("a").attr("href");
		document.location.href=ref;
	});



	//super nav rollovers

	$(".left_col_supernav").hover(
		function() {
			$(this).addClass("left_col_supernav_over");
		},
		function() {
			$(this).removeClass("left_col_supernav_over");
		}
	).click(function() {
		var ref=$(this).find("a").attr("href");
		document.location.href=ref;

	});

	//populate aid_link after page has drawn
	$("a[rel=aid_link]").each(function() {

		var hr=$(this).attr("href");

		if(hr.indexOf("?")>0) {

			$(this).attr({"href":hr+"&aid="+_aid});

		} else {

			$(this).attr({"href":hr+"?aid="+_aid});

		}



	});



});

