function get_element_loc(obj)
{
	var xx=0, yy=0, ww=0, hh=0, obj1;
	obj1 = obj;
	if(obj1)
	{
		do
		{
			xx += parseInt(obj1.offsetLeft, 10);
			yy += parseInt(obj1.offsetTop, 10);
			obj1 = obj1.offsetParent;
			if(!obj1)
				break;
		}while(obj1.tagName.toUpperCase() != "BODY");
		ww = obj.width? obj.width:obj.style.width;
		hh = obj.height? obj.height:obj.style.height;
	}
	return {x:xx, y:yy, w:ww, h:hh};
}

function element_move(obj, obj1, x, y)
{
	var objPos = get_element_loc(obj1);
	obj.style.left = objPos.x + x - parseInt(obj.style.width, 10);
	obj.style.top = objPos.y + y - parseInt(obj.style.height, 10);
}

function remove_element(obj)
{
	while(obj.children.length)
	{
		remove_element(obj.lastChild);
		obj.removeChild(obj.lastChild);
	}
}

var adv_pic_cnt = 0;
var adv_delay_time = 7000;
var adv_idx = 0;
var adv_idx_now = 0;
var adv_alpha = 100;
var AdvObj1=null,AdvObj2=null;
function start_adv_display_run()
{
	if(adv_pic_cnt < 2)
		return ;
	AdvObj1 = document.getElementById("adv_son");
	AdvObj2 = document.getElementById("adv_mother");
	adv_alpha = 100;
	adv_idx_now = adv_idx;
	adv_idx ++;
	if(adv_idx >= adv_pic_cnt)
		adv_idx = 0;
	if(isIE)
	{
		AdvObj1.filters.alpha.opacity = adv_alpha;
	}
	else
	{
		var alN = adv_alpha/100;
		AdvObj1.style.opacity = alN;
	}
	window.setTimeout("ron_adv_effect()", adv_delay_time);
}
function ron_adv_effect()
{
		if(adv_alpha > 0)
		{
			adv_alpha -= 5;
			if(isIE)
			{
				AdvObj1.filters.alpha.opacity = adv_alpha;
			}
			else
			{
				var alN = adv_alpha/100;
				AdvObj1.style.opacity = alN;
			}
			window.setTimeout("ron_adv_effect();", 0);
		}
		else
		{
			AdvObj1.src = ADV_list[adv_idx_now][0];
			AdvObj2.style.backgroundImage = "url(" + ADV_list[adv_idx][0] + ")";
			start_adv_display_run();
		}
}
function goto_adv_url()
{
	document.location.href=ADV_list[adv_idx_now][1];
}

var ADV_list=[
        ["images/0724-main/flash-img02.jpg", "#"],
		["images/0724-main/flash-img03.jpg", "#"],
		["images/0724-main/flash-img04.jpg", "#"],
		["images/0724-main/flash-img01.jpg", "#"]
		     ];

