/*------------------------------------------------------------------------------------
Homepage Diagram (Full Area Click)
------------------------------------------------------------------------------------*/

jQuery(function() {	
	jQuery("#diagram-top-box-container, #diagram-middle-box-container, #diagram-bottom-box-container").click(function(){
	   	window.location=$(this).find("a").attr("href");
		return false;
	});
});

/*------------------------------------------------------------------------------------
Unsupported Browser Warning
------------------------------------------------------------------------------------*/

function browserWarning(){
	if(jQuery.browser.msie && parseInt(jQuery.browser.version) <= 6){ return true;}
	return false;
}

function getbrowserWarning(c_name)
{
	if (document.cookie.length>0)
	{
	c_start=document.cookie.indexOf(c_name + "=");
	if (c_start!=-1)
		{ 
		c_start=c_start + c_name.length+1; 
		c_end=document.cookie.indexOf(";",c_start);
		if (c_end==-1) c_end=document.cookie.length;
		return unescape(document.cookie.substring(c_start,c_end));
		} 
	}
	return "";
}	

function setbrowserWarning(c_name,value,expiredays)
{
	var exdate=new Date();
	exdate.setDate(exdate.getDate()+expiredays);
	document.cookie=c_name+ "=" +escape(value) + ((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
}

if(browserWarning() && getbrowserWarning('Catapult-Strategies-Browser-Warning') != 'seen' ){
	jQuery(function(){
	jQuery("<div id='browserWarning'>You are using an unsupported browser. We recommend you to upgrade to <a href='http://www.google.com/chrome/eula.html'>Google Chrome</a>, <a href='http://getfirefox.com'>FireFox</a> or <a href='http://www.microsoft.com/windows/downloads/ie/getitnow.mspx'>Internet Explorer 8</a>.&nbsp;&nbsp;&nbsp;&nbsp;<a href='#' id='warningClose'>(Close)</a> </div> ")			.css({
				'background': '#FFCCCC',
				'width': '100%',
				'text-align': 'center',
				'padding': '10px 0px'
			})
			.prependTo("body");
	jQuery("#browserWarning a").css({
		'color': "#da0000",
		'font-weight': "700"
	})
		
		jQuery('#warningClose').click(function(){
			setbrowserWarning('Catapult-Strategies-Browser-Warning','seen');
			jQuery('#browserWarning').slideUp('slow');
			return false;
		});
	});	
}
