﻿//Flash File
function flash_file(num){
    var flash = new Object();
    switch(num){
   case "MainBanner" :
       flash.path = "_flash/header_flash.swf";
            flash.width = 960;
            flash.height =165;
            break;
   case "GameMenu" :
       flash.path = "_flash/Abgame.swf";
            flash.width     = 960;
            flash.height    = 69;
            break;
   case "Swords" :
       flash.path = "_flash/game_swords.swf";
            flash.width     = 570;
            flash.height    = 499;
            break;  
   case "fruits" :
       flash.path = "_flash/game_fruits.swf";
            flash.width     = 570;
            flash.height    = 499;
            break;
   case "7pk" :
       flash.path = "_flash/game_7pk.swf";
            flash.width     = 570;
            flash.height    = 499;
            break;
   case "athena" :
       flash.path = "_flash/game_athena.swf";
            flash.width     = 570;
            flash.height    = 499;
            break;
   case "13" :
       flash.path = "_flash/game_13.swf";
            flash.width     = 570;
            flash.height    = 457;
            break;
   case "bar" :
       flash.path = "_flash/game_bar.swf";
            flash.width     = 570;
            flash.height    = 499;
            break;
   case "train" :
       flash.path = "_flash/game_train.swf";
            flash.width     = 570;
            flash.height    = 499;
            break;
   case "hr" :
       flash.path = "_flash/game_hr.swf";
            flash.width     = 570;
            flash.height    = 427;
            break;
   case "mj" :
       flash.path = "_flash/game_mj.swf";
            flash.width     = 570;
            flash.height    = 530;
            break;
   case "goku" :
       flash.path = "_flash/game_goku.swf";
            flash.width     = 570;
            flash.height    = 499;
            break;
   case "planet" :
       flash.path = "_flash/game_planet.swf";
            flash.width     = 570;
            flash.height    = 427;
            break;
   case "star" :
       flash.path = "_flash/game_star.swf";
            flash.width     = 570;
            flash.height    = 499;
            break;
   case "pachinko" :
       flash.path = "_flash/game_pachinko.swf";
            flash.width     = 570;
            flash.height    = 530;
            break;
   case "marble" :
       flash.path = "_flash/game_marble.swf";
            flash.width     = 570;
            flash.height    = 499;
            break; 
    case "baccarat":
            flash.path = "_flash/game_baccarat.swf";
            flash.width = 570;
            flash.height =457;
            break;         
   }
    return flash;
}

//Flash Call
function flash_object(num, p, logchk){

    try{
        var flash = flash_file(num);
        
        if(flash.param != undefined && p != undefined){
            if(p.indexOf(",") > 0){
                var param = p.split(",");
            }
            else{
                var param = new Array(p);
            }
       
            for(var i = 0; flash.param.length > i; i++){
                flash.path += i==0 ? "?" : "&";
                flash.path += flash.param[i]+"="+param[i];
            }
        }        

        var fpath = flash.path.toString();
        if(logchk == "true")
        {
             flash.path += ((fpath.indexOf("?") > 0) ? "&" : "?") + "logchk=1";
        }else
        {
             flash.path += ((fpath.indexOf("?") > 0) ? "&" : "?") + "logchk=0";
        }
        
        flash_load(flash.path, flash.width, flash.height);

    }catch(e)
    {}
}

function flash_load(fsrc, w, h){
    var v = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="' + w + '" height="' +  h + '">'
          + '<param name="movie" value="' + fsrc + '">'
          + '<param name="menu" value="false">'
          + '<param name="quality" value="high">'
          + '<param name="wmode" value="transparent">'
          + '<param name="allowScriptAccess"  value="always" />'
          + '<embed src="' + fsrc + '" quality="high" menu="false" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"'
          + ' width="' + w + '" height="' + h + '" wmode="transparent"></embed>'
          + '</object>';
    document.write(v);
}
