﻿
var siteURL = "http://www.josungmo.jp/" ;   
function videoMessagePop()
{
    var strUrl = siteURL + "jsm/videomessage.html";
    var nWidth = 550;
    var nHeight = 410;
    f_openWinNoResizeNoScroll(strUrl, nWidth, nHeight,"videoMessage");
}
function f_openVod(vodURL)
{
    var strUrl = siteURL + "vod.asp?url=" + vodURL ;
    var nWidth = 820  ;
    var nHeight = 680;
    f_openWinNoResize(strUrl, nWidth, nHeight,"vod");
}


function f_flashCmd_01()
{
    var strUrl = siteURL + "Member/kaiin01.asp" ;
    var nWidth = 820  ;
    var nHeight = 680;
    f_openWinNoResize(strUrl, nWidth, nHeight,"cmd01");
}

function f_flashCmd_02()
{
    var strUrl = siteURL + "Notice/list.asp" ;
    var nWidth = 820  ;
    var nHeight = 680;
    f_openWinNoResize(strUrl, nWidth, nHeight,"cmd02");
}

function f_flashCmd_03()
{
    var strUrl = siteURL + "HTML/goods.html" ;
    var nWidth = 820  ;
    var nHeight = 680;
    f_openWinNoResize(strUrl, nWidth, nHeight,"cmd03");
}

function f_flashCmd_04()
{
    var strUrl = siteURL + "HTML/pol.html" ;
    var nWidth = 820  ;
    var nHeight = 680;
    f_openWinNoResize(strUrl, nWidth, nHeight,"cmd04");
}

function f_flashCmd_05()
{
    var strUrl = siteURL + "main.asp" ;
    top.location.href = strUrl ;
}

function f_flashCmd_06()
{
    var strUrl = siteURL + "Support/memo.asp" ;
    var nWidth = 820  ;
    var nHeight = 680;
    f_openWinNoResize(strUrl, nWidth, nHeight,"cmd06");
}

function f_flashCmd_07()
{
    var strUrl = siteURL + "Support/question.asp" ;
    var nWidth = 820  ;
    var nHeight = 680;
    f_openWinNoResize(strUrl, nWidth, nHeight,"cmd07");
}

function f_openWinNoResize(strUrl, nWidth, nHeight, name) {
	return f_OpenWinBaseFunc(strUrl, nWidth, nHeight, true, "resizable=no,scrollbars=yes", name);
}

function f_openWinNoResizeNoScroll(strUrl, nWidth, nHeight, name) {
	return f_OpenWinBaseFunc(strUrl, nWidth, nHeight, true, "resizable=no,scrollbars=no", name);
}

// Function WindowOpen
function f_OpenWinBaseFunc(url, w, h, bCenter, paraOption, name) 
{
	var strOpt, ret;
	strOpt = "width="+w+",height="+h;
	
	if ( name != "" )
		name = name + new Date().getYear() ;
	else
		name = ""
		
	if ( bCenter )
		strOpt += ",top="+((screen.height-h)/2)+",left="+((screen.width-w)/2);
	if ( paraOption )
	{
		strOpt += ","+paraOption;
	 	//popWinName[name] = ret =  window.top.open(url,name,strOpt);
	 	ret =  window.open(url,name,strOpt);
    }
    
	if ( name )
		ret.focus();
	
	return ret;
}

function goSignUp()
{
    location.href("/Member/Join.asp");
}

function checkEmail(emailStr) {
	var emailPat   = /^(.+)@(.+)$/;
	var userPat    = /^[a-zA-Z0-9\._-]+$/;
	var domainPat  = /^[a-zA-Z0-9\.-]+$/;
	var invalid0   = /^(.+)\.(.+)\.(.+)$/;
	var invalid1   = /^\.(.+)/;
	var invalid2   = /(.+)\.$/;
	var invalid3   = /\.\./;
	var eMailArray = emailStr.match(emailPat);
	if (eMailArray == null) return false;
	var user = eMailArray[1];
	var dom = eMailArray[2];
	if (user.match(userPat) == null 
		//|| user.match(invalid0) != null
		|| user.length < 2 
		|| user.match(invalid1) != null 
		|| user.match(invalid2) != null 
		|| user.match(invalid3) != null) 
	{ return false; }
    
	if (dom.match(domainPat) == null 
		|| dom.indexOf('.') == -1
		|| dom.length < 4
		|| dom.match(invalid1) != null
		|| dom.match(invalid2) != null
		|| dom.match(invalid3) != null) 
	{ return false; }
	return true;
}

