<!--

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
   //MM_swapImage('imageName','','image/address',1);
}

function centerLayout(){
	var layoutWidth = 760;
	
	if (document.getElementById && navigator.appName == 'Netscape'){
		var bodyWidth = self.innerWidth;
		if(bodyWidth >= layoutWidth){
			document.getElementById('centerlayer').style.left = "50%";
			document.getElementById('centerlayer').style.marginLeft = "-380px";
		}else{
			document.getElementById('centerlayer').style.left = "0px";
			document.getElementById('centerlayer').style.marginLeft = "0px";
		}
		
	}else if (document.getElementById){
		var bodyWidth = document.body.offsetWidth; 
		
		if(bodyWidth >= layoutWidth - 10){
			document.getElementById('centerlayer').style.left = "50%";
			document.getElementById('centerlayer').style.marginLeft = "-380px";
		}else{
			document.getElementById('centerlayer').style.left = "0px";
			document.getElementById('centerlayer').style.marginLeft = "0px";
		}
		
	}else if (document.layers){
			document.layers['centerlayer'].left = 0;
			document.layers['centerlayer'].marginLeft = 0;
			
    }else if (document.all){
		var bodyWidth = self.innerWidth;
		if (bodyWidth >= layoutWidth){
			document.all.tags('div')['centerlayer'].style.left = "50%";
			document.all.tags('div')['centerlayer'].style.marginLeft = "-380px";
		}else{
			document.all.tags('div')['centerlayer'].style.left = "0px";
			document.all.tags('div')['centerlayer'].style.marginLeft = "0px";
		}
	}
}
   
function MM_showHideLayers() { //v3.0

  var i,p,v,obj,args=MM_showHideLayers.arguments;

  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];

    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }

    obj.visibility=v; }

}

function showHideContent(id)
  {
    var elem = document.getElementById(id);
    var img = document.images['img' + id];
   	
   	var rExp = "";
   	var replace = "";
   	
    if (elem) 
    {
      if (elem.style.visibility == 'hidden') 
      {
        elem.style.display = 'block';
        elem.style.visibility = 'visible';
		rExp = /up/gi;
        replace = "down";
      } 
      else
      {
        elem.style.display = 'none';
        elem.style.visibility = 'hidden';
        rExp = /down/gi;
        replace = "up";
      }
    }
    
     if (img)
	{
		imgSrc = new String(img.src);
		var newPath = imgSrc.replace(rExp,replace);
		img.src = newPath;
	}
  }
  
function showTips(id1,id2)
{
	var elem1 = document.getElementById(id1);
	var elem2 = document.getElementById(id2);
	
	 if (elem1 && elem2) 
    {
        elem1.style.display = 'none';
        elem1.style.visibility = 'hidden';
        elem2.style.display = '';
        elem2.style.visibility = 'visible';
    } 
} 

function MM_reloadPage()
{
}

function GetLink(list) {

	if (list.selectedIndex > 0) {
		var win = window.open("http://www.sbshopnow.com/templates/sbexit.asp?mr=" + (list.selectedIndex) + "&ct=LIST&sbid=" + list.options[list.selectedIndex].value,"win");
		win.focus();
	}
}

function JumpLink(link) {

	var win = window.open(link,"win");
    win.focus();
}

function LearnMore() {
	window.location = "Cherry_Land.aspx";
}
function xxxx() {
	window.location = "Cherry_Land.aspx";
}

function clickTag1() {
	window.location = "../lisa/rt_lisa.aspx";
}

function clickTag2() {
	window.location = "../keith/rt_keith.aspx";
}

function clickTag3() {
	window.location = "../rt/rt_tracker.aspx";

}

function clickTagSuppCircle() {
window.location = "../rt/rt_support_circle.aspx";
}

function clickTagToolKit() {
window.location = "../rt/rt_tool_overview.aspx";

}

function clickTag4() {
	window.open("demo.aspx","TrackerDemo","width=762,height=500,resizable=yes");
}

