
/* Channel3000.com scripts */
// Begin national js scripts
/**
 * Copyright 2006, Internet Broadcasting.
 * All Rights Reserved.
 *
 * Namespace management. Usage is: using("com.foo.bar") = { ... }
 *
 * Author:  $Author: ddjohnson $
 * Date:    $Date: 2006/07/25 19:47:42 $
 * Version: $Name:  $
 * ID:      $Id: base.js,v 1.2 2006/07/25 19:47:42 ddjohnson Exp $
 */

var ibsys = {
};

function using(namespace)
{
	var parts = namespace.split(/\./);
	var context = window;
	while(parts.length != 0)
	{
		var obj = parts.shift();
		if(!(obj in context))
			context[obj] = {};
		context = context[obj];
	}
	return context;
}


var siteinfo = {lang:"en",timezone:"CST",
distribution: 'core',

"id":"936485",
"advertisingid":"c3k",
"trusteid":"7305",
"tld":"com",
"matchcomid":"505274",
"infospaceid":"ibsys.ch3000",
"ultraseekregion":"fmidwest",
"timezone":"CDT",
"affiliate":"cbs",
"state":"wi",
"owner":"morgan",
"region":"midwest",
"is_ia":"yes",
"cssrepository":"svn",
"emailsignup":{
"v":"2",
"severeCOID":"1021109",
"coreg":{
"display":"false",
"partner":{
"active":"true",
"name":"Opt-Intelligence",
"oi_pid":"10470987"}}},
"sitekey":{
"lc":"c3k",
"uc":"C3K"},
"sitename":{
"lc":"channel3000",
"mx":"Channel3000",
"uc":"CHANNEL3000.COM",
"display":"Channel3000.com",
"publication":"WISC Madison"},
"callletters":{
"lc":"wisc",
"uc":"WISC"},
"statecode":{
"uc":"WI",
"lc":"wi"},
"statename":{
"uc":"WISCONSIN",
"lc":"wisconsin",
"mx":"Wisconsin"},
"city":{
"uc":"MADISON",
"lc":"madison",
"mx":"Madison"},
"surveyemail":"c3knews@channel3000.com",
"slideshow":{
"version":"2"},
"storysettings":{
"tools":{
"display":"true",
"fbLike":""},
"discussion":{
"status":"live",
"type":"facebook",
"disclaimer":"true",
"toggle":"true",
"app_id":"138069019570371"}},
"header":{
"version":"2",
"status":"live",
"DataCoId":"19463267",
"weather":{
"display":"true",
"weatherpage":"myweather"}},
"contentrights":{
"cnn":"yes",
"nbcoo":"no",
"group":"red",
"blue":"yes"},
"adsplit":{
"local":"1",
"national":"1"},
"ibs_ad_config":{
"amp":{
"allow":"yes",
"overridezone":"no"},
"format":"jsPageModel",
"video_split":"yes",
"video_zone_override":""},
"feedroom_links":{
"broadband":"",
"narrowband":""},
"search":{
"ultraseekregion":"indy",
"engineType":"autonomy",
"yellowpagessearch":{
"display":"false",
"YP_action":"http://clk.atdmt.com/AST/go/ntrgiypc0220000132ast/direct/01/"},
"google":{
"display":"true",
"local":"false",
"web":"true",
"png":"true"}},
"source_names":{
"source":{
"poolid":"1782",
"name":"CNN",
"display":"true"},
"source":{
"poolid":"1808",
"name":"ET",
"display":"true"}},
"widget":{
"local":{
"name":"localNews",
"coid":"223006",
"label":"Local News"},
"sports":{
"name":"sportsNews",
"coid":"223094",
"label":"Sports News"},
"weird":{
"name":"weirdNews",
"coid":"4068067",
"label":"Weird News"},
"other":{
"name":"mostPopular",
"coid":"4736007",
"label":"Most Popular"}},
"facebook":{
"connectKey":"bdd39effb341a3a95c7aaf0363a927b8"},
"thirdparty_info":{
"allhea":{
"clicktracker":"http://ad.doubleclick.net/clk;220388505;42510811;u?",
"daprwidget":"http://ad.doubleclick.net/clk;222260391;42510811;o?"},
"aolaut":{
"clicktracker":"http://ad.doubleclick.net/clk;220392457;42510811;v?",
"tabtracker":"http://ad.doubleclick.net/clk;220425198;42510811;u?",
"daprwidget":"http://ad.doubleclick.net/clk;220422676;42510811;s?",
"slideshow":"http://ad.doubleclick.net/clk;220427159;42510811;t?",
"insidearticles":"http://ad.doubleclick.net/clk;220642725;42510811;r?",
"editauto":"http://ad.doubleclick.net/clk;220603066;42510811;m?",
"editorial":"http://ad.doubleclick.net/clk;220449947;42510811;c?",
"search":"http://ad.doubleclick.net/clk;220416793;42510811;v?",
"forum":"http://ad.doubleclick.net/clk;220605998;42510811;c?",
"misc":"http://ad.doubleclick.net/clk;220428758;42510811;z?",
"breastcancer":"http://ad.doubleclick.net/clk;224725825;42510811;y?",
"holidays":"http://ad.doubleclick.net/clk;224725742;42510811;w?",
"halloween":"http://ad.doubleclick.net/clk;224726005;42510811;p?",
"atthemovies":"http://ad.doubleclick.net/clk;228112692;42510811;u?",
"backtoschool":"http://ad.doubleclick.net/clk;228113361;42510811;o?",
"cashforappliances":"http://ad.doubleclick.net/clk;228113732;42510811;q?",
"collegetournament":"http://ad.doubleclick.net/clk;228114215;42510811;n?",
"mylife":"http://ad.doubleclick.net/clk;228114505;42510811;p?",
"newyearnewyou":"http://ad.doubleclick.net/clk;228114952;42510811;v?",
"localsummertravel":"http://ad.doubleclick.net/clk;228115216;42510811;p?",
"easter":"http://ad.doubleclick.net/clk;228269965;42510811;k?",
"superbowl":"http://ad.doubleclick.net/clk;228270363;42510811;u?",
"valentines":"http://ad.doubleclick.net/clk;228272067;42510811;x?",
"fathersday":"http://ad.doubleclick.net/clk;228272886;42510811;g?",
"taxes":"http://ad.doubleclick.net/clk;228273074;42510811;w?",
"mothersday":"http://ad.doubleclick.net/clk;228273299;42510811;f?",
"welcometosummer":"http://ad.doubleclick.net/clk;228274602;42510811;u?"},
"ara":{
"clicktracker":"http://ad.doubleclick.net/clk;220379039;42510811;w?",
"editorial":"http://ad.doubleclick.net/clk;220379039;42510811;w?"},
"bankmw":{
"clicktracker":"http://ad.doubleclick.net/clk;220451012;42510811;e?",
"daprwidget":"http://ad.doubleclick.net/clk;220452375;42510811;r?"},
"bigfish":{
"daprwidget":"http://ad.doubleclick.net/clk;229274257;42510811;b?"},
"brate":{
"clicktracker":"http://ad.doubleclick.net/clk;220499775;42510811;g?",
"feedstracker":"http://ad.doubleclick.net/clk;220501363;42510811;j?",
"im_dapwidget":"http://ad.doubleclick.net/clk;212240130;8704162;m?",
"im_clicktracker":"http://ad.doubleclick.net/clk;212240148;8704162;v?",
"ratestracker":"http://ad.doubleclick.net/clk;220492230;42510811;l?",
"tabtracker":"http://ad.doubleclick.net/clk;220500748;42510811;p?",
"editorial":"http://ad.doubleclick.net/clk;220499775;42510811;g?"},
"care":{
"clicktracker":"http://ad.doubleclick.net/clk;220482670;42510811;s?",
"tabtracker":"http://ad.doubleclick.net/clk;220498939;42510811;h?",
"daprwidget":"http://ad.doubleclick.net/clk;220490565;42510811;u?",
"misc":"http://ad.doubleclick.net/clk;220761056;42510811;q?",
"legal":"http://ad.doubleclick.net/clk;222672265;42510811;v?",
"breastcancer":"http://ad.doubleclick.net/clk;224725045;42510811;s?",
"holidays":"http://ad.doubleclick.net/clk;224725046;42510811;t?",
"halloween":"http://ad.doubleclick.net/clk;224725048;42510811;v?",
"atthemovies":"http://ad.doubleclick.net/clk;228111100;42510811;d?",
"collegetournament":"http://ad.doubleclick.net/clk;228111643;42510811;p?",
"hearthealth":"http://ad.doubleclick.net/clk;228320208;42510811;o?",
"mylife":"http://ad.doubleclick.net/clk;228111932;42510811;q?"},
"comScore":{
"enable":"1"},
"yodle":{
"clicktracker":"http://ad.doubleclick.net/clk;222643066;42510811;s?",
"rotatingwidget":"http://ad.doubleclick.net/clk;222675282;42510811;x?"},
"eharm":{
"cid":"25608",
"clicktracker":"http://ad.doubleclick.net/clk;220506285;42510811;r?",
"tabtracker":"http://ad.doubleclick.net/clk;220601798;42510811;w?",
"rotatingwidget":"http://ad.doubleclick.net/clk;220509693;42510811;x?",
"misc":"http://ad.doubleclick.net/clk;220670494;42510811;v?",
"fixedwidgets":"http://ad.doubleclick.net/clk;220602626;42510811;n?"},
"eharmony":{
"cid":"25608"},
"elrnrs":{
"clicktracker_csp":"http://ad.doubleclick.net/clk;220379244;42510811;u?",
"clicktracker_osfa":"http://ad.doubleclick.net/clk;220382864;42510811;w?",
"clicktracker_nyr":"http://ad.doubleclick.net/clk;221542334;42510811;n?",
"clicktracker_pwm":"http://ad.doubleclick.net/clk;224285964;42510811;d?",
"clicktracker_fixedwidgets":"http://ad.doubleclick.net/clk;224375066;42510811;w?",
"clicktracker":"http://ad.doubleclick.net/clk;225899780;42510811;l?"},
"exprn":{
"tabtracker":"http://ad.doubleclick.net/clk;220411979;42510811;w?",
"clicktracker":"http://ad.doubleclick.net/clk;220387594;42510811;b?",
"misc":"http://ad.doubleclick.net/clk;220396355;42510811;w?",
"rotatingwidget":"http://ad.doubleclick.net/clk;220396087;42510811;y?"},
"experion":{
"id":"6389"},
"facebook":"",
"fdoor":{
"clicktracker":"http://ad.doubleclick.net/clk;220383335;42510811;q?",
"tabtracker":"http://ad.doubleclick.net/clk;220396662;42510811;x?",
"modules":"http://ad.doubleclick.net/clk;220394957;42510811;c?",
"daprwidget":"http://ad.doubleclick.net/clk;220394453;42510811;t?",
"slideshow":"http://ad.doubleclick.net/clk;220398197;42510811;c?",
"editorial":"http://ad.doubleclick.net/clk;220388148;42510811;x?",
"misc":"http://ad.doubleclick.net/clk;220387159;42510811;y?",
"breastcancer":"http://ad.doubleclick.net/clk;224726951;42510811;z?",
"holidays":"http://ad.doubleclick.net/clk;224726950;42510811;y?",
"halloween":"http://ad.doubleclick.net/clk;224726901;42510811;u?",
"atthemovies":"http://ad.doubleclick.net/clk;228071136;42510811;r?",
"cashforappliances":"http://ad.doubleclick.net/clk;228109547;42510811;z?",
"mylife":"http://ad.doubleclick.net/clk;228109884;42510811;d?",
"newyearnewyou":"http://ad.doubleclick.net/clk;228110340;42510811;i?",
"localsummertravel":"http://ad.doubleclick.net/clk;228110672;42510811;q?",
"easter":"http://ad.doubleclick.net/clk;228261697;42510811;e?",
"superbowl":"http://ad.doubleclick.net/clk;228261904;42510811;v?",
"valentines":"http://ad.doubleclick.net/clk;228262582;42510811;y?",
"fathersday":"http://ad.doubleclick.net/clk;228262779;42510811;g?",
"taxes":"http://ad.doubleclick.net/clk;228263127;42510811;u?",
"mothersday":"http://ad.doubleclick.net/clk;228263732;42510811;w?",
"welcometosummer":"http://ad.doubleclick.net/clk;228264235;42510811;v?"},
"flustar":{
"id":"1016"},
"google":{
"verify":"0hyIegE4sFMuncl2UHUejB10SskpqokeVjfQSVTUqJ0=",
"display":"true",
"searchid":"4121045008",
"adsense":"",
"websearch":"",
"analytics":{
"code":"UA-3515011-55",
"display":"false"}},
"hybryd":{
"clicktracker":"http://ad.doubleclick.net/clk;220414679;42510811;w?"},
"lowmb":{
"clicktracker":"http://ad.doubleclick.net/clk;224864099;42510811;f?",
"clicktracker_2":"http://ad.doubleclick.net/clk;230815344;42510811;r?",
"clicktracker_sl":"http://ad.doubleclick.net/clk;224903166;42510811;u?",
"clicktracker_lapr":"http://ad.doubleclick.net/clk;224905956;42510811;d?",
"clicktracker_lapr2":"http://ad.doubleclick.net/clk;226033120;42510811;g?"},
"mains":{
"clicktracker":"http://ad.doubleclick.net/clk;219617409;42510811;a?",
"tabtracker":"http://ad.doubleclick.net/clk;220267578;42510811;a?",
"rbdwidget":"http://ad.doubleclick.net/clk;220381509;42510811;r?",
"slideshow":"http://ad.doubleclick.net/clk;220382139;42510811;r?",
"sidebar":"http://ad.doubleclick.net/clk;220382445;42510811;r?",
"editorial":"http://ad.doubleclick.net/clk;220382445;42510811;r?",
"misc":"http://ad.doubleclick.net/clk;220382769;42510811;a?",
"backtoschool":"http://ad.doubleclick.net/clk;228116325;42510811;r?"},
"medi":{
"clicktracker_1":"http://ad.doubleclick.net/clk;223509136;42510811;s?",
"clicktracker_2":"http://ad.doubleclick.net/clk;223515252;42510811;o?",
"clicktracker_3":"http://ad.doubleclick.net/clk;223515957;42510811;a?",
"clicktracker_4":"http://ad.doubleclick.net/clk;223516424;42510811;q?",
"clicktracker_5":"http://ad.doubleclick.net/clk;223516815;42510811;u?"},
"mnstr":{
"clicktracker":"http://ad.doubleclick.net/clk;220426922;42510811;q?",
"clicktracker_empl":"http://ad.doubleclick.net/clk;220427846;42510811;w?",
"lid":"655",
"tabtracker":"http://ad.doubleclick.net/clk;220428962;42510811;w?",
"tabsearchtracker":"http://ad.doubleclick.net/clk;220428962;42510811;w?",
"bdwidget":"http://ad.doubleclick.net/clk;220429323;42510811;o?",
"findajob":"http://ad.doubleclick.net/clk;220428729;42510811;x?",
"fixedwidgets":"http://ad.doubleclick.net/clk;220428539;42510811;w?",
"misc":"http://ad.doubleclick.net/clk;220428367;42510811;v?",
"slideshow":"http://ad.doubleclick.net/clk;220429129;42510811;s?",
"breastcancer":"http://ad.doubleclick.net/clk;224727987;42510811;j?",
"holidays":"http://ad.doubleclick.net/clk;224728001;42510811;n?",
"halloween":"http://ad.doubleclick.net/clk;224728002;42510811;o?",
"atthemovies":"http://ad.doubleclick.net/clk;228069157;42510811;b?",
"backtoschool":"http://ad.doubleclick.net/clk;228069565;42510811;e?",
"cashforappliances":"http://ad.doubleclick.net/clk;228069930;42510811;a?",
"collegetournament":"http://ad.doubleclick.net/clk;228070145;42510811;q?",
"mylife":"http://ad.doubleclick.net/clk;228070748;42510811;z?",
"newyearnewyou":"http://ad.doubleclick.net/clk;228070888;42510811;e?",
"easter":"http://ad.doubleclick.net/clk;228255807;42510811;a?",
"superbowl":"http://ad.doubleclick.net/clk;228258267;42510811;d?",
"valentines":"http://ad.doubleclick.net/clk;228258500;42510811;t?",
"fathersday":"http://ad.doubleclick.net/clk;228258843;42510811;d?",
"taxes":"http://ad.doubleclick.net/clk;228260643;42510811;u?",
"mothersday":"http://ad.doubleclick.net/clk;228261021;42510811;l?",
"welcometosummer":"http://ad.doubleclick.net/clk;228261265;42510811;v?"},
"monster":{
"lid":"655"},
"rhg":{
"clicktracker":"http://ad.doubleclick.net/clk;220358020;42510811;j?",
"tabtracker":"http://ad.doubleclick.net/clk;220529927;42510811;z?",
"tabtoptracker":"http://ad.doubleclick.net/clk;220529927;42510811;z?",
"bdwidget":"http://ad.doubleclick.net/clk;220537551;42510811;r?",
"cp_clicktracker":"http://ad.doubleclick.net/clk;220528861;42510811;v?",
"eh_clicktracker":"http://ad.doubleclick.net/clk;220362544;42510811;p?",
"eh_bdwidget":"http://ad.doubleclick.net/clk;220537787;42510811;c?",
"eh_tabtracker":"http://ad.doubleclick.net/clk;220536638;42510811;w?",
"wte_clicktracker":"http://ad.doubleclick.net/clk;220527400;42510811;j?",
"wte_bdwidget":"http://ad.doubleclick.net/clk;220538617;42510811;v?",
"wte_tabtracker":"http://ad.doubleclick.net/clk;220537078;42510811;v?",
"diet_jm_clicktracker":"http://ad.doubleclick.net/clk;220362872;42510811;t?",
"diet_jm_bdwidget":"http://ad.doubleclick.net/clk;220538157;42510811;u?",
"diet_jm_tabtracker":"http://ad.doubleclick.net/clk;220536846;42510811;x?",
"editorial":"http://ad.doubleclick.net/clk;220572812;42510811;q?",
"misc_eh":"http://ad.doubleclick.net/clk;220540801;42510811;j?",
"breastcancer":"http://ad.doubleclick.net/clk;224724798;42510811;g?",
"holidays":"http://ad.doubleclick.net/clk;224724874;42510811;b?",
"halloween":"http://ad.doubleclick.net/clk;224724875;42510811;c?",
"atthemovies":"http://ad.doubleclick.net/clk;228167346;42510811;a?",
"backtoschool":"http://ad.doubleclick.net/clk;228172036;42510811;s?",
"collegetournament":"http://ad.doubleclick.net/clk;228172316;42510811;t?",
"mylife":"http://ad.doubleclick.net/clk;228172807;42510811;y?",
"newyearnewyou":"http://ad.doubleclick.net/clk;228172999;42510811;k?",
"localsummertravel":"http://ad.doubleclick.net/clk;228173121;42510811;o?",
"easter":"http://ad.doubleclick.net/clk;228220271;42510811;n?",
"superbowl":"http://ad.doubleclick.net/clk;228221123;42510811;k?",
"valentines":"http://ad.doubleclick.net/clk;228221829;42510811;x?",
"fathersday":"http://ad.doubleclick.net/clk;228226742;42510811;w?",
"taxes":"http://ad.doubleclick.net/clk;228227861;42510811;z?",
"mothersday":"http://ad.doubleclick.net/clk;228228409;42510811;y?",
"welcometosummer":"http://ad.doubleclick.net/clk;228228853;42510811;b?",
"hearthealth":"http://ad.doubleclick.net/clk;228319824;42510811;a?"},
"rtrac":{
"clicktracker":"http://ad.doubleclick.net/clk;220502553;42510811;l?"},
"tripa":{
"mcode":"10744",
"subdomain":"channel3000"},
"tripadvisor":{
"id":"10744",
"subdomain":"channel3000"},
"tzoo":{
"ac":"MSN"},
"WT_info":{
"id":"dcspzacnt00000sdd1q7v5krt_8f9z"},
"tacoda":{
"id":"13694"},
"quantcast":{
"id":{
"code":"p-41jrVeSPpekVU",
"display":"true",
"label":"Morgan Murphy Stations",
"urlencodedlabel":"Morgan%20Murphy%20Stations"}},
"yahoo":{
"verify":"dbee28203a5f964d"}},
"video":{
"playerversion":"5",
"skin":"blue",
"wxicons":"hearst",
"headerlinks":"#000099",
"cpcode":"12882",
"liveflashcpcode":"51533",
"availableskins":{
"skin":{
"name":"blue",
"path":"blue"},
"skin":{
"name":"gray",
"path":"gray"}},
"flowplayer":{
"enabled":"true",
"progressTracking":"true",
"key":"3004b94d1a85cd3d80e",
"adProvider":"dart",
"stratigent":"true",
"controlbar":"tube",
"tools":{
"tool":{
"button":{
"name":"email",
"enabled":"true"}},
"tool":{
"group":"socialmedia",
"button":{
"name":"facebook",
"enabled":"true"},
"button":{
"name":"digg",
"enabled":"true"},
"button":{
"name":"twitter",
"enabled":"true"},
"button":{
"name":"buzz",
"enabled":"true"},
"button":{
"name":"reddit",
"enabled":"true"},
"button":{
"name":"delicious",
"enabled":"true"}}}}},
"linkmethods":{
"mt":{
"name":"slideshow",
"mtid":"181",
"method":"popup",
"width":"1024",
"height":"750",
"top":"0",
"left":"0",
"dynamic_url":"/slideshow[ibs_variable type=iburl att=sectionpath][ibs_variable type=iburl att=coid]/detail.html"}},
"defaultblurbdisplay":{
"method":"IM-Horizontal"}};


