
/*   JWord popup ad js  (encoding:  Shift_JIS)     */
/*        copyright (C) 2002 AccessPort Inc.       */


	function errexit() { return true; }
	window.onerror = errexit;


	function jwdpopWriteIframe(ptnr, agnt, type, byps, code, chkp, wsze, wopt, wpos, intvchk, intv, intkey, iact)
	{
		if (chkp == '')
		{
			chkp = ptnr;
		}

		document.write('<iframe src="http://download.jword.jp/soft/' + chkp + '/chk_ppp.htm?partner=' + ptnr + '&agent=' + agnt + '&ppptype=' + type + '&bypass=' + byps + '&logcode=' + code + '&wsze=' + wsze + '&wopt=' + wopt + '&wpos=' + wpos + '&intvchk=' + intvchk + '&intv=' + intv + '&intkey=' + intkey + '&iactppptype=' + iact + '" id="jwdpopchk" name="jwdpopchk" width="25" height="25" border="0" frameborder="0" marginheight="0" marginwidth="0" style="position:absolute;top:-30px;left:-30px;width:30px;height:30px"><\/iframe>');
	}

	function jwdpopGetNameVal( adtype, code, chk )
	{
		var nameVal;
		nameVal = "ppp:" + adtype + ":" + code + ":" + chk;
		return nameVal;
	}
	
	function jwdpopKKSIFrameUrl( ptnr, adtype, code, chk )
	{
		var nameVal;
		nameVal = jwdpopGetNameVal( adtype, code, chk );
		document.write('<iframe src="http://download.jword.jp/pub/kks/jwd_ad_kks.htm?type=kks&partner=' + ptnr + '&name=' + nameVal + '" id="jwdpopkks" name="jwdpopkks" width="1" height="1" border="0" frameborder="0" marginheight="0" marginwidth="0"><\/iframe>');
	}
	
	function jwdpopKKSImgUrl( ptnr, adtype, code, chk )
	{
		var nameVal;
		nameVal = jwdpopGetNameVal( adtype, code, chk );
		document.write('<img src="http://download.jword.jp/pub/kks/jwd_ad_kks.htm?type=kks&partner=' + ptnr + '&name=' + nameVal + '" id="jwdpopkks" name="jwdpopkks" width="1" height="1" border="0" >');
	}
	
	function jwdpopinstCheckJWD()
	{
		document.write('<script type="text/vbscript" language="VBScript">\n');
		document.write('function CHECK_INSTALL() \n');
		document.write('on error resume next \n');
		document.write('Set cns=CreateObject("CnsHelper.CH")\n');
		document.write('if IsObject(cns) then \n');
		document.write('chk_cnsmin = 1 \n');
		document.write('end if \n');
		document.write('Set jwd2=CreateObject("JWord.Update")\n');
		document.write('if IsObject(jwd2) then \n');
		document.write('chk_Jwd2 = 1 \n');
		document.write('end if \n');
		document.write('end function \n');
		document.write('</script>\n');
		
		CHECK_INSTALL();
	}
	
	/*  ----  default values  ----  */
	var jwdpop_actptnr = 'AP';		// 01 partner 
	var jwdpop_actagnt = '';		// 02 agent 
	var jwdpop_acttype = '001';		// 03 ppptype 
	var jwdpop_actbyps = '0';		// 04 bypass 
	var jwdpop_actcode = 'pppad';		// 05 logcode 
	var jwdpop_actchkp = '';		// 06 chkpartner / parent partner 
	var jwdpop_actwsze = '';		// 07 window size 
	var jwdpop_actwopt = '';		// 08 window option 
	var jwdpop_actwpos = '';		// 09 window position 
	var jwdpop_actichk = '';		// 10 cookie check flag 
	var jwdpop_actintv = '';		// 11 intv for cookie check 
	var jwdpop_actintk = '';		// 12 intkey for cookie check 
	var jwdpop_actiact = '';		// 13 iactppptype - to open after installation 
		
	var chk_cnsmin = 0;
	var chk_Jwd2 = 0;


	/*  ----  setting the actual values  ----  */
	if (jwdpop_setting[0]  == '1')
	{
		if (jwdpop_setting[1])
		{
			jwdpop_actptnr = jwdpop_setting[1];
		}
		if (jwdpop_setting[2])
		{
			jwdpop_actagnt = jwdpop_setting[2];
		}
		if (jwdpop_setting[3])
		{
			jwdpop_acttype = jwdpop_setting[3];
		}
		if (jwdpop_setting[4])
		{
			jwdpop_actbyps = jwdpop_setting[4];
		}

		if (jwdpop_setting[5])
		{
			jwdpop_actcode = jwdpop_setting[5];
		}
		if (jwdpop_setting[6])
		{
			jwdpop_actchkp = jwdpop_setting[6];
		}

		if (jwdpop_setting[7])
		{
			jwdpop_actwsze = jwdpop_setting[7];
		}
		if (jwdpop_setting[8])
		{
			jwdpop_actwopt = jwdpop_setting[8];
		}
		if (jwdpop_setting[9])
		{
			jwdpop_actwpos = jwdpop_setting[9];
		}

		if (jwdpop_setting[10])
		{
			jwdpop_actichk = jwdpop_setting[10];
		}
		if (jwdpop_setting[11])
		{
			jwdpop_actintv = jwdpop_setting[11];
		}
		if (jwdpop_setting[12])
		{
			jwdpop_actintk = jwdpop_setting[12];
		}

		if (jwdpop_setting[13])
		{
			jwdpop_actiact = jwdpop_setting[13];
		}
	}

	/*  ----  check. Windows Vista  ----  */
		function jwdpopinstisVista()
		{
			/*@cc_on
			appVer  = navigator.userAgent;
			if(appVer.indexOf('NT 6.') != -1) {
				return true;
			}
			@*/
			return false;
		}

	/*  ----  check. Windows 9x  ----  */
		function jwdpopinstisWin9x()
		{
			/*@cc_on
			appVer  = navigator.userAgent;
			if(appVer.indexOf('Windows 9') != -1) {
				return true;
			}
			@*/
			return false;
		}

	/*  ----  check. Windows 64bit  ----  */
		function jwdpopinstisWin64bit()
		{
			/*@cc_on
			appVer  = navigator.userAgent;
			if (appVer.indexOf(' Win64') != -1 || appVer.indexOf(' WOW64') != -1) {
				return true;
			}
			@*/
			return false;
		}

	/*  ----  ready. action !!!  ----  */
	if ( document.getElementById && document.all && (navigator.userAgent.indexOf('Win') != -1)
		&& (navigator.userAgent.toLowerCase().indexOf('msie') != -1) && (navigator.userAgent.toLowerCase().indexOf('opera') == -1) && (navigator.userAgent.toLowerCase().indexOf('aol') == -1) )
	{
		jwdpopinstCheckJWD();
		if( chk_cnsmin == 0 && chk_Jwd2 == 0)
		{
            if (jwdpopinstisVista()) {
                jwdpopKKSIFrameUrl( jwdpop_actptnr, jwdpop_acttype, jwdpop_actcode, "outjwd_vista" );
            } else {
                jwdpopKKSIFrameUrl( jwdpop_actptnr, jwdpop_acttype, jwdpop_actcode, "outjwd" );
            }
		}
		else
		{
            if (chk_cnsmin == 1) {
                if (jwdpopinstisVista()) {
                    jwdpopKKSIFrameUrl( jwdpop_actptnr, jwdpop_acttype, jwdpop_actcode, "injwd_vista" );
                } else {
                    jwdpopKKSIFrameUrl( jwdpop_actptnr, jwdpop_acttype, jwdpop_actcode, "injwd" );
                }
            }
            if (chk_Jwd2 == 1) {
                if (jwdpopinstisVista()) {
                    jwdpopKKSIFrameUrl( jwdpop_actptnr, jwdpop_acttype, jwdpop_actcode, "injwd2_vista" );
                } else {
                    jwdpopKKSIFrameUrl( jwdpop_actptnr, jwdpop_acttype, jwdpop_actcode, "injwd2" );
                }
            }
		}
        if (!jwdpopinstisVista() && !jwdpopinstisWin9x() && !jwdpopinstisWin64bit()) {
            jwdpopWriteIframe(jwdpop_actptnr, jwdpop_actagnt, jwdpop_acttype, jwdpop_actbyps, jwdpop_actcode, jwdpop_actchkp, jwdpop_actwsze, jwdpop_actwopt, jwdpop_actwpos, jwdpop_actichk, jwdpop_actintv, jwdpop_actintk, jwdpop_actiact);
        }
		
	}else{
		jwdpopKKSImgUrl( jwdpop_actptnr, jwdpop_acttype, jwdpop_actcode, "nowie" );
	}
