/*
 *	フローティングウィンドウに関連した処理を行います。
 */
var win;
var getScriptPath = function(){
  var f=function(e){
    var name=e.tagName;
    if(!!name && name.toUpperCase()=='SCRIPT') return e;
    var c=e.lastChild;
    return (!!c)?f(c):null;
  };
  var es=f(document);
  if(!es) return window.location;
  return es.getAttribute('src') || window.location;
};
var path = getScriptPath().replace(/floating_window.js/,"");

document.write("<link href=\"" + path + "themes/default.css\" rel=\"stylesheet\" type=\"text/css\"></link>");
document.write("<link href=\"" + path + "themes/alphacube.css\" rel=\"stylesheet\" type=\"text/css\"></link>");
document.write("<script type=\"text/javascript\" src=\"" + path + "js/prototype.js\"></script>");
document.write("<script type=\"text/javascript\" src=\"" + path + "js/window.js\"></script>");

function showWindow(title, maker_cd, x, y){
  createWindow("win01", title, "alphacube", x, y, 320, 240, maker_cd);
}

function createWindow(winID, wTitle, themes, x, y, w, h, maker_cd){
  win = new Window(winID, {
                                title: wTitle, 
                                className: themes,
                                top:y, 
                                left:x, 
                                width:w, 
                                height:h, 
                                zIndex: 0,
                                resizable: true, 
                                draggable:true,
                                closable:true,
                                minimizable:false,
                                maximizable:false,
																opacity:0.7
                               }
                        );
  //win.setDestroyOnClose();
  //win.setHTMLContent(contents);
	win.setURL("../event_win.php?maker_cd=" + maker_cd);
  win.show();
  
  return win;
}
