// JavaScript Document


$(document).ready(function() {
		
	
		$("#footer-nav li").each(function(i){
			$(this).attr("id", "item" + i );
		})
		setCookie("selectedMenuItem","");
		setCookie("expandable","");
		$("#whykleo li a").click(function(i){
			setCookie("selectedMenuItem",$(this).parent("li").attr("id"));
			setCookie("expandable","2c");
		})
		
		$("#kleoapps li a").click(function(i){
			setCookie("selectedMenuItem",$(this).parent("li").attr("id"));
			setCookie("expandable","3c");
		})
		
		$("#services li a").click(function(i){
			setCookie("selectedMenuItem",$(this).parent("li").attr("id"));
			setCookie("expandable","4c");
		})
		
		$("#footer-nav a").click(function()
		{
			var t = $(this).attr("expandable")
			
			if( t != "")
				setCookie("expandable",t);
		});
		
		
});

function setCookie(name, value)

{

 
 
	document.cookie = name+"="+value+"; path=/";

}



function getCookie(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
}


