/* 
Einstein VMS - Flash Launch button

This small piece of javascript works with the Flash Launch button to help launch the VMS in a lightwindow.
This script assumes there is a normal link to the light window VMS somewhere on the same page with id="vms-lightwindow-link"
The script will fire the same lightwindow click handler on that link that clicking it normally would.

*/

function flash_clicked(vindex) {
	var type = typeof(vindex);
	var vid = "";
	
	if (type != "undefined") {
		vid = ""+vindex;
	}
	
	var id = "vms-lightwindow-link"+vid;
	
	var obj = document.getElementById(id);
	
	if (obj) {
		if (obj.className.indexOf('lightwindow') != -1) {
			/* class of link contains lightwindow use lightwindow style */
			myLightWindow.activate(myLightWindow, obj);
		} else if (obj.className.indexOf('popup') != -1)  {
			/* class of link contains popup use popup style */
			vmspopup(obj.href);
		} else {
			/* no class found, use normal link style */
			window.location = obj.href;
		}
	}
}

/* Credit to Graham Mickle for narrowing down the most compatible popup code */
function vmspopup(url){
	var tools = "resizable=no,toolbar=no,location=no,directories=no,status=no,scroll=yes,scrollbars=no,menubar=no,width=980,height=610";
	newWindow = window.open(url, 'vmsPopup', tools);
	newWindow.focus();
}