function getCookie(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 setCookie(c_name,value,expiredays)
{
var exdate=new Date();
exdate.setDate(exdate.getDate()+expiredays);
document.cookie=c_name+ "=" +escape(value)+
((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
}

/*
Si la valeur du cookie keren_coporate_cookie est vide ou nulle,
afficher le popup;
*/

function openPopup(popupName){
	cookieName = "";
	if(popupName =='KC'){
		cookieName 		= 'KC_popup';
		popURL 			= "/popups/kc";
		popWidth 		= 850;
		popHeight 		= 300;
	}
	cookieValue = getCookie(cookieName);
	if (cookieName!="" && (cookieValue==null || cookieValue=='')){
		cookieValue = 1;
		openIt(popURL,popWidth,popHeight);
	}else{
		trace(cookieValue);
	}
}

function openIt(u,w,h){
	window.open(u,'nom','location=0,resizable=0,toolbar=0,menubar=0,location=0,scrollbars=0,width=' + w + ',height=' + h);
}

function trace(t){
	//alert(t);
}



/*
"location=0,"
		+ "menubar=0,"
		+ "resizable=0,"
		+ "scrollbars=0,"
		+ "statusbar=false,dependent,alwaysraised,"
		+ "status=false,"
		+ "titlebar=no,"
		+ "toolbar=0,"
		+ "hotkeys=0,"
		+ "screenx=" + xposition + ","  //NN Only
		+ "screeny=" + yposition + ","  //NN Only
		+ "left=" + xposition + ","     //IE Only
		+ "top=" + yposition;           //IE Only

*/