// GLOBAL Variables
now = new Date();
expire = new Date((now.getFullYear()+1),now.getMonth(),now.getDate());
var child = 0;
var rnd = new Date();
rnd = rnd.getTime();

// Deprecated variables
//var IBS_Sitekey = siteinfo.sitekey.lc;
var IS_IA = siteinfo.is_ia;
IBSSite = new Object();
dotPosition = document.location.host.indexOf('.')+1;
IBSSite.domain = document.location.host.substring(dotPosition);

// Set environment variables
env = new Object();
env.bVer = navigator.appVersion;
env.bName = navigator.appName;
env.platform = navigator.platform;
env.userAgent = navigator.userAgent;
env.cookies = navigator.cookieEnabled;
env.NS4 = (document.layers)? 1 : 0;
env.MacIE = ((navigator.userAgent.indexOf("IE 4")  > -1) && (navigator.userAgent.indexOf("Mac")  > -1))? 1 : 0;
env.IE4 = (document.all && !env.MacIE)? 1 : 0;
env.Gen4 = (document.all || document.layers)? 1 : 0;
if(env.bName.indexOf('Netscape') != -1) isNN = true;
else isNN = false;
if(env.bName.indexOf('Microsoft') != -1) isIE = true;
else isIE = false;

//Open window - pass URL and Attributes
function popUp(URL, ATTRIBUTES)  {
	DEF_ATTRIB = 'width=200,height=200,top=100,left=100,resizable=yes,scrollbars=1';
	if (ATTRIBUTES == null) {
		ATTRIBUTES = DEF_ATTRIB;
	}
	child = window.open(URL, "spawn", ATTRIBUTES + ",scrollbars=1");
	// child.opener = self;
}



