/*
path
*/
var BlogPointPath = 'http://parts.blogpoint.jp/';
//var BlogPointPath = 'http://secure.digichro.co.jp/bp3/';

//alert('secure');

/*
get userAgent
*/
var Win=(navigator.userAgent.indexOf("Win")!=-1);
var Explorer=(navigator.appName.indexOf("Explorer")!=-1);
var Version2=navigator.appVersion;
var appVer01=Version2.indexOf("MSIE",0)+5;
var appVer02=Version2.indexOf(".",appVer01);
var appVer00=Version2.substring(appVer01,appVer02);


/*
for parts
*/

function blogpoint_innerPartsObj(uID,oID,clr){
	var times = new Date().getTime();
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="160" height="345" id="blogpoint_parts" align="middle">');
	document.write('<param flashvars="userID='+ uID +'&oemID='+ oID +'"/ >');
	document.write('<param name="allowScriptAccess" value="always" />');
	document.write('<param name="movie" value="'+ BlogPointPath +'blogpoint_parts_'+clr+'.swf?t='+times+'&userID='+ uID +'&oemID='+ oID +'" />');
	document.write('<param name="quality" value="high" />');
	document.write('<param name="bgcolor" value="#ffffff" />');
	document.write('<param name="wmode" value="transparent" />');
	document.write('<embed src="'+ BlogPointPath +'blogpoint_parts_'+ clr +'.swf?t='+times+'&userID='+ uID +'&oemID='+ oID +'" flashvars="userID='+ uID +'&oemID='+ oID +'" quality="high" wmode="transparent" bgcolor="#ffffff" width="160" height="345" name="blogpoint_parts" align="middle" allowScriptAccess="always" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
	document.write('</object>');
	document.write('<form name="rec" id="rec"><input type="hidden" name="userID" value=""><input type="hidden" name="oemID" value=""><input type="hidden" name="menuNo" value=""></form>');
	window.document.rec.userID.value = uID;
	window.document.rec.oemID.value = oID;
}

function blogpoint_script_load(){
	if	(Win && Explorer && (appVer00=="6")) {
		document.write('<link href="'+ BlogPointPath +'blogpoint_styles_ie6.css" rel="stylesheet" type="text/css" media="all" />');
	} else {
		document.write('<link href="'+ BlogPointPath +'blogpoint_styles.css" rel="stylesheet" type="text/css" media="all" />');
	}
	document.write('<div id="blogpoint_box"></div>');
}

/*
for main
*/
function bb_ie6doc(){
	if(document.compatMode == 'CSS1Compat'){
		return document.documentElement;
	}else{
		return document.body;
	}
}

function blogpoint_openpage(mNo){

	//get value
	window.document.rec.menuNo.value = mNo;
	var uID = document.rec.userID.value;
	var oID = document.rec.oemID.value;
	var mNo = document.rec.menuNo.value;
	//get window size
	if (Win && Explorer && (appVer00=="6") && document.compatMode != 'CSS1Compat') {
		//
		var wWidth = document.body.clientWidth;
		var wHeight = document.body.clientHeight;
		//alert(bytefx.$position(document.getElementById('blogpointparts')).y);
	} else if (Win && Explorer && (appVer00=="6")) {
		var wWidth = document.documentElement.clientWidth;
		var wHeight = document.documentElement.clientHeight;
	} else {
		var wWidth = '100%';
		var wHeight = '100%';
	}
	var times = new Date().getTime();
	addContent = '<div id="blogpoint_wapper">'
			+'<table border="0" cellpadding="0" cellspacing="0" width="'+ wWidth +'" height="'+ wHeight +'" id="blogpoint_table"><tr><td style="text-align:center;vertical-align:middle;">'
			+'<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="600" height="560" id="blogpoint_main" align="middle">'
			+'<param flashvars="userID='+ uID +'&oemID='+ oID +'&mainMenuNo='+ mNo +'" />'
			+'<param name="allowScriptAccess" value="always" />'
			+'<param name="movie" value="'+ BlogPointPath +'blogpoint_main.swf?t='+ times +'&userID='+ uID +'&oemID='+ oID +'&mainMenuNo='+ mNo +'" />'
			+'<param name="quality" value="high" />'
			+'<embed src="'+ BlogPointPath +'blogpoint_main.swf?t='+ times +'&userID='+ uID +'&oemID='+ oID +'&mainMenuNo='+ mNo +'" flashvars="userID='+ uID +'&oemID='+ oID +'&mainMenuNo='+ mNo +'" quality="high" width="600" height="560" name="blogpoint_main" align="middle" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />'
			+'</object>'
			+'</td></tr></table></div>';
		document.getElementById("blogpoint_box").innerHTML = addContent;
	if	(Win && Explorer && (appVer00=="6")) {
		document.getElementById("blogpoint_wapper").style.top = document.body.scrollTop || document.documentElement.scrollTop;
	}

	//ie6 only scroll function
	if (Win && Explorer && (appVer00=="6") && document.compatMode != 'CSS1Compat') {
		document.body.onscroll = function(){
			document.getElementById("blogpoint_wapper").style.top = document.body.scrollTop;
		}
	} else if (Win && Explorer && (appVer00=="6")){
		document.documentElement.onscroll = function(){
			document.getElementById("blogpoint_wapper").style.top = document.documentElement.scrollTop;
		}
	}
	
	//ie6 only resize function
	if(Win && Explorer && (appVer00=="6") && document.compatMode != 'CSS1Compat'){
		window.onresize = function(){
			wWidth = document.body.clientWidth;
			wHeight = document.body.clientHeight;
			document.getElementById("blogpoint_table").style.width = wWidth;
			document.getElementById("blogpoint_table").style.height = wHeight;
		}
	} else if (Win && Explorer && (appVer00=="6")){
		window.onresize = function(){
			wWidth = document.documentElement.clientWidth;
			wHeight = document.documentElement.clientHeight;
			document.getElementById("blogpoint_table").style.width = wWidth;
			document.getElementById("blogpoint_table").style.height = wHeight;
		}
	}
}


function blogpoint_closepage(){
	document.body.onscroll = null;
	document.documentElement.onscroll = null;
	window.onresize = null;
	addContent = '';
	document.getElementById("blogpoint_box").innerHTML = addContent;
}