﻿//Flash File
function flash_file(num){
    var flash = new Object();
    switch(num){
         case "MainTop" :
     flash.path = _IMG_URL + "/images/_flash/main_flash/main_top.swf"; // Main Top Flash
            flash.width = 984;
            flash.height =327;
            break;
   case "MainEvent" :
            flash.path = _IMG_URL + "/images/_flash/flash_banner/main_event.swf"; // Main Event Flash
            flash.width     = 253;
            flash.height    = 173;
            break;  
   case "SubTop" :
            flash.path = _IMG_URL + "/images/_flash/sub_flash/sub_top.swf"; // Sub Top Flash
            flash.width     = 984;
            flash.height    = 286;
            flash.param     = new Array("PageNum");      // Parameter Name
            break;
   case "RightQuick" :
            flash.path = _IMG_URL + "/images/_flash/etc_flash/quicklink.swf"; // Right Quick Flash
            flash.width     = 120;
            flash.height    = 217;
            break;  
   case "ItemShop" :
            flash.path = _IMG_URL + "/images/_flash/etc_flash/080711_ItemShop.swf"; // ItemShop Flash
            flash.width     = 383;
            flash.height    = 116;
            break;       
   case "eventbanner" :
            flash.path = _IMG_URL + "/images/_flash/etc_flash/080711_banner.swf"; // eventbanner Flash
            flash.width     = 234;
            flash.height    = 245;
            break; 
   case "action" :
            flash.path = _IMG_URL + "/images/_flash/etc_flash/action.swf"; // action Flash
            flash.width     = 250;
            flash.height    = 164;
            break;
         case "Character1" :
            flash.path = _IMG_URL + "/images/_flash/character_flash/01_knight_movie.swf"; // Character Flash
            flash.width     = 323;
            flash.height    = 207;
            break; 
   case "Character2" :
            flash.path = _IMG_URL + "/images/_flash/character_flash/02_hunter_movie.swf"; // Character Flash
            flash.width     = 323;
            flash.height    = 207;
            break; 
   case "Character3" :
            flash.path = _IMG_URL + "/images/_flash/character_flash/03_magician_movie.swf"; // Character Flash
            flash.width     = 323;
            flash.height    = 207;
            break; 
   case "Character4" :
            flash.path = _IMG_URL + "/images/_flash/character_flash/04_summoner_movie.swf"; // Character Flash
            flash.width     = 323;
            flash.height    = 207;
            break;
   case "Character5" :
            flash.path = _IMG_URL + "/images/_flash/character_flash/05_segnale_movie.swf"; // Character Flash
            flash.width     = 323;
            flash.height    = 207;
            break;
   case "Character6" :
            flash.path = _IMG_URL + "/images/_flash/character_flash/06_bagi_movie.swf"; // Character Flash
            flash.width     = 323;
            flash.height    = 207;
            break;
   case "Character7" :
            flash.path = _IMG_URL + "/images/_flash/character_flash/07_aloken_movie.swf"; // Character Flash
            flash.width     = 323;
            flash.height    = 207;
            break;
   case "RightBanner" :
            flash.path = _IMG_URL + "/images/_flash/etc_flash/20090105_metalcbopen.swf"; // Right Banner Flash
            flash.width     = 114;
            flash.height    = 164;
            break;       
            
  
 }
    return flash;
}

//Flash Call
function flash_object(num, p, logchk){

    try{
        var flash = flash_file(num);

		var id = "";
		id = 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, p, id);

    }catch(e)
    {}
}

function flash_load(fsrc, w, h, p,id){
    var v = '<object id="'+id+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,12,36" width="' + w + '" height="' +  h + '">'
          + '<param name="movie" value="' + fsrc + '">'
          + '<param name="menu" value="false">'
          + '<param name="quality" value="high">'
          + '<param name="flashvars" value="PageNum='+p+'">'
          + '<param name="wmode" value="transparent">'
          + '<param name="allowScriptAccess"  value="always" />'
          + '<embed name="'+id+'" src="' + fsrc + '" quality="high" menu="false" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" allowScriptAccess="always"'
          + ' width="' + w + '" height="' + h + '" wmode="transparent" flashvars="PageNum='+p+'"></embed>'
          + '</object>';
    document.write(v);
}