﻿// Script Source: CodeLifter.com
// Copyright 2003
// Do not remove this header
isIE=document.all;
isNN=!document.all&&document.getElementById;
isN4=document.layers;
isHot=false;
var whichDog;
// create an instance of the Date object
var newNow = new Date();
/*
cookie expires in one year (actually, 365 days)
365 days in a year
24 hours in a day
60 minutes in an hour
60 seconds in a minute
1000 milliseconds in a second
*/
newNow.setTime(newNow.getTime() + 365 * 24 * 60 * 60 * 1000);
var winCount = 0;
//var subdomain = "amun";
var subdomain = ".macrovision.com";
function setCookie(name, value, expires, path, domain, secure)
{
   var curCookie = name + "=" + escape(value) +
      ((expires) ? "; expires=" + expires.toGMTString() : "") +
      ((path) ? "; path=" + path : "") +
      ((domain) ? "; domain=" + domain : "") +
      ((secure) ? "; secure" : "");
   document.cookie = curCookie;
}
function getCookie(name) {
  var dc = document.cookie;
  var prefix = name + "=";
  var begin = dc.indexOf("; " + prefix);
  if (begin == -1) {
    begin = dc.indexOf(prefix);
    if (begin != 0) return null;
  } else
    begin += 2;
  var end = document.cookie.indexOf(";", begin);
  if (end == -1)
    end = dc.length;
  return unescape(dc.substring(begin + prefix.length, end));
}
function ddInit(e){
  topDog=isIE ? "BODY" : "HTML";
  whichDog=isIE ? document.all.theLayer : document.getElementById("theLayer");  
  hotDog=isIE ? event.srcElement : e.target;  
  while (hotDog.id!="titleBar"&&hotDog.tagName!=topDog){
    hotDog=isIE ? hotDog.parentElement : hotDog.parentNode;
  }  
  if (hotDog.id=="titleBar"){
    offsetx=isIE ? event.clientX : e.clientX;
    offsety=isIE ? event.clientY : e.clientY;
    nowX=parseInt(whichDog.style.left);
    nowY=parseInt(whichDog.style.top);
    ddEnabled=true;
    document.onmousemove=dd;
  }
}
function dd(e){
  if (!ddEnabled) return;
  whichDog.style.left=isIE ? nowX+event.clientX-offsetx : nowX+e.clientX-offsetx; 
  whichDog.style.top=isIE ? nowY+event.clientY-offsety : nowY+e.clientY-offsety;
  return false;  
}
function ddN4(whatDog){
  if (!isN4) return;
  N4=eval(whatDog);
  N4.captureEvents(Event.MOUSEDOWN|Event.MOUSEUP);
  N4.onmousedown=function(e){
    N4.captureEvents(Event.MOUSEMOVE);
    N4x=e.x;
    N4y=e.y;
  }
  N4.onmousemove=function(e){
    if (isHot){
      N4.moveBy(e.x-N4x,e.y-N4y);
      return false;
    }
  }
  N4.onmouseup=function(){
    N4.releaseEvents(Event.MOUSEMOVE);
  }
}
function hideMe(){
  setCookie("surveymvsn","0", newNow,"/");
  if (isIE||isNN) 
  {    
    whichDog.style.visibility="hidden";
    document.getElementById("theLayer2").style.visibility="visible";
  }
  else if (isN4) 
  {
    document.theLayer.visibility="hide";
    document.theLayer2.visibility="visible";
  }
  //alert("When you are ready to take the survey, please click on the Web site survey banner on the top of the page to access the survey.");
}
function hideMeMin(){
  //setCookie("surveyfnp","1", newNow,"/");
  if (isIE||isNN) whichDog.style.visibility="hidden";
  else if (isN4) document.theLayer.visibility="hide";
}
function hideMeFinal(){
  setCookie("surveymvsn","1", newNow,"/");
  if (isIE||isNN) 
  {    
    whichDog.style.visibility="hidden";
    document.getElementById("theLayer2").style.visibility="hidden";
  }
  else if (isN4) 
  {
    document.theLayer.visibility="hide";
    document.theLayer2.visibility="hide";
  }
 
}
function showMe(){
  if (isIE||isNN) whichDog.style.visibility="visible";
    else if (isN4) document.theLayer.visibility="show";
}
function showMeNow(){
  setCookie("survey", 2, newNow);
  { if (isIE||isNN) whichDog.style.visibility="visible";
    else if (isN4) document.theLayer.visibility="show";
  }
}
document.onmousedown=ddInit;
document.onmouseup=Function("ddEnabled=false");