function mouseOverButton(_name){
	
	var _element = document.getElementById(_name);
	_element.style.backgroundImage = "url(images/" + _name + "_o.jpg)";
	
}

function mouseOutButton(_name){
	var _element = document.getElementById(_name);
	_element.style.backgroundImage = "url(images/" + _name + "_s.jpg)";
	
}
function mouseOverButton_gif(_name){
	
	var _element = document.getElementById(_name);
	_element.style.backgroundImage = "url(images/" + _name + "_o.gif)";
	
}

function mouseOutButton_gif(_name){
	var _element = document.getElementById(_name);
	_element.style.backgroundImage = "url(images/" + _name + "_s.gif)";
	
}

function mouseOverBtnDiv(_name){
	
	var _img = document.getElementById(_name+"_overImg");
	_img.style.display = "block";
	
}
function mouseOutBtnDiv(_name){
	var _img = document.getElementById(_name+"_overImg");
	
	_img.style.display = "none";
}

function openRegistration() {
	
	track("/GZ_home/reg");
	openFixedWindow("/chinarun/asp/register_gz/register.html", "registration");
	
}

function openInfo() {
	
	track("/GZ_home/info");
	openFixedWindow("campaignInfo.html", "campaignInfo");
	
}

function openCheckStatus() {
	
	track("/GZ_home/reg_letter_check");
	openFixedWindow("/chinarun/asp/users/check_status_gz.asp", "checkStatus", 400, 443);
	
}

function openChinarun() {
	
	track("/GZ_home/4cc");
	openFixedWindow("http://www.nike.com.cn/chinarun", "chinarun");
	
}

function openRunner() {
	
	track("/GZ_home/QQ_RN");
	openFixedWindow("http://nikeplus.qq.com", "runner");
	
}

function openHumanRace() {
	
	track("/GZ_home/NIKERunning");
	//openFixedWindow("http://inside.nike.com/blogs/nikerunning_humanrace-zh_CN/", "humanRace");
	openFixedWindow("http://nikerunning.nike.com/nikeos/p/nikeplus/zh_CN/?rs=1", "runner");
	
}


function openFixedWindow(_url, _title, _width, _height){

	var win;
	if (_width && _height) {
		win = window.open(_url, _title, "width=" + _width + ",height=" + _height);	
	}
	else {
		win = window.open(_url, _title);	
	}
	win.focus();
}

function getWindowSize() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
  
  return { w:myWidth, h:myHeight };
}


function windowResize(){
	var _body = document.getElementsByTagName("body").item(0);
	var _width = getWindowSize().w;
	var _height = getWindowSize().h;
	
	if(_height <= 600){
		document.documentElement.style.overflow = "auto";
		window.scroll(0,0);
	}else
		document.documentElement.style.overflow = "hidden";
	
	
} 

function showCostDetail(){
	
	var _div = document.getElementById("regCostInfoDetailDiv");
	if(_div.style.display == "block")
		_div.style.display = "none";
	else
		_div.style.display = "block"
}

function initHeader2(_name){
	
	var _div = document.getElementById(_name);
	
	_div.innerHTML = "<div style='height:19px;'></div>" + 
			"<a href='index.html'><div id='logoDiv2'></div></a>" +
      		"<div id='navigateBarDiv' style='float:right; margin-right:10px'>" + 
			/*"	<div class='navigateItemDiv'>" +  					
					"<div onmouseover=mouseOverBtn('nav_btn1') onmouseout=mouseOutBtn('nav_btn1') id='gotoRegBtn'>" + 
					"<a href=\"javascript:track('/landing/details');openWindow('campaignInfo.html#item7');\"><img id='nav_btn1' src='images/btn1_o.jpg' style='display:none; cursor:pointer;' /></a></div></div>" +*/
			"	<div class='navigateItemDiv'>" +  					
					"<div onmouseover=mouseOverBtn('nav_btn2') onmouseout=mouseOutBtn('nav_btn2')  id='gotoInfoBtn'>" + 
					"<a href=\"javascript:track('/landing/details');openWindow('campaignInfo.html');\"><img id='nav_btn2' src='images/btn2_o.jpg' style='display:none; cursor:pointer;' /></a></div></div>" + 
			/*"	<div class='navigateItemDiv'>" +  					
					"<div onmouseover=mouseOverBtn('nav_btn3') onmouseout=mouseOutBtn('nav_btn3')  id='gotoFindBtn'>" + 
					"<a href=\"javascript:track('/landing/friend');openWindow('index.html?#findDiv');\"><img id='nav_btn3' src='images/btn3_o.jpg' style='display:none; cursor:pointer;' /></a></div></div>" + */
			"	<div class='navigateItemDiv'>" +  					
					"<div onmouseover=mouseOverBtn('nav_btn4') onmouseout=mouseOutBtn('nav_btn4')  id='gotoGearBtn'>" + 
					"<a href=\"javascript:track('/landing/product');openWindow('http://nikerunning.nike.com/nikeos/p/nikeplus/zh_CN/products');\"><img id='nav_btn4' src='images/btn4_o.jpg' style='display:none; cursor:pointer;' /></a></div></div>" + 
			"	<div class='navigateItemDiv'>" +  					
					"<div onmouseover=mouseOverBtn('nav_btn5') onmouseout=mouseOutBtn('nav_btn5')  id='gotoSearchBtn'>"  +
					"<a href=\"javascript:track('/landing/reg_letter_check');openLetterWindow();\"><img id='nav_btn5' src='images/btn5_o.jpg' style='display:none; cursor:pointer;' /></a></div></div>" + 
      		" </div> " + 
		  " <br class='clearBoth'/> ";

}

//lipton downloadExcel

function downloadExcel(){
    window.open("Excel/NikeChinaRunRegAddress.xls");
}