/*
  Popup code -- link in any place that needs to pop up the tour:
  <script language="JavaScript" src="/css/js/tour.js"></script>

  To link to the popup, use the following code:
  <a href="#" onClick="openTour();return(false)">...</a>
  This will prevent the link from actually going anywhere.

  Contact: Joseph Smarr (joseph@plaxo.com)
*/

// tour window vars
var tourWindow=null; // handle for the tour window
var tourURL="/info/products/tour"; // first URL to load
var tourX=10; // x-offset from parent page
var tourY=10; // y-offset from parent page
var tourWidth=690; // width of tour window
var tourHeight=350; // height of tour window

// Pops up the "take a tour" window if it's not already open
// host is optional and should be like "www.plaxo.com" so it can open using HTTP
// signin is optional for showing the "already downloaded" tour variant
function openTour(host, signin)
{
	if (!hasRightVersion) {
		if (!confirm('Your browser needs Flash 6 to show the tour. Do you wish to continue anyway?')) {
			return false;
		}

	}
  if(tourWindow==null || tourWindow.closed)
  {
    // positions the tour window indented from the current window
    var tourScreenX=tourX;
    var tourScreenY=tourY;
    if(navigator.appVersion.indexOf("MSIE")==-1)
    {
      // netscape code
      tourScreenX+=window.pageXOffset;
      tourScreenY+=window.pageYOffset;
    }
    else
    {
      // internet explorer code
      tourScreenX+=self.screenLeft;
      tourScreenY+=self.screenTop;
    }

    // specifies the look of the tour window
    var tourFeatures="screenX="+tourScreenX+ // NS
                     ",left="+tourScreenX+ // IE
                     ",screenY="+tourScreenY+ // NS 
                     ",top="+tourScreenY+ // IE
                     ",width="+tourWidth+ 
                     ",height="+tourHeight+
                     ",resizabl=false,status=no,scrollbars=no";

    // opens the tour window
    var url = tourURL;
    if (host) url = "http://" + host + url;
    if (signin) url += '?signin=1';
    tourWindow=window.open(url,"tour",tourFeatures);
  }
  else if(!tourWindow.closed) 
    tourWindow.focus(); // shows the window if it's hidden behind the current window
	return false;
}

