// 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';
var webfeat = 'toolbar=no,status=no,scrollbars=yes,resizable=yes,width=650,height=460';
  
function browser_mac() { return (navigator.appVersion.indexOf("Macintosh") != -1); }

// Big Fish
function buyMahjongTowers() {
  window.open(regbuy + "item=7551-8&affiliate=19083&ss_coupon=SKUN-PN75-BIGF", 'Info', winfeat);
}
function buyMahjongTowersDL() {
  window.open(regbuy + "item=7551-3&affiliate=19083&ss_coupon=SKUN-PN75-BIGF", 'Info', winfeat);
}
function dlMahjongTowers() {
  if(browser_mac()) {macError();}
  else {document.location.href = regaff + "vendor=7551&ref=http://www.bigfishgames.com/downloads/installers/skunkstudios/mahjonggSS.exe";}
}
function buyWizard() {
  window.open(regbuy + "item=7551-10&affiliate=19083&ss_coupon=SKUN-PN75-BIGF", 'Info', winfeat);
}
function buyWizardDL() {
  window.open(regbuy + "item=7551-5&affiliate=19083&ss_coupon=SKUN-PN75-BIGF", 'Info', winfeat);
}
function dlWizard() {
  if(browser_mac()) {macError();}
  else {document.location.href = regaff + "vendor=7551&ref=http://www.bigfishgames.com/downloads/installers/skunkstudios/wizardSS.exe";}
}
function buyTopTen() {
  window.open(regbuy + "item=7551-19&affiliate=19083&ss_coupon=SKUN-PN75-BIGF", 'Info', winfeat);
}
function dlTopTen() {
  if(browser_mac()) {macError();}
  else {document.location.href = regaff + "vendor=7551&ref=http://www.bigfishgames.com/downloads/installers/skunkstudios/solitaireSS.exe";}
}

// GameHouse buy URLs
function buyCollapse2() {
  window.open(regbuy + "item=5896-13&affiliate=19083&ss_coupon=SAVE-3Q25", 'Info', winfeat);
}
function buyBounceOut() {
  window.open(regbuy + "item=5896-1&affiliate=19083&ss_coupon=SAVE-3Q25", 'Info', winfeat);
}
function buyMJSolitaire() {
  window.open(regbuy + "item=5896-9&affiliate=19083&ss_coupon=SAVE-3Q25", 'Info', winfeat);
}

// Alive
function buyRotoBlox() {
  window.open(regbuy + "item=4439-4&affiliate=19083&ss_coupon=MAGI-1UR8", 'Info', winfeat);
}
function dlRotoBlox() {
  if(browser_mac()) {macError();}
  else {document.location.href = regaff + "vendor=4439&ref=http://www.alivegames.com/files/RotoBloxSetup.exe";}
}
function dlBraveDwarves2() {
  if(browser_mac()) {macError();}
  else {document.location.href = regaff + "vendor=4439&ref=http://www.alivegames.com/files/BraveDwarves2Setup.exe";}
}

// LobsterSoft
function buyArcadeLines() {
  window.open(regbuy + "item=1297-14&affiliate=19083&ss_coupon=SKUN-YF3Y", 'Info', winfeat);
}
function dlArcadeLines() {
  if(browser_mac()) {macError();}
  else {document.location.href = regaff + "vendor=1297&ref=http://www.five-plus.com/downloads/arclines.exe";}
}

// TIBO
function buyJigsawPuzzles() {
  window.open(regbuy + "item=2478-20&affiliate=19083&ss_coupon=MBUN-ERPO", 'Buy', winfeat);
}
function dlJigsawPuzzles() {
  if(browser_mac()) {macError();}
  else {document.location.href = regaff + "vendor=2478&ref=http://www.tibo.cz/archive/jpsetup.exe";}
}

// AxySoft
function buyAirXonix() {
  window.open(regbuy + "item=4174-1&affiliate=19083&ss_coupon=SKUN-O189-DOLL", 'Info', winfeat);
}
function buyAxySnake() {
  window.open(regbuy + "item=4174-5&affiliate=19083&ss_coupon=SKUN-O189-DOLL", 'Info', winfeat);
}
function buyAlonix() {
  window.open(regbuy + "item=4174-15&affiliate=19083&ss_coupon=SKUN-O189-DOLL", 'Info', winfeat);
}
function buySkyMaze() {
  window.open(regbuy + "item=4174-9&affiliate=19083&ss_coupon=SKUN-O189-DOLL", 'Info', winfeat);
}
function buyTetrize() {
  window.open(regbuy + "item=4174-2&affiliate=19083&ss_coupon=SKUN-O189-DOLL", 'Info', winfeat);
}
function dlAirXonix() {
  if(browser_mac()) {macError();}
  else {document.location.href = regaff + "vendor=4174&ref=http://www.axysoft.com/airxonix/AirXonix.exe";}
}
function dlAxySnake() {
  if(browser_mac()) {macError();}
  else {document.location.href = regaff + "vendor=4174&ref=http://www.axysoft.com/axysnake/AxySnake.exe";}
}
function dlTetrize() {
  if(browser_mac()) {macError();}
  else {document.location.href = regaff + "vendor=4174&ref=http://www.axysoft.com/axysnake/AxySnake.exe";}
}
function dlAlonix() {
  if(browser_mac()) {macError();}
  else {document.location.href = regaff + "vendor=4174&ref=http://www.axysoft.com/alonix/Alonix.exe";}
}
function dlSkyMaze() {
  if(browser_mac()) {macError();}
  else {document.location.href = regaff + "vendor=4174&ref=http://www.axysoft.com/skymaze/SkyMaze.exe";}
}
function dlTetrize() {
  if(browser_mac()) {macError();}
  else {document.location.href = regaff + "vendor=4174&ref=http://www.axysoft.com/tetrize/TetRize.exe";}
}

