/** required on all pages **/
$(document).ready(function() {

    //topnav dropdowns
    $('ul.main-nav').superfish({
        animation: {opacity:'show'},
        speed: 0                          // faster animation speed 
    }); 

    //topnav active
    $('.main-nav').find('a').append("<span class='top'></span><span class='left'></span><span class='right'></span>");

    //spotlight boxes
    $('.grey-box').append("<div class='tl'></div><div class='tr'></div><div class='bl'></div><div class='br'></div>");

    //image dropshadows
    $('img.dropshadow').wrap("<div class='wrap0'><div class='wrap1'><div class='wrap2'><div class='wrap3'></div></div></div></div>");

    //pop-ups
    $(".popup").colorbox();
    $(".pop-content").colorbox({ iframe: true, width: "700px", height: "490px" });
    $(".pop-video").colorbox({ iframe: true, width: "420px", height: "301px" });
    $(".pop-taf").colorbox({ iframe: true, width: "410px", height: "730px" });
    
});



/************************************************ FUNCTIONS  ************************************************/

/** used to clear default form values **/
function clearDefault(field, value)
{
	if (field.value == value)
		field.value = "";
}


/** use to re-size font **/
var currentSize = "";
var smallSize = "80%";
var largeSize = "115%";

function reduceTextSize(DivName) {    
	var size;
	size = ( currentSize == "" || currentSize == "100%" || currentSize == smallSize )? smallSize : "100%";	
	
	var divObj = new getObj(DivName);
	divObj.style.fontSize = size;
	currentSize = size;
}
function enlargeTextSize(DivName) {
	var size;
	size = ( currentSize == "" || currentSize == "100%" || currentSize == largeSize )? largeSize : "100%";
	
	var divObj = new getObj(DivName);
	divObj.style.fontSize = size;
	currentSize = size;
}
function getObj(name) {
	if (document.getElementById) {
		this.obj = document.getElementById(name);
		if (this.obj) this.style = document.getElementById(name).style;
	} else if (document.all) {
		this.obj = document.all[name];
		if (this.obj) this.style = document.all[name].style;
	} else if (document.layers) {
		if (document.layers[name]) {
			this.obj = document.layers[name];
			if (this.obj) this.style = document.layers[name];
	   } else {
			this.obj = eval("document.layers." + name + ".layers[name]");
			if (this.obj) this.style = eval("document.layers." + name + ".layers[name]");
	   }
	}
}
