function popup(url, win, specs) {
	mywin=window.open(url, win, specs + "status,resizeable,scrollbars");
	mywin.focus();
}

function tagline () {
		var num = Math.round(Math.random()*8);

		if (num == 0) {
	      return('Imagination does not fit in this box.');
		}
		if (num == 1) {
		  return('Web doozers.');
		}
		if (num == 2) {
		  return('Easy made simple.');
		}
		if (num == 3) {
	      return('Growing ideas; harvesting solutions.');
		}
		if (num == 4) {
	 	  return('Business at the speed of fast.');
		}
		if (num == 5) {
	      return('The world is a planet.');
		}
		if (num == 6) {
		  return('Imagine a company.');
		}
		if (num == 7) {
		  return('The magic of quantum mechanics.  The elegance of general relativity.');
		}
		if (num > 7)  {
		  return('Go back to Toronto.');
		}
		
		// return('Hey you kids! Get outta that JELLO tree!');
		// return('eBling.');
		// return('Less Filling. Tastes Great.');

}

function noRightClick() {
    if (event.button==2) {
      alert('Copyright 2006 Mike Polowick.')
    }
}


function getFlashVersion () {
  var browser = navigator.userAgent.toLowerCase();
  flashVersion = -1;    
    
	// NS3+, Opera3+, IE5+ Mac
    if ( navigator.plugins != null && navigator.plugins.length > 0 ) {
        var flashPlugin = navigator.plugins['Shockwave Flash'];
        if ( typeof flashPlugin == 'object' ) {
            if ( flashPlugin.description.indexOf('8.') != -1 ) flashVersion = 8;
			else if ( flashPlugin.description.indexOf('7.') != -1 ) flashVersion = 7;
            else if ( flashPlugin.description.indexOf('6.') != -1 ) flashVersion = 6;
            else if ( flashPlugin.description.indexOf('5.') != -1 ) flashVersion = 6;
            else if ( flashPlugin.description.indexOf('4.') != -1 ) flashVersion = 4;
            else if ( flashPlugin.description.indexOf('3.') != -1 ) flashVersion = 3;
        }
    } 
	
	// IE4+ Win32 (VBscript)
    else if ( browser.indexOf("msie") != -1 && parseInt(navigator.appVersion) >= 4 && browser.indexOf("win")!= -1 && browser.indexOf("16bit")== -1 ) {
      document.write('<scr' + 'ipt language="VBScript"\> \n');
        document.write('on error resume next \n');
        document.write('DIM obFlash \n');
        document.write('SET obFlash = CreateObject("ShockwaveFlash.ShockwaveFlash.8") \nIF IsObject(obFlash) THEN \nflashVersion = 8 \n');
        document.write('ELSE SET obFlash = CreateObject("ShockwaveFlash.ShockwaveFlash.7") END IF \nIF flashVersion < 8 and IsObject(obFlash) THEN \nflashVersion = 7 \n');
        document.write('ELSE SET obFlash = CreateObject("ShockwaveFlash.ShockwaveFlash.6") END IF \nIF flashVersion < 7 and IsObject(obFlash) THEN \nflashVersion = 6 \n');
        document.write('ELSE SET obFlash = CreateObject("ShockwaveFlash.ShockwaveFlash.5") END IF \nIF flashVersion < 6 and IsObject(obFlash) THEN \nflashVersion = 5 \n');
        document.write('ELSE SET obFlash = CreateObject("ShockwaveFlash.ShockwaveFlash.4") END IF \nIF flashVersion < 5 and IsObject(obFlash) THEN \nflashVersion = 4 \n');
        document.write('ELSE SET obFlash = CreateObject("ShockwaveFlash.ShockwaveFlash.3") END IF \nIF flashVersion < 4 and IsObject(obFlash) THEN \nflashVersion = 3 \n');
        document.write('END IF');
      document.write('</scr' + 'ipt\> \n');
  } // no Flash
  else {
    flashVersion = -1;
  }
return flashVersion;
}

function insertFlash(file, width, height) {

	document.write('<object style="z-index:1;" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width=' + width + ' height=' + height + '>');
      document.write('<param name="movie" value="' + file + '">');
      document.write('<param name="quality" value="high">');
      document.write('<param name="menu" value="false"><param name="wmode" value="transparent">');
	  
      document.write('<embed style="z-index:1;" src="' + file + '" quality="high" menu="false" pluginspage="http://www.macromedia.com/go/getflashplayer" wmode=transparent type="application/x-shockwave-flash" width=' + width + ' height=' + height + '></embed></object>');
}


function isMailAddress(m) {
   if ((m == '') || (m == ' ')) { return false; }

    var a = 1;
    var ml = m.length;

    while ((ml>a) && (m.charAt(a) != "@")) { a++ }
    if ((a >= ml) || (m.charAt(a) != "@")) {
	return false;
    } else {
	a = a + 2;
    }
    while ((ml > a) && (m.charAt(a) != ".")) { a++ }
    if ((a >= ml - 1) || (m.charAt(a) != ".")) {
	return false;
    } else {
    return true;
    }
}

function validate(obj) {
	var valid = true;
	msg = "";
	
	if (obj.firstname.value == "") {
		msg += "Please enter your first name.\n";
		obj.firstname.focus();
		valid = false;
	}
	if (obj.lastname.value == "") {
		msg += "Please enter your last name.\n";
		obj.lastname.focus();
		valid = false;
	}
	if (obj.address1.value == "") {
		msg += "Please enter your address.\n";
		obj.address1.focus();
		valid = false;
	}
	if (obj.phone.value == "") {
		msg += "Please enter your phone number.\n";
		obj.phone.focus();
		valid = false;
	}
	if (isMailAddress(obj.email.value) == false) {
		msg += "Please enter a valid email address.\n";
		obj.email.focus();
		valid = false;
	}
	if (obj.position.value == "") {
		msg += "Please choose a position you are applying for.\n";
		obj.position.focus();
		valid = false;
	}

	if (!valid)	alert(msg);
	return valid;

}
