//Global JavaScript Document

/********************************

	Notes:
		+ I rely on JQuery v1.2.6

********************************/

// Prevent console commands from throwing errors in IE
try { console.log('init console... done'); } catch(e) { console = { log: function() {} } }

// Function to open external links in a new window
function externalLinks() {
	$('a[href^="http://"]').click(function(){
		window.open(this.href);
		return false;
	})
}

// Function to open PDFs in a new window
function pdfLinks() {
	$('a[href$=".pdf"]').click(function(){
		window.open(this.href);
		return false;
	})
}


// Open Designer image links in popup
function designerLinks() {
	if(jQuery('#brizo-designers').length) {
		jQuery('#brizo-designers a').click(function(){
			window.open(this.href, '', 'width=330, height=650, location=yes, scrollbars=no, resizable=yes, menubar=yes, status=yes');
			return false;
		})
	}
}


// Initialize JS functions
$(document).ready(function(){
	externalLinks();
	pdfLinks();
	designerLinks();
})