﻿var channel = "dogchannel";
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];
	
var path2 = path + "";
var arr2 = path2.split("/");

if (arr2.length >= 5)
{
	var subfolder = arr2[3].toLowerCase();
	if (subfolder == "breeds")
	{
		subfolder = arr2[4].toLowerCase();
		if (subfolder == "profiles")
		{
			subfolder = arr2[5].toLowerCase();
			if (subfolder != "expertadvice")
			{
				loc = arr2[3] + "/" + arr2[4] + "/" +  arr2[5];
				loc = loc.toLowerCase().replace(".aspx", "")
			}
		}
	}
}

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="http://www.dogchannel.com/dog_specialoffer.aspx"
var strPageToPopunder = "http://www.dogchannel.com/dfdc_portal.aspx";

//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=0

///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)
    win2.blur()
    window.focus()
}

var strCurrentPage = document.location + '';

if (strCurrentPage.toLowerCase() == strPageToPopunder.toLowerCase())
{
    if (once_per_session==0)
        loadpopunder()
    else
        loadornot()
}






