/* 
Cablevision Editorials Website
Designed and Created by Lama Media Inc. (www.lamamedia.com)
Copyright (c) 2003 by Cablevision Systems Corporation.
All rights reserved.
*/


// ****************************************************************
// GLOBALS
// ****************************************************************

var v_CT_VideoLink = "";
var v_LI_VideoLink = "";
var vHLogo = new Array();
var vHLogoNum = 0;
var vHLogoMax = 13;


// ****************************************************************
// START
// ****************************************************************

function fHomeShow() {
	var tLeftSec, tRightSec;
	
	var tLastEd = fGetCookie("LastEd");
	if (tLastEd == "CT") {
		tLeftSec = "CT";
		tRightSec = "LI";
	} else { // tLastEd = "LI"
		tLeftSec = "LI";
		tRightSec = "CT";
	}

	v_CT_VideoLink = ('javascript:fPopVideo(\'' + v_CT_Video + '\');');
	if (v_CT_Video == "") v_CT_VideoLink = ('javascript:fPopNoVideo();');
	v_LI_VideoLink = ('javascript:fPopVideo(\'' + v_LI_Video + '\');');
	if (v_LI_Video == "") v_LI_VideoLink = ('javascript:fPopNoVideo();');

	fButtonPath("all/home/");
	fNewButton(0, "Join Our Mailing List", "list", 263, 72, "javascript:fPopMailingList();", 1);
	fNewButton(1, "LI Editorial Video", "video", 100, 12, v_LI_VideoLink, 1);
	fNewButton(11, "CT Editorial Video", "video", 100, 12, v_CT_VideoLink, 1);
	fButtonPath("LI/");
	fNewButton(4, "Your Turn Response Form", "LI_ytres", 100, 181, "javascript:fPopResponse();", 1);
	fNewButton(5, "Your Turn Current Edition", "LI_ytcur", 100, 124, "javascript:fCurrentYT('LI');", 1);
	fNewButton(6, "Peter Kohler", "LI_heditor", 100, 180, "LI/LI_bio", 0, 0, 1);
	fButtonPath("CT/");
	fNewButton(14, "Your Turn Response Form", "CT_ytres", 100, 181, "javascript:fPopResponse();", 1);
	fNewButton(15, "Your Turn Current Edition", "CT_ytcur", 100, 124, "javascript:fCurrentYT('CT');", 1);
	fNewButton(16, "Dianne Wildman", "CT_heditor", 100, 180, "CT/CT_bio", 0, 0, 1);
	fButtonPath("all/logos/");
	fNewButton(20, "Cablevision", "cv", 117, 76, "http://www.cablevision.com/", 1, "logoWin", 1);
	fNewButton(21, "Optimum Online", "opton", 117, 76, "http://www.optimumonline.com/", 1, "logoWin", 1);
	fNewButton(22, "Power to Learn", "ptl", 117, 76, "http://www.powertolearn.com", 1, "logoWin", 1);
	fNewButton(23, "News 12", "news12", 117, 76, "http://www.news12.com", 1, "logoWin", 1);
	
	vTopLinks[0] = vTL_About;
	vTopLinks[1] = vTL_Reply;
	vTopLinks[2] = vTL_Contact;
	
	for (t = 1; t <= vHLogoMax; t++) {
		vHLogo[t] = new Image(); vHLogo[t].src = ('media/all/hlogo/hlogo' + t + '.gif');
	}
		
	document.open();
	fBrowserTable();
// TOP	
	document.write('<tr><td>');
	document.write('<table width="100%" cellpadding="0" cellspacing="0" border="0"><tr>');
	document.write('<td width="376"><img name="hLogo" src="media/all/hlogo/hlogo0.gif" width="330" height="94" alt="Cablevision Editorials" border="0"><img src="media/all/home/hlogor.gif" width="46" height="94" alt="" border="0"></td>');
	fShowTopRight("home");
	document.write('</tr></table>');
	document.write('</td></tr>');
// CEN	
	document.write('<tr><td><div class="hcen">');
	document.write('<table width="100%" cellpadding="0" cellspacing="0" border="0"><tr>');
	document.write('<td><img src="media/all/home/hcen_left.gif" width="6" height="417" alt="" border="0"></td>');
	fHomeSection(tLeftSec);
	document.write('<td><img src="media/all/home/hcen_cen.gif" width="6" height="417" alt="" border="0"></td>');
	fHomeSection(tRightSec);
	document.write('<td><img src="media/all/home/hcen_right.gif" width="6" height="417" alt="" border="0"></td>');
	document.write('</tr></table></div></td></tr>');
// LOGOS	
	document.write('<tr><td class="hbtm-top">');
	document.write('<img src="media/all/home/hbtm_top.gif" width="762" height="10" alt="" border="0">');
	document.write('<table class="hbtm-logos" width="100%" cellpadding="0" cellspacing="0" border="0"><tr>');
	document.write('<td class="hbtm-logoleft" align="left">');
	fShowButton(20);
	document.write('</td><td align="left">');
	fShowButton(21);
	document.write('</td><td align="center" width="100%">');
	fShowButton(0);
	document.write('</td><td align="right">');
	fShowButton(22);
	document.write('</td><td class="hbtm-logoright" align="right">');
	fShowButton(23);
	document.write('</td></tr></table></td></tr>');
// BTM
	document.write('<tr><td>');
	document.write('<table width="100%" cellpadding="0" cellspacing="0" border="0"><tr>');
	document.write('<td class="hbtm-left" width="376"><a href="http://www.lamamedia.com" target="linkWin">Designed &amp; Created by LaMa Media Inc.</a></td>');
	document.write('<td class="hbtm-cen">&nbsp;</td>');
	document.write('<td class="hbtm-right" width="385"><a href="http://www.cablevision.com/index.jhtml?pageType=privacy" target="linkWin">Privacy Policy</a></td>');
	document.write('</tr></table></td></tr>');
	document.write('</table>');
	document.LIArch.reset();
	document.CTArch.reset();
	document.close();
	setTimeout('fHomeLogo()', 1500);
}

