function popCreditMgt(type, locale, userId) {
	var width = 500;
	var height = 300;
	var day = new Date();
	var id = day.getTime();
	var url = "/authCredit/AuthCreditServlet?action=";
	var localeValue;

	switch(type){
		case "buyCredit":
			url = url + "buyCredit";
			break;
		case "addCredit":
			url = url + "addCredit";
			break;
		case "pickCredit":
			url = url + "pickCredit";
			break;
		case "histCredit":
			url = url + "histCredit";
			break;
	}

	switch (locale) {
		case "en":
			localeValue = "&locale=en";
			break;
		case "gb":
			localeValue = "&locale=gb";
			break;
		case "b5":
		default:
			localeValue = "&locale=b5";
			break;
	}
	url += localeValue +"&userId="+ userId;
	var screenWidth = screen.width;
	var screenHeight = screen.height;

	var targetX = (screenWidth - width) / 2;
	var targetY = (screenHeight - height) / 2;

	var win = window.open(url, "credit", "width="+width+",height="+height+",top="+targetY+",left="+targetX+",status = no, resizable = no, scrollbars=no, toolbar=no, menubar=no, location=no");

	if (!win)
		return;

	win.focus();
}
  
  function popWin(pType, pLocale)
  {
  	var homeLocale = "";
  	if (typeof(pLocale) == "undefined" && typeof(locale) != "undefined")
  	{
  		pLocale = locale;
	}
  	switch(pLocale){
  		case "b5":
  			homeLocale = "tc";
  			break;
  		case "gb":
  			homeLocale = "sc";
  			break;
  		case "en":
  			homeLocale = "eng";
  			break;
  		default:
  			homeLocale = "eng";
  	}
  	switch(pType){
  		case "home":
  		case "logoLink":
  			openWindow( 'http://www.zip2zap.com.cn/home-' + homeLocale + '-company.htm', 'HomeWin', 880, 780, 'status = no, resizable = 0' );
  			break;
  		case "contactUs":
  		case "enquiry":
  			openWindow( 'http://www.zip2zap.com.cn/home-' + homeLocale + '-contact.htm', 'HomeWin', 880, 780, 'status = no, resizable = 0' );
  			break;
  		case "feedBack":
  			openWindow( '/feedback/FeedbackServlet?action=showFeedbackForm&locale=' + locale, 'Win', 370, 320, 'status = no, resizable = 0' );
  			break;
  		case "allRightsReserved":
  			openWindow( 'http://www.zip2zap.com.cn/home-' + homeLocale + '-company.htm', 'HomeWin', 880, 780, 'status = no, resizable = 0' );
  			break;

  		case "disclaimer":
  			openWindow( '/disclaimer/Disclaimer_' + pLocale + '.htm', 'Win', 420, 200, 'status = no, resizable = 0' );
  		  break;
  		case "privacy":
  			openWindow( '/disclaimer/PrivacySecurity_' + pLocale + '.htm', 'Win', 420, 420, 'status = no, resizable = 1, scrollbars=1,toolbar=no, menubar=no, location=no' );
  		  break;
  		case "termOfUse":
  			openWindow( '/disclaimer/TermOfUse_' + pLocale + '.htm', 'Win', 420, 420, 'status = no, resizable = 0, scrollbars=1' );
  		  break;
  	}
  	function openWindow(path, winName, w, h, property)
  	{
  	 var screenWidth = screen.width;
 	   var screenHeight = screen.height;

  	 var targetX = (screenWidth - w) / 2;
  	 var targetY = (screenHeight - h) / 2;

  	 var win = window.open(path, winName, "width="+w+",height="+h+",top="+targetY+",left="+targetX+","+property);
  	 if (!win)
  	 {
  	   return;
     }

  	 win.focus();
    }
  }
