// JavaScript Document
function getArgs( ) {
     var args = new Object( );
     var query = location.search.substring(1);      // Get query string
     var pairs = query.split("&");                  // Break at ampersand
     for(var i = 0; i < pairs.length; i++) {
         var pos = pairs[i].indexOf('=');           // Look for "name=value"
         if (pos == -1) continue;                   // If not found, skip
         var argname = pairs[i].substring(0,pos); // Extract the name
         var value = pairs[i].substring(pos+1);     // Extract the value
         value = decodeURIComponent(value);         // Decode it, if needed
         args[argname] = value;                     // Store as a property
     }
     return args["utm_campaign"];  
}

utm_code=getArgs();
//alert(utm_code);

function banka(s){
	if(utm_code != undefined){
		if(s!="index.html"){
			new_url = "http://www.cardcmb.com/fcnx/"+s+"?utm_campaign="+utm_code;
		}else{
			new_url = "http://www.cardcmb.com/fcnx/"+s+"?status=confirm&utm_campaign="+utm_code;
		}
	}else{
		new_url = "http://www.cardcmb.com/fcnx/"+s;
	}
	window.location.href = new_url;
}


function banka_kitty(){

	if (utm_code != undefined){
		new_url = "https://ccclub.cmbchina.com/CrdCardApply/LoginChannelSelect.aspx?cardsel=7501&WT.mc_id=" + utm_code;
	}else{
		new_url = "https://ccclub.cmbchina.com/CrdCardApply/LoginChannelSelect.aspx?cardsel=7501";
	}
	
	pageTracker._trackPageview('/主页/立即办卡/Kitty/button');
	window.open(new_url,"CMB_Banka","","");
	//window.location.href = new_url;
}


function banka_kitty2(){

	if (utm_code != undefined){
		new_url = "https://ccclub.cmbchina.com/CrdCardApply/LoginChannelSelect.aspx?cardsel=1101&WT.mc_id=" + utm_code;
	}else{
		new_url = "https://ccclub.cmbchina.com/CrdCardApply/LoginChannelSelect.aspx?cardsel=1101";
	}
	
	pageTracker._trackPageview('/主页/立即办卡/Kitty/button');
	window.open(new_url,"CMB_Banka","","");
	//window.location.href = new_url;
}

function banka_elle(){

	if (utm_code != undefined){
		new_url = "https://ccclub.cmbchina.com/CrdCardApply/LoginChannelSelect.aspx?cardsel=8339&WT.mc_id=" + utm_code;
	}else{
		new_url = "https://ccclub.cmbchina.com/CrdCardApply/LoginChannelSelect.aspx?cardsel=8339";
	}
	
	pageTracker._trackPageview('/主页/立即办卡/ELLE/button');
	window.open(new_url,"CMB_Banka","","");
	//window.location.href = new_url;
}











function showPop(){
	document.getElementById('light').style.display='block';
	document.getElementById('fade').style.display='block';
}

function closePop(){
	document.getElementById('light').style.display='none';
	document.getElementById('fade').style.display='none';
}

function proloadImgs(){					//预先加载背景图,否则点击时会闪屏
	var arr = new Array();
	arr[0] = new Image();
	arr[0].src="nx_images/pop1_03.png";
	arr[0].onload;
	arr[1] = new Image();
	arr[1].src="nx_images/pop2_03.png";
	arr[1].onload;
	arr[2] = new Image();
	arr[2].src="nx_images/menu3_07.jpg";
	arr[2].onload;
	arr[3] = new Image();
	arr[3].src="nx_images/menu3_14.jpg";
	arr[3].onload;
	arr[4] = new Image();
	arr[4].src="nx_images/menu1_07.jpg";
	arr[4].onload;
	arr[5] = new Image();
	arr[5].src="nx_images/menu2_05.jpg";
	arr[5].onload;
	arr[6] = new Image();
	arr[6].src="nx_images/menu2_08.jpg";
	arr[6].onload;
	arr[7] = new Image();
	arr[7].src="nx_images/menu3_06.jpg";
	arr[7].onload;
	arr[8] = new Image();
	arr[8].src="nx_images/menu4_09.jpg";
	arr[8].onload;
	arr[9] = new Image();
	arr[9].src="nx_images/menu4_08.jpg";
	arr[9].onload;
	arr[10] = new Image();
	arr[10].src="nx_images/menu1_11.jpg";
	arr[10].onload;
	arr[11] = new Image();
	arr[11].src="nx_images/menu4_10.jpg";
	arr[11].onload;
	arr[12] = new Image();
	arr[12].src="nx_images/menu1_05.jpg";
	arr[12].onload;
	arr[13] = new Image();
	arr[13].src="nx_images/menu4_11.jpg";
	arr[13].onload;
	arr[14] = new Image();
	arr[14].src="nx_images/menu2_07.jpg";
	arr[14].onload;
	arr[15] = new Image();
	arr[15].src="nx_images/menu4_03.jpg";
	arr[15].onload;
	arr[16] = new Image();
	arr[16].src="nx_images/menu1_06.jpg";
	arr[16].onload;
	arr[17] = new Image();
	arr[17].src="nx_images/menu2_06.jpg";
	arr[17].onload;
	arr[18] = new Image();
	arr[18].src="nx_images/menu1_03.jpg";
	arr[18].onload;
	arr[19] = new Image();
	arr[19].src="nx_images/menu2_03.jpg";
	arr[19].onload;
	arr[20] = new Image();
	arr[20].src="nx_images/menu4_05.jpg";
	arr[20].onload;

	arr[21] = new Image();
	arr[21].src="nx_images/menu1_10.jpg";
	arr[21].onload;
	arr[22] = new Image();
	arr[22].src="nx_images/menu3_08.jpg";
	arr[22].onload;
	arr[23] = new Image();
	arr[23].src="nx_images/menu3_13.jpg";
	arr[23].onload;
	arr[24] = new Image();
	arr[24].src="nx_images/menu3_03.jpg";
	arr[24].onload;
	arr[25] = new Image();
	arr[25].src="nx_images/menu3_12.jpg";
	arr[25].onload;
	arr[26] = new Image();
	arr[26].src="nx_images/menu3_05.jpg";
	arr[26].onload;
	arr[27] = new Image();
	arr[27].src="nx_images/menu3_09.jpg";
	arr[27].onload;
	arr[28] = new Image();
	arr[28].src="nx_images/menu1_09.jpg";
	arr[28].onload;
	arr[29] = new Image();
	arr[29].src="nx_images/menu3_11.jpg";
	arr[29].onload;
	arr[30] = new Image();
	arr[30].src="nx_images/menu4_07.jpg";
	arr[30].onload;
	arr[31] = new Image();
	arr[31].src="nx_images/menu4_06.jpg";
	arr[31].onload;
	arr[32] = new Image();
	arr[32].src="nx_images/menu1_08.jpg";
	arr[32].onload;
/*
	arr[33] = new Image();
	arr[33].src="nx_images/index_06.jpg";
	arr[33].onload;
	arr[34] = new Image();
	arr[34].src="nx_images/index_03.jpg";
	arr[34].onload;
	arr[35] = new Image();
	arr[35].src="nx_images/clear.gif";
	arr[35].onload;
*/

}


proloadImgs();

