//////////////////////////////////////////////////////////
//	tqcwEmbedFlash										//
//	Purpose: Embed Flash using ActiveX Embed Fix		//
//	Version: 1.01										//
//	Created By: PAG31427								//
//														//
//	INPUTS												//																//
//	-----------------------------------------			//
//	url			= string // REQUIRED: mymovie.swf		//
//	width		= string // REQUIRED: 100px or 100%		//
//	height		= string // REQUIRED: 100px or 100%		//
//	version		= string // REQUIRED: 5,0,0,0			//
//	id			= string // REQUIRED: myID				//
//	flashVars	= string // OPTIONAL: a querystring		//
//	wmode		= string // OPTIONAL: window, opaque,	//
//									  transparent		//
//														//
//	NOTES												//
//														//
//	-----------------------------------------			//	
//	to pass variables to flash add a					//
//	query string to the url like this...				//
//	flash/header.swf?location=home						//
//														//
//////////////////////////////////////////////////////////
function tqcwEmbedFlash(url, width, height, version, id, flashVars, wmode) {
	
	if (wmode == "" || wmode == undefined) {
		wmode = "window";
	}
	
	if (flashVars == "" || flashVars == undefined) {
		flashVars = "";
	}

	//alert("test");
	document.write('<OBJECT codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=' + version + '" height="' + height + '" width="' + width + '" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" viewastext>' + '\n');
	document.write('<PARAM name="ID" value="' + id + '">' + '\n');
	document.write('<PARAM name="FlashVars" value="' + flashVars + '">' + '\n');
	document.write('<PARAM name="FlashVars" value="qsLocation=Products">' + '\n');
	document.write('<PARAM name="Movie" value="' + url + '">' + '\n');
	document.write('<PARAM name="WMode" value="' + wmode + '">' + '\n');
	document.write('<PARAM name="Quality" value="High">' + '\n');
	document.write('<PARAM name="AllowScriptAccess" value="always">' + '\n');
	//document.write('<PARAM name="Scale" value="noscale">' + '\n');
	//document.write('<PARAM name="EmbedMovie" value="0">' + '\n');
	//document.write('<PARAM name="SWRemote" value="">' + '\n');
	//document.write('<PARAM name="MovieData" value="">' + '\n');
	document.write('<EMBED src="' + url + '" name="' + id + '" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" flashvars="' + flashVars + '" swliveconnect="false" type="application/x-shockwave-flash" width="' + width + '" height="' + height + '">' + '\n');
	document.write('</EMBED>' + '\n');
	document.write('</OBJECT>' + '\n');
}

//////////////////////////////////////////////////////
//	tqcwShowBrowserMode								//
//	Purpose: Creates popup wit browser mode			//
//	Version: 1.0									//
//	Created By: PAG31427							//
//													//
//	INPUTS											//
//	-----------------------------------------		//
//	None											//
//													//
//	NOTES											//
//	-----------------------------------------		//
//	Diagnostic tool to verify the browser mode		//
//													//
//////////////////////////////////////////////////////
function tqcwShowBrowserMode() {
	alert("Current Broser Mode: " + document.compatMode)
}

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//	tqcwOpenBrWindow																												//
//	Purpose: Creates popup browser window																							//
//	Version: 2.0																													//
//	Created By: PAG31427																											//
//																																	//
//	INPUTS																															//
//	---------------------------------------------------------------------------------------------------------------------------		//
//	theURL			= String	// REQUIRED: http://www.myurl.com or mypage.com														//
//	winName			= String	// REQUIRED: The object name for the window; entering '' will autoname the window					//
//	width			= Number	// REQUIRED: width of window																		//
//	height			= Number	// REQUIRED: hieght of window																		//
//	windowOptions	= String	// OPTIONAL: you can manually add features or type a keyword										//												//
//									// Manual Example:																				//
//									// 'toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes'				//
//									// Keywords																						//
//									// nobars	// creates a window without bars													//
//																																	//
//	SAMPLE USAGE																													//
//	---------------------------------------------------------------------------------------------------------------------------		//
//	<A href="JavaScript: tqcwOpenBrWindow('test.html','test','width=760,height=550')">sample</A>									//
//																																	//
//	NOTES																															//
//	---------------------------------------------------------------------------------------------------------------------------		//
//	Same as DreamWeaver MX																											//
//																																	//
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function tqcwOpenBrWindow(theURL,winName,width,height,windowOptions) {

	switch ( windowOptions ) {
		case ""  :
			features = "width="+width+",height="+height+",toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes";
			break;
		case undefined :
			features = "width="+width+",height="+height+",toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes";
			break;
		case "nobars" :
			features = "width="+width+",height="+height+",toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=yes";
			break;
		default : 
			// do nothing
			break;
	}
	
	// give nameless windows a generic name based on time
	if (winName == "" || winName == undefined) {
		var now = new Date(); //name the window after the time if it is blank
		var timeStamp = ""; //intialize the var as a string
		timeStamp = timeStamp + now.getUTCHours();
		timeStamp = timeStamp + now.getUTCMinutes();
		timeStamp = timeStamp + now.getUTCSeconds();
		//alert(timeStamp);
		
		winName = "window" + timeStamp;
	}
	
	window.open(theURL,winName,features);
}





