var bOnExitChecked
var bSwitchingPage


// Add to page link building in main.php.function linkToPage()
//$page = 'index.php?content=' . $page . $tmp . '" onMouseOver="switchingPage(true)" onMouseOut="switchingPage(false)"'; 
function switchingPage(bTrue)
{
bSwitchingPage = bTrue
}

// The hideme button
function hideMe()
{
bOnExitChecked = false
var objUpSale = document.getElementById("upSale")
objUpSale.style.visibility = 'hidden'
}

function exitPop() 
{

// Switching pages within the site?
if(bSwitchingPage)
{
return 
}


if(bOnExitChecked){return}
bOnExitChecked=true;


//alert('Please click the Cancel button in the next step for more saving.')


var objUpSale = document.getElementById("upSale")


//parseInt(objUpSale.style.top) 
objUpSale.style.top = document.body.scrollTop + 30

objUpSale.style.visibility = 'visible'

// Otherwise the travel dropdown will be at the top (IE, FireFox okay)
// Doesn't work: objUpSale.style.zIndex = '999'


return "*****************************************************\n\n" + 
"Don't Sneak Away Just Yet - Click the Cancel Button to" +
"\n\n" + 
"Save Over $1,000 a Year on Your Car Insurance!" + 
"\n\n" + 
"Click the Cancel Button Now to Check It Out..." + 
"\n\n*****************************************************"

}


// Ad tracking
var iSiteID = 0

// Show 2 stacked ads, short list for each
function showAd()
{
showAdEx("viagra")
}

// Called by showAd()
function showAdEx(sKeywords, iLength, iTemplate)
{
var sHTML

// Default template
if(!iTemplate)
{
iTemplate = 0
}

// Default length
if(!iLength)
{
iLength = 2
}

// &sid= (site ID)
// &test=on (testing mode)
sHTML = '<script ' +
'src="http://search.revenuepilot.com/servlet/search?mode=js&id=20139&tid=' + iTemplate + '&perpage=' + iLength + '&filter=off' +
'&skip=0&by=off&sid=' + iSiteID + '&keyword=' + sKeywords + '"></script>\n'

document.write(sHTML)
}