/**
 * =============================================================
 *  open_window.js
 * =============================================================
 *  @copyright	COPYRIGHT (C) 2009 MdN Corporation., ALL RIGHTS RESERVED.
 *  @version	$Id
 */

var windowList = new Array();


windowList.push({
	url : "/webcatalog/",
	window_name : "popup_window",
	options : {
		width : 980,
		height : 790,
		location : "yes",
		scrollbars : "yes",
		resizable : "yes",
		top : 100,
		left : 100
	}
});


windowList.push({
	url : "/sale_info.html",
	window_name : "popup_window",
	options : {
		width : 600,
		height : 600,
		location : "yes",
		scrollbars : "yes",
		resizable : "yes",
		top : 100,
		left : 100
	}
});

windowList.push({
	url : "/new/new_009.html",
	window_name : "popup_window",
	options : {
		width : 800,
		height : 560,
		location : "yes",
		scrollbars : "yes",
		resizable : "yes",
		top : 100,
		left : 100
	}
});
windowList.push({
	url : "/new/new_01.html",
	window_name : "popup_window",
	options : {
		width : 800,
		height : 493,
		location : "yes",
		scrollbars : "yes",
		resizable : "yes",
		top : 100,
		left : 100
	}
});
windowList.push({
	url : "/new/new_02.html",
	window_name : "popup_window",
	options : {
		width : 800,
		height : 493,
		location : "yes",
		scrollbars : "yes",
		resizable : "yes",
		top : 100,
		left : 100
	}
});
windowList.push({
	url : "/new/new_03.html",
	window_name : "popup_window",
	options : {
		width : 800,
		height : 493,
		location : "yes",
		scrollbars : "yes",
		resizable : "yes",
		top : 100,
		left : 100
	}
});
windowList.push({
	url : "/new/new_04.html",
	window_name : "popup_window",
	options : {
		width : 800,
		height : 493,
		location : "yes",
		scrollbars : "yes",
		resizable : "yes",
		top : 100,
		left : 100
	}
});
windowList.push({
	url : "/new/new_05.html",
	window_name : "popup_window",
	options : {
		width : 800,
		height : 493,
		location : "yes",
		scrollbars : "yes",
		resizable : "yes",
		top : 100,
		left : 100
	}
});
windowList.push({
	url : "/new/new_06.html",
	window_name : "popup_window",
	options : {
		width : 800,
		height : 493,
		location : "yes",
		scrollbars : "yes",
		resizable : "yes",
		top : 100,
		left : 100
	}
});
windowList.push({
	url : "/new/new_010.html",
	window_name : "popup_window",
	options : {
		width : 800,
		height : 505,
		location : "yes",
		scrollbars : "yes",
		resizable : "yes",
		top : 100,
		left : 100
	}
});

MyLib.event.observe(window, "load", openPopupWindow, false);

function openPopupWindow(){
	var list;
	var anchor;
	var anchors = document.getElementsByTagName("a");

	if(typeof(windowList) != "undefined"){
		for(var i=0; anchor=anchors[i]; i++){
			for(var j=0; list=windowList[j]; j++){
				if(anchor.href.match(new RegExp(list.url, "i"))){
					anchor.list = list;

					MyLib.event.observe(anchor, "click", function(event){
						var options = "";

						for(var index in this.list.options){
							options += index + "=" + this.list.options[index] + ",";
						}

						options = options.replace(/,$/, "");

						window.open(this.href, this.list.window_name, options).focus();

						MyLib.event.stop(event);
					}, false);

					break;
				}
			}
		}
	}
}

