function getLocalHost( callerProtocol, callerHost )
{
    return callerProtocol + "//" + callerHost
}

function goTour( callerLocation, tourpage, fullTour )
{
	self.resizeTo( FRAME_WIDTH, FRAME_HEIGHT )
    if( location.search.length > 0 )
    {
        tourLocation = tourpage + location.search + "&"
    }
    else
    {
        tourLocation = tourpage += "?"
    }
    tourLocation += "lh=" + escape(getLocalHost( location.protocol, location.host ))+"&ft="+fullTour
//    alert( tourLocation );
    callerLocation.replace( tourLocation );
}

function errloadSmallImg()
{
	location.replace("tourfailure.html"+location.search);
}

function tourfailure( pac )
{
  	errPage = "tourerror.html";
    if ( pac["pac_promo_state"].length == 0 )
    {
    	errPage = "tourerror.html";
    }
    else if ( pac["pac_promo_state"] == "1" )
    {
    	errPage = "tourerror.html";
    }
    else if ( pac["pac_promo_state"] == "2" )
    {
    	errPage = "rcluster-5.propel.com/activate";
    }
    else
    {
    	errPage = "rcluster-5.propel.com/subscribe";
    }
    location.replace( errPage+location.search);
}

function goFullTour( pac )
{
  	tourPage = "tourerror.html";
    if ( pac["pac_promo_state"].length == 0 )
    {
    	tourPage = "tourerror.html";
    }
    else if ( pac["pac_promo_state"] == "2" )
    {
    	tourPage = "rcluster-5.propel.com/activate";
    }
    else
    {
    	tourPage = "fulltour.html";
    }
    location.replace( tourPage+location.search);
}
