// JavaScript Document

var theflashVersion = "8";

//jquery
$(document).ready(function(){ 
//jquery function to fix IE6 png issue						   
	$(document).pngFix(); 
//jquery function to insert flash	
	$('#banner').flash(
		{
		src: '/images/flash/banner.swf',
		width: 990,
		height: 170,
		allowScriptAccess:'always',	
		wmode:'transparent'
		},
        {version: theflashVersion}
	);
//jquery function to insert flash	
	$('#flashSignpost').flash(
		{
		src: '/images/flash/whatwedo.swf',
		width: 230,
		height: 190,
		allowScriptAccess:'always',	
		wmode:'transparent'
		},
        {version: theflashVersion}
		);
	

//jquery slide and cookies
		
		
		// test if cookie exists, if it dosent then set to open
		if ($.cookie('contactPanelHide') != 'Hidden')
		{
		$.cookie('contactPanelHide', 'Open')	
			}

		//Set variable contactPanelHide to the cookie value
		var contactPanelHide = $.cookie('contactPanelHide');
		
		//If the cookie value is 'hidden', hide the Iframe
		if (contactPanelHide == ''){
			$('#contactPanel_Iframe').css ("display","block");
		}
		//If the cookie is 'open' set the Iframe to block
		else if(contactPanelHide == 'Open'){
			$('#contactPanel_Iframe').css ("display","block");
		}
		//If the cookie is '' set the Iframe to block
		else if(contactPanelHide == 'Hidden'){
			$('#contactPanel_Iframe').css ("display","none");
		}
		//Test the cookie value
		//alert("1"+contactPanelHide);


	//jquery slide
	$("#btnSlide").click(function(){
	  $("#contactPanel_Iframe").toggle(1000);
	  $(this).toggleClass("btnSlideDOWN")
	  
		 	$.timer(1100, function (timer) {
			if (contactPanelHide == 'Hidden'){
				$.cookie('contactPanelHide', 'Open');
			//alert("2cookie changed from hidden to open");
				}
			else if(contactPanelHide == 'Open'){
				$.cookie('contactPanelHide', 'Hidden');
			//alert("3cookie changed from open to hidden");
				}
			else if(contactPanelHide == ''){
				$.cookie('contactPanelHide', 'Hidden');
		//	alert("4cookie dosent exist so panel must have been open, changeing it to hidden");
				}
				
			contactPanelHide = $.cookie('contactPanelHide');
	
			//alert("5"+contactPanelHide);

			timer.stop();
			});
	});



/////////////////////////
}); 


 
 
	