function checkNum34(str)
{
  var reg = /^[0-9]{3,4}$/ ;   
  return reg.test(str);    
}	   
 function checkNum24(str)
{
  var reg = /^[0-9]{2,4}$/ ;   
  return reg.test(str);    
}	   
function checkEngNum(str)
{
	var alpha = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
	var numeric = '1234567890';
	var nonKorean = alpha + numeric; 
	
	var i ; 
	for ( i=0; i < str.length; i++ )  {
		if( nonKorean.indexOf(str.substring(i,i+1)) < 0) {
			break ; 
		}
	}

	if ( i != str.length ) {
		return false ; 
	}
	else{
		return true ;
	} 

	return true;
}

function isNumber(str, allowable) {

	valid = true;
	cmp = "0123456789" + allowable;

	for (i=0; i<str.length; i++) {
		if (cmp.indexOf(str.charAt(i)) < 0) {
			valid = false;
			break;
		}
	}

	return valid;

}

function f_strByteLen(str) {
	var count = 0;
	for (var i=0; i<str.length; i++) {
		var c = str.charCodeAt(i);
		if ((c > 0 && c <= 0x007E) || (c >= 0xFF61 && c <= 0xFF9F)) count++;
		else count=count+2
	}
	return count;
}

function f_checkHiraKana(str) {
	for (var i=0; i<str.length; i++) {
		var c = str.charCodeAt(i);
		if ((c < 0x3041) || (c > 0x3093)) return false;
	}
	return true;
}

function f_checkFullKataKana(str) {
	for (var i=0; i<str.length; i++) {
		var c = str.charCodeAt(i);
		if ((c < 0x30A1) || (c > 0x30F6)) return false;
	}
	return true;
}

function f_checkHalfKataKana(str) {
	for (var i=0; i<str.length; i++) {
		var c = str.charCodeAt(i);
		if ((c < 0xFF65) || (c > 0xFF9F)) return false;
	}
	return true;
}

function f_checkHanJa(str) {
	for (var i=0; i<str.length; i++) {
		var c = str.charCodeAt(i);
		if ((c < 0x4E9C) || (c > 0x9ED1)) return false;
	}
	return true;
}

function f_checkFullSpace(str) {
	for (var i=0; i<str.length; i++) {
		var c = str.charCodeAt(i);
		if (c == 0x3000) return true;
	}
	return false;
}

function f_getBlankStr(val) {
	var blankStr = "";
	for (var i=0;i<val;i++) blankStr = blankStr + " ";
	return blankStr;
}


// FLASH
function Site_Flash(Url, wd, ht, swfId, wm) {
	var TxtSwf = "" ;
	TxtSwf += "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,29,0' width='"+ wd +"' height='"+ ht +"' id='"+ swfId +"'>" ;
	TxtSwf += "<param name='movie' value='"+ Url +"'>" ;
	TxtSwf += "<param name='wmode' value='"+ wm +"'>" ;
	TxtSwf += "<param name='allowScriptAccess' value='always'>" ;
	TxtSwf += "<param name='allowFullScreen' value='true'>" ;
	TxtSwf += "<param name='quality' value='high'>" ;
	TxtSwf += "<embed src='"+ Url +"' width='"+ wd +"' height='"+ ht +"' wmode='"+ wm +"' id='"+ swfId +"' allowScriptAccess='always' allowFullScreen='true' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash'></embed>" ;
	TxtSwf += "</object>" ;

	document.write (TxtSwf);
}


function closeWin()
{
    window.close();
}