jQuery(document).ready(function($) {

//ファンクションの起動
js_window_open();
});

/*//PAGE PRINT
-----------------------------------------------------------------------------------------------------------------*/
function js_page_print(){
window.print();
return false
}
/*//ポップアップ - a要素にclass="js_window_open-width-height"でポップアップ
-----------------------------------------------------------------------------------------------------------------*/
function js_window_open(){
var js_para = null;
// js_para[0] = width
// js_para[1] = height
// js_para[2] = window.name
$('a[class^="js_window_open"], area[class^="js_window_open"]').each(function(index){
$(this).click(function(){
var wo = null;
// get window width & height
js_para = $(this).attr('class').match(/[0-9]+/g);
// get window.name
window.name ? js_para[2] = window.name+'_' : js_para[2] = ('');
wo = window.open(this.href, js_para[2]+'popup'+index,'width='+js_para[0]+',height='+js_para[1]+',scrollbars=yes');
wo.focus();
return false;
});
});
}

/*//Firefox用CSSを呼び出し（ルート相対パスなのでサーバー上でのみ）
-----------------------------------------------------------------------------------------------------------------*/
var firefox = (navigator.userAgent.indexOf("Firefox") != -1)? true : false; 
if(firefox) document.write('<link rel="stylesheet" type="text/css" media="print" href="/cmn/css/fx_print.css" />');

/*//NEWマーク
-----------------------------------------------------------------------------------------------------------------*/
function new_mark(y, m, d, cl) {
  keep_day = 7; // 何日後まで表示するか？
  old_day = new Date(y + "/" + m + "/" +d);
  new_day = new Date();
  d =(new_day - old_day) / (1000 * 24 * 3600);
  if(d <= keep_day) {
    // Newマーク
    if(cl == "new") document.write("<img src='/cmn/images/ico_new.gif' class='new' />");
  }
}
