// LiveCut Javascript library.
// $Id: //depot/LiveCut/src/web/liveCut.js#26 $

var smsNumber = "1-415-606-5439";
var copyright = "Copyright &copy; 2003-2011 LiveCut LLC. U.S. pat. no. 7,403,913.";
var emailAddr = String.fromCharCode(115,101,114,118,105,99,101,64,108,105,118,101,99,117,116,46,99,111,109);
var twitterUrl = String.fromCharCode(104,116,116,112,58,47,47,116,119,105,116,116,101,114,46,99,111,109,47,
		76,105,118,101,99,117,116,83,101,114,118,105,99,101); // http://twitter.com/LivecutService

// Hack around including this in every file or generating it in the <BODY>; MSIE performs
// compilation/expansion/evaluation of generated <SCRIPT> tags out of order.
document.write("<SCRIPT LANGUAGE='JavaScript' SRC='lc_nav.js' TYPE='text/javascript'></SCRIPT>\n");

// Build an INPUT element of TYPE hidden, with the given NAME and VALUE
function hiddenInput(name, value) {
	var input = document.createElement("INPUT");
	
	input.type = "hidden";
	input.name = name;
	input.value = value;
	
	return input;
}

// ************** DISPLAY UTILITIES ****************
function printContactAddress() {
	printContactAddressCap("E");
}

function printContactAddressCap(first) {
	// Try to beat address harvesters, take 2
	// eMail Obfuscator Script 1.31 by Tim Williams - freeware output
	// (http://members.cox.net/timandbeth/spam/spam.htm)
	// Or use "od -t u1" on *NIX.
    document.write(String.fromCharCode(60,97,32,104,114,101,102,61,34) // <a href="
    	+ String.fromCharCode(109,97,105,108,116,111,58) // mailto:
    	+ emailAddr
    	+ String.fromCharCode(34,62,first.charCodeAt(0),109,97,105,108,32,117,115,60,47,97,62)); // ">Email us</a>
}

function printTwitterAddress() {
	document.write('<a href="'
		+ twitterUrl
		+ '" target="twitter"><img src="http://twitter-badges.s3.amazonaws.com/twitter-a.png" alt="Follow us on Twitter"/></a>');
		
		// Won't align in center of table cell
		//+ '" target="twitter" class="twitter-follow-button" data-show-count="false" data-align="center">'
		//+ "Follow us on Twitter</a>");
	//document.write('<script src="http://platform.twitter.com/widgets.js" type="text/javascript"></script>');
}

function printTwitterLink() {
	document.write('<a href="' + twitterUrl + '" target="twitter">Follow us on Twitter</a>');
}

function printSMSNumber() {
	document.write("<B>" + smsNumber + "</B>");
}

function printXLinks() {
	document.write("<H3 CLASS='h3Text' ALIGN='center' STYLE=UNDERLINE>"
		+ "Other <I>LiveCut</I>s on the Web</H3>\n");
	document.write("<P CLASS='bodyText' ALIGN='center'>\n");
	document.write("An <A HREF='http://harmonicinc.com/view_product.cfm?id=352'>"
		+ "automated video-on-demand live ingest tool</A> for cable TV operators.<BR>\n");
	document.write("A <A HREF='http://livecut.sourceforge.net'>"
		+ "multi camera editing tool</A> for Apple Final Cut Pro 4.5.<BR>\n");
	document.write("Also the <A HREF='http://mdsp.smartelectronix.com/livecut'>"
		+ "rhythm track sequencer plugin</A> for VST.<BR></P>\n");
}

function printCatalogLink() {
	 // Make HREF='catalog.html' later when implementing search
	document.write("<A HREF='Catalog'>catalog</A>");
}

function printCopyright() {
	document.write(copyright);
}

//
// Functions to refactor rendering of WhiteOwlWeb decorations
//
var ctrColWidth = 890; 

function startCtrColTable() {
	document.write("<br><!-- START CENTER COLUMN TABLE --><div align='center'>"
		+ "<table cellpadding='0' cellspacing='0' border='0' width='" + ctrColWidth + "' bgcolor='#D5ECFF' summary=''>\n");
}

function outputHeader() {
	document.write("<!-- LiveCut Header -->"
		+ "<tr><td align='center'>"
		+ "<img src='images/livecut-" + ctrColWidth + ".jpg' width='" + ctrColWidth + "' height='145' alt='LiveCut' border='0'><br>"
		+ "</td></tr>"
		+ "<!-- End LiveCut Header -->\n");
}

function outputNavBar() {
	document.write("<!-- JS Nav Bar -->"
		+ "<tr><td height='30' align='center' valign='top'>");
		
	// In lc_nav.js
	renderButtons();
	
	document.write("<br></td></tr>"
		+ "<!-- End Nav Bar -->\n");
}

function startCoreTextTable() {
	document.write("<tr>"
		+ "<td align='center'>"
		+ "<!-- CORE TEXT TABLE -->"
		+ "<table width='80%' align='center' cellpadding='0' cellspacing='0' border='0' summary=''>"
		+ "<tr>"
		+ "<td align='left'>"
		+ "<br>\n");
}

function endCoreTextTable() {
	document.write("</td></tr></table>"
		+ "<!-- END CORE TEXT TABLE -->\n");
}

function endCtrColTable() {
	document.write("</td></tr></table>"
		+ "</div>"
		+ "<!-- END CENTER COLUMN TABLE -->\n");
}

function outputFooter() {
	document.write("<!-- COPYRIGHT FOOTER -->"
		+ "<div align='center'>"
		+ "<table bgcolor='#A50525' cellpadding='10' cellspacing='0' border='0' width='" + ctrColWidth + "' class='footer' summary=''>"
		+ "<tr>"
		+ "<td align='center'>"
		+ "<p class='footer'>"
		+ copyright
		+ "</p></td></tr></table>"
		+ "</div>"
		+ "<!-- END COPYRIGHT FOOTER --><br>\n");
}

