

function open_window(url, w, h) {
	w = (w == null) ? screen.width / 2 : w;
	h = (h == null) ? screen.height / 2 : h;
	return window.open(url, "_sunnyland_publications","scrollbars=1,resizable=1,"
						+ "width=" + w + ",height=" + h);
}

function isValidEmail(eml) {
	var re = /^[\w][\w\.-]*[\w]@[\w][\w\.-]*[\w]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$/;
	return re.test(eml);
}


// Flash Detection script
// Adapted (or downloaded and modified) from... 
// MOOCK FPI [fLASH pLAYER iNSPECTOR] 
// http://www.moock.org/webdesign/flash/detection/moockfpi/
//
function detectFlash( requiredVersion ) {  
  // If navigator.plugins exists...
  var flashVersion = 0;
  
  if (navigator.plugins && (navigator.plugins["Shockwave Flash 2.0"]
        || navigator.plugins["Shockwave Flash"])) {
      // Some version of Flash was found. Time to figure out which.
      
      // Set convenient references to flash 2 and the plugin description.
      var isVersion2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
      var flashDescription = navigator.plugins["Shockwave Flash" + isVersion2].description;

      // DEBUGGING: uncomment next line to see the actual description.
      // alert("Flash plugin description: " + flashDescription);
      
      // A flash plugin-description looks like this: Shockwave Flash 4.0 r5
      // We can get the major version by grabbing the character before the period
      // note that we don't bother with minor version detection. 
      // Do that in your movie with $version or getVersion().
      flashVersion = parseInt(flashDescription.substring(16));
  }
  else {
    try {
        var flashPlugin = new ActiveXObject("ShockwaveFlash.ShockwaveFlash." + requiredVersion);
        flashVersion = requiredVersion;
    }
    catch( x ) {
    }
  }
  
  // If we're on msntv (formerly webtv), the version supported is 4 (as of
  // January 1, 2004). Note that we don't bother sniffing varieties
  // of msntv. You could if you were sadistic...
  if(navigator.userAgent.indexOf("WebTV") != -1) flashVersion = 4;  
  
  // DEBUGGING: uncomment next line to display flash version
  // alert("version detected: " + actualVersion);


  // We're finished getting the version on all browsers that support detection.
  // Time to take the appropriate action.

  // If the user has a new enough version...
  if (flashVersion >= requiredVersion) {
    return true;
  }
  return false;
}


function updateToolbar() {
	if( !detectFlash(5) ) {
		var toolbar = document.getElementById("toolbar");
		if( toolbar ) {
			toolbar.innerHTML = "<img src='v3/images/toolbar.jpg' border='0' "
							  + "usemap='#tbmap' width='778' height='240' />";
		}
	}
}

window.attachEvent( "onload", updateToolbar );

