function OpenPopupWindow(url, w, h, param) {
  today = new Date();
  
  WindowName='PopupWin'+today.getTime();
  if (!param) {
   window.open(url,WindowName,'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=' + w + ',height=' + h);
  } else {
   window.open(url,WindowName, + param + ',width=' + w + ',height=' + h);
  }
  return false;
}       


function bookmark(title, url) 
{
        if (title == undefined)
                title = document.title;

        if (url == undefined)
                url = top.location.href;

        if (window.sidebar) 
        {
                // Firefox
                window.sidebar.addPanel(title, url, '');
        } 
        else if (window.opera && window.print) 
        {
                // Opera
                var t = document.createElement('a');
                t.setAttribute('rel', 'sidebar');
                t.setAttribute('href', url);
                t.setAttribute('title', title);
                t.click();
        } else 
        {
                // IE
                window.external.AddFavorite(url, title);
        }
        return false;
}

function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(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;
}

