﻿var fflag;
var flash_ok_flg;
var opera_flg;
var flash_write_flg;

fflag=0;

//OK:1
flash_ok_flg=0;

//OK Opera(Over950):1
opera_flg=0;

//0:Not Flash 1:Flash1 2:Flash2
flash_write_flg=0;

function flash_chk(){
fflag=0;
if (document.layers || document.all || document.getElementById) {
	if (!fflag && document.all && !window.opera && navigator.userAgent.indexOf('Win')>-1) {
		document.write('<scr' + 'ipt type="text/vbscript"\> \n');
		document.write('on error resume next \n');
		document.write('fflag=( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.6")))\n');
		document.write('</scr' + 'ipt> \n');
		}
    else if (navigator.plugins['Shockwave Flash']) fflag=1;
	}

if (fflag==0)
{
	//No Flash
	flash_ok_flg=0;
	flash_write_flg=0;

}
else {
	if (document.all && !window.opera)
	{
	//Flash1
	flash_ok_flg=1;	
	flash_write_flg=1;
	opera_flg=0;
	}

	else
	{
	//Flash2
	flash_ok_flg=1;	
	flash_write_flg=2;
	opera_flg=0;

		if (window.opera)
		{
		//strBrowser = "Opera";
		var ua=navigator.appVersion;
		var nHit = ua.indexOf(" (");
		var nVersion=0;
		nVersion = ua.substr(0,nHit);
		nVersion=nVersion*1;
			if(nVersion>= 9.5){opera_flg=1;flash_write_flg=2;}else{opera_flg=0;flash_write_flg=0;}
		}

    }
}


//Flash Image Write
//0:Not Flash 1:Flash1 2:Flash2
if(flash_write_flg==1)
{
//Flash1
document.write('<div class="top_image2">'+
    '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="992" height="380">'+
	'<param name="movie" value="topimage.swf" />'+
    '<param name="wmode" value="transparent" />'+
	'<param name="quality" value="high" />'+
    '<embed wmode="transparent" src="topimage.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="992" height="380">'+
    '</embed>'+
    '</object>'+
	'</div>'+
	'');
}
else
{
 if(flash_write_flg==2)
 {
//Flash2
document.write('<div class="top_image2">'+
	'<object type="application/x-shockwave-flash" data="topimage.swf" width="992" height="380">'+
	'<param name="wmode" value="transparent" />'+
	'<param name="quality" value="high" />'+
    '</object>'+	
	'</div>'+
	'');

 }
 else
 {
 //No FLASH
document.write('<table summary="Classical Resorts Japan" width="992" border="0" cellpadding="0" cellspacing="0">'+
        '<tr>'+
          '<td><img src="image/top_img1.jpg" alt="Japan snow resorts" width="248" height="280" /></td>'+
          '<td><img src="image/top_img2.jpg" alt="Japan snow resorts" width="248" height="280" /></td>'+
          '<td><img src="image/top_img3.jpg" alt="Japan snow resorts" width="248" height="280" /></td>'+
          '<td><img src="image/top_img4.jpg" alt="Japan snow resorts" width="248" height="280" /></td>'+
        '</tr>'+
        '<tr>'+
          '<td colspan="4">'+
		  '<div class="top_image">'+
		  	'<p class="top_image_copy">'+
			'The prefectures of Nagano and Niigata are nestled in the awe inspiring Japanese Alps and home to some of the best ski and snowboard resorts in Japan.'+ 
			'Hakuba with 10 ski and snowboard resorts and over 150 lifts offers access to more terrain, vertical rise and advanced slopes than anywhere in Japan. '+
			'At Shiga Kogen, Japan' + "'" + 's largest ski and snowboard resort, one lift ticket lets you ride on all of the 71 lifts, gondolas and ropeways. '+ 
			'Nozawa Onsen is a big mountain resort with great skiing and complimented by the wonderful charms and vibrant character of an authentic Japanese ski village.  '+
			'Myokokogen boasts big snow and if you' + "'" + 're not in waist deep powder you' + "'" + 're going to be enjoying some of the best vertical and longest runs in all of Japan. '+
			'<br />'+
			'Unbelievable snow, non existent lift lines, breathtaking scenery, delicious cuisine, soothing hot springs, fascinating history and culture are just a few of the many reasons to make Nagano and Niigata, your next ski and snowboard destination.'+
			'</p>'+
			'<div class="top_image_map"><img src="image/top_img5.jpg" alt="Japan snow resorts" width="330" height="230" usemap="#map" /> '+
			'</div><br clear="all" />'+
		  '</div>'+
		  '</td>'+
        '</tr>'+
	'</table>'+
	'');

 }
}
//Flash Image Write End
//func end
}


function flash_copy_chk(){
//Flash Copy visible Start
if(flash_write_flg==1 || flash_write_flg==2)
{
	if(document.all)
 	{
 	top_image_copy2.style.display="block";
 	}
 	else
 	{
 	var topimagecopy2= document.getElementById("top_image_copy2");
	topimagecopy2.style.display="block";
 	}
}
//Flash Copy visible End




//func end
}
