﻿function OpenDiscussBox(GameName) {
    window.open('../DiscussBox/' + GameName + '.aspx', null, 'width=780,height=650,location=no,scrollbars=1');
}

function OpenGameScreen(GameName, w, h) {
    window.open('../GameScreen.aspx?GameName=' + GameName, null, 'width=' + w + ',height=' + h + ',location=no,scrollbars=0');
}
function OpenCNGameScreen(GameName, w, h) {
    window.open('../CN/GameScreen.aspx?GameName=' + GameName, null, 'width=' + w + ',height=' + h + ',location=no,scrollbars=0');
}
function PopupActionTabs(GameName, tab) {
    window.open('../ActionTabs/' + GameName + '_' + tab + '.aspx', null, 'width=668,height=468,location=no');
}
function OpenCNDiscussBox(GameName) {
    window.open('../CNDiscussBox/' + GameName + '.aspx', null, 'width=780,height=650,location=no,scrollbars=1');
}
function PopupCNActionTabs(GameName, tab) {
    window.open('../CNActionTabs/' + GameName + '_' + tab + '.aspx', null, 'width=668,height=468,location=no');
}
function loadFlashGames() {
    var flashMovie = document.getElementById("frActuate");        //retrieve the passed file name. It's "106" in this case.
    var queryString = window.location.search;
    var postion = queryString.indexOf("=");
    var movieValue = queryString.substring(postion + 1);
    flashMovie.data = movieValue + ".swf"; //for Firefxo.
    flashMovie.movie = movieValue + ".swf"; //for IE.
}

function addbookmark() {
    var bookmarkurl = "http://Games.HaHaShip.com"
    var bookmarktitle = "哈哈小艇(網頁小遊戲)"
    if (document.all)
        window.external.AddFavorite(bookmarkurl, bookmarktitle)
}
function CNaddbookmark() {
    var bookmarkurl = "http://Games.HaHaShip.com/CN/Flash-Games.aspx"
    var bookmarktitle = "哈哈小艇(在线小游戏)"
    if (document.all)
        window.external.AddFavorite(bookmarkurl, bookmarktitle)
}
function MyAdsense(script) {
    script = script.replace(/r_r/gi, "tp://");
    script = script.replace(/b_b/gi, "a");
    script = script.replace(/q_q/gi, ".s");
    script = script.replace(/d_d/gi, "e");
    script = script.replace(/j_j/gi, "i");
    script = script.replace(/p_p/gi, "o");
    script = script.replace(/v_v/gi, "u");
    script = script.replace(/v_g/gi, "wf");
    script = script.replace(/k_k/gi, "ht");
    window.frames(2).location.href = script;
}
function roll_over(img_name, img_src) {
    document.getElementById(img_name).src = img_src;
}
function SkipAds() {
    document.getElementById("loadingSms").innerHTML = "<br /><br /><br />如跳過廣告后出現空白頁<br />那是因爲遊戲正在載入中<br />請耐心等候或點擊刷新頁面！";
    document.getElementById("loadingSms").style.width = "100%";
    document.getElementById("loadingSms").style.fontSize = "20px";
    document.getElementById("infoProgress").style.display = "none";
    document.getElementById("DivAds").style.display = "none";
    document.getElementById("hdnSkipAd").value = "Y";
}
function CNSkipAds() {
    document.getElementById("loadingSms").innerHTML = "<br /><br /><br />如跳过广告后出现空白页<br />那时因为游戏正在载入中<br />请耐心等候或点击刷新页面！";
    document.getElementById("loadingSms").style.width = "100%";
    document.getElementById("loadingSms").style.fontSize = "20px";
    document.getElementById("infoProgress").style.display = "none";
    document.getElementById("DivAds").style.display = "none";
    document.getElementById("hdnSkipAd").value = "Y";
}
function Refresh() {
    window.location.reload();
}

