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/') 
);

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";
}

//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");
}
//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) {
	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 {
				if (document.newsletterbox) {
					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";
	}
}

//Member Tracking
startMemberTracking();

//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);