// FIX THE STRINGS ( apostrophes)
function fixString(strText) {
	if(!strText || strText == null) return "";
	var newstr = strText.replace(/~/g, "&#39;");
	return newstr;
}

// Replace white space around tags in teaser - used in TopStory and PhotoArray
function padTags(s){
	if(!s || s == null) return "";
	var tmp = s.replace(/(<\w)/ig, " $1");
	tmp = tmp.replace(/(<\/\w>)/ig, "$1 ");
	return tmp;
}

/**
 * returns the parent widget ID of the given indexID, for use
 * with jsIndex
 */
function getWidgetID(indexId)
{
	var el = document.getElementById("index"+indexId);
	if(el == null) return null;
	var p = el.parentNode;
	while(p)
	{
		if(p.id && p.id.match(/sw[0-9]+/))
			return p.id.replace(/sw/,"");
		p = p.parentNode;
	}
	return null;
}




var XMLObj = {
	impl: function() {
		return (window.XMLHttpRequest ? new XMLHttpRequest() : 
				(window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP") : 
					new Error("No XMLHttpRequest Implementation")));
	},
	
	get: function(url, handler) {
		var req = XMLObj.impl();
		req.open("get", url, true);
		req.onreadystatechange = function() {
			/* Opera may return status 304; unchanged */
			if(req.readyState == 4) {
				handler(req.responseXML, req.responseText);
			}
		};
		req.send(null);
	},
	
	post: function(url, params, handler) {
		var req = XMLObj.impl();
		req.open("post", url, true);
		req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		req.setRequestHeader("Referer", document.location.href);
		req.onreadystatechange = function() {
			/* Opera may return status 304; unchanged */
			if(req.readyState == 4 ) {
				handler(req.responseXML, req.responseText);
			}
		};
		req.send(params);
	}
};



