var tempurl=location.href;

if(tempurl.toLowerCase().indexOf("jsplacead.asp")!=-1 || tempurl.toLowerCase().indexOf(".aspx")!=-1)
{
	
}
else
{

// Use this function to retrieve a cookie.
function getCookie(name){
var cname = name + "=";               
var dc = document.cookie;             
    if (dc.length > 0) {              
    begin = dc.indexOf(cname);       
        if (begin != -1) {           
        begin += cname.length;       
        end = dc.indexOf(";", begin);
            if (end == -1) end = dc.length;
            return unescape(dc.substring(begin, end));
        } 
    }
return null;
}

// Use this function to save a cookie.
function setCookie(name, value, expires) {
document.cookie = name + "=" + escape(value) + "; path=/" +
((expires == null) ? "" : "; expires=" + expires.toGMTString());
}

// Use this function to delete a cookie.
function delCookie(name) {
document.cookie = name + "=; expires=Thu, 01-Jan-70 00:00:01 GMT" +  "; path=/";
}


// These three functions calculate the expiration date/time of the cookie
function leapYear(yr) {
	if (((yr % 4 == 0) && yr % 100 != 0) || yr % 400 == 0)
		return true;
	else return false;
}

function numDaysIn(mth,yr) {
	if (mth==4 || mth==6 || mth==9 || mth==11) return 30;
	else if ((mth==2) && leapYear(yr)) return 29;
	else if (mth==2) return 28;
	else return 31;
}

function getNextSunday(){
	
	dToday=new Date();
	nMonth=dToday.getMonth()+1;
	nDay=dToday.getDate();
	nYear=dToday.getUTCFullYear();
	nDaysInMonth=numDaysIn(nMonth,nYear);
	strDay=dToday.getDay();
	dStartofWeek=new Date();
	dEndofMonth=new Date();
	dEndofMonth.setTime((dToday.getTime())+((nDaysInMonth-nDay)*(1000*60*60*24)));
	strEndofMonth=dEndofMonth.getMonth()+1+"/"+dEndofMonth.getDate()+"/"+dEndofMonth.getUTCFullYear()+ " 23:59:59";
	newone = new Date(strEndofMonth)
	return newone;
	
}

// Set a variable equal to the returned results of the cookie date/time function
exp = getNextSunday();


var secs
var timerID = null;
var timerRunning = false;
var delay = 1000;

// Set the length of the timer, in seconds
secs = 15;
StopTheClock();
StartTheTimer();

function StopTheClock()
{
    if(timerRunning){
        clearTimeout(timerID);
    timerRunning = false;
	}
}

function StartTheTimer()
{
    if (secs==0)
    {
        StopTheClock();
        hideName();
    }
    else
    {
        secs = secs - 1;
        timerRunning = true;
        timerID = self.setTimeout("StartTheTimer()", delay);
    }
}





  
  

// Function sets the Div visibilty to hidden
function hideName() {
document.getElementById("NameAcquisition").style.visibility = "hidden"        
}

// Function sets the Div visibilty to hidden
function showName() {
document.getElementById("NameAcquisition").style.visibility = "visible"        
}

// Code to write our the HTML of the Div
document.write('<div id="NameAcquisition" name="NameAcquisition" style="position: absolute; left: 70px; top: 70px; z-index: 200; visibility: hidden;">');
document.write('		<table cellpadding="0" cellspacing="0" border="0" width="375" bgcolor="#666666">');
document.write('			<tr>');
document.write('				<td rowspan="4"><img src="/images/s.gif" width="5" height="1" border="0" alt="">');
document.write('				<td colspan="3"><img src="/html/images/NameAcquisition/banner.gif" width="365" height="92" border="0" alt="Get more for less!"></td>');
document.write('				<td rowspan="4"><img src="/images/s.gif" width="5" height="1" border="0" alt="">');
document.write('			</tr>');
document.write('			<tr>');
document.write('				<td colspan="3"><img src="/html/images/NameAcquisition/lifestyle.jpg" width="365" height="183" border="0" alt=""></td>');
document.write('			</tr>');		
document.write('			<tr>');
document.write('				<td class="colorFFFFFFbg"><img src="/images/s.gif" width="10" height="100" border="0" alt=""></td>');
document.write('				<td class="colorFFFFFFbg">Sign up to receive HP\'s hottest specials, promotions, and newly launched product offers for small and medium businesses.<br><br><a href="https://h30046.www3.hp.com/subchoice/subhub.aspx"><img src="/html/images/NameAcquisition/btn_sign_up.gif" width="64" height="20" border="0" alt="Sign Up"></a></td>');
document.write('				<td class="colorFFFFFFbg"><img src="/images/s.gif" width="10" height="100" border="0" alt=""></td>');
document.write('			</tr>');
document.write('			<tr>');
document.write('				<td><img src="/images/s.gif" width="10" height="75" border="0" alt=""></td>');
document.write('				<td>');
document.write('				<span style="color: #CCCCCC; font-size: 90%;">You can remove your name from the list at any time by clicking the unsubscribe link at the bottom of the email.  Please see our <a href="http://welcome.hp.com/country/us/eng/privacy.htm" class="udrline" style="color: #CCCCCC;">privacy policy</a> for any questions.</span>');
document.write('				<div align="right"><span class="colorFFFFFFbld">&raquo;&nbsp;</span><a href="#" onclick="javascript:hideName();" class="themeheaderlink">Close</a>&nbsp;&nbsp;</div>');
document.write('				</td>');
document.write('				<td><img src="/images/s.gif" width="10" height="75" border="0" alt=""></td>');	
document.write('			</tr>');		
document.write('			<tr>');
document.write('				<td colspan="5"><img src="/images/s.gif" width="1" height="10" border="0" alt=""></td>');
document.write('			</tr>');
document.write('		</table>');
document.write('</div>');




// Setting the URL of the page to the variable myString
var myString = window.location.href;

// Setting parameter variables based off the myString variable
var index = myString.indexOf("19701");
var index2 = myString.search("home.asp");
var index3 = myString.search("/ssl/");

// Setting variables for the temporary cookie
var CPQTestingCookiesDaysToLive = 30;
var CPQTestingCookiesnow = new Date();

// Setting our temporary cookie.
CPQTestingCookiesthen = CPQTestingCookiesnow.getTime() + (CPQTestingCookiesDaysToLive * 24 * 60 * 60 * 1000);
CPQTestingCookiesnow.setTime(CPQTestingCookiesthen);
document.cookie = "strCPQTestingCookiesValue=yes; expires=" + CPQTestingCookiesnow.toGMTString();


// Below is the logic tree that determines when to hide the layer and when to show it.

// This checks to see if "19071" is present in the URL and hides the layer if it is not.
if (index == -1) {
	hideName();
	
// This check to see if "home.asp" is in the URL and hides the layer if it is.	
} else if (index2 > -1) {
	hideName();
	
// This check to see if "/ssl/" is in the URL and hides the layer if it is.		
} else if (index3 > -1) {
	hideName();

// If none of the three conditions above are met, we go into the a sub-tree which determines when to display.
} else {
	// Setting the value of the cookie "CPQ1Time" to a varialbe
	strCookieValue = getCookie("CPQ1Time");
	
	// If strCookieValue has a value of "ok" then we hide the layer
	if (strCookieValue=="ok") {
		hideName();
		
	// If strCookieValue does not have a value of "ok" then we fork into yet another sub-tree
	} else {
		// This checks to see if our temporary cookie was successfully written, and if not, hides the layer
		if (document.cookie.indexOf("strCPQTestingCookiesValue=") == -1) {
			hideName();
			
		// And finally, if none of the other conditions are met, we set our CPQ1Time cookie and show the layer.	
		} else {
			setCookie("CPQ1Time", "ok", exp); 
			showName();			
		}
	}
}
  
}  
  