// GAMES functions

var regbuy = "http://www.regnow.com/softsell/nph-softsell.cgi?";
var regaff = "http://www.regnow.com/softsell/visitor.cgi?affiliate=19083&action=site&";
var winfeat = 'toolbar=yes,status=yes,scrollbars=yes,resizable=yes,width=760,height=600';
  
function browser_mac() { return (navigator.appVersion.indexOf("Macintosh") != -1); }
function safari_mac() { return (navigator.appVersion.indexOf("Safari") != -1); }

// Skunk Studios

function buyGutterball() {
  if(browser_mac()) {document.location.href = regbuy + "item=8314-6";}
  else {document.location.href = regbuy + "item=8314-1";} 
}
function buyGutterball2() {
  if(browser_mac()) {document.location.href = regbuy + "item=8314-14";}
  else {document.location.href = regbuy + "item=8314-13";} 
}
function buyQBz() {
  if(browser_mac()) {document.location.href = regbuy + "item=8314-7";}
  else {document.location.href = regbuy + "item=8314-2";} 
}
function buyWordUp() {
  if(browser_mac()) {document.location.href = regbuy + "item=8314-8";}
  else {document.location.href = regbuy + "item=8314-3";}
}
function buySpelvin() {
  if(browser_mac()) {document.location.href = regbuy + "item=8314-5";}
  else {document.location.href = regbuy + "item=8314-4";} 
}
function buySveerz() {
    if(browser_mac()) {document.location.href = regbuy + "item=8314-10";}
     else {document.location.href = regbuy + "item=8314-9";}
}
function buyLoco() {
  if(browser_mac()) {window.open("http://gameblast.shockwave.com/servlet/updateCart?action=addItem&site=sw&sku=tamaleloco2-mac", 'Loco', winfeat);}
  else {window.open("http://gameblast.shockwave.com/servlet/updateCart?action=addItem&site=sw&sku=tamaleloco2-pc", 'Loco', winfeat);}
}
function buyVarmintz() {
  if(browser_mac()) {document.location.href = regbuy + "item=8314-12";}
  else {document.location.href = regbuy + "item=8314-11";}
}
function buyTennisTitans() {
  if(browser_mac()) {document.location.href = regbuy + "item=8314-16";}
  else {document.location.href = regbuy + "item=8314-15";}
}
function buyMahJongAdventures() {
  if(browser_mac()) {document.location.href = regbuy + "item=8314-18";}
  else {document.location.href = regbuy + "item=8314-17";}
}
function buyQBeez2() {
  if(browser_mac()) {document.location.href = regbuy + "item=8314-20";}
  else {document.location.href = regbuy + "item=8314-19";}
}
function bundleGames() {
    if(browser_mac()) {document.location.href = regbuy + "bundle=8314-5,8314-6,8314-7,8314-8,8314-10&styleid=6013";}
     else {document.location.href = regbuy + "bundle=8314-1,8314-2,8314-3,8314-4,8314-9&styleid=6013";}
}

function dlGutterball() {
  if(browser_mac()) {document.location.href = 'http://www.skunkstudios.com/gutterball/downloadmac.htm';}
  else {document.location.href = 'http://www.skunkstudios.com/gutterball/download.htm';}
}
function dlGutterball2() {
  if(browser_mac()) {document.location.href = 'http://www.skunkstudios.com/gutterball2/downloadmac.htm';}
  else {document.location.href = 'http://www.skunkstudios.com/gutterball2/download.htm';}
}
function dlQBz() {
  if(browser_mac()) {document.location.href = 'http://www.skunkstudios.com/qbeez/downloadmac.htm';}
  else {document.location.href = 'http://www.skunkstudios.com/qbeez/download.htm';}
}
function dlWordUp() {
  if(browser_mac()) {document.location.href = 'http://www.skunkstudios.com/wordup/downloadmac.htm';}
  else {document.location.href = 'http://www.skunkstudios.com/wordup/download.htm';}
}
function dlSpelvin() {
  if(browser_mac()) {document.location.href = 'http://www.skunkstudios.com/spelvin/downloadmac.htm';}
  else {document.location.href = 'http://www.skunkstudios.com/spelvin/download.htm';}
}
function dlLoco() {
  if(browser_mac()) {document.location.href = 'http://www.skunkstudios.com/loco/downloadmac.htm';}
  else {document.location.href ='http://www.skunkstudios.com/loco/download.htm';}
}
function dlSveerz() {
  if(browser_mac()) {document.location.href = 'http://www.skunkstudios.com/sveerz/downloadmac.htm';}
  else {document.location.href = 'http://www.skunkstudios.com/sveerz/download.htm';}
}
function dlVarmintz() {
  if(browser_mac()) {document.location.href = 'http://www.skunkstudios.com/varmintz/downloadmac.htm';}
  else {document.location.href = 'http://www.skunkstudios.com/varmintz/download.htm';}
}
function dlTennisTitans() {
  if(browser_mac()) {document.location.href = 'http://www.skunkstudios.com/tennistitans/downloadmac.htm';}
  else {document.location.href = 'http://www.skunkstudios.com/tennistitans/download.htm';}
}

// General

function moreInfo(mGame) {
 theURL = 'http://www.skunkstudios.com/' + mGame + '/index.html';
 document.location.href = regaff + "vendor=8413&ref=" + theURL;
}

