function getPageSize(){
		
		var xScroll, yScroll;
		
		if (window.innerHeight && window.scrollMaxY) {	
			xScroll = document.body.scrollWidth;
			yScroll = window.innerHeight + window.scrollMaxY;
		} else if (document.body.scrollHeight > document.body.offsetHeight){
			xScroll = document.body.scrollWidth;
			yScroll = document.body.scrollHeight;
		} else { 
			xScroll = document.body.offsetWidth;
			yScroll = document.body.offsetHeight;
		}
		
		var windowWidth, windowHeight;
		if (self.innerHeight) {	
			windowWidth = self.innerWidth;
			windowHeight = self.innerHeight;
		} else if (document.documentElement && document.documentElement.clientHeight) {
			windowWidth = document.documentElement.clientWidth;
			windowHeight = document.documentElement.clientHeight;
		} else if (document.body) { 
			windowWidth = document.body.clientWidth;
			windowHeight = document.body.clientHeight;
		}	
		
		if(yScroll < windowHeight){
			pageHeight = windowHeight;
		} else { 
			pageHeight = yScroll;
		}
	
		if(xScroll < windowWidth){	
			pageWidth = windowWidth;
		} else {
			pageWidth = xScroll;
		}
		arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight) 
		return arrayPageSize;
}

function setStyleById(i, p, v) {
			var n = document.getElementById(i);
			//alert(n+"  "+p+"  "+v)
			n.style[p] = v;
		}


function updateFlashCon() {
		var arrayPageSize = getPageSize();
		//alert(arrayPageSize)
		//alert(con.getStyle('width'))
		setStyleById("flashcontent","left",Math.max(0,(arrayPageSize[2]-950)/2)+'px');
		setStyleById("flashcontent","top",Math.max(0,(arrayPageSize[3]-600)/2)+"px");
}
var old_address="/";
function onAddressChange(event){
	var _address=SWFAddress.getValue();
	if(old_address!=_address){
		var names=SWFAddress.getPathNames();
		//alert(_address+"  \nnames:"+names)
		//trackerToWMX(_address,"#"+_address);
		//¼ÇÂ¼µ±Ç°µØÖ·
		old_address=_address;
	}
}
function trackerToWMX(_str1,_str2){
	wmx_flash_counter(_str1,_str2);
	//alert("trackerToMigo::"+_str1+" "+_str2)
}
function trackerByFlash(str1,str2){
	//pageTracker._trackPageview("/flashBtn::"+str1+"/"+str2);
	//wmx_trackBtn(str1,str2);
}
function trackerByMigo(str1,str2,str3){
	//pageTracker._trackPageview("/flashBtn::"+str1+"/"+str2);
	//wmx_trackBtn(str1,str2);
	//alert("trackerByMigo "+str1+"  " +"  "+ str2+"  " + str3)
	if(str1=="wmx_trackBtn"){
		wmx_trackBtn(str2,str3);
	}else if(str1=="wmx_flash_counter"){
		wmx_flash_counter(str2,str3);
	}
	
}
function clearBannerHref(){
	var ref = '';
	if (document.referrer.length > 0) {
	   ref = document.referrer;
	}
	try {
	   if (ref.length == 0 && opener.location.href.length > 0) {
		ref = opener.location.href;
	   }
	} catch (e) {}
}
function initRemy(){
	//clearBannerHref();
	updateFlashCon();
	SWFAddress.addEventListener(SWFAddressEvent.CHANGE,onAddressChange)
	window.onresize= updateFlashCon;
}