
var ns6=document.getElementById&&!document.all
var ie=document.all
var newwindow='';

function confrm(q,y,n) { var confrm= confirm(q); if (confrm==true) { window.location=y; } else { window.location=n; } }

function DefaultEnterKey(keypressed){ if (keypressed==13){ event.keyCode=null; window.document.getElementById('one').click(); } return true; }

function load(opt) { if (opt == 'reload') { window.setTimeout("document.survey.submit()",2250); } }

function AgentType(link) {
  var survey = window.open(link,"AgentType","location=0,status=0,scrollbars=0,toolbar=0,resizable=1,menubar=0,directories=0,width=725,height=550");
  if (window.focus) { survey.focus(); } return; }

function PopWindow(link,width,height,scroll) {
  var survey = window.open(link,"AgentType","location=0,status=0,scrollbars="+scroll+
  ",toolbar=0,resizable=1,"+"menubar=0,directories=0,width="+width+",height="+height);
  if (window.focus) { survey.focus(); } return; }

function PopMap(link,width,height,scroll) {
  var survey = window.open(link,"C21Map","location=0,status=0,scrollbars="+scroll+
  ",toolbar=0,resizable=1,"+"menubar=0,directories=0,width="+width+",height="+height);
  if (window.focus) { survey.focus(); } return; }

function changeto(e,highlightcolor,element){
  var TRhighlightbehavior=element
  source=ie? event.srcElement : e.target
  if (source.tagName=="TABLE") return
  while(source.tagName!=TRhighlightbehavior && source.tagName!="HTML")
    source=ns6? source.parentNode : source.parentElement
    if (source.style.backgroundColor!=highlightcolor&&source.id!="ignore")
      source.style.backgroundColor=highlightcolor }

function contains_ns6(master, slave) {
  while (slave.parentNode)
  if ((slave = slave.parentNode) == master)
  return true;
  return false; }

function changeback(e,originalcolor){
  if (ie&&(event.fromElement.contains(event.toElement)||source.contains(event.toElement)||source.id=="ignore")||source.tagName=="TABLE") return
  else if (ns6&&(contains_ns6(source, e.relatedTarget)||source.id=="ignore")) return
  if (ie&&event.toElement!=source||ns6&&e.relatedTarget!=source)
    source.style.backgroundColor=originalcolor }

function SetCookie(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 GetCookie(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; }

function RemCookie(name) { createCookie(name,"",-1); }

function pickerPopup302(ifn,sam) {
  var bl=screen.width/2-102;
  var bt=screen.height/2-104;page="/style/colorpicker.html"+"?ifn="+escape(ifn)+"&sam="+escape(sam);
  if(!newwindow.closed&&newwindow.location) { newwindow.location.href=page; }
  else{newwindow=window.open(
    page,"CTRLWINDOW",
         "help=no,status=no,toolbar=no,menubar=no,location=no,scrollbars=no,resizable=no,dependent=yes,width=248,height=280,left="+bl+
         ",top="+bt+",");
  if(!newwindow.opener)newwindow.opener=self;};
  if(window.focus){ newwindow.focus() } }

