// JavaScript Document
function buildShadows(){
	$(".shadow").each(function(i){
		var plug = $(this).html();
		var spacer = "<img src='images/spacer.gif' width='5' height='5' border='0'>";
		var topLeft = "<img src='images/shadowTL.jpg' width='5' height='5' border='0' align='left' style='display:inline' />";
		var btmLeft = "<img src='images/shadowBL.jpg' width='5' height='5' border='0' align='left' style='display:inline' />";
		var topRight = "<img src='images/shadowTR.jpg' width='5' height='5' border='0' align='right' style='display:inline' />";
		var btmRight = "<img src='images/shadowBR.jpg' width='5' height='5' border='0' align='right' style='display:inline' />";
		$(this).html("<table cellpadding='0' cellspacing='0' border='0'><tr><td colspan='3' id='shdwTop'>"+topLeft+topRight+"</td></tr><tr><td id='shdwLeft'>"+spacer+"</td><td id='shdwContent'>"+plug+"</td><td id='shdwRight'>"+spacer+"</td></tr><tr><td colspan='3' id='shdwBottom'>"+btmLeft+btmRight+"</td></tr></table>");
	});
}
function buildShadowsAlt(){
	$(".shadowNoTop").each(function(i){
		var plug = $(this).html();
		var spacer = "<img src='images/spacer.gif' width='5' height='5' border='0'>";
		var topLeft = "<img src='images/shadowTL.jpg' width='5' height='5' border='0' align='left' style='display:inline' />";
		var btmLeft = "<img src='images/shadowBL.jpg' width='5' height='5' border='0' align='left' style='display:inline' />";
		var topRight = "<img src='images/shadowTR.jpg' width='5' height='5' border='0' align='right' style='display:inline' />";
		var btmRight = "<img src='images/shadowBR.jpg' width='5' height='5' border='0' align='right' style='display:inline' />";
		$(this).html("<table cellpadding='0' cellspacing='0' border='0'><tr><td colspan='3' id='shdwNoTop'>"+topLeft+topRight+"</td></tr><tr><td id='shdwLeft'>"+spacer+"</td><td id='shdwContent'>"+plug+"</td><td id='shdwRight'>"+spacer+"</td></tr><tr><td colspan='3' id='shdwBottom'>"+btmLeft+btmRight+"</td></tr></table>");
	});
}
function buildShadowsTextBox(){
	$(".shadowTextBox").each(function(i){
		var plug = $(this).html();
		var spacer = "<img src='images/spacer.gif' width='5' height='5' border='0'>";
		var topLeft = "<img src='images/shadowTL.jpg' width='5' height='5' border='0' align='left' style='display:inline' />";
		var btmLeft = "<img src='images/shadowBL.jpg' width='5' height='5' border='0' align='left' style='display:inline' />";
		var topRight = "<img src='images/shadowTR.jpg' width='5' height='5' border='0' align='right' style='display:inline' />";
		var btmRight = "<img src='images/shadowBR.jpg' width='5' height='5' border='0' align='right' style='display:inline' />";
		$(this).html("<table cellpadding='0' cellspacing='0' border='0'><tr><td colspan='3' id='shdwTop'>"+topLeft+topRight+"</td></tr><tr><td id='shdwLeft'>"+spacer+"</td><td class='textBox' id='shdwContent'>"+plug+"</td><td id='shdwRight'>"+spacer+"</td></tr><tr><td colspan='3' id='shdwBottom'>"+btmLeft+btmRight+"</td></tr></table>");
	});
}
function buildShadowsImage(){
	$(".shadowImage").each(function(i){
		$("#"+this.id).wrap('<div id="shadowWrapper_'+this.id+'"></div>');
		var img = "<img class='"+$(this).attr('class')+"' id='"+$(this).attr('id')+"' src='"+$(this).attr('src')+"' width='"+$(this).attr('width')+"' height='"+$(this).attr('height')+"' border='"+$(this).attr('border')+"' alt='"+$(this).attr('alt')+"' align='"+$(this).attr('align')+"' >";
		var spacer = "<img src='images/spacer.gif' width='5' height='5' border='0'>";
		var topLeft = "<img src='images/shadowTL.jpg' width='5' height='5' border='0' align='left' style='display:inline' />";
		var btmLeft = "<img src='images/shadowBL.jpg' width='5' height='5' border='0' align='left' style='display:inline' />";
		var topRight = "<img src='images/shadowTR.jpg' width='5' height='5' border='0' align='right' style='display:inline' />";
		var btmRight = "<img src='images/shadowBR.jpg' width='5' height='5' border='0' align='right' style='display:inline' />";
		$("#shadowWrapper_"+this.id).html("<table align='"+$(this).attr('align')+"' cellpadding='0' cellspacing='0' border='0'><tr><td colspan='3' id='shdwTop'>"+topLeft+topRight+"</td></tr><tr><td id='shdwLeft'>"+spacer+"</td><td class='textBox' id='shdwContent'>"+img+"</td><td id='shdwRight'>"+spacer+"</td></tr><tr><td colspan='3' id='shdwBottom'>"+btmLeft+btmRight+"</td></tr></table>");
	});
}

/**** SITE WIDE ****/
function clearTextBox(){
	$(this).val('');
}
function href(url){
	window.location = url;
}
function preLoadImages(){
	for(var i=0;i<arguments.length;i++){
		var img = new Image();
		img.src = arguments[i];
	}
}

function hideSAS(){
	$("#sealAirSecurityPopUp").hide();
}
function showSAS(e){
	var top = e.pageY-195;
	var left = e.pageX;
	$("#sealAirSecurityPopUp").css("top",top);
	$("#sealAirSecurityPopUp").css("left",left);
	$("#sealAirSecurityPopUp").show();
}
function printWindow(){
   bV = parseInt(navigator.appVersion)
   if (bV >= 4) window.print()
}