function cqHelp() {
	window.open('http://www.committedquitters.com');
}

function clickTag5() {
	window.open('QuitTracker_widget_pc.zip');
}

function clickTag6() {
	window.open('QuitTracker_widget_mac.zip');
}

function Rules() {
	window.open("CherryGame/CherryGameRules.aspx","Rules","width=762,height=600,resizable=yes,scrollbars=yes");
}

//			DO NOT REMOVE WAITING 4 APPROVAL

//Smoking Control Cross Brand ExitSurvey_Q2_2008
function exitSurveyPop()
{
	var timeIn = getCookie('gskW2QExitCookie');
	var limit = 4*60*1000 + Date.parse(timeIn);
	var nowTime = new Date();
	var popped = readCookie('gskW2QExitCookiePopped');
	
	if(limit < nowTime.getTime() && popped != "true")
		popSurvey();
}


function popSurvey()
{
	var subDir = getURL() + "W2QExitSurvey.aspx";
	var newWin = window.open(subDir,'_blank','scrollbars=yes,resizable=yes, width=780, height=620');
	
	//if it hasnt create gskW2QExitCookiePopped
	document.cookie = 'gskW2QExitCookiePopped=true; expires=Thu, 2 Aug 2010 20:47:11 UTC; path=/' 
	
	//determines whether the pop up is blocked
	if(!(newWin && newWin.top))
	{	
		//then delete original cookie
		delCookie();
	}
}

function getURL(){
  var strReturn = "";
  var strHref = window.location.href;
  var strArray = strHref.split("/");
  var i;
  
  if(strArray[2].toLowerCase() == "localhost")
	i = 5;
  else
	i = 4;
  
  while(i<strArray.length)
  {
	strReturn += "../";
	i++;
  }

  return strReturn;
} 

function popped()
{
	var popped = getCookie('gskW2QExitCookiePopped');
	
	if(popped == null || popped == "")
		return false;
	else
		return true;
}

//returns a date and time when the cookie was created
//returns the current date and time if it is a new cookie
function getCookie(cookieName)
{
	var cookie = document.cookie;
	var prefix = cookieName + "=";
	var begin = cookie.indexOf("; " + prefix);
	
	if(begin == -1)
	{
		begin = cookie.indexOf(prefix);
		
		if(begin != 0)
			return new Date();
		else
		{
			var foundCookie = cookie.substring(begin,cookie.length);
			var timeIn = "=TimeIn=";
			var beginTime = foundCookie.indexOf(timeIn);
			var end = foundCookie.indexOf(";",beginTime);
			if(end == -1)
				end = document.cookie.length;
			return (foundCookie.substring(beginTime + 8,end));			
		}
	}
	else
	{
		var foundCookie = cookie.substring(begin,cookie.length);
		var timeIn = "=TimeIn=";
		var beginTime = foundCookie.indexOf(timeIn);
		end = foundCookie.indexOf(";",beginTime);
		if(end == -1)
			end = document.cookie.length;
		return (foundCookie.substring(beginTime + 8,end));
	}
}

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;
}

//sets the expiration date of the cookie so it can be erased
function delCookie()
{
	var d = new Date();
	document.cookie = "gskW2QExitSurvey;expires=Thu, 01-Jan-70 00:00:01 GMT;";	
}


//open the Commit Cappuccino sample campaign and contigency
function openCapSample()
{
	window.location = "commit5dollar.promo";
}


//navigate to the flavors page - ok, this was obvious
function gotoFlavorsPage()
{
	window.location = "Flavors.aspx";
}

//checks the cookie
//setInterval ( "exitSurveyPop()", 5000 );

// End of Smoking Control Cross Brand ExitSurvey_Q2_2008// End of Smoking Control Cross Brand ExitSurvey_Q2_2008

//-->


function puzzleMiddle(){
	window.location = 'Quit_Place.aspx';
//do nothing, commit flash calls this, but isn;t needed, so this is just stopping a js error.
}