/* Modif. 03/20/07  MB  Remove googlebot 404 errors */
var onLiveHomepage = (
(location.toString().indexOf('http://www.lifetimetv.com/index.html')!=-1) ||
(location.toString().indexOf('http://www.lifetimetv.com/index.php')!=-1) ||
(location.toString() == 'http://www.lifetimetv.com') ||
(location.toString() == 'http://www.lifetimetv.com/') ||
(location.toString() == 'www.lifetimetv.com') ||
(location.toString() == 'http://lifetimetv.com') ||
(location.toString() == 'http://lifetimetv.com/') 
);

/* Removed no longer used
var if_Site_ID = "lifetime";
var if_sid = "1";

var if_tag = "<SCRIPT LANGUAGE='JavaScript' " + "DEFER SRC=http" + "://" +
"a248.e.akamai.net/7/836/1132/102403/" + if_Site_ID + ".insightfirst.com/scripts/" + if_Site_ID + "_prod_if.js" +
"></SCR" + "IPT>";
*/


/*if (location.href.indexOf("capwiz") == -1) {
var if_sid=1;
var if_scriptExtension="_prod_if.js";
} else {
var if_sid=78;
var if_scriptExtension="_dev_if.js";
}

var if_tag = "<SCRIPT LANGUAGE='JavaScript' " + "DEFER SRC=http" + "://" +
"a248.e.akamai.net/7/836/1132/102403/" + if_Site_ID + ".insightfirst.com/scripts/" + if_Site_ID + if_scriptExtension +
"></SCR" + "IPT>";
*/

var mep1="&Network=" + escape("Lifetime TV");
var docLoc = new String(document.location);

//Homepage - km042805
if (onLiveHomepage) {
	mep1 = "&Network=" + escape("Lifetime TV")  +"&ContentArea=HomePage";
}

if (docLoc.indexOf('/google/missing.php')!=-1) {
	docLoc = docLoc.replace('/google/missing.php','');
}

if (location.toString().indexOf('lifetimeradio.com')!=-1) {
	mep1 = "&Network=" + escape("Lifetime Radio") + "&ContentArea=Radio";
}

//PhotoContest rating page
if (location.toString().indexOf('/photocontest/rate.php')!=-1) {
	mep1 = "&PhotoID=" + PhotoContestID + "&Network=" + escape("Lifetime TV");
}
//Games
if ((location.toString().indexOf('/games/')!=-1) || (location.toString().indexOf('/trivia/')!=-1)) {
	mep1 = "&Rollup=Games" + "&Network=" + escape("Lifetime TV");
}
//Quizzes
if (location.toString().indexOf('/quiz/')!=-1) {
	mep1 = "&Rollup=Quizzes" + "&Network=" + escape("Lifetime TV");
}
//Grey's Anatomy Trivia
if (location.toString().indexOf('/shows/greysanatomy/trivia/') != -1) {
	mep1 += "&GreysTrivia=" + vars['GreysTrivia'];
}
//Nora Roberts New Book
if (location.toString().indexOf('/movies/noraroberts/norasnewbook/') != -1) {
	mep1 += "&norabook=" + vars['norabook'];
}
//Bloodties Quiz
if (location.toString().indexOf('/shows/bloodties/quiz/') != -1) {
	mep1 += "&bloodquizpage=" + vars['bloodquizpage'];
}
//Spotlight 25 Poll
if (location.toString().indexOf('/shows/spotlight25/poll/') != -1) {
	mep1 += "&pq=" + vars['pq'];
}
//E-mail a friend
if (location.toString().indexOf('emailafriend.pl')!=-1) {
	var emfValue = new String(document.emaf.article_url.value);
	
	if (emfValue.indexOf('?')!=-1) { var new_articleURL = emfValue.substring(0,emfValue.indexOf('?')); } 
	else { var new_articleURL = emfValue; }

	mep1 = "&Action=" + escape('E-mail a Friend') + "&ArticleURL=" + escape(new_articleURL) + "&Network=" + escape("Lifetime TV");
}
//E-mail a friend - special pages hack
if ((document.emaf) && (document.emaf.special) && (document.emaf.special.value=='yes')) {
	var emfValue = new String(document.emaf.article_url.value);
	mep1 = "&Action=" + escape('E-mail a Friend') + "&ArticleURL=" + escape(emfValue) + "&Network=" + escape("Lifetime TV");
}
//Error page 404
if (document.title.toString().indexOf('Error 404')!=-1) {
    // Bypass googlebot.lifetime -- not real 404 errors
    if (docLoc.indexOf('http://googlebot') == -1) {
    	mep1 = "&if_httpErrorType=404&if_httpErrorURL=" + escape(docLoc) + "&if_httpErrorReferrer=" + escape(document.referrer) + "&Network=" + escape("Lifetime TV");
    }
}
//Error page 500
if (document.title.toString().indexOf('Error 500')!=-1) {
	mep1 = "&if_httpErrorType=500&if_httpErrorURL=" + escape(document.location) + "&if_httpErrorReferrer=" + escape(document.referrer) + "&Network=" + escape("Lifetime TV");
}
//Boards
if (location.toString().indexOf('boards.lifetimetv.com')!=-1) {
	mep1 = "&Category=boards" + "&Network=" + escape("Lifetime TV");
}

