//
// Created from template /WWW/content/maptemplates/ClientSimpleMap.template
// Date: Fri Dec 16 17:17:58 2011 GMT
//

if(typeof LEVU=="undefined"){LEVU=function(){function f(a){var b=document.getElementsByTagName("body");if(b.length===0)b=document.getElementsByTagName("head");b[0].appendChild(a)}return p={SQ:function(a){var b=this.FS(a);if(b){var c=b.src.indexOf("/"+a+"?");if(c>-1)return b.src.substr(c+a.length+2)}return""},ES:function(a){if((a=this.FS(a))&&a.innerHTML)try{eval(a.innerHTML)}catch(b){LEVU.LE("error with es of [ "+a.innerHTML+" ]","Error")}},FS:function(a){for(var b=document.getElementsByTagName("script"),
c=b.length-1;c>=0;c-=1)if(b[c].src.indexOf("/"+a)>-1)return b[c];return""},GP:function(a,b){if(b&&a)return LEVU.RX(a,"[?|&]?"+b+"=([^&]*)")},SP:function(a,b,c){var d=a.indexOf(b);if(d>0){d=RegExp("[&|?]"+b+"=[^&]*");return a.replace(d,b+"="+c)}else if(d<0)return a+"&"+b+"="+c;else{d=RegExp("^"+b+"=[^&]*");return a.replace(d,b+"="+c)}},AIF:function(a,b){var c=document.createElement("iframe");if(b){c.width="18px";c.height="18px"}else{c.width="0px";c.height="0px"}c.style.position="absolute";c.style.top=
"0px";c.style.left="-999em";f(c);c.src=a},WIF:function(a,b){var c=LEVU.GetCB(5),d='<iframe id="tmif'+c+'" src="" style="position: absolute; top: 0px; left: -999em " ';d+=b?'width = "18px" height="18px"':'width = "0px" height="0px"';document.write(d+"></iframe>");document.getElementById("tmif"+c).src=a},AJS:function(a){var b=document.createElement("script");b.type="text/javascript";f(b);b.src=a},CIm:function(a){(new Image).src=a},DS:function(a){if(!a)return 0;return a>=Math.random()*100?1:0},LE:function(a,
b){b||(b="Error");typeof console!="undefined"&&LEVU.GC("tmDebug")==1&&console.log("TagMan "+b+": "+a)},GetCB:function(a){return(Math.random()+"").substr(2,a)},GC:function(a){var b=document.cookie,c=b.indexOf(a+"=");if(c>-1){epos=b.indexOf(";",c);return epos>c?unescape(b.substr(c+a.length+1,epos-c-a.length-1)):unescape(b.substr(c+a.length+1))}else return""},SC:function(a,b,c,d){a=a+"="+escape(b)+";";if(d==1)a+=" expires=Tue, 2 Jun 2015 00:00:00 UTC;";c||(c="/");a+=" path="+c+";";document.cookie=a},
OTQ:function(a){var b=[];for(var c in a)b.push(escape(c)+"="+escape(a[c]));return b.join("&")},QTO:function(a){a=a.replace(/^[?&]/,"").split("&");for(var b={},c=0;c<a.length;c++){var d=a[c].split("=");b[unescape(d[0])]=unescape(d[1])}return b?b:""},IIF:function(){return window.parent.frames.length===0?0:1},RX:function(a,b){if(a&&b){var c=RegExp(b).exec(a);if(c){c.splice(0,1);return c.join("")}}return""},SS:function(a,b,c){if(a)return c?a.toString().substr(b,c):a.toString().substr(b);return""},FD:function(a,
b){if(a&&b)return a.indexOf(b)==-1?0:1;return 0},GS:function(a,b){if(a&&b){var c="";b=","+b+",";for(var d=a.split("/"),g=d.length*-1,e=0;e<d.length;e+=1){if(b.indexOf(","+e+",")>-1||b.indexOf(","+g+",")>-1){if(c)c+="/";c+=d[e]}g+=1}return c}},WJS:function(a,b){var c='<script type="text/javascript"';c+=b?' src="'+a+'">':">"+a;document.write(c+"<\/script>")},ADW:function(a){if(typeof LEVU.djs=="undefined")LEVU.djs="";LEVU.djs+=" "+a},IDW:function(){if(typeof LEVU.djs!="undefined"&&LEVU.djs){var a="https://"==
LEVU.GPR()?"https://sec":"http://res";LEVU.WJS(a+".levexis.com/js/LEVU.WDW.xjs",1)}},WDW:function(){if(typeof LEVU.djs!="undefined"&&LEVU.djs){LEVU.WJS(LEVU.djs,0);LEVU.djs=""}},GPR:function(){return location.protocol=="https:"?"https://":"http://"},PR:function(a){var b="";for(var c in a)b+="\t"+c+"=>"+a[c]+"\n";return b}}}();LEVU.ES("lu.js");var q=LEVU.SQ("lu.js");if(q){var u=LEVU.GPR()+q;LEVU.WJS(u,1)}};
if ( LEVU.GC('tmStaging') ) {
    // avoid infinite loop if someone puts live template on staging or is messing around with their dns
    if (typeof(tmIncludedOnce)=='undefined') {
        var stagingMapURL = LEVU.FS('subarudealernet.js');
        if (stagingMapURL) {            
            var stagingMapURL = stagingMapURL.src.replace( /(.*?)\/\/(.*?)\.(.*?)\// , '$1//tagstaging.$3/' );
            LEVU.WJS(stagingMapURL,1);
        } else {
            LEVU.LE('Unable to find [subarudealernet.js]','FATAL');
        }
        var tmIncludedOnce = 1;
    }
} else {

    <!-- No Client JS -->
    
    // reverse compatibility
    if (typeof( tmPageId ) == 'undefined' && typeof( tmContId ) != 'undefined') var tmPageId = tmContId;
    
    
    if (typeof(tmPageId)!='undefined') LEVU.LE('base tmPageId='+tmPageId,'Debug');
    if (typeof(tmOPV)!='undefined') LEVU.LE('base tmOPV='+tmOPV,'Debug');
    
    // Initialise globals
    var searchRecords = [ LEVU.GS(location.pathname,'1') // Path postition 1
,LEVU.GS(location.pathname,'1,2') // Path postition 1 and 2
,tmParam["soadealer"].toString() + location.pathname // Dealer Code AND URL Path
 ];
    
    if (!searchRecords) {
            LEVU.LE('No mapping rules found','Warning');
    } else {
            LEVU.LE("Mapping Rule Values\n" + LEVU.PR(searchRecords),'Debug');	
    }
   
    // Unhashed data
    var Unencoded = [ {OPVTO:30,SPID:6,Maps:{"0index.htm":[16,0],"0certified-inventory":[18,0],"0used-inventory":[19,0],"0testexceptioncase201007134666":[20,0],"1new-inventory/index.htm":[17,0],"1financing/index.htm":[21,0]}},
	{OPVTO:30,SPID:11,Maps:{"0index.htm":[16,0],"0certified-inventory":[18,0],"0used-inventory":[19,0],"0testexceptioncase201007981321":[20,0],"1new-inventory/index.htm":[17,0],"1financing/index.htm":[21,0]}},
	{OPVTO:30,SPID:3,Maps:{"0index.htm":[16,0],"0certified-inventory":[18,0],"0used-inventory":[19,0],"0testexceptioncase201007154798":[20,0],"1new-inventory/index.htm":[17,0],"1financing/index.htm":[21,0]}},
	{OPVTO:30,SPID:7,Maps:{"0index.htm":[16,0],"0used-inventory":[19,0],"0certified-inventory":[18,0],"0testexceptioncase201007448173":[20,0],"1new-inventory/index.htm":[17,0],"1financing/index.htm":[21,0]}},
	{OPVTO:30,SPID:9,Maps:{"0index.htm":[16,0],"0certified-inventory":[18,0],"0used-inventory":[19,0],"0testexceptioncase201007321544":[20,0],"1new-inventory/index.htm":[17,0],"1financing/index.htm":[21,0]}},
	{OPVTO:30,SPID:12,Maps:{"0index.htm":[16,0],"0certified-inventory":[18,0],"0used-inventory":[19,0],"0testexceptioncase201007716241":[20,0],"1new-inventory/index.htm":[17,0],"1financing/index.htm":[21,0]}},
	{OPVTO:30,SPID:2,Maps:{"0certified-inventory":[18,0],"0used-inventory":[19,0],"0testexceptioncase201007246236":[20,0],"0index.htm":[16,0],"0":[36,0],"1new-inventory/index.htm":[17,0],"1financing/index.htm":[21,0],"2070149/contact-form.htm":[52,0],"2070117/used-inventory/index.htm":[34,0],"2070117/new-inventory/index.htm":[33,0],"2070117/contact-form.htm":[36,0],"2070203/used-inventory/index.htm":[38,0],"2070117/special-offers.htm":[35,0],"2070203/new-inventory/index.htm":[37,0],"2070203/special-offers.htm":[39,0],"270203/contact-form.htm":[40,0],"2070469/new-inventory/index.htm":[41,0],"2070469/used-inventory/index.htm":[42,0],"2070469/special-offers.htm":[43,0],"2070469/contact-form.htm":[44,0],"2070484/new-inventory/index.htm":[45,0],"2070484/used-inventory/index.htm":[46,0],"2070484/special-offers.htm":[47,0],"2070484/contact-form.htm":[48,0],"2070149/new-inventory/index.htm":[49,0],"2070149/used-inventory/index.htm":[50,0],"2070149/special-offers.htm":[51,0]}},
	{OPVTO:30,SPID:8,Maps:{"0index.htm":[16,0],"0certified-inventory":[18,0],"0used-inventory":[19,0],"0testexceptioncase201007918771":[20,0],"1new-inventory/index.htm":[17,0],"1financing/index.htm":[21,0]}},
	{OPVTO:30,SPID:1,Maps:{"0certified-inventory":[18,0],"0testexceptioncase201007123123":[20,0],"0used-inventory":[19,0],"0used":[26,0],"1financing/index.htm":[21,0],"1contact-form.htm":[29,0],"1new-inventory/index.htm":[17,0],"1specials/new.htm":[28,0],"1dealership/directions.htm":[31,0],"1new/Subaru":[25,0],"1index.htm":[16,0]}},
	{OPVTO:30,SPID:4,Maps:{"0index.htm":[16,0],"0used-inventory":[19,0],"0certified-inventory":[18,0],"0testexceptioncase201007781946":[20,0],"1new-inventory/index.htm":[17,0],"1financing/index.htm":[21,0]}},
	{OPVTO:30,SPID:13,Maps:{"0index.htm":[16,0],"0certified-inventory":[18,0],"0used-inventory":[19,0],"0testexceptioncase201007716324":[20,0],"1new-inventory/index.htm":[17,0],"1financing/index.htm":[21,0],"1makeanoffer-form-confirm.htm":[22,0],"1carflix-form-confirm.htm":[22,0],"1contact-form-confirm.htm":[22,0],"1emailafriend-form-confirm.htm":[22,0],"1eprice-form-confirm.htm":[22,0],"1fastquote-confirm.htm":[22,0],"1tradein-form-confirm.htm":[22,0],"1vehiclelead-form-confirm.htm":[22,0]}},
	{OPVTO:30,SPID:10,Maps:{"0index.htm":[16,0],"0certified-inventory":[18,0],"0used-inventory":[19,0],"0testexceptioncase201007698732":[20,0],"1new-inventory/index.htm":[17,0],"1financing/index.htm":[21,0]}},
	{OPVTO:30,SPID:5,Maps:{"0index.htm":[16,0],"0certified-inventory":[18,0],"0used-inventory":[19,0],"0testexceptioncase201007897944":[20,0],"1new-inventory/index.htm":[17,0],"1financing/index.htm":[21,0]}} ];

    var i=-1;
    var tmContainer;
    //
    // Only Search if pageId maches
    //
    for (var j=0;j<Unencoded.length;j++) {
    	var map = Unencoded[j];
	if (map["SPID"] == tmPageId) {
		i = searchRecords.length;
		LEVU.LE("Mapping string\n" + LEVU.PR(map["Maps"]),'Debug');	
		while (i > 0 && !tmContainer) {
			i--;
			tmContainer = map["Maps"][i+searchRecords[i].toString()];
		}
	}
    }
    if (i==-1)
	LEVU.LE('No mappings for this tmContainer','Warning');
     
    // update pageId and tmContainerId if matched
    if (tmContainer) {
            var sourcePageId =  tmPageId;
            tmOPV = tmContainer[1];
            tmPageId = tmContainer[0];
    }
}
