var newWin = null;

function popUp(strURL, strType, strHeight, strWidth)
{
	popUp(strURL, strType, strHeight, strWidth,null);
}

function popUp(strURL, strType, strHeight, strWidth,title1) {
 if (newWin != null){
	if(!newWin.closed)
		newWin.close();
 }
 var strOptions="";
 if (strType=="console")
   strOptions="scrollbars,resizable,toolbar=new,height="+
     strHeight+",width="+strWidth;
 if (strType=="fixed")
   strOptions="status,height="+
     strHeight+",width="+strWidth;
 if (strType=="elastic")
   strOptions="toolbar,menubar,scrollbars,"+
     "resizable,location,height="+
     strHeight+",width="+strWidth;  
 

 newWin = window.open(strURL, '_blank', strOptions);

 //if (title1 != null && title1 != "")
 //{
  //newWin.document.title = title1;
 //}
 newWin.focus();
 
}

/**
 * Sets a Cookie with the given name and value.
 *
 * name       Name of the cookie
 * value      Value of the cookie
 * [expires]  Expiration date of the cookie (default: end of current session)
 * [path]     Path where the cookie is valid (default: path of calling document)
 * [domain]   Domain where the cookie is valid
 *              (default: domain of calling document)
 * [secure]   Boolean value indicating if the cookie transmission requires a
 *              secure transmission
 */
function setCookie(name, value, expires, path, domain, secure)
{
     //if (expires == null)
     //{
	//	expires = new Date();
	//	expires.setDate(expires.getDate()+1);
	// }
     if (path == null)
     {
		path = '/';
	 }		
    document.cookie= name + "=" + value +
        ((expires) ? "; expires=" + expires.toGMTString() : "") +
        ((path) ? "; path=" + path : "") +
        ((domain) ? "; domain=" + domain : "") +
        ((secure) ? "; secure" : "");
}

function deleteCookie ( cookieName )
{
  var cookieDate = new Date ( );  // current date & time
  cookieDate.setTime ( cookieDate.getTime() - 1 );
  document.cookie = cookieName += "=; expires=" + cookieDate.toGMTString();
}

function getCookie ( cookieName )
{
  var results = document.cookie.match ( cookieName + '=(.*?)(;|$)' );

  if ( results )
    return ( unescape ( results[1] ) );
  else
    return null;
}