
/* Used for the comment box */
function change(id) {
	var el = $(id);
	
	if (el.style.top == "410px") {
		el.style.top = "230px";
	} else if (el.style.top == "") {
		el.style.top = "230px";
	} else {
		el.style.top = "410px";
	}
	
}

function clearDefault(el) {
  if (el.defaultValue==el.value) el.value = ""
}

function toggleLayer(whichLayer)
{
	if (document.getElementById)
	{
		// this is the way the standards work
		var style2 = document.getElementById(whichLayer).style;
		style2.display = style2.display? "":"block";
	}
}

function popupWindow(myurl, windowName, width, height) {
	var newWindow;
	var props = 'scrollBars=yes,resizable=yes,toolbar=no,menubar=no,location=no,directories=no,width='+width+',height='+height;
	newWindow = window.open(myurl, windowName, props);
}

function UpdateImage(inputId, imageId) {
	var pic = document.getElementById(inputId).value;
	document.getElementById(imageId).src = pic;
}

function UpdateImage(imagePrefix, inputId, imageId) {
	var pic = document.getElementById(inputId).value;
	document.getElementById(imageId).src = imagePrefix + pic;
}

function popPlayer() {
	playerwindow = window.open("R3_Player_Detachable.html", "r3player","toolbar=no, status=no, directories=no, location=no, menubar=no, resizable=no, scrollbars=no,width=250, height=450");
}

function lBiFrame(obj, startIndex) { 
	if (startIndex == null) { startIndex = 0; }

	var iframe = window.frames['iframeWindow'];	
	var iframeForm = iframe.document.aspnetForm;

	var hrefvalues  = iframeForm.LightBox_iFrame_imgUrls.value; 	
	var titlevalues = iframeForm.LightBox_iFrame_imgTitles.value; 

	var lightBoxLinks = document.getElementById('lightBoxLinks');

	var arrHrefs = hrefvalues.split("::");
	var arrTitles= titlevalues.split("::");

	lightBoxLinks.innerHTML = "";

	for (var i=0; i<arrHrefs.length; i++) {
		var linkString;

		if (i == startIndex) {
			linkString = "<a id=\"startImage\" href=\"" + arrHrefs[i] + "\" rel=\"lightbox[images]\" title=\""+ arrTitles[i] + "\">nothing</a>";
		} else {
			linkString = "<a href=\"" + arrHrefs[i] + "\" rel=\"lightbox[images]\" title=\""+ arrTitles[i] + "\">nothing</a>";
		}
		lightBoxLinks.innerHTML += linkString;
	}
	myLightbox.start(document.getElementById('startImage'));
}

function makeIFrameSmall() {

	var elIFrame 	 = document.getElementById('ctl00_leftPaneContent');
	var elSidebar 	 = document.getElementById('sidebar');
	var elLeftColumn = document.getElementById('leftColumn');
	
	elIFrame.width = 500;
	elIFrame.scrolling = "auto";
	elIFrame.style.overflow = "";
	
	var style2 = elSidebar.style;
	style2.display = "block";
	
	var style3 = elLeftColumn.style;
	style3.width = "500px";
	style3.left = "200px";
	
}

function makeIFrameLarge() {
	var elIFrame 	 = document.getElementById('ctl00_leftPaneContent');
	var elSidebar 	 = document.getElementById('sidebar');
	var elLeftColumn = document.getElementById('leftColumn');
	
	elIFrame.width = 690;
	elIFrame.scrolling = "no";
	elIFrame.style.overflow = "hidden";
	
	var style2 = elSidebar.style;
	style2.display = "none";
	
	var style3 = elLeftColumn.style;
	style3.width = "690px";
	style3.left = "10px";
}

function isIFrameLarge() {
	var elIFrame 	 = document.getElementById('ctl00_leftPaneContent');
	return (elIFrame.width == 690);
}

function isIFrameSmall() {
	return !isIFrameLarge();
}


function hideAllR3Flash() {
	hideR3MediaPlayer();
	hideR3Promos();
}

function hideR3MediaPlayer() {
	var elSidebar 	 = document.getElementById('rightColumn');
	
	var style2 = elSidebar.style;
	style2.display = "none";	
}

function hideR3Promos() {
	if (isIFrameSmall()) {
		var elSidebar 	 = document.getElementById('sidebar');

		var style2 = elSidebar.style;
		style2.display = "none";	
	}
}

function showAllR3Flash() {
	showR3MediaPlayer();
	showR3Promos();
}

function showR3MediaPlayer() {
	var elSidebar 	 = document.getElementById('rightColumn');
	
	var style2 = elSidebar.style;
	style2.display = "block";	
}

function showR3Promos() {
	if (isIFrameSmall()) {
		var elSidebar 	 = document.getElementById('sidebar');
		
		var style2 = elSidebar.style;
		style2.display = "block";
	}
}

function hideIFrameScrollBars() {
		var elIFrame 	 = document.getElementById('ctl00_leftPaneContent');
		
		// If the iFrame is 500 wide, then the iframe is small and we change the scrollability of the iframe
		if (isIFrameSmall()) { 
			elIFrame.scrolling = "no"; 
		} else {
			// otherwise we're in the large iframe and we need to change the overflow property of the nmcMainContent div
			var iFrameDocument = window.frames['iframeWindow'].document;
			var divNmcContent  = iFrameDocument.getElementById('nmcMainContent');

			divNmcContent.style.overflow = "hidden";
		}
}

function showIFrameScrollBars() {
		var elIFrame 	 = document.getElementById('ctl00_leftPaneContent');
		if (isIFrameSmall()) { 
			elIFrame.scrolling = "auto"; 
		} else {
			var iFrameDocument = window.frames['iframeWindow'].document;
			var divNmcContent  = iFrameDocument.getElementById('nmcMainContent');

			if (divNmcContent.style.overflow == "hidden") {
				divNmcContent.style.overflow = "auto";
			}	
		}
}


		