// PopCap BUY
function buyBookworm() {
  window.open(regbuy + "item=5327-26&affiliate=19083&ss_coupon=SKUN-9220", 'Info', winfeat);
}
function buyTipTop() {
  window.open(regbuy + "item=5327-25&affiliate=19083&ss_coupon=SKUN-9220", 'Info', winfeat);
}
function buyDynomite() {
  window.open(regbuy + "item=5327-14&affiliate=19083&ss_coupon=SKUN-9220", 'Info', winfeat);
}
function buyNingpo() {
  window.open(regbuy + "item=5327-15&affiliate=19083&ss_coupon=SKUN-9220", 'Info', winfeat);
}
function buyAlchemy() {
  if(browser_mac()) {window.open(regbuy + "item=5327-11&affiliate=19083&ss_coupon=SKUN-9220", 'Info', winfeat);}
  else {window.open(regbuy + "item=5327-3&affiliate=19083&ss_coupon=SKUN-9220", 'Info', winfeat);}
}
function buyBejeweled() {
  if(browser_mac()) {window.open(regbuy + "item=5327-10&affiliate=19083&ss_coupon=SKUN-9220", 'Info', winfeat);}
  else {window.open(regbuy + "item=5327-1&affiliate=19083&ss_coupon=SKUN-9220", 'Info', winfeat);}
}
function buyBigMoney() {
  if(browser_mac()) {window.open(regbuy + "item=5327-19&affiliate=19083&ss_coupon=SKUN-9220", 'Info', winfeat);}
  else {window.open(regbuy + "item=5327-9&affiliate=19083&ss_coupon=SKUN-9220", 'Info', winfeat);}
}
function buySevenSeas() {
  if(browser_mac()) {window.open(regbuy + "item=5327-21&affiliate=19083&ss_coupon=SKUN-9220", 'Info', winfeat);}
  else {window.open(regbuy + "item=5327-9&affiliate=19083&ss_coupon=SKUN-9220", 'Info', winfeat);}
}
function buyNoahsArk() {
  if(browser_mac()) {window.open(regbuy + "item=5327-24&affiliate=19083&ss_coupon=SKUN-9220", 'Info', winfeat);}
  else {window.open(regbuy + "item=5327-9&affiliate=19083&ss_coupon=SKUN-9220", 'Info', winfeat);}
}
function buyMummyMaze() {
  if(browser_mac()) {window.open(regbuy + "item=5327-20&affiliate=19083&ss_coupon=SKUN-9220", 'Info', winfeat);}
  else {window.open(regbuy + "item=5327-8&affiliate=19083&ss_coupon=SKUN-9220", 'Info', winfeat);}
}
// PopCap PC
function dlBookworm() {
  if(browser_mac()) {macError();}
  else {document.location.href = regaff + "vendor=5327&ref=http://www.popcap.com/installer_download.php?url=Bookworm_setup.exe";}
}
function dlTipTop() {
  if(browser_mac()) {macError();}
  else {document.location.href = regaff + "vendor=5327&ref=http://www.popcap.com/installer_download.php?url=TipTopSetup.exe";}
}
function dlDynomite() {
  if(browser_mac()) {macError();}
  else {document.location.href = regaff + "vendor=5327&ref=http://www.popcap.com/installer_download.php?url=WinDynomite_setup.exe";}
}
function dlNingpo() {
  if(browser_mac()) {macError();}
  else {document.location.href = regaff + "vendor=5327&ref=http://www.popcap.com/installer_download.php?url=WinNingPo_setup.exe";}
}
function dlNoahsArk() {
  if(browser_mac()) {macError();}
  else {document.location.href = regaff + "vendor=5327&ref=http://www.popcap.com/installer_download.php?url=WinNoah_setup.exe";}
}
// PopCap Mac
function dlAlchemy() {
  if(browser_mac()) {document.location.href = regaff + "vendor=5327&ref=http://www.popcap.com/installer_download.php?url=AlchemyDeluxe.dmg";}
  else {document.location.href = regaff + "vendor=5327&ref=http://www.popcap.com/installer_download.php?url=WinAlchemy_setup.exe";}
}
function dlBejeweled() {
  if(browser_mac()) {document.location.href = regaff + "vendor=5327&ref=http://www.popcap.com/installer_download.php?url=BejeweledDeluxe.dmg";}
  else {document.location.href = regaff + "vendor=5327&ref=http://www.popcap.com/installer_download.php?url=WinBejeweled_setup.exe";}
}
function dlBigMoney() {
  if(browser_mac()) {document.location.href = regaff + "vendor=5327&ref=http://www.popcap.com/installer_download.php?url=BigMoneyDeluxe.dmg";}
  else {document.location.href = regaff + "vendor=5327&ref=http://www.popcap.com/installer_download.php?url=WinBMSetup.exe";}
}
function dlSevenSeas() {
  if(browser_mac()) {document.location.href = regaff + "vendor=5327&ref=http://www.popcap.com/installer_download.php?url=SevenSeasDeluxe.dmg";}
  else {document.location.href = regaff + "vendor=5327&ref=http://www.popcap.com/installer_download.php?url=WinSevenSeas_setup.exe";}
}

