// JavaScript Document

var newWindow;

function displayMovie(imageName, iWidth, iHeight){
	if(!newWindow || newWindow.closed){
		newWindow = window.open("", "", "height="+iHeight+", width="+iWidth+"");
		
		var newContent = "<HTML><HEAD><TITLE>Example</TITLE></HEAD>"
			newContent += "<BODY leftmargin=0 topmargin=0><table width='100%' height='100%' border='0' cellspacing='0' cellpadding='0'><tr><td align='center' valign='middle'>"
			newContent += "<OBJECT classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'"
			newContent += "codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0' WIDTH='100%' HEIGHT='100%'>"
			newContent += "<PARAM NAME=movie VALUE='"+imageName+"'><PARAM NAME=quality VALUE=high>"
			newContent += "<PARAM NAME=scale VALUE=exactfit> <PARAM NAME=salign VALUE=LT> <PARAM NAME=bgcolor VALUE=#FFFFFF>" 
			newContent += "<EMBED src='"+imageName+"' loop=false quality=high scale=exactfit salign=LT bgcolor=#FFFFFF  WIDTH=100% HEIGHT=100% TYPE='application/x-shockwave-flash' PLUGINSPAGE='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash'></EMBED>"
			newContent += "</OBJECT>"
			newContent += "</td></tr></table>"
			newContent += "</BODY></HTML>"
			newWindow.document.write(newContent);
			newWindow.document.close();
	}
	else{
		newWindow.close();
		newWindow = window.open("", "", "height="+iHeight+", width="+iWidth+"");
		var  newContent = "<HTML><HEAD><TITLE>Example</TITLE></HEAD>"
			newContent += "<BODY leftmargin=0 topmargin=0><table width='100%' height='100%' border='0' cellspacing='0' cellpadding='0'><tr><td align='center' valign='middle'>"
			newContent += "<OBJECT classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'"
			newContent += "codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0' WIDTH='100%' HEIGHT='100%'>"
			newContent += "<PARAM NAME=movie VALUE='"+imageName+"'><PARAM NAME=quality VALUE=high>"
			newContent += "<PARAM NAME=scale VALUE=exactfit> <PARAM NAME=salign VALUE=LT> <PARAM NAME=bgcolor VALUE=#FFFFFF>" 
			newContent += "<EMBED src='"+imageName+"' loop=false quality=high scale=exactfit salign=LT bgcolor=#FFFFFF  WIDTH=100% HEIGHT=100% TYPE='application/x-shockwave-flash' PLUGINSPAGE='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash'></EMBED>"
			newContent += "</OBJECT>"
			newContent += "</td></tr></table>"
			newContent += "</BODY></HTML>"
			
			newWindow.document.write(newContent);
			newWindow.document.close();
			
			newWindow.focus();
	}
}
	
function displayImage(imageName, iWidth, iHeight){
	if(!newWindow || newWindow.closed){
		newWindow = window.open("", "", "height="+iHeight+", width="+iWidth+"");
		
		var newContent = "<HTML><HEAD><TITLE>Example</TITLE></HEAD>"
			newContent += "<BODY leftmargin=0 topmargin=0><table width='100%' height='100%' border='0' cellspacing='0' cellpadding='0'><tr><td align='center' valign='middle'><img src=" + imageName + "></td></tr></table>"
			newContent += "</BODY></HTML>"
			newWindow.document.write(newContent);
			newWindow.document.close();
	}
	else{
		newWindow.close();
		newWindow = window.open("", "", "height="+iHeight+", width="+iWidth+"");
		var newContent = "<HTML><HEAD><TITLE>Example</TITLE></HEAD>"
			newContent += "<BODY leftmargin=0 topmargin=0><img src=" + imageName + ">"
			newContent += "</BODY></HTML>"
			
			newWindow.document.write(newContent);
			newWindow.document.close();
			
			newWindow.focus();
	}
}
