function openwincms(str) {
	var flg = 0;
	if (typeof(nwincms) == "undefined") { flg=1; }
	else if (nwincms.closed) { flg=1; }

	if (flg==1){
		nwincms = window.open(str, "_blank", 'scrollbars=no,resizable=no,status=no,location=no,scrolling=no,status=no');
	}
	nwincms.focus();
}

function openwin(str) {
	nwin = window.open(str, 'brand', 'width=708,height=496,scrollbars=no,resizable=no,status=no,location=no,scrolling=no,status=no');
	nwin.focus();
}

function openwin2(str) {
	nwin = window.open(str,'arigatou','width=297,height=373,scrollbars=no,resizable=no,status=no,location=no,scrolling=no,status=no');
	nwin.focus();
}

function openwin22(str) {
	nwin = window.open(str,'arigatou','width=276,height=373,scrollbars=no,resizable=no,status=no,location=no,scrolling=no,status=no');
	nwin.focus();
}
function openwin222(str) {
	nwin = window.open(str, 'brand', 'width=580,height=880,scrollbars=yes,resizable=no,status=no,location=no,scrolling=no,status=no');
	nwin.focus();
}
function openwinFree(str,width) {
	nwin = window.open(str, 'brand', 'width=' + width + ',height=880,scrollbars=yes,resizable=no,status=no,location=no,scrolling=no,status=no');
	nwin.focus();
}


function openwinFreee(str,width,height) {
	nwin = window.open(str, 'brand', 'width=' + width + ',height=' + height +',scrollbars=yes,resizable=no,status=no,location=no,scrolling=no,status=no');
	nwin.focus();
}


function openwin_shoplist(str) {
    var Mywin=window.open('','arigatou','width=630,height=450,left=100,top=100,scrollbars=no');
    Mywin.document.open();
    Mywin.document.write("<html><body style='margin:0px;padding:0px;'>");
    Mywin.document.write("<img src='" + str + "' border=0>");
    Mywin.document.write('</body></html>');
    Mywin.focus();
}


function openwin3(str) {
    var Mywin=window.open('','arigatou','width=600,height=393,left=100,top=100,scrollbars=no');
    Mywin.document.open();
    Mywin.document.write("<html><body style='margin:0px;padding:0px;'>");
    Mywin.document.write("<img src='" + str + "' border=0>");
    Mywin.document.write('</body></html>');
    Mywin.focus();
}

function openwin_detile(str) {
	newPic = new Image();
	newPic.src = str;
	var w = newPic.width;
	var h = newPic.height;
	var Size = "width="+w+",height="+h+",scrollbars=no,resizable=no,status=no,location=no,scrolling=no,status=no"
	nwin = window.open(str,'detile',Size);
  nwin.document.write("<html><body style='margin:0px;padding:0px;'>");
  nwin.document.write("<img src='" + str + "' border=0>");
  nwin.document.write('</body></html>');
	nwin.focus();
}


function openwin_top2(str) {
	nwin = window.open('index.html','','width=1000,height=700,scrollbars=no,resizable=no,status=no,location=no,scrolling=no');
	nwin.focus();
}

function img_restore(str){
	newPic = new Image();
	newPic.src = str;
}

function BackTo(url){ 
	window.opener.location.href = url;
	window.blur() 
} 

// 問合せ機能フォームチェック
function check(){ 

var flag = 0; 

if(document.Form.name.value == ""){
flag = 1; 
} 
else if(document.Form.name2.value == ""){
flag = 1; 
} 
else if(document.Form.mail.value == ""){
flag = 1; 
} 
else if(document.Form.subject.value == ""){
flag = 1; 
} 
else if(document.Form.body.value == ""){
flag = 1; 
} 
else if(!document.Form.mail.value.match(/[!#-9A-~]+@+[a-z0-9]+.+[^.]$/i)){
flag = 1; 
}

if(flag){ 
window.alert('未入力の項目があるか、メールアドレスが不正です。');
return false;
} 
else{ 
return true;
} 

} 

function check_en(){ 

var flag = 0; 

if(document.Form.name.value == ""){
flag = 1; 
} 
else if(document.Form.name2.value == ""){
flag = 1; 
} 
else if(document.Form.mail.value == ""){
flag = 1; 
} 
else if(document.Form.subject.value == ""){
flag = 1; 
} 
else if(document.Form.body.value == ""){
flag = 1; 
} 
else if(!document.Form.mail.value.match(/[!#-9A-~]+@+[a-z0-9]+.+[^.]$/i)){
flag = 1; 
}

if(flag){ 
window.alert('There are empty fieds or the e-mail adress you input is invalid');
return false;
} 
else{ 
return true;
} 

} 


function Confirm_Logout(){
	if(window.confirm('ログアウトしてもよろしいですか？')){
		location.href = "logout.aspx";
	}else{
		//location.href = "logout.aspx";
	}
}
function popup_goods(url) {
	var WinName = "popup_goods";
	var WinOpt = "width=450,height=500,scrollbars=no,resizable=no,status=no,location=no,scrolling=no";
	var newWin = window.open(url,WinName,WinOpt);
	newWin.focus();
}
