//initialize variables
var flashInstalled = jQuery.fn.flash.hasFlash(8);
var flashPrompt = false;
var menu_style;
var this_page;
var active_dir;
var template_media_vers;
//initialize shadowbox before DOM is loaded//
Shadowbox.init({players:['img', 'html', 'flv', 'swf', 'qt', 'iframe']});

$(document).ready(function(){
	if(!flashCheck()) {
		//add the 'noflash' ID to the <html> tag
		$("html").attr("id","noflash");
		//add the superfish class name to the client_header menu
		
	}
	if(menu_style == "vertical"){
		$("#nav").attr("class","sf-menu sf-vertical");
	}else{
		$("#nav").attr("class","sf-menu");
	}
	//load the remote javascript for the non-flash menu system
	$.getScript("http://common.pbhs.com/Scripts/superfish.js", function(){
		// initialize the superfish menus
		$("#nav").show();
		$('ul.sf-menu').superfish({
			dropShadows: false,
			animation: {opacity:'none',height:'show'}
		});
	});
	$.getScript("http://common.pbhs.com/Scripts/superfish.js", function(){
			// initialize the superfish menus
			$('ul.sf-menu').superfish({ 
				delay:       1000,                            // one second delay on mouseout 
				animation:   {opacity:'show',height:'show'},  // fade-in and slide-down animation 
				speed:       'fast',                          // faster animation speed 
				autoArrows:  true,                           // disable generation of arrow mark-up 
				dropShadows: false                            // disable drop shadows 
			}); 				
		$('#nav>li>a span').remove();
	});
});
function flashCheck(){
	if(!jQuery.fn.flash.hasFlash(8) || $("html").attr("id") == 'noflash') {
		return false;
	}else{
		return true;
	
	}
}
////functions
function getPage(){
	if (this_page == undefined){
		this_page=unescape(location.href);
		var this_page_split = this_page.split("/");
		//alert(this_page_split.length);
		if(this_page.indexOf('?')!==-1)
			this_page=this_page.substring(0,this_page.indexOf('?'))
			this_page=this_page.substr(this_page.lastIndexOf('/')+1)
		
		if (this_page == ""){
			this_page = "index.asp";
		}
	}
	return this_page;
}

function getDir(){
	if($("body").attr("id") == "home"){
		var active_dir = "";
		
	}else{
	   var active_dir = "../"; 
	   
	}
	return active_dir;
}
jQuery.fn.decHTML = function() { 
  return this.each(function(){ 
    var me   = jQuery(this); 
    var html = me.html(); 
    me.html(html.replace(/&amp;/g,'&').replace(/&lt;/g,'<').replace(/&gt;/g,'>')); 
  }); 
}; 

