var monthArray = new Array();
monthArray['Jan'] = "January";
monthArray['Feb'] = "February";
monthArray['Mar'] = "March";
monthArray['Apr'] = "April";
monthArray['May'] = "May";
monthArray['Jun'] = "June";
monthArray['une'] = "June";
monthArray['Jul'] = "July";
monthArray['Aug'] = "August";
monthArray['Sep'] = "September";
monthArray['Oct'] = "October";
monthArray['Nov'] = "November";
monthArray['Dec'] = "December";

function openWindow(anchor, options)
{
	var args = '';

	if (typeof(options) == 'undefined')
	{
		var options = new Object();
	}

	if (typeof(options.name) == 'undefined')
	{
		options.name = 'win' + Math.round(Math.random()*100000);
	}

	if (typeof(options.height) != 'undefined' && typeof(options.fullscreen) == 'undefined')
	{
		args += "height=" + options.height + ",";
	}

	if (typeof(options.width) != 'undefined' && typeof(options.fullscreen) == 'undefined')
	{
		args += "width=" + options.width + ",";
	}

	if (typeof(options.fullscreen) != 'undefined')
	{
		args += "width=" + screen.availWidth + ",";
		args += "height=" + screen.availHeight + ",";
	}

	if (typeof(options.center) == 'undefined')
	{
		options.x = 0;
		options.y = 0;
		args += "screenx=" + options.x + ",";
		args += "screeny=" + options.y + ",";
		args += "left=" + options.x + ",";
		args += "top=" + options.y + ",";
	}

	if (typeof(options.center) != 'undefined' && typeof(options.fullscreen) == 'undefined')
	{
		options.y=Math.floor((screen.availHeight-(options.height || screen.height))/2) - (screen.height-screen.availHeight);
		options.x=Math.floor((screen.availWidth-(options.width || screen.width))/2)-(screen.width-screen.availWidth);
		args += "screenx=" + options.x + ",";
		args += "screeny=" + options.y + ",";
		args += "left=" + options.x + ",";
		args += "top=" + options.y + ",";
	}

	if (typeof(options.scrollbars) != 'undefined')
	{
		args += "scrollbars=1,";
	}
	if (typeof(options.menubar) != 'undefined')
	{
		args += "menubar=1,";
	}
	if (typeof(options.locationbar) != 'undefined')
	{
		args += "location=1,";
	}
	if (typeof(options.resizable) != 'undefined')
	{
		args += "resizable=1,";
	}

	// alert(args);
	var win = window.open(anchor, options.name, args);
	return false;
}


function podcastPlayer(divname, playerid, soundfile, width, height, autostart)
{
	var so = new SWFObject("/flash/podcast/audio-player/player.swf", divname, width, height, "8", "#ffffff");

	if (typeof autostart == 'undefined' ) autostart = "no";

	// alert(autostart);
	so.addParam("quality", "high");
	so.addParam("wmode", "transparent");
	so.addParam("menu", "false");
	so.addParam("movie", "/flash/podcast/audio-player/player.swf");
	// var flashVarString= "playerID=" + playerid + "&amp;soundFile=" + soundfile ;
	var flashVarString= "playerID=" + playerid + "&amp;soundFile=" + soundfile + "&amp;autostart=" + autostart;
	// alert(flashVarString);
	so.addParam("FlashVars", flashVarString);
	// so.addParam("FlashVars", "playerID=4&amp;soundFile=/collateral/podcast/casestudy/Cbeyond.mp3");
	so.write(divname);
}

function prepareDiggThis(title, url)
{
	// alert("Title is: " + $("h1:first").text());
	alert("Title is: " + title);
	alert("URL is: " + url);
}

function trackElq(value)
{
	if ( typeof elqFCS != 'undefined')
	{
		elqFCS(value);
		// alert('trackElq alert: ' + value);
	}
}

function trackElq1(value){

	if ( window.location )
	{
		newValue = window.location.protocol + "//" + window.location.host + value ;
	}
	else
	{
		newValue = "http://www.telcordia.com" + value ;
	}
	// alert(newValue);
	// alert(value);
	// $.post("/elqNow/elqRedir.htm",{ref:value});	
	//$.post("/elqNow/elqRedir.htm",{ref:newValue});	
	$.get("/elqNow/elqRedir.htm",{ref:newValue},function(data){alert("Data Loaded: " + data)});
}

function popVideo(ids,videoName,videoLink){
	var arrayIds = new Array();
	arrayIds = ids.split(',')
	for ( var i in arrayIds )
	{
		if (s.getQueryParam('sc_cid') == arrayIds[i] ){
		tb_show(videoName,videoLink);
		trackElq("test");
		}
	}

}

function getQueryStringParamValue(strQStrParam)
{
	var defaultValue=null;
	var strURL = document.location.href;
	var strQStrParamValue = '';
	if (strURL.indexOf('?') != -1)
	{
		strQStrParamValue = strURL.substr(strURL.indexOf('?') + 1);
		if (strQStrParamValue.indexOf(strQStrParam) != -1)
		{
			strQStrParamValue = strQStrParamValue.substr(strQStrParamValue.indexOf(strQStrParam));
			strQStrParamValue = strQStrParamValue.substr(strQStrParamValue.indexOf('=') + 1);
			if (strQStrParamValue.indexOf('&') != -1)
				strQStrParamValue = strQStrParamValue.substr(0,strQStrParamValue.indexOf('&'));
			return strQStrParamValue;
		}
		else
		{
			strQStrParamValue = defaultValue;
			return strQStrParamValue;
		}
	}
	else
	{
		strQStrParamValue = defaultValue;
		return strQStrParamValue;
	}
}
