<!--

function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		hdr_06_over = newImage("images/hdr_06-over.gif");
		hdr_07_hdr_06_over = newImage("images/hdr_07-hdr_06_over.gif");
		hdr_07_over = newImage("images/hdr_07-over.gif");
		hdr_08_hdr_07_over = newImage("images/hdr_08-hdr_07_over.gif");
		preloadFlag = true;
	}
}

function getCookie(name)
{
    var dc = document.cookie;
    var prefix = name + "=";
    var begin = dc.indexOf("; " + prefix);
    if (begin == -1)
    {
        begin = dc.indexOf(prefix);
        if (begin != 0) return null;
    }
    else
    {
        begin += 2;
    }
    var end = document.cookie.indexOf(";", begin);
    if (end == -1)
    {
        end = dc.length;
    }
    return unescape(dc.substring(begin + prefix.length, end));
}

function setCookie(name, value, expires, path, domain, secure)
{
    var expires2 = new Date()
    expires2.setTime(expires2.getTime() + (365*24*60*60*1000));
    document.cookie= name + "=" + escape(value) +
        ((expires2) ? "; expires=" + expires2.toGMTString() : "") +
        ((path) ? "; path=" + path : "") +
        ((domain) ? "; domain=" + domain : "") +
        ((secure) ? "; secure" : "");
}

function setandgo(ls_id)
{
//	alert("just into setandgo...");
    setCookie("location_served_id",ls_id,"","/","");
	// reload page
//    var loc=""+window.location;
//    loc = loc.replace(/\?.*?$/g, "");
//	alert("setting and going, i think! loc = " + loc);
//	history.go(0); // reload this page
    window.location.reload();
}

// from BFCprint

// added 12/12/08 for sitemap per BFC
  $(document).ready(function(){
    $('div.head_sitemap:eq(0)> div').hide(); 
    $('a#sm_toggle').click(function () {
      $('#sm_outer').slideToggle(400)
 
   return false;
 });
 
});
  
// the rest was provided by BFC back in Nov.

/*		$(document).ready(function() {
		 
		 // toggles the slickbox on clicking the noted link 
		  $('a#sm_toggle').click(function() {
		    $('#sm_outer').slideToggle(400);
		    return false;
		  });
		 
		});
*/
		$(document).ready(function() {
		  $('a#loginLink').click(function() {
			if (document.getElementById('loginFormMiniMain').style.display == 'block')
			{
				$('#loginFormMiniMain').fadeOut('fast');
			}
			else
			{
				$('#loginFormMiniMain').fadeIn('fast');
				document.getElementById('username').focus();
			}
		    return false;
		  });
		});


//<![CDATA[
    jQuery.preloadImages = function()
{
  for(var i = 0; i<arguments.length; i++)
  {
    jQuery("<img>").attr("src", arguments[i]);
  }
}

$.preloadImages( 
"images/Tab-1-Active.gif",
"images/Tab-2-Active.gif",
"images/Tab-3-Active.gif",
"images/Tab-4-Active.gif",

"images/Tab-1.gif",
"images/Tab-2.gif",
"images/Tab-3.gif",
"images/Tab-4.gif"

);
//]]>

//<![CDATA[
 	var lastTabId = 1;
	function tab_switch(id)
	{
		document.getElementById('section-' + lastTabId).style.display = 'none';
		document.getElementById('section-' + id).style.display = 'block';
		lastTabId = id;
		
		var ourTabs = document.getElementById('tab_anchors').getElementsByTagName("li");
		
		for(var i = 0; i < ourTabs.length; i++)
		{
			if ((i + 1) == id)
			{
				ourTabs[i].className = 'tabOn' + (i+1);
			}
			else
			{
				ourTabs[i].className = 'tab' + (i+1);
			}
		}
		
		//.anchors .tabs-selected a.a_tab1:link, .anchors .tabs-selected a.a_tab1:visited,
		
		
	}
//]]>


$(document).ready(function(){
			//each click on a button will be intercepted
			$("#page-wrap div.button").click(function(){
				
				//we store the reference here to avoid doing $(this) each time we need and spare some processing
				$clicked = $(this);
				
				// if the button is not already "transformed" AND is not animated
				if($clicked.css("opacity") != "1" && $clicked.is(":not(animated)"))
				{
					//we animate it (remember the reference for optimisation ?)
					$clicked.animate({opacity: 1}, 600 );
					
					//we "calculate" the id to shown (each button div MUST have a "xx-button" and the target div must have an id "xx" )
					//yet again the reference
					var idToLoad = $clicked.attr("id").split('-');
					//we search trough the content for the visible div and we fade it out
					$("#right").find("div:visible").fadeOut("fast", function(){
						//once the fade out is completed, we start to fade in the right div
						$(this).parent().find("#"+idToLoad[0]).fadeIn();
					})
				}
				
				//we reset the other buttons to default style
				$clicked.siblings().animate({opacity: 0.5}, 600 );
				
			});
		});


// -->