
var fl_path ="http://www.ifonpal.com/event/20080808/flash/data/BlogPaster.swf";
var big_fl_path ="http://www.ifonpal.com/event/20080808/flash/data/BlogPasterfull.swf";

var agent = navigator.appName;
var main;
var nowpix;
var ua = navigator.userAgent;
//
function caution() {
	alert("dead");
}
function closeParts() {
	sendToActionScript();
	if(ua.indexOf("Safari") > -1 || ua.indexOf("Firefox") > -1) {
		document.getElementById('flash').style.display="none";
		document.getElementById('flash').removeAttribute("id");
		window.removeEventListener('scroll', scrollEvent, false);
	} else {
		document.body.removeChild(document.getElementById('flash'));
		window.detachEvent('onscroll',scrollEvent);
	}	
}
function sendToActionScript() {	
	if(ua.indexOf("Safari") > -1 || ua.indexOf("Firefox") > -1) {
		var obj = document.getElementById('FirefoxBlogPaster');
		obj.sendToActionScript();
	} else {
		var obj = document.getElementById('BlogPaster');
		obj.sendToActionScript();		
	}	
}
function comeBackFrame() {
	if(ua.indexOf("Safari") > -1 || ua.indexOf("Firefox") > -1) {
		var obj = document.getElementById('flash_main');
		obj.comeBackFrameHandler("event");	
	} else {
		var obj = document.getElementById('kinoyama_fla');
		obj.comeBackFrameHandler("event");	
	}	
	
	
}
//
function createMOZ() {
	main = document.createElement('div');
	imgObj = document.createElement('embed');
	imgObj.src = big_fl_path;
	imgObj.id = 'flash_main';
	imgObj.quality='high';
	imgObj.setAttribute('wmode','transparent');
	imgObj.width='100%';
	imgObj.height='100%';
	imgObj.setAttribute('allowScriptAccess','always');
	imgObj.type='application/x-shockwave-flash';
	imgObj.pluginspage='http://www.macromedia.com/go/getflashplayer';
	//

	main.id = 'flash';
	document.body.appendChild(main);
	initiaCSS();
	document.getElementById('flash').appendChild(imgObj);
}
//
function createIE() {
	main = document.createElement('div');
	initiaCSS();
	main.id = 'flash';
	var dd = document.createElement('div');
	dd.id = 'w';
	var flaObj1 = document.createElement('object');
	flaObj1.id ='kinoyama_fla';
	var flaObj2 = document.createElement('param');
	flaObj2.name ='allowScriptAccess';
	flaObj2.value='always';
	var flaObj3 = document.createElement('param');
	flaObj3.name='movie';
	flaObj3.value=big_fl_path;
	var flaObj4 = document.createElement('param');
	flaObj4.name='quality';
	flaObj4.value='high';
	var flaObj5 = document.createElement('param');
	flaObj5.name='wmode';
	flaObj5.value='transparent';
	document.body.appendChild(main);
	document.getElementById('flash').appendChild(flaObj1);
	document.getElementById('kinoyama_fla').appendChild(flaObj2);
	document.getElementById('kinoyama_fla').appendChild(flaObj3);
	document.getElementById('kinoyama_fla').appendChild(flaObj4);
	document.getElementById('kinoyama_fla').appendChild(flaObj5);
	document.getElementById('kinoyama_fla').setAttribute("classid","clsid:d27cdb6e-ae6d-11cf-96b8-444553540000");
	document.getElementById('kinoyama_fla').setAttribute("codebase","http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0");
	document.getElementById('kinoyama_fla').width='100%';
	document.getElementById('kinoyama_fla').height='100%';
}

function initiaCSS() {
	main.style.position = "absolute";
	main.style.zIndex="500";
	main.style.top = nowpix+"px";
	main.style.left="0";
	main.style.height="100%";
	main.style.width="100%";
}

function scrollEvent() {
	if(agent == "Microsoft Internet Explorer") {

		nowpix = document.documentElement.scrollTop;
	} else if(agent == "Netscape") {
		//alert("sc");
		nowpix = scrollY +"px";
		//alert(nowpix);
	}
	document.getElementById('flash').style.top = nowpix;
}



function blogFloat() {
	try {
		window.addEventListener('scroll', scrollEvent, false);
	} catch (e) {
		window.attachEvent('onscroll',scrollEvent);
	}
	if(agent == "Microsoft Internet Explorer") {
		nowpix = document.documentElement.scrollTop;
		createIE();
	} else if(agent == "Netscape") {
		nowpix = scrollY;
		createMOZ();
	}
}

document.writeln("<div>");
document.writeln("<object id=BlogPaster classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,124,0' width='160' height='370' name='BlogPaster' align='middle'>");
document.writeln("<param name='allowScriptAccess' value='always'>");
document.writeln("<param name='movie' value='"+ fl_path +"'>");
document.writeln("<param name='quality' value='high'>");
document.writeln("<param name='bgcolor' value='#ffffff'>");
document.writeln("<param name='wmode' value='transparent'>");
document.writeln("<embed id='FirefoxBlogPaster' src='"+ fl_path +"' allowScriptAccess='always' wmode='transparent' quality='high' bgcolor='#ffffff' width='160' height='370' name='FirefoxBlogPaster' align='middle' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer'>");
document.writeln("</object>");
document.writeln("</div>");
