// downloaded from https://clients.mindbodyonline.com/adm/home.asp (toolbox,Êsetup,Êlinks&shortcuts)
// CE 07.15.09

function launchWS(winName) {

	//window height and width
	myHeight = screen.height*.80;
	myWidth = 900;
	
	//widow height bounds
	if ( myHeight < 556 ) {
		myHeight = 556;
	} else if (myHeight>700) {
		myHeight = 700;
	}
	
	//get screen size, and cacl center screen positioning
	var height = screen.height;
	var width = screen.width;
	var leftpos = width / 2 - myWidth / 2;
	var toppos = (height / 2 - myHeight / 2) - 40; 

   //open window	
   msgWindow=window.open(winName,"ws_window","toolbar=no,location=no,directories=no,resizable=yes,menubar=no,scrollbars=no,status=yes,width=" + myWidth + ",height="+ myHeight + ", left=" + leftpos + ",top=" + toppos);  

   //focus window
   setTimeout('msgWindow.focus()',1);
}

//------------------------------------------------------------------------------

var IE6 = (navigator.userAgent.toLowerCase().indexOf('msie 6') != -1)  && (navigator.userAgent.toLowerCase().indexOf('msie 7') == -1);

var mod = new Modalizer();
window.addEvent('domready',function() {
	$$('.dialogWindow .closeBox a').addEvent('click', function() {
		if(!IE6) mod.modalHide();
		$(this.getProperty('ref')).setStyle('display','none');
	}); // click
	$$('.moreInfo a.dialoglink').addEvent('click', function() {
		if(!IE6) mod.modalShow({'hideOnClick':false}).setModalStyle({'z-index': 50});
		var modRef = $(this.getProperty('ref'));
		modRef.setStyle('top',(document.documentElement.clientHeight - modRef.getStyle('height').toInt())/2).setStyle('display','block');
		window.onresize = function() {
			modRef.setStyle('top',(document.documentElement.clientHeight - modRef.getStyle('height').toInt())/2);
		};
	}); // click
}); // domready