// Fly or Die
function buyGemJam() {
  window.open(regbuy + "item=7834-1&affiliate=19083&ss_coupon=SKUN-HE0T", 'Info', winfeat);
}
function dlGemJam() {
  if(browser_mac()) {macError();}
  else {document.location.href = regaff + "vendor=7834&ref=http://www.flyordie.com/pub/GemJamGoldInstall.exe";}
}

// Skunk Studios
function buyGutterball() {
  window.open(regbuy + "item=8314-1&affiliate=19083&ss_coupon=MBUN-SIQH", 'Info', winfeat);
}
function buyQBz() {
  window.open(regbuy + "item=8314-2&affiliate=19083&ss_coupon=MBUN-SIQH", 'Info', winfeat);
}
function buyWordUp() {
  window.open(regbuy + "item=8314-3&affiliate=19083&ss_coupon=MBUN-SIQH", 'Info', winfeat);
}
function buySpelvin() {
  if(browser_mac()) {window.open(regbuy + "item=8314-5&affiliate=19083&ss_coupon=MBUN-SIQH", 'Info', winfeat);}
  else {window.open(regbuy + "item=8314-4&affiliate=19083&ss_coupon=MBUN-SIQH", 'Info', winfeat);}
}
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 dlGutterball() {
  if(browser_mac()) {document.location.href = regaff + "vendor=8314&ref=http://www.skunkstudios.com/downloads/";}
  else {document.location.href = regaff + "vendor=8314&ref=http://www.skunkstudios.com/cgi-bin/Gutterball_RN.cgi?Win";}
}
function dlQBz() {
  if(browser_mac()) {document.location.href = regaff + "vendor=8314&ref=http://www.skunkstudios.com/downloads/";}
  else {document.location.href = regaff + "vendor=8314&ref=http://www.skunkstudios.com/cgi-bin/QBz_RN.cgi?Win";}
}
function dlWordUp() {
  if(browser_mac()) {document.location.href = regaff + "vendor=8314&ref=http://www.skunkstudios.com/downloads/";}
  else {document.location.href = regaff + "vendor=8314&ref=http://www.skunkstudios.com/cgi-bin/WordUp_RN.cgi?Win";}
}
function dlSpelvin() {
  if(browser_mac()) {document.location.href = regaff + "vendor=8314&ref=http://www.skunkstudios.com/downloads/";}
  else {document.location.href = regaff + "vendor=8314&ref=http://download.skunkstudios.com/installers/Spelvin_Setup.exe";}
}
function dlLoco() {
  if(browser_mac()) {document.location.href = "http://download.shockwave.com/pub/tamaleloco/Installtamaleloco.sit";}
  else {document.location.href ="http://download.shockwave.com/pub/tamaleloco/Installtamaleloco.exe";}
}
function webSpelvin() {
  window.open(regaff + "vendor=8314&ref=http://www.skunkstudios.com/spelvin/game/", 'WebGame', webfeat);
}

// Kraisoft
function buyAtomaders() {
  window.open(regbuy + "item=9041-1&affiliate=19083&ss_coupon=MAGI-KTSL", 'Info', winfeat);
}
function dlAtomaders() {
  if(browser_mac()) {macError();}
  else {document.location.href ="http://wadim.com/files/atomadersdemo.zip";}
}

// General

function moreInfo(mGame, mAff) {
 theURL = 'http://www.magicbunny.com/games/' + mGame + '/index.html';
 //window.open(regaff + "vendor=" + mAff + "&ref=" + theURL, 'Info', winfeat);
 document.location.href = regaff + "vendor=" + mAff + "&ref=" + theURL;
}

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

function openSSB(theURL) {
  features = 'status=no,scrollbars=no,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);
}
function openNews() {
  features = 'status=no,scrollbars=no,resizable=yes,width=450,height=300';
  window.open('get_newsletter.htm', '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; }
}