//** Animated Collapsible DIV v2.0- (c) Dynamic Drive DHTML code library: http://www.dynamicdrive.com.
//** May 24th, 08'- Script rewritten and updated to 2.0.
//** June 4th, 08'- Version 2.01: Bug fix to work with jquery 1.2.6 (which changed the way attr() behaves).

var ac = {
	getCookie:function(Name){ 
		var re=new RegExp(Name+"=[^;]*", "i"); //construct RE to search for target name/value pair
		if (document.cookie.match(re)) //if cookie found
			return document.cookie.match(re)[0].split("=")[1] //return its value
		return null
	},
	
	setCookie:function(name, value, days){
		if (typeof days!="undefined"){ //if set persistent cookie
			var expireDate = new Date()
			expireDate.setDate(expireDate.getDate()+days)
			document.cookie = name+"="+value+"; path=/; expires="+expireDate.toGMTString()
		}
		else //else if this is a session only cookie
			document.cookie = name+"="+value+"; path=/"
	}
}

$(document).ready(function(){
	if(ac.getCookie("viewed")){
		$("#big").hide();
		$("#small").addClass('sm_disp').show();
	}else{
		ac.setCookie("viewed", "viewed", 5);
		$("#big").addClass('disp').show();
		$("#banner div#small").hide();
	}
	$("#small").click(function(){
		$("#expand_banner").hide();
		$(this).slideUp("slow");
		$("#big").slideDown("fast");
	});
	$("#close").click(function(){
		$("#expand_banner").show();
		$("#big").slideUp("slow");
		$("#small").slideDown("fast");
	});
});