// Define client cookie values
cookiesList = document.cookie.split('; ');
myCookies = new Array();
for(c=0; c<cookiesList.length; c++) {
	cookieTemp = cookiesList[c].split('=');
	myCookies[cookieTemp[0]] = cookieTemp[1];
}

// Added new variable to support multiple sub domains
var docDomain = document.domain.split('.');
var dd='';
for(var i=1; i<docDomain.length; i++) {
	dd+="."+docDomain[i];
}
docDomain=dd;

// Set cookie info
function setCookie( name, value, path, expires, domain, secure ) {
	expire.setTime(now.getTime() + expires * 24 * 60 * 60 * 1000);
	curCookie =  name + "=" + escape(value) +
		((expires) ? "; expires=" + expire.toGMTString() : "") +
		((path) ? "; path=" + path : "") +
		((domain) ? "; domain=" + domain : "") +
		((secure) ? "; secure" : "");
	if ((name + "=" + escape(value)).length <= 4000) document.cookie = curCookie;
	else if (confirm("Cookie exceeds 4KB and will be cut!")) document.cookie = curCookie;
}

// Get cookie info
function getCookie(c) {
	if(typeof myCookies[c] != 'undefined') return myCookies[c];
	else return '';
}

// Remove cookie
function deleteCookie(name,path) {
	setCookie(name,"",path,-1,docDomain);
}

