var targeturl 	= "http://www.sonasphere.com/mash/applet/index.html";
var	windowtitle		= "Massh! - v0.19a";

// Get OS
var agt			= navigator.userAgent.toLowerCase();
var is_mac 		= (agt.indexOf("mac")!=-1);
var is_safari 	= (agt.indexOf("safari")!=-1);
		
// Offset for browser bar...
var offset = 0;

// Are we on a mac?
if (is_mac){
	offset 		= 0;
}

// Function called from any page to open the applet
function massh(){
		
	// Get screen dimensions
	if (window.screen){
		
		// Window dimensions
		var w = 910;
		var h = 700;
			
		// Get x/y coordinates for window
		var x=screen.availWidth-12;
		var y=screen.availHeight-60;
			
		// Open in center of screen
		x = (x/2) - (w/2);
		y = (y/2) - (h/2);
	
		//
//		resizable = 1;
		
		if(is_mac){ 
			massh_mac();
		}else{
			window.open(targeturl,"",'width='+w+',height='+h+',scrollbars=0,status=0,resizable,left='+x+',top='+y);
		}
	}	
}

// Function called from any page to open the applet for a MAC
function massh_mac(){
		
	// Get screen dimensions
	if (window.screen){
		
		// Window dimensions
		var w = 900;
		var h = 700;
			
		// Get x/y coordinates for window
		var x=screen.availWidth-12;
		var y=screen.availHeight-60;
			
		// Open in center of screen
		x = (x/2) - (w/2);
		y = (y/2) - (h/2);
		
		if(is_safari){
			w = 900;
			h = 704;
			resizable = 0;
		}else resizable = 1;
		
		window.open(targeturl, windowtitle,'width='+w+',height='+h+',scrollbars=0,status=0,resizable='+resizable+',left='+x+',top='+y);
	}	
}