//Newsletter Boxes
if (typeof vars != 'undefined') {
	if (!document.sweepsform) {
			//if it's finished, capture the url and send to insight
			if ( (vars['message']=="requestnewsletter") || (vars['message']=="registernewsletter") ) {
				mep1 += "&if_xtransStatus=end&if_xtransName="+listSite;
				mep1 += "&if_xtransCategory="+listSite;
				mep1 += "&if_xtransItem=http://"+location.hostname+location.pathname;
				mep1 += "&if_xtransQuantity=1&if_xtransValue=1";
				mep1 += "&if_xtransAction=checkout";
			}
			//this is means entry is available to user, set status to "start"
			else {
                // 11/20/06
				if (document.newsletterbox && document.newsletterbox.list_site) {
					mep1 += "&if_xtransStatus=start&if_xtransName="+document.newsletterbox.list_site.value;
				}
			}
	}
}

//Flash - km 05-2005
if (typeof flash != 'undefined') {
	if (flash.installed) {
		mep1 += "&if_nt_Flash=" + escape(flash.version);
	}
}

//sweeps transactions
if (document.sweepsform) { 
	//if it's finished, capture the url and send to insight
	if (location.toString().indexOf('.pl')!=-1) {
		mep1 += "&if_xtransStatus=end&if_xtransName=sweepsentry";
		mep1 += "&if_xtransCategory=sweepsentry";
		mep1 += "&if_xtransItem=http://"+OAS_sitepage_hard;
		mep1 += "&if_xtransQuantity=1&if_xtransValue=1";
		mep1 += "&if_xtransAction=checkout";
	}
	//this is means entry is available to user, set status to "start"
	else {
		mep1 += "&if_xtransStatus=start&if_xtransName=sweepsentry";
	}
}

//Games
if ((location.toString().indexOf('/games/')!=-1) || (location.toString().indexOf('/trivia/')!=-1)) {
	google_ad_client = "pub-9082181525007573"; google_ad_width = 728; google_ad_height = 90; google_ad_format = "728x90_as"; google_ad_type = "text_image";
	google_ad_channel = "3425241626";
	google_color_border = "FFFFFF";
	google_color_bg = "F6F6F6";
	google_color_link = "6795A8";
	google_color_text = "000000";
	google_color_url = "6795A8";
	document.write("<SCRIPT TYPE='text/javascript' src='http://pagead2.googlesyndication.com/pagead/show_ads.js'></SCR" + "IPT>");
}


//Member Tracking
//startMemberTracking();
//Member Tracking
var tc = new Class_MemberTrackingCookie();
var mi = new Class_MemberExtendedInfoCookie();

/* Removed no longer used
//Only track live pages
document.write(if_tag);
if (document.referrer.indexOf("msn") != -1) {

document.write('<IMG SRC="http://lifetimeCollect.insightfirst.com/data?Affiliate=msn&tax0_SiteID=1&if_pv=tax_only" WIDTH="1" HEIGHT="1" BORDER="0">');

}
*/

//if (location.toString().indexOf('/astro/daily/')!=-1) { OAS_AD('x32'); }

//alert(mep1);

//WEBSIDE STORY INCLUDES

if (!remoteDomain) { var remoteDomain = '';}

if (typeof(hbx_bypass) == "undefined" ){
	//  Removed 3/18/2009
	// document.write("<SCRIPT TYPE='text/javascript' src='" + remoteDomain + "/js/common/hbx_vars.js'></SCR" + "IPT>");
	// document.write("<SCRIPT TYPE='text/javascript' src='" + remoteDomain + "/js/common/hbx.js'></SCR" + "IPT>");
}
// Identify the server that this script is running on
var loc = new String(location);
var onDevorQaorStage = loc.contains('http://dev') || loc.contains('http://qa') || loc.contains('http://stage');

// OMNITURE INCLUDES
if (typeof(omnit_bypass) == "undefined" ){
	// Must define 's_account' before loading omniture.js
	if (onDevorQaorStage) {
  		var s_account="lifetimedev,lifetimeglobal-dev"; // (account is populated from server settings) 
	} else {
  		var s_account="lifetimeprod,lifetimeglobal"; // 
	}
	document.write("<SCRIPT TYPE='text/javascript' src='" + remoteDomain + "/js/common/omniture.js'></SCR" + "IPT>");
	document.write("<SCRIPT TYPE='text/javascript' src='" + remoteDomain + "/js/common/omniture_custom.js'></SCR" + "IPT>");
}

// Google Analytics  7/3/2008
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));

// Call google analytics _custom.js  for Google analytics
document.write("<SCRIPT TYPE='text/javascript' src='" + remoteDomain + "/js/common/googlean_custom.js'></SCR" + "IPT>");

if (!onLRW){
	drawRemoteFooter();
}
drawEnd();