function fHomeSection(rWhich) {
	var t, tName, tAbbr, tButtAdd, tVideoLink;
	var tPQuestion, tPStr, tPNum, tPVotes, tPVoted;
	var tPAnswers = new Array();

	if (rWhich == "LI") {
		tName = "Long Island";
		tAbbr = "LI";
		tButtAdd = 0;
	} else { // rWhich == "CT"
		tName = "Connecticut";
		tAbbr = "CT";
		tButtAdd = 10;
	}

	document.write('<td width="50%">');
	document.write('<table class="');
	if (vBrowser == "Netscape") document.write('nn-');
	document.write('hcen-table" width="100%" cellpadding="0" cellspacing="0" border="0"><tr>');
	document.write('<td><table width="100%" cellpadding="0" cellspacing="0" border="0"><tr>');
	document.write('<td class="hcen-which" colspan="2">');
	document.write('<img src="media/' + rWhich + '/' + rWhich + '.gif" width="240" height="20" alt="' + tName + '" border="0">');
	document.write('</td></tr><tr valign="top">');
	document.write('<td width="100"><div class="hcen-c1">');
	tVideoLink = eval('v_' + rWhich + '_VideoLink');
	document.write('<a href="' + tVideoLink + '">');
	document.write('<img onMouseOver="fButton(\'' + (1 + tButtAdd) + '|1\'); return true" onMouseOut="fButton(\'' + (1 + tButtAdd) + '|0\'); return true" src="media/video/' + rWhich + '_video.jpg" width="100" height="75" alt="' + tAbbr + ' Editorial Video" border="0"></a><br>');
	fShowButton(1 + tButtAdd);
	document.write('</div><div class="hcen-c1">');
	fShowButton(4 + tButtAdd);
	document.write('</div><div class="hcen-c1">');
	fShowButton(5 + tButtAdd);
	document.write('</div></td>');
	document.write('<td><div class="hcur-edlabel">CURRENT EDITORIAL</div>');
	document.write('<div class="hcur-ed">');
	document.write('<div class="hcur-title"><a href="javascript:fCurrent(\'' + rWhich + '\');">');
	document.write(eval("v_" + rWhich + "_Title") + '</a></div>');
	document.write('<div class="hcur-tease">');
	document.write(eval("v_" + rWhich + "_Tease"));
	document.write('</div>');
	if (eval("v_" + rWhich + "_More")) {
		document.write('<div class="hcur-more"><a href="javascript:fCurrent(\'' + rWhich + '\');">READ&nbsp;MORE&nbsp;&gt;<a><br>&nbsp;</div>');
	}
	document.write('</div>');
	if (eval("v_" + rWhich + "_Feature")) {
		document.write('<div class="feature"><table width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td>');
		document.write('<a href="content/' + rWhich + '/' + rWhich + '_feature.html">');
		document.write(eval("v_" + rWhich + "_FeatureText"));
		document.write('</a></td></tr></table></div>');
	}
	fMakeArch(rWhich, "home");
	document.write('</td></tr></table></td><td>');
	document.write('<div class="hcen-c3">');
	fShowButton(6 + tButtAdd);
	document.write('</div><div class="poll">');
	document.write('<img src="media/all/home/poll.gif" width="100" height="20" alt="' + tAbbr + ' Current Poll" border="0">');
	tPQuestion = eval("v_" + rWhich + "_PollQ");
	tPStr = eval("v_" + rWhich + "_PollA");
	tPNum = (fNumItems(tPStr, vDelim) - 1);
	for (t = 0; t < tPNum; t++) {
		tPAnswers[t] = fGetItem(tPStr, t, vDelim);
	}
	tPVotes = eval("v_" + rWhich + "_PollVotes");
	while (tPVotes.length > tPAnswers.length) {
		tPVotes.pop();
	}
	tPVoted = fGetCookie(rWhich + eval("v_" + rWhich + "_PollN"));
	fPollShow(rWhich, tPQuestion, tPAnswers, tPVotes, 0, tPVoted, 0);
	document.write('</div></td></tr></table></td>');
}

function fHomeLogo() {
	++vHLogoNum;
	if (vHLogoNum <= vHLogoMax) {
		document['hLogo'].src = vHLogo[vHLogoNum].src;
		setTimeout('fHomeLogo()', 50);
	}
}