// In case old cookie functions are used somewhere...
WM_setCookie  = setCookie;
WM_readCookie = getCookie;
WM_killCookie = deleteCookie;



function fixPngImage(p) {
	var imgsrc;
	var trans = "http://images.ibsys.com/sh/images/spacer.gif";   
	if(typeof p.tested != undefined && !p.tested &&  typeof p.runtimeStyle != 'undefined') {
	   // retain image src
	   imgsrc = p.src;

	   // make sure the image is a PING
	   if ( /\.png$/.test( imgsrc.toLowerCase() ) ) {
	   	// If it is set it to a transparent image
		p.src = trans;
		// Set the runtime style to load the alpha image in the background
		p.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + imgsrc + "',sizingMethod='scale')";
		p.tested = true;
	   }
   }
}

// Calls 'func' on 'eventName' in 'obj'
function addEvent(obj, eventName, func) {
	if (typeof YAHOO != 'undefined') {
		window.addEvent = function(obj, eventName, func) {
			return YAHOO.util.Event.addListener(obj, eventName, func);
		}
	} else {
		this.setObj = function(obj) {
			return (typeof obj == 'string' ? document.getElementById(obj) || false : typeof obj == 'object' ? obj : false);
		}
		obj = setObj(obj);
		if (obj.addEventListener) {
			window.addEvent = function(obj, eventName, func) {
				obj = setObj(obj);
				if (obj) {
					return obj.addEventListener(eventName, func, true);
				} else {
					return false;
				}
			}
		} else if (obj.attachEvent) {
			window.addEvent = function(obj, eventName, func) {
				obj = setObj(obj);
				if (obj) {
					obj.attachEvent("on" + eventName, func);
					return true;
				} else {
					return false;
				}
			}
		} else {
			return false;
		}
	}
	return addEvent(obj, eventName, func);
}
/**
 * Copyright 2006, Internet Broadcasting Systems. All Rights Reserved.
 * Author:    $Author: bstime $
 * Date:      $Date: 2007/11/27 22:17:40 $
 * Version:   $Name:  $
 * ID:        $Id: AdObj.js,v 1.13 2007/11/27 22:17:40 bstime Exp $
*/

