var className = ( document.all && !window.opera )? 'className' : 'class';
var Agent = navigator.userAgent;
var base_win_width = 990;
var obj_copy;
var obj_bgcopy;
var limitwidth = 965;
var limitheight = 700;

function init_liquidlayout() {
	obj_copy = document.getElementById("copyimg");
	obj_bgcopy = document.getElementById("bgcopy");
	replace_copy();
}

function replace_copy() {
	var new_top = getWinHeight() + getScrollY() - 20;
	if( getWinWidth() < limitwidth) {
		if (Agent.indexOf('Mac') != -1) {
			new_top -= 13;
		}
	}
	if( limitheight<getWinHeight()) {
		if( obj_copy) obj_copy.style.top = new_top + "px";
		if( obj_bgcopy) obj_bgcopy.style.top = new_top + "px";
	} else {
		if( obj_copy) obj_copy.style.top = limitheight + "px";
		if( obj_bgcopy) obj_bgcopy.style.top = limitheight + "px";
	}
}

function getScrollY() {
	if( document.body.scrollTop) return document.body.scrollTop;
	else if(document.documentElement.scrollTop) return document.documentElement.scrollTop;
	else return 0;
}

function getWinWidth() {
	if(window.innerWidth){
		return window.innerWidth;
	}else if(document.documentElement && document.documentElement.clientWidth){
		return document.documentElement.clientWidth;
	}else if ( document.body && document.body.clientWidth){
		return document.body.clientWidth;
	}
}

function getWinHeight() {
	if(window.innerHeight)
		return window.innerHeight;
	if(document.body.parentNode.clientHeight)
		return document.body.parentNode.clientHeight;
	if(document.body.clientHeight)
		return document.body.clientHeight;
}

window.onload = function() {
	init_liquidlayout();
	initRollovers();
}
window.onresize=function(){
	replace_copy();
}
window.onscroll=function(){
	replace_copy();
}
