﻿var channel = "petproductnews";
var axel  = Math.random();
var ord   = axel * 1000000000000000000;
var tile  = 1;
var pos   = 1;
var adid  = "";

var path  = document.location;
var re    = /\/([\.\w_]+\/)(([\.\w-_]+\/){0,1})([\.\w_]+\/)*(.*?)$/;
var arr   = re.exec(path);
var loc   = "home";

if (arr[2] != "")
	loc = arr[2];

function displayTopBanner()
{
	document.write('<SCRIPT LANGUAGE="JavaScript1.1" SRC="http://ad.doubleclick.net/adj/' + channel + '.tmus/' + loc + ';adid=' + adid + ';tile=' + tile + ';dcopt=ist;sz=728x90;ord=' + ord + '?" ><\/SCRIPT>');



	if ((!document.images && navigator.userAgent.indexOf("Mozilla/2.") >= 0)  || navigator.userAgent.indexOf("WebTV")>= 0) 
	{
		document.write('<A HREF="http://ad.doubleclick.net/jump/' + channel + '.tmus/' + loc + ';adid=' + adid + ';tile=' + tile + ';dcopt=ist;sz=728x90;ord=' + ord + '?" TARGET="_blank">');
		document.write('<IMG SRC="http://ad.doubleclick.net/ad/' + channel + '.tmus/' + loc + ';adid=' + adid + ';tile=' + tile + ';dcopt=ist;sz=728x90;ord=' + ord + '?" WIDTH="728" HEIGHT="90" BORDER="0" ALT=""></A>');
	}
	document.write("<NOSCRIPT>");
	document.write("<IMG SRC=\"http://ad.doubleclick.net/ad/" + channel + ".tmus/" + loc + ";adid=" + adid + ";tile=" + tile + ";dcopt=ist;sz=728x90;ord=123456789?\" WIDTH=\"728\"HEIGHT=\"90\" BORDER=\"0\" ALT=\"\"></A>");
	document.write("</NOSCRIPT>");
	tile++;

	
}

function displaySkyScraper()
{
	document.write('<SCRIPT LANGUAGE="JavaScript1.1" SRC="http://ad.doubleclick.net/adj/' + channel + '.tmus/' + loc + ';adid=' + adid + ';tile=' + tile + ';sz=160x600;ord=' + ord + '?" ><\/SCRIPT>');
	if ((!document.images && navigator.userAgent.indexOf("Mozilla/2.") >= 0)  || navigator.userAgent.indexOf("WebTV")>= 0) 
	{
		document.write('<A HREF="http://ad.doubleclick.net/jump/' + channel + '.tmus/' + loc + ';adid=' + adid + ';tile=' + tile + ';sz=160x600;ord=' + ord + '?" TARGET="_blank">');
		document.write('<IMG SRC="http://ad.doubleclick.net/ad/' + channel + '.tmus/' + loc + ';adid=' + adid + ';tile=' + tile + ';sz=160x600;ord=' + ord + '?" WIDTH="160" HEIGHT="600" BORDER="0" ALT=""></A>');
	}
	document.write("<NOSCRIPT>");
	document.write("<IMG SRC=\"http://ad.doubleclick.net/ad/" + channel + ".tmus/" + loc + "adid=" + adid + ";tile=" + tile + ";sz=160x600;ord=123456789?\" WIDTH=\"160\"HEIGHT=\"600\" BORDER=\"0\" ALT=\"\"></A>");
	document.write("</NOSCRIPT>");
	tile++;
}

function displayContentAd()
{
	document.write('<SCRIPT LANGUAGE="JavaScript1.1" SRC="http://ad.doubleclick.net/adj/' + channel + '.tmus/' + loc + ';adid=' + adid + ';tile=' + tile + ';sz=336x280;ord=' + ord + '?" ><\/SCRIPT>');
	if ((!document.images && navigator.userAgent.indexOf("Mozilla/2.") >= 0)  || navigator.userAgent.indexOf("WebTV")>= 0) 
	{
		document.write('<A HREF="http://ad.doubleclick.net/jump/' + channel + '.tmus/' + loc + ';adid=' + adid + ';tile=' + tile + ';sz=336x280;ord=' + ord + '?" TARGET="_blank">');
		document.write('<IMG SRC="http://ad.doubleclick.net/ad/' + channel + '.tmus/' + loc + ';adid=' + adid + ';tile=' + tile + ';sz=336x280;ord=' + ord + '?" WIDTH="336" HEIGHT="280" BORDER="0" ALT=""></A>');
	}
	document.write("<NOSCRIPT>");
	document.write('<A HREF="http://ad.doubleclick.net/jump/' + channel + '.tmus/' + loc + ';adid=' + adid + ';tile=' + tile + ';sz=336x280;ord=123456789?" TARGET="_blank">');
	document.write('<IMG SRC="http://ad.doubleclick.net/ad/' + channel + '.tmus/' + loc + ';adid=' + adid + ';tile=' + tile + ';sz=336x280;ord=123456789?" WIDTH="336" HEIGHT="280" BORDER="0" ALT=""></A>');
	document.write("</NOSCRIPT>");
	tile++;

}