function dlMacOSX() {
 alert("Coming soon to Mac OSX! Real soon!\n\n" + "You can play the Mac version in Classic while you wait!");
}

function openSS(theURL) {
  features = 'status=no,scrollbars=no,resizable=yes,width=660,height=500';
  window.open(theURL, 'Screenshot', features);
}

function openDD(theURL) {
  features = 'status=no,scrollbars=yes,resizable=yes,width=680,height=550';
  window.open(theURL, 'Desktops', features);
}

function openFD(theFILE) {
  features = 'status=no,scrollbars=yes,resizable=yes,width=680,height=550';
  window.open('http://www.skunkstudios.com/sveerz/vip/Desktops/' + theFILE, 'Desktops', features);
}

function ssOpen(theGAME) {
  features = 'status=no,scrollbars=no,resizable=yes,width=770,height=572';
  theURL = 'http://www.skunkstudios.com/' + theGAME + '/ss1.htm';
  window.open(theURL, 'Screenshot', features);
}

function ssOpen2(theGAME) {
  features = 'status=no,scrollbars=no,resizable=yes,width=730,height=600';
  theURL = 'http://www.skunkstudios.com/' + theGAME + '/ss1.htm';
  window.open(theURL, 'Screenshot', features);
}

function webPlay(theGAME,theW,theH) {
  if (screen.width > 800) {
    features = 'status=no,scrollbars=no,resizable=yes,width=' + theW + ',height=' + theH;
  } else {
	features = 'status=no,scrollbars=yes,resizable=yes,width=' + theW + ',height=' + theH;
  }
  theURL = 'http://www.skunkstudios.com/webgames/games/' + theGAME + '.htm';
  window.open(theURL, 'WebGame', features);
}
function webGame(theGAME) {
  features = 'status=no,scrollbars=no,resizable=yes,width=700,height=540';
  theURL = 'http://www.skunkstudios.com/' + theGAME + '/game/index.html';
  window.open(theURL, 'WebGame', features);
}
function webGame2(theGAME) {
  if (screen.width > 800) {
    features = 'status=no,scrollbars=no,resizable=yes,width=760,height=620';
  } else {
	features = 'status=no,scrollbars=yes,resizable=yes,width=760,height=620';
  }
  theURL = 'http://www.skunkstudios.com/' + theGAME + '/game/index.html';
  window.open(theURL, 'WebGame', features);
}
function webGame3(theGAME) {
  if (screen.width > 800) {
    features = 'status=no,scrollbars=no,resizable=yes,width=760,height=620';
  } else {
	features = 'status=no,scrollbars=yes,resizable=yes,width=760,height=620';
  }
  if(safari_mac()) {
      theURL = 'http://www.skunkstudios.com/' + theGAME + '/game/index_safari.html';
  } else {
      theURL = 'http://www.skunkstudios.com/' + theGAME + '/game/index.html';
  }
  window.open(theURL, 'WebGame', features);
}
function webLoco() {
  features = 'status=no,scrollbars=no,resizable=yes,width=680,height=620';
  theURL = 'http://www.shockwave.com/bin/content/shockwave.jsp?id=tamalerumble2';
  window.open(theURL, 'WebGame', features);
}
function openSSB(theURL) {
  features = 'status=no,scrollbars=yes,resizable=yes,width=820,height=620';
  window.open(theURL, 'Screenshot', features);
}

function openTell() {
  features = 'status=no,scrollbars=no,resizable=yes,width=450,height=550';
  window.open('/tell_a_friend.htm', 'Tell', features);
}
function openContact() {
  features = 'status=no,scrollbars=no,resizable=yes,width=450,height=480';
  // window.open('/contact_us.htm', 'Contact', features);
  alert("This feature is coming soon to the new website.");
}
function openNews() {
  features = 'status=no,scrollbars=yes,resizable=yes,width=600,height=420';
  window.open('http://blast.skunkstudios.com/dada/cgi-bin/mail.cgi?f=list&l=newsletr', 'News', features);
}
function openPrivacy() {
  features = 'status=no,scrollbars=yes,resizable=yes,width=620,height=450';
  window.open('/privacy/privacy.htm', 'Privacy', features);
}

// standart MM sh#t

function MM_checkPlugin(plgIn, theURL, altURL, autoGo) { //v3.0
  var ok=false; document.MM_returnValue = false;
  with (navigator) if (appName.indexOf('Microsoft')==-1) ok=(plugins && plugins[plgIn]);
  else if (appVersion.indexOf('3.1')==-1) { //not Netscape or Win3.1
    if (plgIn.indexOf("Flash")!=-1 && window.MM_flash!=null) ok=window.MM_flash;
    else if (plgIn.indexOf("Director")!=-1 && window.MM_dir!=null) ok=window.MM_dir;
    else ok=autoGo; }
  if (!ok) theURL=altURL; 
  if (theURL) window.location=theURL;
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function MM_displayStatusMsg(msgStr) { //v1.0
  status=msgStr;
  document.MM_returnValue = true;
}

function MM_callJS(jsStr) { //v2.0
  return eval(jsStr)
}

function macError() {
  if (browser_mac()) {
    alert("We're sorry.  This game is not available for Macintosh.");
    return false;
  }
  else { return true; }
}