if (!window.Utils) Utils ={};
Utils.Cookie={};

Utils.Cookie.get= function(name) { 
 		var nameEQ = name + "=";
  	var ca = document.cookie.split(';');
  	for(var i=0;i < ca.length;i++) {
    	var c = ca[i];
    	while (c.charAt(0)==' ') c = c.substring(1,c.length);
    		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
  		}
  	return null;
	};

Utils.Cookie.del= function(name) {
	  var cookie_date = new Date ();
		cookie_date.setYear('1970');
		cookie_date.setTime ( cookie_date.getTime() - 1 );
		cookie= name + "=;path=/; expires=" + cookie_date.toGMTString();
		document.cookie = cookie;
	};
Utils.Cookie.set = function(name,value,domain){
    days=365;
    var date = new Date();
    date.setTime(date.getTime()+(days*24*60*60*1000));
    var expires = "; expires="+date.toGMTString();
    var cookie=name+"="+value;
    if (domain){
      cookie+='; domain='+domain;
    }

    cookie+= expires+"; path=/";
    document.cookie = cookie;
};
