var adfdLeftSrc = "images/piao.swf"
var adfdLeftFlash = "flash"
var adfdLeftHref = ""
var adfdLeftWidth = 159;
var adfdLeftHeight = 168;
var heightOffset = 600;
var widthOffset = 960;
var adfdRun = true;

if(adfdLeftSrc != ""){
	if(adfdLeftFlash == "flash"){
		document.write("<div id=\"adfdLeftFloat\" style=\"position: absolute;width:" + adfdLeftWidth + ";\"><embed wmode=transparent src=\"" + adfdLeftSrc + "\" quality=\"high\" id=\"dl\" width=\"" + adfdLeftWidth + "\" height=\"" + adfdLeftHeight + "\" type=\"application/x-shockwave-flash\"></embed></div>");
	}else{
		document.write("<div id=\"adfdLeftFloat\" style=\"position: absolute;width:" + adfdLeftWidth + ";\"><a href=\"" + adfdLeftHref +" \" target=\"_blank\"><img  border=0 src=\"" + adfdLeftSrc + "\" quality=\"high\" id=\"dl\" width=\"" + adfdLeftWidth + "\" height=\"" + adfdLeftHeight + "\" type=\"application/x-shockwave-flash\"></a></embed></div>");
	}
	loadloadFDl();
}

function loadloadFDl(){
    judgeloadFDl();
    moveloadFDl();
}

function moveloadFDl() {
    judgeloadFDl();
    if(adfdRun){
        setTimeout("moveloadFDl();",80);
    }
}

function judgeloadFDl(){
    document.getElementById("adfdLeftFloat").style.top = document.documentElement.scrollTop+document.documentElement.clientHeight-heightOffset+'px';
    if(document.body.clientWidth <= 1280){
        document.getElementById("adfdLeftFloat").style.left = document.body.clientWidth-(document.body.clientWidth-widthOffset)/2+2+'px';
    }else{
        document.getElementById("adfdLeftFloat").style.left = document.body.clientWidth/2+470+'px';
    }
}

function closeActivesFloatDiv(){
	adfdRun = false;
	document.getElementById("adfdLeftFloat").style.display = "none";
}

function detectBrowser(){
	var ret = "ie6"; // default
	var user_agent = navigator.userAgent;
	if(user_agent.indexOf("MSIE 6.0") > -1)
		ret = "ie6"
	else if(user_agent.indexOf("MSIE 7.0") > -1)
		ret = "ie7";
	else if(user_agent.indexOf("MSIE 8.0") > -1)
		ret = "ie8";
	else if(user_agent.indexOf("360") > -1)
		ret = "360";
	else if(user_agent.indexOf("Gecko") > -1)
		ret = "firefox";
	return ret;
}

function resize(){
	var windowHeight = 0;
	var windowWidth = 0;
	var browser = detectBrowser();
	if("ie6" == browser){
		windowHeight = document.documentElement.offsetHeight;
		windowWidth = document.documentElement.offsetWidth;
	}else if("ie7" == browser){
		windowHeight = document.documentElement.offsetHeight;
		windowWidth = document.documentElement.offsetWidth;
	}else if("ie8" == browser){
		windowHeight = document.documentElement.offsetHeight;
		windowWidth = document.documentElement.offsetWidth;
	}else if("firefox" == browser){
		windowHeight = window.innerHeight;
		windowWidth = document.documentElement.clientWidth;
	}else{
		windowHeight = windowWidth = 0;
	}

	heightOffset = windowHeight - 100;
	widthOffset = windowWidth - 350;

	judgeloadFDl();
}