function newImage(ID,file) {
	document.getElementById(ID).src='/images/'+file;
}

function open_window(URL,name,left,top,width,height,menubar){
	 rp=window.open(URL,name,"top="+top+",left="+left+",height="+height+",width="+width+",menubar="+menubar+",scrollbars=1,resizable=1,status=1");
	 rp.focus();
	 return(false);
}

function showVideoPopup(frameSrc)
{
  var iFrame = document.getElementById("iframeVideoPopup");

  iFrame.src = frameSrc;
  iFrame.style.display = "block";
}

function printPage()
{
    var gAutoPrint = true; // Flag for whether or not to automatically call the print function
	if (document.getElementById != null)
	{
		var html = '<HTML>\n<HEAD>\n';		
		html += writeLinkTags();

		html += '\n</HEAD>\n<BODY style="background-image: none; background-color:white;">\n';
		var printReadyElem = document.getElementById("PrintArea"); 

		if (printReadyElem != null)
		{
			html += '<!-- ********************** PRINT-START *********************-->\n' ;
			html += '<table style="width:100%;">\n<tr>\n<td>\n' + printReadyElem.innerHTML + '\n</td>\n</tr>\n</table>\n';
			html += '<!-- ********************** PRINT-SLUT **********************-->\n' ;
		}
		else
		{
			alert("Could not find the PrintArea section in the HTML");
			return;
		}		
			
		html += '\n</BODY>\n</HTML>';
		
		var printWin = window.open("","PrintPreview","width=506,height=600,resizable=no,top=50,left=50");
		if (printWin != null)
		{
			printWin.document.open();
			printWin.document.write(html);
			printWin.document.close();
			if (gAutoPrint)
			{
				printWin.print();
				printWin.close();
			}
		}
	}
	else
	{
		alert("Sorry, the print ready feature is only available in modern browsers.");
	}
}

function writeLinkTags() {
	var styleSheets = document.styleSheets;
	var result = "";
	if (styleSheets) {
		for (i = 0; i < styleSheets.length; i++) {
			styleSheet = styleSheets[i];
			if(styleSheet.href != '')
				result += '<link href="'+ styleSheet.href +'" type="text/css" rel="stylesheet" />';
		}
	}
	return result;
}	
