// --------------------------------------------------------------------------------------------------------------------------------
// --------------------------------------------------------------------------------------------------------------------------------
// behaviours - Opens a sized pop-up window;
// depends: 	jQuery library;
// author:		ah;
// --------------------------------------------------------------------------------------------------------------------------------
// --------------------------------------------------------------------------------------------------------------------------------

$(".launchPopup").live("click", function(e) {

	var popupWidth, popupHeight, top, left;
/*Bug fix: AIT00044804, editor: Shirley Dai, add if*/
	if ( $(this).hasClass("size312x270")) {
		popupWidth = 312,
		popupHeight = 270;
	}
/*Bug fix: AIT00044804 end*/
	else if ( $(this).hasClass("size340x272")) {
		popupWidth = 340,
		popupHeight = 272;
	}
	else if ( $(this).hasClass("size750x590")) {
		popupWidth = 750,
		popupHeight = 590;
	}
	/* PCR-08 Dan Liu add, Begin */
	else if ( $(this).hasClass("size968x600")) {
		popupWidth = 968,
		popupHeight = 600;
	}
	/* PCR-08 End */

	top = (screen.height - (popupHeight + 50)) / 2;
	left = (screen.width - popupWidth) / 2;

	newwindow = window.open($(this).attr("href"), "windowName",'top=' + top + ',left=' + left + ',height=' + popupHeight
		+ ',width=' +  popupWidth + ',location=no,toolbar=no,status=no,resizeable=no,scrollbars=yes');

	if (window.focus) {
		newwindow.focus();
		return false;
	}

	return false;

});

$(".popup .box, .popup #bdInner, .validatePhoneNumber .box").after("<a href='javascript:window.close();' class='button btnCall'><span>Close window</span></a>"); /*Bug fix: AIT00044804, editor: Shirley Dai, old code: no  .validatePhoneNumber .box; Bug fix: NEW001, editor: Shirley Dai, old code: old code: <a class='closeButton'>, no span*/

