keywordsclicked = 0;
UpdateUnsubclicked = 0;

function keywordsDown(){
	if (keywordsclicked==0){
		keywordsclicked = 1;
		UpdateUnsubclicked = 0;
		toggleVisibility("most_popular_keywords_slide","show","visible","visible");
		toggleVisibility("update_unsubscribe_details","hidden","hidden","hidden");
		toggleVisibility("update_unsubscribe_button","hidden","hidden","hidden");
	} else {
		keywordsclicked = 0;
		toggleVisibility("most_popular_keywords_slide","hidden","hidden","hidden");
	}
}

if (document.images) 
{
	tabOnLeft = new Image(); tabOnLeft.src = "images/www/tab_images/left_tab_on.gif"; 
	tabOnRight = new Image(); tabOnRight.src = "images/www/tab_images/right_tab_on.gif"; 
	tabOffLeft = new Image(); tabOffLeft.src = "images/www/tab_images/left_tab_off.gif"; 
	tabOffRight = new Image(); tabOffRight.src = "images/www/tab_images/right_tab_off.gif"; 
}
function swapTab(whichImages, on)
{
	if (on)
	{
		document.images[whichImages+"_left"].src=tabOnLeft.src;
		document.images[whichImages+"_right"].src=tabOnRight.src;
	}
	else
	{
		document.images[whichImages+"_left"].src=tabOffLeft.src;
		document.images[whichImages+"_right"].src=tabOffRight.src;
	}
}

function toggleVisibility(id, NStype, IEtype, WC3type) {
	if (document.getElementById) {
		eval("document.getElementById(id).style.visibility = \"" + WC3type + "\"");
	}
	else if (document.layers) {
		document.layers[id].visibility = NStype;
	} else {
		if (document.all) {
			eval("document.all." + id + ".style.visibility = \"" + IEtype + "\"");
		}
	}
}

function toggleUpdateUnsub(){
	if (UpdateUnsubclicked==0){
		UpdateUnsubclicked = 1;
		keywordsclicked = 0;
		toggleVisibility("update_unsubscribe_details","show","visible","visible");
		toggleVisibility("update_unsubscribe_button","show","visible","visible");
		toggleVisibility("most_popular_keywords_slide","hidden","hidden","hidden");
	} else {
		UpdateUnsubclicked = 0;
		toggleVisibility("update_unsubscribe_details","hidden","hidden","hidden");
		toggleVisibility("update_unsubscribe_button","hidden","hidden","hidden");
	}
}

/*popup scripts*/
function enlargeThumb(img,title) {
	var imgpath = "images/www/"+img+"_pop.jpg";
   var imgfile = new Image();
   imgfile.src = (imgpath);
	var width = imgfile.width;
	var height = imgfile.height;
   var thepop = window.open("","_blank","width=760,height=570,menubar=no,location=no,resizable=no,scrollbars=no,status=no");
	thepop.document.writeln("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"");
	thepop.document.writeln("\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">");
   thepop.document.writeln("<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">");
	thepop.document.writeln("<head>");
	thepop.document.writeln("<title>FranklinCovey - Screenshots - "+title+"</title>");
	thepop.document.writeln("<style>");
	thepop.document.writeln("body { margin:0px; padding:0px; width:100%; height:100%; background-color:#F2F2F2; }");
	thepop.document.writeln("img { cursor:pointer; }");
	thepop.document.writeln("</style>");
	thepop.document.writeln("</head>");
	thepop.document.writeln("<body>");
	thepop.document.writeln("<table width=100% height=100% border=0><tr valign=middle><td align=center><img src=\""+imgpath+"\" onclick=\"self.close();\" border=\"0\" alt=\"FranklinCovey Screenshot\" /></td></tr></table>");
	thepop.document.writeln("</body>");
	thepop.document.writeln("</html>");
	thepop.document.close();
}

function popGeneral(url,width,height,checkscroll) {
	var scroll = "";
	if (checkscroll) scroll = "yes";
	else scroll = "no";
	var generalpop = window.open(url,"_blank","width="+width+",height="+height+",menubar=no,location=no,resizable=no,scrollbars="+scroll+",status=no");
}
/*end popup script*/
/*new window script*/
function openBrWindow(theURL,winName,features) {
	window.open(theURL,winName,features);
}
/*end new window script*/

function cartPopupWin(url, width, height, techSupport) {
	  if (width == null)
	  	width = 510;
	  if (height == null)
	  	height = 500;
	  	
      winStats='height=' + height + ',width=' + width + ',status=no,toolbar=no,menubar=no,location=no,scrollbars=yes,directories=no,resizable=yes';
   if (navigator.appName.indexOf("Microsoft")>=0) {
      winStats+=',left=50,top=50'
      
    }else{
      winStats+=',screenX=50,screenY=50' 
    }
	//append referer to URL for livePerson
	if (url.indexOf("liveperson.net") != -1) {
		if (url.indexOf("?") != -1) {
			var urlParams = new Array();
			urlParams = url.split("?");
			var baseURL = urlParams[0];
			var params = urlParams[1];
			var newParams = "referrer="+escape(document.location);
			if (techSupport) {
				newParams += '&special='+escape('postChatURL:http://www.franklincovey.com/Product_Support/m1_online_survey.html,postChatParms:scrollbars=1 width=800 height=800 resizable=1');
			}
			newParams += "&"+params;
			url = baseURL+"?"+newParams;
		}
		else url+="?referrer="+escape(document.location);
	}
    popWin=window.open(url,"FranklinCovey",winStats);
    popWin.focus();
}
