/************ global variables *************/var ie = ((navigator.appName=="Microsoft Internet Explorer") && ((parseInt(navigator.appVersion)) >= 4));var ns6 = (navigator.userAgent.toLowerCase().indexOf('gecko') != -1);var ns4 = ((navigator.appName=="Netscape") && ((parseInt(navigator.appVersion)) >= 4) && ((parseInt(navigator.appVersion)) < 5));var mac = false;mac = (navigator.userAgent.indexOf("Mac") != -1);onHome = false;oversomething = false;somethingson = false;// netscape 4 does its onMouseOuts differently for divs. ns4mouseouts is the extra script to do it:ns4mouseouts = '\r<!-- begin onmouseouts for netscape 4 -->\r<script language="javascript" type="text/javascript">\r<!--\r';masterHTML = '';masterStyle = '<style type="text/css">\r';current = new Array('','','','','');document.onmouseover=checkover;document.onclick=checkover;/************ constructor and sitemap *************/function Item(menuNum, itemNum, itemName, url, children) {	this.menuNum = menuNum;	this.num = itemNum;	this.name = itemName;	this.url = url;	this.children = children;}sitemap = new Array(	new Item(0,0,'Contact Us','contact.html',null),	new Item(1,0,'Products','http://www.mediacomcc.com/products_index.html',		new Array('',			new Item(1,1,'High-Speed Internet','http://www.mediacomcc.com/products_internet.html',null),			new Item(1,2,'Family Cable','http://www.mediacomcc.com/products_familycable.html',null),			new Item(1,3,'Premium Services','http://www.mediacomcc.com/products_premiumsvcs.html',null),			new Item(1,4,'Digital Cable','http://www.mediacomcc.com/products_digitalcable.html',null),			new Item(1,5,'Pay-Per-View','http://www.mediacomcc.com/products_ppv.html',null),			new Item(1,6,'Video-On-Demand','http://www.mediacomcc.com/products_video.html',null)		)	),	new Item(2,0,'Customer Service','http://www.mediacomcc.com/cstsvc_pledge.html',		new Array('',			new Item(2,1,'Service Pledge','http://www.mediacomcc.com/cstsvc_pledge.html',null),			new Item(2,2,'My Account','https://mdcom.convergentcare.com/mdcom/validateSelfCareCustomer.do?action=initialize',null),			new Item(2,3,'Help Center','http://www.mediacomcc.com/cstsvc_help.html',null),			new Item(2,4,'Parental Control','http://www.mediacomcc.com/pdf/parentalcontrols.pdf',null),			new Item(2,5,'Billing Questions','http://www.mediacomcc.com/cstsvc_billing.html',null),			new Item(2,6,'User Guide Library','http://www.mediacomcc.com/cstsvc_library.html',null),			new Item(2,7,'FAQ','cstsvc_faq.html',null)		)	),	new Item(3,0,'Corporate Info','http://www.mediacomcc.com/corporate_aboutus.html',		new Array('',			new Item(3,1,'About Us','http://www.mediacomcc.com/corporate_aboutus.html',null),			new Item(3,2,'Community','http://www.mediacomcc.com/corporate_community.html',null),			new Item(3,3,'Press Room','http://www.mediacomcc.com/corporate_pressroom.php',null),			new Item(3,4,'Investor Relations','javascript:investorRelations()',null),			new Item(3,5,'Career Center','http://www.mediacomcc.com/corporate_career.php',null),			new Item(3,6,'Local Ad Sales','http://www.onmediaadsales.com',null),			new Item(3,7,'Code of Ethics','http://www.mediacomcc.com/codeofethics.html',null)		)	),	new Item(4,0,'Home','index.html',null));/************ building functions *************/function buildTopNav() {	if (currentSection != -1)		current[currentSection] = '_on';	masterTop = '';	masterTop += '<a href="' + sitemap[0].url + '" onmouseover="select(0)" onmouseout="deselect()" target="_top">';	masterTop += '<img src="images/nav0' + current[0] + '.gif" alt="' + sitemap[0].name + '" name="n0" width="85" height="32" border="0" id="n0" /></a>';	masterTop += '<a href="' + sitemap[1].url + '" onmouseover="select(1)" target="_top">';	masterTop += '<img src="images/nav1' + current[1] + '.gif" alt="' + sitemap[1].name + '" name="n1" width="71" height="32" border="0" id="n1" /></a>';	masterTop += '<a href="' + sitemap[2].url + '" onmouseover="select(2)" target="_top">';	masterTop += '<img src="images/nav2' + current[2] + '.gif" alt="' + sitemap[2].name + '" name="n2" width="113" height="32" border="0" id="n2" /></a>';	masterTop += '<a href="' + sitemap[3].url + '" onmouseover="select(3)" target="_top">';	masterTop += '<img src="images/nav3' + current[3] + '.gif" alt="' + sitemap[3].name + '" name="n3" width="106" height="32" border="0" id="n3" /></a>';	if (!onHome) {		masterTop += '<a href="' + sitemap[4].url + '" onmouseover="select(4)" onmouseout="deselect()" target="_top">';		masterTop += '<img src="images/nav4' + current[4] + '.gif" alt="' + sitemap[4].name + '" name="n4" width="51" height="29" border="0" id="n4" /></a>';	}	document.write(masterTop);	navOn = new Array();	navOff = new Array();		for (var i=0; i<=((onHome) ? 4 : 4); i++) {		navOff[i] = new Image();		navOff[i].src = "images/nav" + i + ".gif";		navOn[i] = new Image();		navOn[i].src = "images/nav" + i + "_on.gif";	}}function buildMenus() {	currentSection = -1;		for (var i=0; i<((onHome) ? 4 : 4); i++)		if (sitemap[i].children)			buildMenu(i);}function buildMenu(section) {	topButtonSizes = new Array(85, 71, 113, 106);	// array of the widths of the menu graphics across the top	var menuoffset = 145;	var i;	for (i=0; i<section; i++)		menuoffset += topButtonSizes[i];	if (onHome)		menuoffset += 107;	masterStyle += '#menu' + section + ' { position:absolute; width:110; height:10; z-index:1' + section + ';';	masterStyle += ' left: ' + menuoffset + 'px; top: 52px; visibility: hidden; }\r';	html = '';		html += '<!-- begin menu ' + section + ' -->\r';		html += '<div id="menu' + section + '" onMouseOut="hideMenu(this,' + section + ',event.relatedTarget)">\r';	html += '<table width="110" border="0" cellspacing="1" cellpadding="0"><tr><td bgcolor="#686868">\r';	html += '<table width="100%" border="0" cellspacing="1" cellpadding="0">';	masterHTML += html;		for (i=1; i<sitemap[section].children.length; i++)		buildItem( sitemap[section].children[i] );	masterHTML += '</table></td></tr></table>\r</div>\r<!-- end menu ' + section + ' -->';	ns4mouseouts += 'document.menu' + section + '.onmouseout=function(evt) { hideMenu(0,' + section + ',0); };\r';}//didIt = false;function buildItem(itm) {	html = '';	html += '<tr id="item' + itm.menuNum + itm.num + '" onClick="window.location=\'' + itm.url + '\'">\r\t';	html += '<td class="topnav" onMouseOver="this.className=\'topnavon\'" onMouseOut="this.className=\'topnav\'">';	if (ns4) {		html += '<ilayer width="108" name="item' + itm.menuNum + itm.num + '">';		html += '<layer width="108" height="15" onMouseOver="selectItem(' + itm.menuNum + ',' + itm.num + ')"';		html += ' onMouseOut="deselectItem(' + itm.menuNum + ',' + itm.num + ')">';	}	html += '&nbsp;<a href="' + itm.url + '" target="_top">' + itm.name + '&nbsp;</a>';	if (ns4)		html += '</layer></ilayer>';			html += '</td>\r</tr>';/*	if (!didIt) {		alert(html);		didIt = true;	}	*/	masterHTML += html;}function outputHTML() {	document.writeln('<!-- begin dynamically-generated code -->\r');	document.writeln(masterHTML);	document.writeln('<!-- end dynamically-generated code -->\r');	if (ns4) {		document.writeln('<script src="js/ns4.js" type="text/javascript" language="javascript"></script>');		document.writeln(ns4mouseouts);		document.writeln('// -->\r</script>');	}}function outputStyles() {	document.writeln(masterStyle);	document.writeln('</style>');}/************ action functions *************/function checkover() {	if (!oversomething && somethingson)		clearAll();}function clearAll() {	oversomething = false;	somethingson = false;	for (i=0; i<((onHome) ? 4 : 4); i++) {		if (i != currentSection)			document["n" + i].src = navOff[i].src;		if (i > 0 && i < 4)			showHideLayers( ("menu" + i),'','hide');	}}// selects a menu item (mostly used for NS4)function selectItem(menuNum, itemNum) {		oversomething = true;	somethingson = true;	if (ns4)		document.layers["menu" + menuNum].layers["item" + menuNum + itemNum].bgColor = "#FFFFFF";				// select current menu item}// deselects a menu item (NS4)function deselectItem(menuNum, itemNum) {	if (ns4)		document.layers["menu" + menuNum].layers["item" + menuNum + itemNum].bgColor = "#D9D9D9";			// deselect current menu item}function select(section) {	oversomething = true;	somethingson = true;	for (i=0; i<((onHome) ? 4 : 4); i++)		if (i != currentSection)			document["n" + i].src = navOff[i].src;	for (i=1; i<=3; i++)		showHideLayers( ("menu" + i),'','hide');	document["n" + section].src = navOn[section].src;		if (sitemap[section].children)		showHideLayers( ("menu" + section),'','show');}function deselect() {	oversomething = false;}function hideMenu(el, menuNum, target) {	if ((ie && !el.contains(event.toElement)) || (ns6 && !ns6Contains(el, target)) || ns4) {		oversomething = false;		somethingson = true;		if (ns4)			checkover();	} }/*************************** general menu code****************************/// netscape 6 version of IE's element.contains() functionfunction ns6Contains(container, containee) {	var isParent = false;	do {		if ((isParent = container == containee))			break;		containee = containee.parentNode;	}	while (containee != null);	return isParent;}// code for DHTML menus:function finditem(n, d) {	var p,i,x;	if (!d)		 d=document;	if ((p=n.indexOf("?"))>0&&parent.frames.length) {    	d=parent.frames[n.substring(p+1)].document;    	n=n.substring(0,p);    }	if (!(x=d[n])&&d.all)		x=d.all[n];	for (i=0;!x&&i<d.forms.length;i++)		x=d.forms[i][n];	for (i=0;!x && d.layers && i<d.layers.length;i++)		x=finditem(n,d.layers[i].document);	if (!x && document.getElementById)		x=document.getElementById(n);	return x;}function showHideLayers() {	var i, p, v, item, args = showHideLayers.arguments;	for (i=0; i<(args.length-2); i+=3)		if ((item=finditem(args[i]))!=null) {			v=args[i+2];			if (item.style) {				item=item.style;				v = (v=='show') ? 'visible' : (v='hide') ? 'hidden' : v;			}			item.visibility=v;		}}/************* other site functions ********/function cabletour() { 	tourwindow = window.open('swf/digital_cable_tour.html', 'digitalcable','toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=690,height=425');	if (window.focus)		tourwindow.focus();}function internettour() { 	tourwindow = window.open('swf/online_tour.html', 'internet','toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=690,height=425');	if (window.focus)		tourwindow.focus();}function ppv(movie) { 	url = "ppv/" + movie + ".html";	tourwindow = window.open(url, 'PPVdetail','toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=515,height=530');	if (window.focus)		tourwindow.focus();}function disclaimer(page) { 	url = 'disclaimer' + page + '.html';	disclaimerwindow = window.open(url, 'LegalDisclaimers','toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=415,height=500');	if (window.focus)		disclaimerwindow.focus();}function investorRelations() {	investorRelationsWindow = window.open('investor_disclaimer.html','InvestorRelations','toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=415,height=500');	if (window.focus)		investorRelationsWindow.focus();}function MM_openBrWindow(theURL,winName,features) { //v2.0  window.open(theURL,winName,features);}