function displayPanelAd()
{
	
	document.write('<SCRIPT LANGUAGE="JavaScript1.1" SRC="http://ad.doubleclick.net/adj/' + channel + '.tmus/' + loc+ ';adid=' + adid + ';pos=' + pos + ';tile=' + tile + ';sz=125x125;ord=' + ord + '?" ><\/SCRIPT>');
	if ((!document.images && navigator.userAgent.indexOf("Mozilla/2.") >= 0)  || navigator.userAgent.indexOf("WebTV")>= 0) 
	{
		document.write('<A HREF="http://ad.doubleclick.net/jump/' + channel + '.tmus/' + loc + ';adid=' + adid + ';pos=' + pos + ';tile=' + tile + ';sz=125x125;ord=' + ord + '?" TARGET="_blank">');
		document.write('<IMG SRC="http://ad.doubleclick.net/ad/' + channel + '.tmus/' + loc + ';adid=' + adid + ';pos=' + pos + ';tile=' + tile + ';sz=125x125;ord=' + ord + '?" WIDTH="125" HEIGHT="125" BORDER="0" ALT=""></A>');
	}
	
	document.write("<NOSCRIPT>");
	document.write('<A HREF="http://ad.doubleclick.net/jump/' + channel + '.tmus/' + loc + ';adid=' + adid + ';pos=' + pos + ';tile=' + tile + ';sz=125x125;ord=123456789?" TARGET="_blank">');
	document.write('<IMG SRC="http://ad.doubleclick.net/ad/' + channel + '.tmus/' + loc + ';adid=' + adid + ';pos=' + pos + ';tile=' + tile + ';sz=125x125;ord=123456789?" WIDTH="125" HEIGHT="125" BORDER="0" ALT=""></A>');
	document.write("</NOSCRIPT>");
	tile++;	
	pos++;

}






// JScript File

//Pop-under window- By JavaScript Kit
//Credit notice must stay intact for use
//Visit http://javascriptkit.com for this script

//specify page to pop-under
var popunder=""
var strPageToPopunder = "";

//specify popunder window features
//set 1 to enable a particular feature, 0 to disable
var winfeatures="width=575,height=445,scrollbars=0,resizable=1,toolbar=0,location=0,menubar=0,status=0,directories=0"

//Pop-under only once per browser session? (0=no, 1=yes)
//Specifying 0 will cause popunder to load every time page is loaded
var once_per_session=1

///No editing beyond here required/////

function get_cookie(Name) 
{
    var search = Name + "="
    var returnvalue = "";
    if (document.cookie.length > 0) 
    {
        offset = document.cookie.indexOf(search)
        if (offset != -1) 
        { // if cookie exists
                offset += search.length
            // set index of beginning of value
            end = document.cookie.indexOf(";", offset);
            // set index of end of cookie value
            if (end == -1)
                end = document.cookie.length;
            returnvalue=unescape(document.cookie.substring(offset, end))
        }
    }
    return returnvalue;
}

function loadornot()
{
    if (get_cookie('popunder')=='')
    {
        loadpopunder()
        document.cookie="popunder=yes"
    }
}

function loadpopunder()
{
    win2=window.open(popunder,"",winfeatures)
	if(win2){
		win2.blur()
		window.focus()
	}
}

var strCurrentPage = document.location + '';

if (strCurrentPage.toLowerCase() == strPageToPopunder.toLowerCase())
{
    if (once_per_session==0)
        loadpopunder()
    else
        loadornot()
}



var txtfdID='';
var strKeyPressForm="search";
var txtfdIDNewsLetter='';

document.onkeydown = KeyPress;
function KeyPress()
{
	if (event.keyCode == 13)
	{
		if(strKeyPressForm=="search"){
			if(event.srcElement.id==txtfdID){
				document.location = "/search.aspx?q="+googleEncode(event.srcElement.value);
				return false;
			}
		} else if(strKeyPressForm=="newsletterminiform"){
			if(event.srcElement.id==txtfdIDNewsLetter){
				document.location = "/newslettersignup.aspx?email="+event.srcElement.value;
				return false;
			}
		} else if(strKeyPressForm=="contest"){
			return KeyPressHandlerContest(null);
		} else if(strKeyPressForm=="profilequicksearch"){
			return KeyPressHandlerProfileQuickSearch(null);
		} else if(strKeyPressForm=="profileadvancedsearch"){
			return KeyPressHandlerProfileAdvancedSearch(null);
		} else if(strKeyPressForm=="survey"){
			return KeyPressHandlerSurvey(null);
		}
	}
}

function KeyPressChangeTarget(strForm){
	strKeyPressForm=strForm;
}

function googleEncode(str)
{
    str = str.replace(/ /g,"+");
    str = str.replace(/&/g,"%26");
    return str;
}