/**
 * Generic AdObj holds properties to ease calling pixel ads for specific uses
 *
 * Usage of class methods:
 *	<li>AdObj.create(position,sz,swId,coId,section) - create and return a new AdObj</li>
 *  <li>AdObj.refreshPosition(positions...) - refresh one or more positions</li>
 *  <li>AdObj.refreshAll() - refresh all ads</li>
 *	<li>AdObj.remove(name) - remove ad</li>
 *
 * @constructor
 * @param {String} position Corresponds to ad position, like mediawidow, banner or tile
 * @param {String} sz Size, formatted as 2x2
 * @param {String} swId Section widget id
 * @param {String} coId Content id
 * @param {String} section Section widget section
 */

function AdObj(position, sz, swId, coId, section) {
	this.position = position;
	this.sz = sz;
	this.swId = swId;
	this.coId = coId ? "+"+coId : "";
	this.section = section;
	var size = this.sz.split("x");
	this.width = size[0];
	this.height = size[1];
}

/**
 * @deprecated in favor of {@link AdObj#refresh}
 *
 * Append iframe with ad call to end of document or refresh the ad of set position
 * NOTE: DART key set to ibs.[sitekey].interactive
 * NOTE: Changed .refresh Removed the extra + between position and coid
 */
AdObj.prototype.callAd = function() {
	if (!document.getElementById(this.position)) {
		// append iframe to document
		document.getElementsByTagName("body")[0].appendChild(document.createElement("span")).innerHTML = "<iframe id="+this.position+" src='http://ad.doubleclick.net/adi/ibs."+siteinfo.sitekey.lc+".interactive/"+adZone+";kw="+this.section+"+"+this.position+this.coId+";comp="+adid+";ad=true;tile="+dcadposition+ ";pgtype=detail;sz="+this.sz+";ord="+rnd+"?' width='"+this.width+"' height='"+this.height+"' marginwidth='0' marginheight='0' frameborder='0' scrolling='no'></iframe>";
	} else {
		// refreshAd is defined in base js
		refreshAd(this.position);
	}
}

