/*! 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/school-of-cricket/.*",
    html: '<link href="/_resx/css/sponsors-carousel/hidecarousel.css" type="text/css" rel="stylesheet" /><a id="header-sponsor" href="http://www.railwaymetro.co.nz"><img src="/images/sponsors/railwaymetro-newworld.gif" width="160" height="55" alt="Railway Metro New World" /></a>',
	element: ".content_header",
	operation: "prepend"
}
,
{
    include: "/content/teams/future-firebirds.*",
    html: '<a id="header-sponsor" href="http://www.dental.net.nz/"><img src="/images/sponsors/code-header.gif" width="160" height="55" alt="Centre of Dental Excellence" /></a>',
    element: ".content_header",
    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);