/*! ADServe v1 <http://nvinteractive.co.nz>
	Copyright (c) NV Interactive
	
	References:
		jquery-1.2.6.js
		
	Release Notes:

		
*/

/* [ Ad declarations ] */
/* Only one replace will occur per page, order is important. */

var ads = new Array(

				
{
	include: "/content/investing/nz-deposit-scheme.aspx",
	html: '<div id="banner"><a href="/content/investing/nz-deposit-scheme.aspx"><img src="/images/promotions/deposit-scheme/NZDGS_950x110.jpg" width="950" height="110" alt="MARAC Finance Limited has a guarantee under the New Zealand deposit guarantee scheme." /></a></div>',
	element: "#main",
	operation: "prepend"
}
,
{
	include: "(/content/finance/)|(/content/promotions/flytofiji.aspx)|(/content/promotions/flytofiji-terms.aspx)",
	html: '<div id="banner"><a href="/flytofiji"><img src="/images/promotions/flytofiji.950x110.jpg" width="950" height="110" alt="Be in to WIN 1 of 3 trips to Fiji when you finance your car with MARAC*." /></a></div>',
	element: "#main",
	operation: "prepend"
}
,
{
	include: "(/content/finance/)|(/content/promotions/flytofiji.aspx)|(/content/promotions/flytofiji-terms.aspx)",
	html: '<a href="/flytofiji"><img src="/images/promotions/flytofiji.170x123.jpg" alt="Be in to WIN 1 of 3 trips to Fiji when you finance your car with MARAC." width="170" height="123" /></a>',
	element: "#sidebar",
	operation: "append"
}

/*, removed 24 september 2009
{
	include: "(/pie_calculator.htm)|(/content/investing/pies.aspx)",
	html: '<div id="banner"><a href="/pies/"><img src="/images/promotions/PIE/PIE_950x110.jpg" width="950" height="110" alt="Paying less tax is as easy as PIE" /></a></div>',
	element: "#main",
	operation: "prepend"
}
,
{
	include: "(/content/investing/)|(/content/finance/)|(/enquiry-forms/motor-vechicle-contact.aspx)|(/faq/car-finance.aspx)|(/net/calculators/motor-vehicle.aspx)",
	exclude: "/content/investing/pies.aspx",
	html: '<a href="/pies/"><img src="/images/promotions/PIE/PIE_mini_sky_170x115.gif" width="170" height="115" /></a>',
	element: "#sidebar",
	operation: "append"
} */



)
	


adserve = function(){
	
	var init = function(){
		
		for(var i in ads){
			var ad = ads[i];
			
			var re_include = new RegExp(ad.include, "gim");
			var re_exclude = new RegExp(ad.exclude, "gim");
			
			if(re_include.test(window.location) ){
				if( !(ad.exclude != undefined && re_exclude.test(window.location) ) )
					$(ad.element)[ad.operation](ad.html);
			}
		}
	
	}	
	
	return {
	/* Public API
	*/
	init: init
	}
		
}();

$(document).ready(adserve.init);