/**
 * Refresh this ad.
 */
AdObj.prototype.refresh = function(adid,tileNum)
{
	var randInt = parseInt(Math.random(1)*100000000);
                adid = (typeof adid == "undefined") ? "" : adid;
	var category = (typeof WT != 'undefined' && WT.cg_n != '' && adid == '')?WT.cg_n.toLowerCase():'interactive';
	// var obj = document.getElementById(this.position);
	// if(obj == null)
	// {
		var arr = getByClassName(document.body, "ad"+this.position);
		if(arr.length == 0)
			return;
		// obj = arr[0];
	// }
	//http://ad.doubleclick.net/adi/ibs.chi.interactive/;kw=video+news+null+banner1+9385129;ad=true;pgtype=detail;sz=728x90;adid=36780253;ord=940767630?
	var tileNum = (typeof dcadposition != 'undefined' ? dcadposition : tileNum || 1);
	var src = "http://ad.doubleclick.net/adi/ibs."+siteinfo.sitekey.lc+"."+category+"/"+adZone+";kw="+this.section+"+"+this.position+this.coId+";ad=true;tile="+tileNum+ ";pgtype=detail;sz="+this.sz+";"+adid+";ord="+randInt+"?";
	// if(/iframe/i.exec(obj.nodeName) != null)
	// {
	// 	obj.src = "";
	// 	obj.src = src;
	// }
	// else
	arr[0].innerHTML = "<iframe id="+this.position+" src='"+src+"' width='"+this.width+"' height='"+this.height+"' marginwidth='0' marginheight='0' frameborder='0' scrolling='no'></iframe>";
}

/** AdObj class members */
/**
 * collection of Ad Objects
 */
AdObj.elements = new Object();

/**
 * Create a AdObj instance and add it to the collection
 */
AdObj.create = function create(position,sz,swId,coId,section)
{
	return AdObj.elements[position] = new AdObj(position,sz,swId,coId,section);
}

/**
 * Refresh ads by position: AdObj.refreshPosition("banner1","tile1","square");
 */
AdObj.refreshPosition = function refreshPosition()
{
	for(var j=0; j < arguments.length; j++)
		if(AdObj.elements[arguments[j]])
			AdObj.elements[arguments[j]].refresh();
}

/**
 * Refresh all ads
 */
AdObj.refreshAll = function refreshAll(adid)
{
	var i=1;
	for(var p in AdObj.elements) {
		AdObj.elements[p].refresh(adid,i);
		i++;
	}
}

AdObj.adIds = new Object();

/**
 * Returns an event handler for WMP CurrentItemChange event.
 *
 * The returned handler refreshes ads if the currentMedia has a
 * "dcAdTag" parameter.
 *
 * @param <String> videoPlugID
 * @return <function>
 */
AdObj.createAdRefreshHandler = function createAdRefreshHandler(videoPlugID)
{
	return (function()
	{
		if(!document ||
		   !document.body ||
		   !document.getElementById(videoPlugID))
		{
			return;
		}
		// NOTE: may need to change this if the format of the 'adid' parameter
		// value changes.  currently it is 'adid=[0-9]+'
		var adTagParam = document.getElementById(videoPlugID).currentMedia.getItemInfo("dcAdTag");
		if(/adid=[0-9]+/.exec(adTagParam) != null && !AdObj.adIds[adTagParam])
		{
			AdObj.adIds[adTagParam] = true;
			// log("Refreshing: " + adTagParam);
			AdObj.refreshAll(adTagParam);
			window.setTimeout(
				(function()
				{
					AdObj.adIds[adTagParam] = false;
				}), 1000);
		}
		else
		{
			// log("NOT Refreshing ads; adid="+adTagParam);
		}
	});
}

/**
 * Remove an ad by name.
 * @param <String> name
 * @return true if the object was deleted.
 */
AdObj.remove = function(name)
{
	if(AdObj.elements[name])
		return delete AdObj.elements[name];
	else
		return false;
}

/**
 * TODO: put this function somewhere else
 */
function getByClassName(parent,className)
{
	var nl = parent.getElementsByTagName("*");
	var arr = [];
	for(var j=0; j < nl.length; j++)
	{
		if(nl.item(j).className && nl.item(j).className.indexOf(className) != -1)
			arr.push(nl.item(j));
	}
	return arr;
}
// 

function setDCSid(id) {
     gDcsId=id;
}

