/*! 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/company-info/)|(/content/finance/)|(/content/investing/)|(/content/calculators/)|(/content/insurance/)|(/content/dealer-finance/)|(/net/)",
html: '<div id="banner"><a href="/content/motor/default.aspx"><img src="/images/promotions/hawaii-2011/hawaii-950x110.jpg" width="950" height="110" alt="" /></a></div>',
element: "#main",
operation: "prepend"
}
,
{
    include: "(/content/company-info/)|(/content/finance/)|(/content/investing/)|(/content/calculators/)|(/content/insurance/)|(/content/dealer-finance/)|(/net/)",
html: '<a href="/content/motor/default.aspx"><img src="/images/promotions/hawaii-2011/hawaii-170x225.jpg" alt="" width="170" height="225" /></a>',
element: "#sidebar",
operation: "append"
}
,
{
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"
});

	














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);
