// --------------------------------------------------------------------------------------------------------------------------------
// --------------------------------------------------------------------------------------------------------------------------------
// behaviours - Opens new browser window;
// depends: 	jQuery library;
// author:		ah;
// --------------------------------------------------------------------------------------------------------------------------------
// --------------------------------------------------------------------------------------------------------------------------------

// -- define namespace;
if (typeof Barclaycard !== 'object') var Barclaycard={};

Barclaycard.newWindow = new (function(){
	
	var params = 'width=750,height=570,scrollbars=1';
	
	this.openWindow = function(url) {
		window.open(url,'BarclaycardPopup', params);
	};
	
	this.openStandardWindow = function(url) {
		window.open(url,''); //name removed so it doesn't open in same window
	};	
	
	this.onReady = function() {
		
		$('a.newWindow, a.newSizedWindow, a.btnNewWindow, a.external, a.pdf, a.getPdf').each(function(){
			$(this).append('<span class="newWindowTitle">(Opens in a new window)</span>');
		});
		
		$('a.newSizedWindow').click(function(){
			window.open(this.href,'BarclaycardPopup', params);
			return false;
		});
			
		
		$('a.newWindow, a.btnNewWindow, a.external, a.pdf, a.getPdf').click(function(){
			$(this).attr('target','_blank');
		});
		
		$('a.closeWindow').click(function(){
			window.close();
			return false;	
		});
		
	};

});

$(document).ready(function(){Barclaycard.newWindow.onReady();});

// --------------------------------------------------------------------------------------------------------------------------------
// --- end of file --- 
// -------------------------------------------------------------------------------------------------------------------------------