function mwpop(path,w,h) {
	var atts = 'width='+w+',height='+h+',\'scrollbars=yes,toolbar=no,status=no,location=no,menubar=no,top=50,left=50';
	popUp(path, atts);
//window.location.href=path.split('?')[0];
}

function setMediaPlayerCookie (num) {
  setCookie("mediaWindow",num,"",30,window.location.host,"");
  return "done";
}

function getMediaPlayerCookie () {
  var myCookie = new String(getCookie("mediaWindow"));
  return myCookie;
}


/* toggleData function
 * toggles all elements inside a parent element
 * 2 params 
 *   id - the parent element id
 *   cn - class name of elements you want to hide
 */
function toggleData(id,cn){
	var div = document.getElementById(id);
	var cond = div.getElementsByTagName('*');
	for(var i = 0;i<cond.length;i++){
		if(cond[i].className.indexOf(cn) != -1) {
		cond[i].style.display = (cond[i].style.display != 'none') ? 'none' : '';
		}
	}
}
/* hideData function
 * hides all elements inside a parent element
 * same params as toggleData
 * current usage - full display of current conditions weather object calls this function 
 */
function hideData(id,cn){
	var div = document.getElementById(id);
	var cond = div.getElementsByTagName('*');
	for(var i = 0;i<cond.length;i++){
		if(cond[i].className.indexOf(cn) != -1) {
			if(cond[i].style.display != 'none') cond[i].style.display = 'none';
		}
	}
}
	


/*
 * Copyright 2006, Internet Broadcasting Systems. All Rights Reserved.
 * CVS: $Id: tagCNN.js,v 1.2 2007/07/27 15:19:07 mwakefield Exp $
 * CVS Path: $Source: /u01/cvsroot/javascript/webtrends/tagCNN.js,v $
 * Phaedra Content ID: 
 * Example URL: http://preview.wesh.com/index.html
*/

getElementsByClassName = function(node, classname) {
    var a = [];
    var re = new RegExp('\\b' + classname + '\\b');
    var els = node.getElementsByTagName("*");
    for(var i=0,j=els.length; i<j; i++)
	if(re.test(els[i].className))a.push(els[i]);
    return a;
}

var cnnTaggingForWebTrends = {
	load: function() {
		var cnnButtons = getElementsByClassName(document, "source_name_CNN");
		for (var button = 0; button < cnnButtons.length; button++) {
			addEvent(cnnButtons[button].parentNode, "click", 
				function(event) {
					if(event.target){
						// Firefox uses event.target to reference object that was clicked
						cnnTaggingForWebTrends.action(event.target);
					}
					else {
						// Internet Explorer uses event.srcElement to reference object that was clicked
						cnnTaggingForWebTrends.action(event.srcElement);
					}
				}
			);
		}
	},
	action: function(clickedCNN) {
		var temp = gDcsId;
		gDcsId="dcs2dg4lq00000gw3pkr8nynl_3j5j";
		dcsMultiTrack(
			'DCSext.ib_partner',siteinfo.owner,
			'DCSext.ib_station',siteinfo.callletters.uc,
			'DCSext.ib_cnn_linkname',clickedCNN.innerHTML,
			'DCSext.ib_cnn_linkurl',clickedCNN.href,
			'DCSext.ib_pool',siteinfo.sitekey.uc
		);
		gDcsId=temp;
	}
}

addEvent(window, "load", 
	function(){
		cnnTaggingForWebTrends.load();
	} 
);



/***
* Function to launch nbc video pop-up window player added 8.22.06
***/
    function  launchNbcVideo(pathid) { 
	site='http://video.'+ siteinfo.sitename.lc  +'.'+ siteinfo.tld +'/player.html'; 
	param = '?dlid='; 
	newwindow=window.open(site+param+pathid,'sendtofriend','toolbar=no,scrollbars=no,location=no,statusbar=no,menubar=no,resizable=no,width=750,height=550');	
	if (window.focus) {
		newwindow.focus()
	}
}



/***
* Changed by Aron B-- 8.23.06
* Changed by Joe L -- 1/24/07
***/
function launchvideo(pathid) {
	if (siteinfo.video.dmps == 'true') {
		site='http://video.'+ siteinfo.sitename.lc  +'.'+ siteinfo.tld +'/player/?id=' + pathid;
		document.location = site;
	} else {
		site='http://video.'+ siteinfo.sitename.lc  +'.'+ siteinfo.tld +'/player.html';
		param = '?dlid=';
		newwindow=window.open(site+param+pathid,'sendtofriend','toolbar=no,scrollbars=no,location=no,statusbar=no,menubar=no,resizable=no,width=750,height=550');
		if (window.focus) {newwindow.focus()}
	}
}
function launchvideodir(pathid) {
	site='http://video.'+ siteinfo.sitename.lc  +'.'+ siteinfo.tld +'/player.html';
	param = '?dl=';
	newwindow=window.open(site+param+pathid,'sendtofriend','toolbar=no,scrollbars=no,location=no,statusbar=no,menubar=no,resizable=no,width=750,height=550');
	if (window.focus) {newwindow.focus()}
}


// End national_js scripts


