window.onload = function(){
		if (document.cookie != "") {
   document.getElementById("footbar").style.display=(getCookie("footbar")=="none")?"none":"";
   document.getElementById("footbarshow").style.display=(getCookie("footbar")=="none")?"":"none";
   if ((getCookie("footbar")=="none"))
   {
    findDimensions();
   }
}
}

function showfootbar()
{
  document.getElementById("footbar").style.display=(document.getElementById("footbar").style.display=="none")?"":"none";
  document.getElementById("footbarshow").style.display=(document.getElementById("footbarshow").style.display=="none")?"":"none";
  if (document.getElementById("footbar").style.display=="none")
  {
   findDimensions();
  }else{
	 document.getElementById("footbar_wrap").style.width="100%";
     document.getElementById("footbar_wrap").style.left = 0;
	 document.getElementById("footbarskin").style.width="1014px";
  }	
  setCookie("footbar",document.getElementById("footbar").style.display);
}
function setCookie(name,value) {	
	var exp = new Date();
	exp.setTime(exp.getTime()+60*60*24*365*1000);
	document.cookie = name + "="+ escape (value) + ";expires=" + exp.toGMTString();
}
function getCookie(name) {
    var arr = document.cookie.match(new RegExp("(^| )"+name+"=([^;]*)(;|$)"));
    if(arr != null) return unescape(arr[2]); return null;	
}

       
   function findDimensions()
   {
    var winWidth = 0; 
    if (document.getElementById("footbar").style.display=="none")
    {
    if (self.innerWidth){
     winWidth = self.innerWidth;
	}else if ((document.body) && (document.body.clientWidth)){
     winWidth = document.body.clientWidth;
     if (document.documentElement  && document.documentElement.clientWidth)
     {
     winWidth = document.documentElement.clientWidth;
     }
	 if (winWidth>1014)
	 {
	  document.getElementById("footbar_wrap").style.left=(winWidth/2-494)+"px";
	 }else{
	  document.getElementById("footbar_wrap").style.left = 0;
	 }
	 document.getElementById("footbar_wrap").style.width="24px";
	 document.getElementById("footbarskin").style.width="24px";
     }
	}
   }
     window.onresize=findDimensions;
