function makeNewWindow(Source){
var newWindow;
var docHTML;

docHTML='<html>\n';
docHTML+='<head>\n';
docHTML+='<title>Enlarge View</title>\n';
docHTML+='<head>\n';
docHTML+='<body bgcolor="#000000">\n';
docHTML+='<center><img src="'+ Source +'"></center>\n';
docHTML+='</body>\n';
docHTML+='</html>\n';

newWindow=window.open('','newWindow','scrollbars=1,resizable=1,width=520,height=390');

newWindow.document.open();
newWindow.document.write(docHTML);
newWindow.document.close();

}

function checkCookie()
{

  if (WriteCookie("cname","camsoft") == "Write failure") {
    alert("You must allow the use of cookies in your browser to be able to use the Advisor");
    return false;
  }
  return true;
}

function WriteCookie(name,value,expires,domain,path,secure)
{
  var CookieVal, CookError;
  CookieVal= CookError = "";  
  if (name) {
    CookieVal=CookieVal+escape(name)+"=";
    if (value) {
      CookieVal=CookieVal+escape(value);
      if (expires) {
        CookieVal=CookieVal+";expires="+expires.toGMTString();
      }      
      if (domain){
        CookieVal=CookieVal+";domain="+domain;
      }
      if (path) {
        CookieVal=CookieVal+";path="+path;
      }  
      if (secure) {
        CookieVal=CookieVal+";secure";
      }
    }
    else {
      CookError=CookError+"Value failure";
    }  //need valid value
  }
  else {
    CookError=CookError+"Name failure";
  }  //need valid name
  
  if (!CookError) {
    document.cookie=CookieVal; //sets cookie
    if (value != ReadCookie(name)) {  //checks to make sure it worked
      CookError="Write failure";
    }
  }  
  return CookError;
}

function ReadCookie(name) {
  var allCookie, CookieVal, length,start,end;
  cookieVal="";
  name=name+"=";  //append equals to  avoid false matches.
  allCookie=document.cookie;
  length=allCookie.length;
  if (length>0) {  //no cookies - user is probably incinerating cookies.
    start=allCookie.indexOf(name,0);
    if (start!=-1) {  //if string appeared - otherwise cookie wasn't set.
      start+=name.length;
      end=allCookie.indexOf(";",start);
      if (end==-1) {end=length;}
      cookieVal=unescape(allCookie.substring(start,end));
    }
  }
  return(cookieVal);
}
function getParams()
{
  var idx=document.URL.indexOf('?');
  var params = new Array();
  if (idx != -1) {
    var pairs=document.URL.substring(idx+1,document.URL.length).split('&');
    for (var i=0; i<pairs.length; i++) {
      nameVal=pairs[i].split('=');
      params[nameVal[0]]=nameVal[1];
    }
  }
  return params;
}





