// SUBWINDOW +++++++++++++++++++++++++++++++++++++++++++++//
var _sub = new Object();
_sub.data = new Array();
_sub.data_idx = new Number();
_sub.img_idx = new Number();
function popup(data_idx,img_idx) {
	_sub.data_idx = data_idx;
	_sub.img_idx = img_idx;
	_sub.title = _sub.data[_sub.data_idx].title;
	if(isCookieAvarable()) {
		deleteCookie("idx");
	}
	_sub.win =window.open("","mazdaproductinfo","width=650,height=600,status=yes,scrollbars=yes,directories=no,menubar=yes,resizable=yes,toolbar=no");
	_sub.win.focus();
	write_popup();
}
function write_popup() {
	var html = '';
	html += '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">' + "\r\n";
	html += '<html>' + "\r\n";
	html += '<head>' + "\r\n";
	html += '<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">' + "\r\n";
	html += '<title>MAZDA:' + _sub.data[_sub.data_idx].title +' | Product Information</title>' + "\r\n";
	html += '<meta http-equiv="Content-Style-Type" content="text/css">' + "\r\n";
	html += '<meta http-equiv="Content-Script-Type" content="text/javascript">' + "\r\n";
	html += '<link rel="stylesheet" type="text/css" href="/common/css/default.css" media="screen,print" charset="utf-8">' + "\r\n";
	html += '<link rel="stylesheet" type="text/css" href="/publicity/resource/css/subwin.css" media="screen,print">' + "\r\n";
	html += '<link rel="stylesheet" type="text/css" href="/profile/resource/css/detail.css" media="screen,print">' + "\r\n";
	html += '<link rel="stylesheet" type="text/css" href="/common/css/font_s.css">' + "\r\n";
	
	html += '<script type="text/javascript" src="/common/js/default.js" charset="utf-8"></script>' + '\r\n';
	html += '<script type="text/javascript" src="/profile/resource/js/cookie.js" charset="utf-8"></script>' + '\r\n';
	html += '<script type="text/javascript" src="/profile/resource/js/function.js" charset="utf-8"></script>' + '\r\n';
	
	html += '<script type="text/javascript">' + '\r\n';
	html += '<!--' + '\r\n';
	html += 'var data = new Object();' + '\r\n';
	html += 'data.idx = ' + _sub.img_idx + ';' + '\r\n';
	html += 'data.img = new Array();' + '\r\n';
	for(var i = 0; i < _sub.data[_sub.data_idx].img.length; i ++) {
		html += 'data.img[' + i + '] = "' + _sub.data[_sub.data_idx].img[i] + '";' + '\r\n';
	}
	html += '//-->' + '\r\n';
	html += '</script>' + '\r\n';
	
	html += '</head>' + "\r\n";
	html += '<!--| body |-->' + "\r\n";
	html += '<body onload="function_initialize()">' + "\r\n";
	html += '<p style="background:#f2f2f2;height:0;"><a href="#thetext"><img src="/common/img/prt_clear.gif" alt="Skip to main content" width="0" height="0" border="0"></a></p>' + "\r\n";
	html += '<!--|| container ||-->' + "\r\n";
	html += '<!--||| header |||-->' + "\r\n";
	html += '<noscript>' + "\r\n";
	html += '<p>This page uses JavaScript.</p>' + "\r\n";
	html += '</noscript>' + "\r\n";
	html += '<div id="header">' + "\r\n";
	html += '<p><img src="/publicity/resource/img/prt_logo.gif" width="70" height="57" alt="" /></p>' + "\r\n";
	html += '<br class="clear">' + "\r\n";
	html += '</div>' + "\r\n";
	html += '<!--||| /header |||-->' + "\r\n";
	html += '<!--||| contents |||-->' + "\r\n";
	html += '<div id="contents">' + "\r\n";
	html += '<a name="thetext"></a>' + "\r\n";
	html += '<div id="mainarea">' + "\r\n";
	html += '<h1><img src="' + _sub.data[_sub.data_idx].ttl_img + '" height="20" alt="' + _sub.data[_sub.data_idx].ttl_alt + '"></h1>' + "\r\n";
	html += '<div class="pro_enlarge">' + "\r\n";
	html += '<div class="pic"><img src="/common/img/null.gif" alt="" name="img" id="img"></div>' + "\r\n";
	html += '<div class="paging">' + "\r\n";	
	if(_sub.data[_sub.data_idx].img.length > 1) {
		html += '<p class="prev"><a href="javascript:prev();"><img src="/resource/img/btn_prev_01.gif" width="50" height="17" alt="Back"></a></p>' + "\r\n";
		html += '<p class="next"><a href="javascript:next();"><img src="/resource/img/btn_next_01.gif" width="48" height="17" alt="Next"></a></p>' + "\r\n";
	}
	html += '<br class="clear">' + "\r\n";
	html += '</div>' + "\r\n";
	html += '<p>' + _sub.data[_sub.data_idx].caption + '</p>' + "\r\n";
	html += '</div>' + "\r\n";
	html += '</div>' + "\r\n";
	html += '<div class="close"><a href="javascript:window.close();"><img src="/common/img/btn_close.gif" width="49" height="11" alt="close" /></a></div>' + "\r\n";
	html += '</div>' + "\r\n";
	html += '<!--||| /contents |||-->' + "\r\n";
	html += '<!--||| footer |||-->' + "\r\n";
	html += '<div id="footer">' + "\r\n";
	html += '<div class="footer_belt">' + "\r\n";
	html += '<p class="copyright">&copy;Copyright Mazda Motor Corporation. All rights reserved.</p>' + "\r\n";
	html += '<br class="clear">' + "\r\n";
	html += '</div>' + "\r\n";
	html += '</div>' + "\r\n";
	html += '<!--||| /footer |||-->' + "\r\n";
	html += '<!--|| /container ||-->' + "\r\n";
	html += '<!-- Insert This Access Tags -->' + "\r\n";
	html += '</body>' + "\r\n";
	html += '<!--| /body |-->' + "\r\n";
	html += '</html>' + "\r\n";
	
	if(_sub.win.document) {
		_sub.win.document.open();
		_sub.win.document.write(html);
		_sub.win.document.close();
	}
}