var setup=[];
setup.cssfile="http://www.centralgaragetenterden.co.uk/autodirector/client/red.css";
setup.pagesizes=[5,10,25,50,0];
setup.site="centralgarage";
setup.locale="GBP";
setup.searchURL="http://www.centralgaragetenterden.co.uk/autodirector/carlistsearch.php?site=centralgarage&search=";
setup.viewURL="http://www.centralgaragetenterden.co.uk/autodirector/viewupdate.php?site=centralgarage&amp;id=";
setup.emailURL="http://www.centralgaragetenterden.co.uk/autodirector/emailsales.php?site=centralgarage&id=";
setup.thumburl="http://www.centralgaragetenterden.co.uk/autodirector/data/centralgarage/thumbs/";
setup.picurl="http://www.centralgaragetenterden.co.uk/autodirector/data/centralgarage/pics/";
setup.picsize=600;
setup.licprod=true;
setup.showform=true;
setup.adverton=true;
setup.orderbyon=true;
setup.advert="powered by Elsmore Creative Marketing";
setup.advertURL="http://www.elsmore.co.uk/";

var vehiclelist;
function DefineVehicles() {
	vehiclelist=[];
	vehiclelist[0]=new Vehicle(14, false, 2008, "VAUXHALL MERIVA 1.4 16V DESIGN", 16919, "blue", "", "08 57 Vauxhall Meriva Design 1.4 16v Twinport. Power Steering, Anti Lock Brakes, Air Conditioning, 2 Sunroofs, Electric Windows, Electric Mirrors, Remote Central Door Locking, Radio CD Player, Front Fog Lamps, Privacy Glass, Twin Front Air Bags, Only 16919 Miles, Finished In Metallic Blue.", 8670, [101,102,103]);
	vehiclelist[1]=new Vehicle(57, false, 2008, "FORD FUSION + 1.6", 9555, "black", "automatic", "08 58 Ford Fusion + 1.6. Power Steering, Anti Lock Brakes, Alloy Wheels, Air Conditioning, Front Fog Lamps, Electric Front Windows, Electric Mirrors, Radio CD Player, Remote Central Door Locking, Balance Manufacturers Warranty, Twin Front Air Bags, Side Air Bags, Only 9555 Miles, Finished In Metallic Black.", 7970, [150,151,152]);
	vehiclelist[2]=new Vehicle(58, false, 2007, "FORD FIESTA STYLE CLIMATE", 23769, "black", "automatic", "07 57 Ford Fiesta 1.6 Style Climate 5 Door. Power Steering, Anti Lock Brakes, Air Conditioning, Heated Front Screen, Electric Front Windows, Electric Mirrors, Remote Central Door Locking, Radio CD Player, Head Restraints, Twin Front Air Bags, Only 23769 Miles, Finished In Metallic Black.", 7470, [147,148,149]);
	vehiclelist[3]=new Vehicle(50, false, 2007, "FORD FOCUS 1.6 LX", 19205, "grey", "automatic", "07 07 Ford Focus 1.6 LX 5 Door. Power Steering, Anti Lock Brakes, Air Conditioning, Remote Central Door Locking, Electric Front Windows, Electric Mirrors, Radio CD Player, Head Restraints, Folding Rear Seats, Twin Front Air Bags, Side Air Bags, Only 19205 Miles, Finished In Metallic Grey.", 7370, [123,124,125]);
	vehiclelist[4]=new Vehicle(73, false, 2009, "PEUGEOT 107 1.0 VERVE", 17767, "red", "manual", "09 09 Peugeot 107 Verve. Power Steering, Anti Lock Brakes, Alloy Wheels, Air Conditioning, Electric Windows, Radio CD Player, Remote Central Door Locking, £20|A Year Road Tax, Group 1 Insurance, Twin Front Air Bags, Side Air Bags, Only 17767 Miles, Finished In Red.", 6970, []);
	vehiclelist[5]=new Vehicle(51, false, 2007, "NISSAN  NOTE 1.6 SE", 26859, "silver", "automatic", "07 07 Nissan Note 1.6 SE 5 Door. Power Steering, Anti Lock Brakes, Alloy Wheels, Air Conditioning, Electric Windows, Electric Mirrors, Remote Central Door Locking, Radio CD Player, Front Fog Lamps, Twin Front Air Bags, Side Air Bags, Curtain Air Bags, Only 26869 Miles, Finished In Metallic Silver.", 6770, [156,157,158]);
	vehiclelist[6]=new Vehicle(68, false, 2005, "HONDA CIVIC 1.4 SE", 41480, "blue", "automatic", "05 55 Honda Civic 1.4 SE 5 Door, Power Steering, Anti Lock Brakes, Alloy Wheels, Air Conditioning, Electric Windows, Electric Mirrors, Remote Central Door Locking, Radio CD Player, Head Restraints, Twin Front Air Bags, Side Air Bags, Only 41470 Miles, Finished In Metallic Blue.", 6470, [192,193,194]);
	vehiclelist[7]=new Vehicle(18, false, 2006, "MITSUBISHI COLT 1.4 EQUIPPE", 29369, "grey", "automatic", "06 55 Mitsubishi Colt 1.4 Equippe 3 Door. Power Steering, Anti Lock Brakes, Alloy Wheels, Air Conditioning, Electric Windows, Electric Mirrors, Radio CD Player, Remote Central Door Locking, Twin Front Air Bags, Only 29367 Miles, Finished In Metallic Grey.", 5470, [83,84,85]);
	vehiclelist[8]=new Vehicle(47, false, 2006, "FIAT DOBLO MPV DYNAMIQUE 1.4", 23565, "blue", "manual", "06 06 Fiat  Doblo Dynamique 1.4 MPV. Power Steering, Anti Lock Brakes, Alloy Wheels, Air Conditioning, Sliding Rear Doors, Electric Front Windows, Radio CD Player, Remote Central Door Locking, Folding Rear Seats, Front Fog Lamps, Twin Front Air Bags, Only 23565 Miles, Finished In Metallic Bue.", 5470, [120,121,122]);
	vehiclelist[9]=new Vehicle(19, false, 2006, "FORD KA ZETEC CLIMATE", 16148, "grey", "manual", "06 56 Ford  KA Zetec Climate, Power Steering, Anti Lock Brakes, Allot Wheels, Air Conditioning, Heated Front Screen, Electric Windows, Electric Mirrors, Radio CD Player, Remote Central Door Locking, Rear Spoiler, Twin Front Air Bags, Side Air Bags, Only 16148 Miles, Finished In Metallic Grey.", 5270, [38,39,40]);
	vehiclelist[10]=new Vehicle(66, false, 2003, "HONDA JAZZ 1.4 SE", 47456, "green", "automatic", "03 53 Honda Jazz 1.4 SE. Power Steering, Anti Lock Brakes, Alloy Wheels, Air Conditioning, Electric Sunroof, Electric Windows, Electric Mirrors, Radio CD Player, Remote Central Door Locking, Haed Restraints, Folding Rear Seats, Twin Front Air Bags, Only 47456 Miles, Finished In Metallic Green.", 5270, [177,178,179]);
	vehiclelist[11]=new Vehicle(74, false, 2003, "RENAULT  KANGOO  EXPRESSION", 29950, "blue", "automatic", "03 53 Renault Kangoo Expression 1.6 16v 5Door. Power Steering, Anti Lock Brakes, Alloy Wheels, Electric Front Seats, Electric Mirrors, Remote Central Door Locking, Radio CD Player, Removable Rear Seats, Front Fog Lamps, Twin Front Air Bags,  Twin Front Air Bags, Only 29950 Miles,", 4470, []);
	vehiclelist[12]=new Vehicle(62, false, 2005, "NISSAN MICRA 1.2 S", 48450, "silver", "manual", "05 05 Nissan Micra 1.2 S 5 Door, Power Steering, Anti Lock Brakes, Electric Windows,   Remote Central Door Locking, Radio CD Player, Head Restraints, Folding Rear Seats,   Twin Front Air Bags, Side Air Bags, Only 48450 Miles, Finished In Metallic Silver.", 4370, [168,169,170]);
	vehiclelist[13]=new Vehicle(72, false, 2004, "NISSAN MICRA 1.2 SE", 29061, "black", "manual", "04 54 Nissan Micra 1.2 SE 3 Door. Power Steering, Anti Lock Brakes, Alloy Wheels, Air Conditioning, Electric Windows, Electric Mirrrors, Remote Central Door Locking, Radio CD Player, Head Restraints, Folding Rear Seats, Twin Front Air Bags, Only 29061 Miles, Finished In Metallic Black.", 4270, [186,187,188]);
	vehiclelist[14]=new Vehicle(67, false, 2002, "RENAULT LAGUNA 1.8 16V PRIVILEGE", 59250, "silver", "automatic", "02 52 Renault Laguna 1.8 Privilege 16v 5 Door, Power Steering, Anti Lock Brakes, Alloy Wheels, Air Conditioning, Electric Windows, Electric Mirrors, Remote Central Door Locking, Front Fog Lamps, Radio CD Player, Twin Front Air Bags, Side Air Bags, Curtain Air Bags, Only 59250 Miles, Finished In Metallic Silver.", 3470, [180,181,182]);
	vehiclelist[15]=new Vehicle(71, false, 2001, "TOYOTA COROLLA  1.6 GS", 62801, "silver", "manual", "01 Y Toyota Corolla 1.6 GS 5 Door. Power Steering, Anti Lock Brakes, Air Conditioning, Electric Front Windows, Electric Mirrors, Remote Central Door Locking, Radio Cassette Player, Head Restraints, Folding Raer Seats, Twin Front Air Bags, Only 62801 Miles, Finished In Metallic Silver.", 2770, [189,190,191]);
	vehiclelist[16]=new Vehicle(69, false, 2000, "SKODA  FELICIA 1.6 GLXi", 81219, "silver", "manual", "00 W Skoda Felicia 1.6 GLXi 5 Door. Power Steering, Anti Lock Brakes, Sunroof, Electric Mirrors, Radio Cassette Player, Central Door Locking, Front Fog Lamps, Head Restraints, Folding Rear Seats, Drivers Air Bag, Only 81219 Miles, Finished In Metallic Silver.", 1470, [183,184,185]);
	vehiclelist[17]=new Vehicle(13, false, 2008, "FIAT 500 LOUNGE", 6016, "white", "manual", "08 08 Fiat 500 1.2 Lounge. Panoramic Roof, Power Steering, Anti Lock Brakes, Alloy Wheels, Air Conditioning, Electric Windows, Electric Mirrors, Remote Central Door Locking, Radio CD Player, Sunroof, Balance Manufacturers Warranty, Twin Front Air Bags, Side Air Bags, Only 6016 Miles, Finished In White.", null, [53,54,55]);
	vehiclelist[18]=new Vehicle(59, false, 2007, "RENAULT MEGANE 1.6 DYNAMIQUE", 5850, "quartz", "automatic", "07 07 Renault Megane 1.6 Dynamique 5 Door. Power Steering, Anti Lock Brakes, Alloy Wheels, Air Conditioning, Electric Windows, Electric Mirrors, Remote Central Door Locking, Radio CD Player, Front Fog Lamps, Twin Front Air Bags, Side Air Bags, Only 5850 Miles, Finished In Metallic Quartz.", null, [162,163,164]);
	vehiclelist[19]=new Vehicle(32, false, 2006, "CITROEN XSARA PICASSO EXCLUSIVE 2.0", 18655, "grey", "automatic", "06 56 Citroen Xsara Picasso 2.0 Exclusive. Power Steering, Anti Lock Brakes, Alloy Wheels, Air Conditioning, Remote Central Door Locking, Electric Windows, Electric Mirros, Radio CD Player, Front Fog Lamps, Twin Front Air Bags, Side Air Bags, Only 18655 Miles, Finished In Metallic Grey.", null, [68,69,70]);
	vehiclelist[20]=new Vehicle(70, false, 2001, "NISSAN ALMERA 1.8 SE", 45840, "black", "automatic", "01 Y Nissan Almera 1.8 SE 5 Door. Power Steering, Anti Lock Brakes, Air Conditioning, Electric Front Windows, Electric Mirrors, Radio CD Player, Remote Central Door Locking, Head Restraints, Folding Rear Seats, Twin Front Air Bags, Only 45840 Miles, Finished In Metallic Black.", null, []);
}
setup.searchon=true;



// Client JavaScript, (C)AutoDirector
setup.text = {
	searchtitle: "search",
	search: "search:",
	ordertitle: "change vehicle order",
	orderby: "order by:",
	go: "go",
	detaillink: "click for more details...",
	model: "model:",
	colour: (setup.locale == 'USD' ? 'color' : 'colour') + ":",
	gearbox: (setup.locale == 'USD' ? 'transmission' : 'gearbox') + ":",
	mileage: "mileage:",
	mileageunit: "miles",
	details: "details:",
	novehicles: "No vehicles are available at this time. Please return later.",
	nodetails: "The vehicle you requested is not available. Please return to the showroom.",
	contact: "contact us about this vehicle",
	name: "name:",
	nametitle: "enter your name",
	email: "email:",
	emailtitle: "enter your email address",
	telephone: "telephone:",
	telephonetitle: "enter your telephone number",
	questions: "questions:",
	questionstitle: "enter any questions or comments",
	send: "send enquiry",
	invalid: "Please enter",
	invalidname: " - your name",
	invalidcontact: " - an email address or telephone number",
	invalidemail: " - a valid email address",
	sendenquiry: "sending your enquiry...",
	sendsuccess: "Your enquiry was sent successfully. We will contact you shortly.",
	sendfail: "Sorry, but your enquiry could not be sent at this time. Please try again later or contact us directly.",
	sendtimeout: "Sorry, but your enquiry is taking too long. Please try again later.",
	backshowroom: "&lt; back to the showroom",
	back: "&lt; back",
	backtitle: "previous page",
	next: "next &gt;",
	nexttitle: "next page",
	vehicle: "vehicle",
	vehicles: "vehicles",
	show: "show",
	showall: "all",
	showor: "or",
	showpage: "per page",
	searchfail: "Sorry, but your search is taking too long.\nPlease try again later.",
	imageclose: "close",
	imageback: "back",
	imagenext: "next"
}

setup.override={
	showprice: true,
	currencystart: "",
	currencyend: "",
	pricemessage: ["sold", "please call"]
}

// sorting options
var sortTypes = [];
var st=0;
sortTypes[st++] = { name: "price, highest first", sort: function(a, b) { return SortCars(a.price, b.price, -1); } };
sortTypes[st++] = { name: "price, lowest first", sort: function(a, b) { return SortCars(a.price, b.price, 1); } };
sortTypes[st++] = { name: "make/model, A to Z", sort: function(a, b) { return SortCars(a.model, b.model, 1); } };
sortTypes[st++] = { name: "make/model, Z to A", sort: function(a, b) { return SortCars(a.model, b.model, -1); } };
sortTypes[st++] = { name: "year, youngest first", sort: function(a, b) { return SortCars(a.year, b.year, -1); } };
sortTypes[st++] = { name: "year, oldest first", sort: function(a, b) { return SortCars(a.year, b.year, 1); } };
sortTypes[st++] = { name: "mileage, lowest first", sort: function(a, b) { return SortCars(a.mileage, b.mileage, 1); } };
sortTypes[st++] = { name: "mileage, highest first", sort: function(a, b) { return SortCars(a.mileage, b.mileage, -1); } };
sortTypes[st++] = { name: "search result", sort: function(a, b) { return SortCars(a.searchrank, b.searchrank, -1); } };
sortTypes[st++] = { name: "search (reversed)", sort: function(a, b) { return SortCars(a.searchrank, b.searchrank, 1); } };

var run=[];setup.comlimit=1000;setup.timeout=10000;setup.thisURL=location.protocol+"//"+location.host+(location.port!=""?":"+location.port:"")+location.pathname;setup.activesearch=false;setup.JSsearch=null;setup.activesend=false;setup.JSsend=null;setup.senderror="";setup.salesemail="";setup.lightbox=null;var $T=setup.text;setup.divs=["licence","search","jumptop","list","jumpend","backtop","vehicle","enqresult","enquiry","backend","sponsor"];if(setup.orderbyon||setup.searchon){setup.Tsearch='<form id="adsearch" action="'+setup.thisURL+'" method="get"><fieldset><legend>'+$T.searchtitle+"</legend>";setup.Tsearch+='<div class="order"><label for="adorderby" title="'+$T.ordertitle+'">'+$T.orderby+'</label><select id="adorderby" name="adorderby"></select></div>';if(setup.searchon){setup.Tsearch+='<div class="search"><label for="adsearchterm" title="search for a vehicle">'+$T.search+'</label><input id="adsearchterm" name="adsearchterm" type="text" size="20" maxlength="50" /><input type="submit" value="'+$T.go+'" class="button" /></div>'}setup.Tsearch+="</fieldset></form>"}else{setup.Tsearch=""}setup.Tlist='<a id="ad_id[id]" href="#" title="'+$T.detaillink+'">[pic]';setup.Tdetail="[pics]";var adt="";if($T.model){adt+='<dt class="model">'+$T.model+'</dt><dd class="model">[newcar] [year] [model]</dd>'}if($T.colour){adt+='<dt class="colour">'+$T.colour+'</dt><dd class="colour">[colour]</dd>'}if($T.gearbox){adt+='<dt class="gearbox">'+$T.gearbox+'</dt><dd class="gearbox">[gearbox]</dd>'}if($T.mileage){adt+='<dt class="mileage">'+$T.mileage+'</dt><dd class="mileage">[mileage]</dd>'}if(adt){setup.Tlist+="<dl>"+adt+"</dl>"}if($T.details){adt+='<dt class="details">'+$T.details+'</dt><dd class="details">[info]</dd>'}if(adt){setup.Tdetail+="<dl>"+adt+"</dl>"}if(setup.override.showprice){adt='<div class="price">[price]</div>';setup.Tlist+=adt;setup.Tdetail+=adt}setup.Tlist+="</a>";setup.Tdetail+='<img src="'+setup.viewURL+'[id]" class="count" />';setup.Tlistnone="<p>"+$T.novehicles+"</p>";setup.Tdetailnone="<p>"+$T.nodetails+"</p>";setup.Tenquiry='<form id="adenquiry" action="'+setup.thisURL+'" method="get"><fieldset><legend>'+$T.contact+'</legend><div><label for="adname" title="'+$T.nametitle+'">'+$T.name+'</label><input  id="adname" name="adname" type="text" size="20" maxlength="50" /></div><div><label for="ademail" title="'+$T.emailtitle+'">'+$T.email+'</label><input  id="ademail" name="ademail" type="text" size="20" maxlength="100" /></div><div><label for="adtel" title="'+$T.telephonetitle+'">'+$T.telephone+'</label><input  id="adtel" name="adtel" type="text" size="20" maxlength="20" /></div><div><label for="adcomments" title="'+$T.questionstitle+'">'+$T.questions+'</label><textarea id="adcomments" name="adcomments" rows="4" cols="20"></textarea></div><div><input type="submit" value="'+$T.send+'" class="button" /></div></fieldset></form>';setup.Tback='<a href="#">'+$T.backshowroom+"</a>";setup.Tsponsor="";if(setup.adverton!=""){setup.Tsponsor+=setup.advert;if(setup.advertURL!=""){setup.Tsponsor='<a href="'+setup.advertURL+'">'+setup.Tsponsor+"</a>"}}setup.Tunlic='This showroom is powered by an unlicenced trial copy of AutoDirector. You may evaluate the AutoDirector system for 30 days. To remove this message, please visit <a href="http://www.autodirector.co.uk/">http://www.autodirector.co.uk/</a> and purchase a licence key.';function SortCars(B,A,C){if(B<A){return -1*C}if(B>A){return 1*C}return 0}function ADstart(){setup.OK=true;if(!owl.Dom){setup.OK=false;alert("Please use a more modern browser to view the showroom.")}else{if(owl.Dom.Get("#autodirector").length!=1){setup.OK=false;alert('This page does not contain a\n<div id="autodirector"></div> tag.')}if(owl.Dom.Get("head").length!=1){setup.OK=false;alert("The page does not contain a <head>.")}}if(!setup.OK){return }if(setup.cssfile!=""){owl.Dom.LoadCSS(setup.cssfile)}setup.adnode=owl.Dom.Get("#autodirector")[0];DefineVehicles();DefineDefaults();DefineNodes();var D=run.list;if(!setup.orderbyon&&!setup.searchon){ShowVehicleList()}else{var B=owl.Dom.Get("#adorderby")[0];var A=owl.Dom.Get("#adsearchterm")[0];if(A&&run.searchresult==null){D=true;A.value=run.search;run.search="";EventSearchSubmit()}else{if(B){var C=run.thispage;B.value=run.orderby;EventChangeOrder();if(run.thispage!=C){run.thispage=C;ShowVehicleList()}}}}if(!D&&run.ID>0){var E=run.ID;run.ID=0;ShowVehicle(E)}else{run.ID=0}}function DefineDefaults(){var E=[];owl.Cookie.Restore(E,"adcs");var C=owl.Http.Arguments();var D=function(H,I){var G=I;if(owl.Object.PropertyExists(E,H)){G=E[H]}if(owl.Object.PropertyExists(C,H)){G=C[H]}return G};run.ID=owl.Number.toInt(D("id",0));run.list=(D("list",true)==true);if(run.ID>0&&run.list==true&&owl.Object.PropertyExists(C,"id")&&!owl.Object.PropertyExists(C,"list")){run.list=false}run.orderby=owl.Number.toInt(D("orderby",0));run.pagesize=owl.Number.toInt(D("pagesize",setup.pagesizes[0]));run.thispage=owl.Number.toInt(D("thispage",1));run.name=D("name","");run.email=D("email","");run.tel=D("tel","");run.comments=D("comments","");run.scrollpos=owl.Number.toInt(D("scrollpos",0));var A=(owl.Object.PropertyExists(C,"search")?C.search:"");var F=(owl.Object.PropertyExists(E,"search")?E.search:"");if(A!=""&&setup.searchon){run.orderby=(setup.orderbyon?sortTypes.length-2:0);run.list=true}if(A!=""&&A!=F){run.search=A;run.searchresult=null}else{run.search=F;run.searchresult=D("searchresult","");if(run.searchresult!=""){run.searchresult=run.searchresult.split(",")}else{for(var B=0;B<vehiclelist.length;B++){run.searchresult[B]=vehiclelist[B].id}}UpdateSearchResult()}}function SaveDefaults(){owl.Cookie.Store(run,"adcs")}function DefineNodes(){owl.Dom.RemoveChildren(setup.adnode);var B;for(var E=0;E<setup.divs.length;E++){B=document.createElement("div");B.id="autodirector_"+setup.divs[E];setup["node"+setup.divs[E]]=setup.adnode.appendChild(B);setup["node"+setup.divs[E]].style.display="none"}if(!setup[String.fromCharCode(108,105,99,112,114,111,100)]){var F=setup[String.fromCharCode(84,117,110,108,105,99)];var D=setup.nodelicence;if(F.substr(31,5)=="unlic"){owl.innerHTML(D,F,false)}else{owl.innerHTML(D,String.fromCharCode(85,78,76,73,67,69,78,67,69,68),false)}var C=D.style;C.position="static";C.display="block";C.visibility="visible";C.width="auto";C.height="auto";C.fontSize="1.2em";C.fontWeight="bold";C.textAlign="center";C.padding="0.5em";C.marginBottom="0.5em";C.color="#c00";C.backgroundColor="#ffc";C.border="3px solid #c00"}if(setup.orderbyon||setup.searchon){owl.innerHTML(setup.nodesearch,setup.Tsearch,false);var G=owl.Dom.Get("#adorderby")[0];if(G){var A;for(var I=(setup.orderbyon?0:sortTypes.length-2);I<sortTypes.length-(setup.searchon?0:2);I++){A=document.createElement("option");A.setAttribute("value",I);A.appendChild(document.createTextNode(sortTypes[I].name));G.appendChild(A)}G.value=run.orderby;new owl.Event(G,"change",EventChangeOrder)}var H=owl.Dom.Get("#adsearch")[0];if(H){new owl.Event(H,"submit",EventSearchSubmit)}}if(setup.showform){owl.innerHTML(setup.nodeenquiry,setup.Tenquiry,false);owl.Dom.Get("#adname")[0].value=run.name;owl.Dom.Get("#ademail")[0].value=run.email;owl.Dom.Get("#adtel")[0].value=run.tel;owl.Dom.Get("#adcomments")[0].value=run.comments;new owl.Event(owl.Dom.Get("#adenquiry"),"submit",EventSendEnquiry);new owl.Event(owl.Dom.Get("#adcomments"),"keypress",EventLimitComments)}owl.innerHTML(setup.nodebacktop,setup.Tback,false);owl.innerHTML(setup.nodebackend,setup.Tback,false);if(setup.Tsponsor!=""){owl.innerHTML(setup.nodesponsor,setup.Tsponsor,false);setup.nodesponsor.style.display="block"}new owl.Event(setup.nodelist,"click",EventVehicleClick);new owl.Event(setup.nodejumptop,"click",EventPageClick);new owl.Event(setup.nodejumpend,"click",EventPageClick);new owl.Event(owl.Dom.Get("a",setup.nodebacktop)[0],"click",EventBackClick);new owl.Event(owl.Dom.Get("a",setup.nodebackend)[0],"click",EventBackClick)}function ShowVehicleList(C){run.list=true;C=(C!==false);var I="list";if(vehiclelist.length>0){if(setup.orderbyon||setup.searchon){I+=",search"}I+=",jumptop,jumpend";var A=run.pagesize;if(A<1){A=99999}var D=Math.floor((vehiclelist.length-1)/A)+1;if(run.thispage>D){run.thispage=D}if(C){var L=(run.thispage-1)*A;var F=L+A-1;if(F>vehiclelist.length-1){F=vehiclelist.length-1}var H="";for(var J=L;J<=F;J++){H+=vehiclelist[J].Replace(setup.Tlist)}owl.innerHTML(setup.nodelist,H);var K="<p>"+vehiclelist.length+" "+(vehiclelist.length>1?$T.vehicles:$T.vehicle)+": "+$T.show+" ";var E=[],G=false;for(var M=0;M<setup.pagesizes.length;M++){if(setup.pagesizes[M]<vehiclelist.length||!G){E[E.length]=setup.pagesizes[M];if(setup.pagesizes[M]>=vehiclelist.length){G=true}}}for(var M=0;M<E.length;M++){K+='<a href="#*'+E[M]+'"'+(run.pagesize==E[M]?' class="active"':"")+">"+(E[M]>0?E[M]:$T.showall)+"</a>";if(M+2<=E.length){K+=(M+2==E.length?" "+$T.showor+" ":", ")}}K+=" "+$T.showpage+"</p>";if(D>1){K+="<ol>";if(run.thispage>1){K+='<li><a href="#-1" class="back" title="'+$T.backtitle+'">'+$T.back+"</a></li>"}for(var B=1;B<=D;B++){K+='<li><a href="#'+B+'" title="page '+B+'"';if(B==run.thispage){K+=' class="active"'}K+=">"+B+"</a></li>"}if(run.thispage<D){K+='<li><a href="#+1" class="next" title="'+$T.nexttitle+'">'+$T.next+"</a></li>"}K+="</ol>"}owl.innerHTML(setup.nodejumptop,K);owl.innerHTML(setup.nodejumpend,K)}}else{if(C){owl.innerHTML(setup.nodelist,setup.Tlistnone)}}ShowNodes(I);SaveDefaults()}function ShowVehicle(E){run.list=false;var A="vehicle,backtop,backend";var C=setup.showform;if(E!=run.ID){run.ID=E;var B=VehicleIndex(E);if(B>=0){owl.innerHTML(setup.nodevehicle,vehiclelist[B].Replace(setup.Tdetail));var D=owl.Dom.Get("#autodirector_pics",setup.nodevehicle);if(D.length==1){setup.lightbox=new owl.Lightbox(D[0])}else{setup.lightbox=null}}else{run.ID=0;owl.innerHTML(setup.nodevehicle,setup.Tdetailnone);C=false}}if(C){A+=",enquiry"}ShowNodes(A);owl.Screen.ScrollToElement(setup.adnode,0,100,0,30);SaveDefaults()}function ShowNodes(A){for(var B=1;B<setup.divs.length-1;B++){setup["node"+setup.divs[B]].style.display=(A.indexOf(setup.divs[B])>=0?"block":"none")}}function VehicleIndex(B){var A=0;while(B!=vehiclelist[A].id&&A<vehiclelist.length-1){A++}return(vehiclelist[A].id==B?A:-1)}function UpdateSearchResult(){vehiclelist.sort(sortTypes[0].sort);var B=vehiclelist.length;var C;for(var A=0;A<B;A++){C=0;while(vehiclelist[A].id!=run.searchresult[C]&&C<run.searchresult.length){C++}vehiclelist[A].searchrank=(vehiclelist[A].id==run.searchresult[C]?B-C:-A)}}function Vehicle(C,J,I,F,G,A,B,E,H,D){this.id=C;this.newcar=(J?"NEW":"");this.year=owl.Number.toInt(I);this.model=F;this.mileage=owl.Number.toInt(G);this.colour=(A!=""?A:"-");this.gearbox=(B!=""?B:"-");this.info="|"+E+"|";this.info=reRepeat(this.info,/\|\-+\|/g,"|<hr />|");this.info=reRepeat(this.info,/\|-([^\|]+)\|/g,"|<h2>$1</h2>|");this.info=reRepeat(this.info,/\_([^\|]+)\_/g,"{{strong}}$1{{/strong}}");this.info=reRepeat(this.info,/!\(([^\||\(]+)\)/g,'{{img src="$1" /}}');this.info=reRepeat(this.info,/\[([^\||\[]+)\]\(\(([^\||\(]+)\)\)/g,'{{a href="$2"}}$1{{/a}}');this.info=reRepeat(this.info,/\(\(([^\||\(]+)\)\)/g,'{{a href="$1"}}$1{{/a}}');this.info=reRepeat(this.info,/\|\*([^\|]+)\|/g,"|<li>$1</li>|");this.info=reRepeat(this.info,/\|\+([^\|]+)\|/g,"|<liN>$1</liN>|");this.info=reRepeat(this.info,/\|([^\<][^\|]+)\|/g,"|<p>$1</p>|");this.info=reRepeat(this.info,/<\/li>\|<li>/g,"</li><li>");this.info=reRepeat(this.info,/<\/liN>\|<liN>/g,"</liN><liN>");this.info=reRepeat(this.info,/\|(<li>[^\|]+<\/li>)\|/g,"|<ul>$1</ul>|");this.info=reRepeat(this.info,/\|(<liN>[^\|]+<\/liN>)\|/g,"|<ol>$1</ol>|");this.info=reRepeat(this.info,/liN>/g,"li>");this.info=reRepeat(this.info,/\{\{/g,"<");this.info=reRepeat(this.info,/\}\}/g,">");this.info=reRepeat(this.info,/\|/g,"");this.price=(H!==null?owl.Number.toInt(H):0);this.pics=D;this.searchrank=0}function reRepeat(D,B,C){var A;do{A=D;D=D.replace(B,C)}while(D!=A);return D}Vehicle.prototype.Replace=function(A){A=A.replace(/\[id\]/gi,this.id);A=A.replace(/\[newcar\]/gi,this.newcar);A=A.replace(/\[year\]/gi,this.year);A=A.replace(/\[model\]/gi,this.model);A=A.replace(/\[mileage\]/gi,NumberFormat(this.mileage,0)+" "+$T.mileageunit);A=A.replace(/\[colour\]/gi,this.colour);A=A.replace(/\[gearbox\]/gi,this.gearbox);A=A.replace(/\[info\]/gi,this.info);var B;if(setup.override.pricemessage[this.price]){B=setup.override.pricemessage[this.price]}else{B=NumberFormat(this.price,0,true)}A=A.replace(/\[price\]/gi,B);if(this.pics.length>0){A=A.replace(/\[pic\]/gi,'<img src="'+setup.thumburl+this.pics[0]+'.jpg" title="'+this.model+'" />');var D='<ol id="autodirector_pics">';for(var C=0;C<this.pics.length;C++){D+='<li><a href="'+setup.picurl+this.pics[C]+'.jpg" title="'+this.model+" photograph "+(C+1)+' - click to enlarge..."><img src="'+setup.thumburl+this.pics[C]+'.jpg" alt="'+this.model+' photograph" /><strong>'+this.year+" "+this.model+"</strong><span>photograph "+(C+1)+" of "+this.pics.length+"</span></a></li>"}D+="</ol>";A=A.replace(/\[pics\]/gi,D)}else{A=A.replace(/\[pic\]/gi,"");A=A.replace(/\[pics\]/gi,"")}return A};function EventVehicleClick(A){A.StopDefaultAction();run.scrollpos=owl.Screen.ViewScroll().Y;var B=owl.Dom.FindAncestor(A.Target,"a");var C=(B?owl.Number.toInt(String(B.id).substr(5)):0);if(C>0){ShowVehicle(C)}}function EventChangeOrder(C){if(C){C.StopDefaultAction()}var B=owl.Dom.Get("#adorderby");if(B.length==1){B=B[0];owl.Css.ClassApply(B.parentNode,"active");run.orderby=B.value;vehiclelist.sort(sortTypes[run.orderby].sort);var A=owl.Dom.Get("#adsearchterm");if(A.length==1){A=A[0];if(run.orderby>=sortTypes.length-2){A.value=run.search}else{A.value=""}}run.thispage=1;ShowVehicleList();owl.Css.ClassRemove(B.parentNode,"active");owl.Screen.ScrollToElement(setup.adnode,0,100,0,30)}}function EventSearchSubmit(C){if(C){C.StopDefaultAction()}var A=owl.Dom.Get("#adsearchterm");if(!setup.activesearch&&A.length==1){A=A[0];var B=owl.String.Clean(A.value);if(B.length>0){if(B==run.search){owl.Dom.Get("#adorderby")[0].value=sortTypes.length-2;EventChangeOrder()}else{setup.activesearch=true;run.search=B;A.value=run.search;owl.Css.ClassApply(A.parentNode,"active");if(setup.JSsearch){owl.Dom.HeadRemove(setup.JSsearch)}setup.JSsearch=owl.Dom.LoadJS(setup.searchURL+escape(run.search)+"&callback=EventSearchResult()");setTimeout(EventSearchTimeout,setup.timeout)}}}}function EventSearchResult(){SearchReset();UpdateSearchResult();owl.Dom.Get("#adorderby")[0].value=sortTypes.length-2;EventChangeOrder()}function EventSearchTimeout(){if(setup.activesearch){SearchReset();owl.Dom.HeadRemove(setup.JSsearch);setup.JSsearch=null;run.search="";alert($T.searchfail)}}function SearchReset(){owl.Css.ClassRemove(owl.Dom.Get("#adsearchterm")[0].parentNode,"active");setup.activesearch=false}function EventPageClick(I){I.StopDefaultAction();var E=owl.Dom.FindAncestor(I.Target,"a");if(E){var B=E.getAttribute("href");var F=B.lastIndexOf("#");if(F>=0){var G=B.substr(F+1);var C=G.charAt(0);var A=(C=="*");var D=(C=="-"||C=="+");G=owl.Number.toInt(G);if(A){if(G!=run.pagesize){run.pagesize=G;ShowVehicleList()}}else{var H=(D?run.thispage+G:G);if(run.thispage!=H){run.thispage=H;ShowVehicleList();owl.Screen.ScrollToElement(setup.adnode,0,100,0,30)}}}}}function EventBackClick(A){A.StopDefaultAction();if(!setup.activesend){ShowVehicleList(false)}window.scrollTo(0,run.scrollpos)}function EventSendEnquiry(I){I.StopDefaultAction();if(!setup.activesend){var E="";var C=false;var A=owl.Dom.Get("#adcomments")[0];run.comments=owl.String.Trim(A.value).replace(/\r/g,"").replace(/\n/g,"\n");var B;do{B=run.comments;run.comments=run.comments.replace(/\n\n/g,"\n")}while(run.comments!=B);run.comments=run.comments.substr(0,setup.comlimit);A.value=run.comments;var H=owl.Dom.Get("#adtel")[0];run.tel=owl.String.Trim(H.value);H.value=run.tel;var D=owl.Dom.Get("#ademail")[0];run.email=D.value;if(run.email!=""){run.email=verify_email(run.email);if(run.email==""){E=$T.invalidemail+"\n"+E;C=D}else{D.value=run.email}}if(run.email==""&&run.tel==""&&E==""){E=$T.invalidcontact;C=D}var J=owl.Dom.Get("#adname")[0];run.name=owl.String.Clean(J.value);J.value=run.name;if(run.name.length<4){E=$T.invalidname+"\n"+E;C=J}if(C){alert($T.invalid+"\n"+E);try{C.select()}catch(G){}try{C.focus()}catch(G){}}else{setup.activesend=true;setup.nodeenquiry.style.display="none";owl.Css.ClassApply(setup.nodeenqresult,"active");owl.Dom.Text(setup.nodeenqresult,$T.sendenquiry);setup.nodeenqresult.style.display="block";var F=setup.emailURL+run.ID;F+="&callback=EventSendResult()";F+="&url="+escape(setup.thisURL);F+="&name="+escape(run.name);F+=(run.email!=""?"&email="+escape(run.email):"");F+=(run.tel!=""?"&tel="+escape(run.tel):"");F+=(run.comments!=""?"&comments="+escape(run.comments):"");if(setup.JSsend){owl.Dom.HeadRemove(setup.JSsend)}setup.JSsend=owl.Dom.LoadJS(F);setTimeout(EventSendTimeout,setup.timeout);SaveDefaults()}}}function EventSendResult(){SendReset();var A="";switch(setup.senderror){case"":A+=$T.sendsuccess;break;case"noemail":A+=$T.sendfail;setup.nodeenquiry.style.display="block";break;default:A+=$T.sendfail;break}owl.Dom.Text(setup.nodeenqresult,A)}function EventSendTimeout(){if(setup.activesend){SendReset();owl.Dom.HeadRemove(setup.JSsend);setup.JSsend=null;owl.Dom.Text(setup.nodeenqresult,$T.sendtimeout);setup.nodeenquiry.style.display="block"}}function SendReset(){owl.Css.ClassRemove(setup.nodeenqresult,"active");setup.activesend=false}function EventLimitComments(A){var B=A.Key();if(A.Element.value.length>setup.comlimit){A.Element.value=A.Element.value.substr(0,setup.comlimit)}if(B.Function==""&&B.Pressed.length+A.Element.value.length>setup.comlimit){A.StopDefaultAction()}}function NumberFormat(F,C,J){var G=(setup.locale=="EURO"?" ":",");var L=(setup.locale=="EURO"?",":".");var M="-";var K="";var B,H,E,I;if(isNaN(F)){F=0}C=Math.abs(owl.Number.toInt(C));B=(F<0);F=owl.String.Pad(String(Math.round(Math.abs(F)*Math.pow(10,C))),C,"0");H=F.substr(0,F.length-C);E=F.substr(F.length-C);if(H==""){H="0"}else{do{I=H;H=H.replace(/(\d+)(\d{3})/g,"$1"+G+"$2")}while(H!=I)}F=H+(C>0?L+E:"");if(J){var A="\u00a3";var D="";if(setup.override.currencystart||setup.override.currencyend){A=(setup.override.currencystart||"");D=(setup.override.currencyend||"")}else{if(setup.locale=="USD"){A="$"}if(setup.locale=="EURO"){A="";D="\u20ac"}}F=A+F+D}if(B){F=M+F+K}return F}function verify_email(A){A=owl.String.Trim(A.toLowerCase());if(A!=""){if(A.replace(/^[^@]+@[a-z0-9]+([_\.\-]{0,1}[a-z0-9]+)*([\.]{1}[a-z0-9]+)+$/,"")!=""){A=""}}return A}if(!owl){var owl={};owl.Version=0.1;owl.UserAgent=navigator.userAgent.toLowerCase();owl.Browser={IE:/msie/.test(owl.UserAgent)&&!/opera/.test(owl.UserAgent),Mozilla:/mozilla/.test(owl.UserAgent)&&!/(compatible|webkit)/.test(owl.UserAgent),Opera:/opera/.test(owl.UserAgent),Safari:/webkit/.test(owl.UserAgent),Konqueror:/konqueror/.test(owl.UserAgent)};owl.Browser.Version=owl.UserAgent.replace(/^.+[ox|ra|on|or][\/: ]/,"");if(owl.Browser.Version.indexOf("msie")>=0){owl.Browser.Version=owl.Browser.Version.replace(/^.+[ie][\/: ]/,"")}owl.Browser.Version=owl.Browser.Version.replace(/([^\d.].+$)/,"");owl.Browser.VerNum=parseFloat(owl.Browser.Version);owl.Number=function(){var A=/[^0-9-.]/g;function C(E){var F=String(E);F=F.replace(A,"");var D=parseInt(F,10);return(isNaN(D)?0:D)}function B(D){if(isNaN(D)){D=0}return(Math.min(1,Math.max(-1,D)))}return{toInt:C,Sign:B}}();owl.String=function(){var E=/^\s*|\s*$/g;var B=/[^\w|\s|@|&|.|,|!|%|(|)|+|-]/g;var A=/[_|\s]+/g;function F(H){return String(H).replace(E,"")}function G(H){return F(String(H).replace(B,"").replace(A," "))}function C(J,I,H){J=String(J);I=owl.Number.toInt(I);if(typeof H=="undefined"){H=" "}else{H=String(H);if(H.length<1){H=" "}}while(J.length<I){J=H+J}return J}function D(K,J){if(typeof J=="string"){J=[J]}if(J&&J.length){for(var I=0,H=J.length;I<H;I++){K=K.replace(new RegExp("(^|[^%])%"+I+"([^0-9]|$)","g"),"$1"+J[I]+"$2")}}return K}return{Trim:F,Clean:G,Pad:C,Format:D}}();if(owl&&!owl.Array){owl.Array=function(){function B(E){return !!(E&&E.constructor==Array)}function A(F,E){F[F.length]=E}function C(F){var E=null;if(F.length>0){E=F[F.length-1];F.length--}return E}function D(E,F){return(E?(B(E)?E:[E]):(typeof F=="undefined"?[]:(B(F)?F:[F])))}return{Is:B,Push:A,Pop:C,Make:D}}()}owl.Each=function(F,D){if(F.length){for(var C=0,B=F.length,A=F[0];C<B&&D(A,C)!==false;A=F[++C]){}}else{for(var E in F){if(D(F[E],E)===false){break}}}};owl.Property=function(){function A(F){if(!F.owlP){F.owlP={};F.owlP.length=0}}function D(G,F,H){owl.Each(owl.Array.Make(G),function(I){A(I);I.owlP[F]=H;I.owlP.length++})}function E(G,F){return(B(G,F)?G.owlP[F]:null)}function B(G,F){return(G&&G.owlP&&typeof G.owlP[F]!="undefined")}function C(G,F){owl.Each(owl.Array.Make(G),function(H){if(H.owlP&&H.owlP[F]){delete H.owlP[F];H.owlP.length--;if(H.owlP.length==0){H.owlP=null}}})}return{Set:D,Get:E,Exists:B,Delete:C}}();owl.Object=function(){var B="[=]";var F="[:]";function A(H,I){return(typeof H[I]!="undefined")}function E(H,J){var I=typeof (H[J]);return(I!="undefined"&&I!="function")}function G(H,I){return(typeof H[I]=="function")}function C(I){var K,J,H="";for(K in I){switch(typeof I[K]){case"boolean":J="B";break;case"number":J="N";break;case"string":J="S";break;default:J=""}if(J!=""){H+=(H==""?"":F)+K+B+J+String(I[K])}}return H}function D(K,I){var P,J,O,M,N,L,H=I.split(F);for(P=0,J=H.length;P<J;P++){L=H[P].split(B);if(L.length==2){O=L[0];M=L[1].charAt(0);N=L[1].substr(1);switch(M){case"B":N=(N.toLowerCase()=="true");break;case"N":N=parseFloat(N);break}K[O]=N}}return K}return{Exists:A,PropertyExists:E,MethodExists:G,Serialize:C,DeSerialize:D}}()}if(owl&&!owl.Http){owl.Http=function(){var B,A;function C(){var E=owl.String.Trim(location.search);if(E!=A){A=E;B={};if(E.charAt(0)=="?"){E=E.substr(1)}owl.Each(E.split("&"),function(F){var G=F.split("=");if(G.length==2){B[unescape(G[0])]=unescape(G[1])}})}return B}function D(E){C();return(B[E]?B[E]:null)}return{Arguments:C,Argument:D}}()}if(owl&&!owl.Cookie){owl.Cookie=function(){var H="[|]";var F=/\[\|\]/g;var D=null;var B=function(){G("testcookie","testvalue",0.1);var J=(A("testcookie")=="testvalue");B=function(){return J};return B()};function G(L,N,M){if(!D){D={}}D[L]=N;N=String(N).replace(/\r/g,"").replace(/\n/g,H);var J="";if(M){var K=new Date();K.setTime(K.getTime()+(M*1000));J="; expires="+K.toUTCString()}document.cookie=L+"="+String(N)+J+"; path="+location.pathname.substr(0,location.pathname.indexOf("/",1)+1)}function A(J){var K=null;if(!D){D={};owl.Each(document.cookie.split(";"),function(M){M=owl.String.Trim(M);var L=M.indexOf("=");if(L>0){D[M.substr(0,L)]=M.substring(L+1).replace(F,"\n")}})}if(D[J]){K=D[J]}return K}function I(J){G(J,"",-60);D[J]=null}function E(K,J,L){G(J,owl.Object.Serialize(K),L)}function C(L,K){var J=A(K);if(J){L=owl.Object.DeSerialize(L,J)}return L}return{Enabled:B,Set:G,Get:A,Delete:I,Store:E,Restore:C}}()}if(owl&&!owl.Image){owl.Image=function(){function A(D,E){var C=new Image();C.src=D;if(E){if(C.complete){E(C)}else{C.onload=function(){E(C)}}}}function B(D,E,C){if(owl.Browser.IE&&owl.Browser.VerNum>=5.5&&owl.Browser.VerNum<7){if(!C){C="crop"}owl.Each(owl.Array.Make(D),function(F){F.style.backgroundImage="none";F.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+E+"', sizingMethod='"+C+"')"})}}return{Load:A,IEpng:B}}()}if(owl&&!owl.Css){owl.Css=function(){function B(G,F){var H=true;if(F){owl.Each(owl.Array.Make(G),function(I){var J=" "+I.className+" ";H=(J.indexOf(" "+F+" ")>=0);return H})}return H}function E(G,F){owl.Each(owl.Array.Make(G),function(H){var I=" "+H.className+" ";if(I.indexOf(" "+F+" ")<0){I+=F;H.className=owl.String.Trim(I)}})}function D(G,F){owl.Each(owl.Array.Make(G),function(H){var I="";if(F){I=" "+H.className+" ";I=owl.String.Trim(I.replace(new RegExp(" "+F+" ","gi")," "))}H.className=I})}function A(I,G,F){G=Math.min(Math.max(G,0),99.999);var H=G/100;owl.Each(owl.Array.Make(I),function(J){if(F!==false){if(J.style.visibility=="hidden"){if(G>0){J.style.visibility="visible"}}else{if(G==0){J.style.visibility="hidden"}}}J.style.opacity=H;J.style.MozOpacity=H;J.style.filter="alpha(opacity:"+G+")";J.style.KHTMLOpacity=H})}function C(F,H){var G="";if(F){if(document.defaultView&&document.defaultView.getComputedStyle){G=document.defaultView.getComputedStyle(F,"").getPropertyValue(H)}else{if(F.currentStyle){H=H.replace(/\-(\w)/g,function(I,J){return J.toUpperCase()});G=F.currentStyle[H]}}}return G}return{ClassExists:B,ClassApply:E,ClassRemove:D,Opacity:A,ComputedStyle:C}}()}if(owl&&owl.Browser&&owl.Browser.IE&&Math.floor(owl.Browser.VerNum)==6){try{document.execCommand("BackgroundImageCache",false,true)}catch(e){}}if(owl&&owl.Css&&!owl.Dom&&document.getElementById&&document.getElementsByTagName){owl.Dom=function(){var T=1;var Q=2;var S=3;var L=8;var J=/[^\w|\s|-|#|\.|,|\[|\]|=|~|!|*]/g;var G=/\s+/g;var R=/^[^#|\.|\[]*/;var E=/#[^#|\.|\[]+/;var F=/\.[^#|\.|\[]+/;var H=/\[(.+)\]/;var M=/([~|!|*]*=)/;var O=/(^[^=|~|!|*])+/;var X=owl.Array,a=[document];function D(h,c){c=X.Make(c,a);h=owl.String.Trim(String(h).replace(J,"").replace(G," "));var b=[],k=h.split(","),m,g,l,i,j,f;for(l=0,i=k.length;l<i;l++){m=owl.String.Trim(k[l]);var d=c.slice();g=m.split(" ");for(j=0,f=g.length;j<f;j++){if(c.length>0){d=I(g[j],d)}}owl.Each(d,function(n){X.Push(b,n)})}return b}function I(i,r){var l=[],x,m,q,f,k,w,j,g;var h={Tag:"",ID:"",Class:"",AttribCheck:function(){return true}};h.Tag=R.exec(i);h.Tag=(h.Tag?h.Tag[0].toLowerCase():"*");if(h.Tag==""){h.Tag="*"}h.ID=E.exec(i);h.ID=(h.ID?h.ID[0].substr(1):"");h.Class=F.exec(i);h.Class=(h.Class?h.Class[0].substr(1):"");var u=H.exec(i);if(u){u=u[1];var c,v=null,d=M.exec(u);d=(d?d[1]:null);if(d){var o=u.indexOf(d);c=u.substr(0,o);v=u.substr(o+d.length)}else{c=u}h.AttribCheck=function(p){var n;switch(c){case"class":n=p.className;break;case"for":n=p.htmlFor;break;default:n=p.getAttribute(c);break}n=(n?n:"");return((n==""&&(!d||d=="!="))||(!d||((d=="="&&n==v)||(d=="!="&&n!=v)||(d=="*="&&n.indexOf(v)>=0)||(d=="~="&&(" "+n+" ").indexOf(" "+v+" ")>=0))))}}for(q=0,f=r.length;q<f;q++){x=[];if(h.ID){m=document.getElementById(h.ID);if(m&&(h.Tag=="*"||m.nodeName.toLowerCase()==h.Tag)&&(!h.Class||owl.Css.ClassExists(m,h.Class))&&h.AttribCheck(m)){x[0]=m}}else{var b=function(n){return((h.Tag=="*"||n.nodeName.toLowerCase()==h.Tag)&&(h.Class==""||owl.Css.ClassExists(n,h.Class))&&h.AttribCheck(n))};if(h.Tag=="*"){x=P(r[q],0,b)}else{m=r[q].getElementsByTagName(h.Tag);for(j=0,g=m.length;j<g;j++){if(b(m[j])){x[x.length]=m[j]}}}}for(k=0,w=x.length;k<w;k++){l[l.length]=x[k]}}return l}function P(d,b,g){var f=function(k,m){var l=[],j,h,i;if(!m){m=1}for(j=0,h=k.childNodes.length;j<h;j++){i=k.childNodes[j];if(i.nodeType==T&&i.nodeName!="!"){if(!g||g(i)){l[l.length]=i}if(k.childNodes.length>0&&(!b||m<b)){l=l.concat(f(i,m++))}}}return l};d=X.Make(d,a);var c=[];owl.Each(d,function(h){c=c.concat(f(h))});return c}function A(f,d,c,b){f=X.Make(f,a);d=X.Make(d,a);owl.Each(d,function(k,j){if(b){C(k)}var l=Math.min(j,f.length-1);for(var h=0,g=f[l].childNodes.length;h<g;h++){k.appendChild(f[l].childNodes[h].cloneNode(true))}if(c){C(f[l])}else{Y(k)}})}function Y(b){owl.Each(X.Make(b,a),function(c){P(c,null,function(d){if(d.id){d.removeAttribute("id")}return true})})}function C(b){owl.Each(X.Make(b,a),function(c){while(c.lastChild){c.removeChild(c.lastChild)}})}function K(c,b){b=b.toLowerCase();while(c.nodeName.toLowerCase()!=b&&c.parentNode){c=c.parentNode}if(c.nodeName.toLowerCase()!=b){c=null}return c}function B(d){var f=false;for(var g=0,b=d.childNodes.length;g<b&&!f;g++){f=(d.childNodes[g].nodeType==S?d.childNodes[g]:B(d.childNodes[g]))}return f}function V(b,d){var c=(typeof d!="undefined");d=(c?(typeof d=="string"?[d]:d):"");owl.Each(X.Make(b,a),function(h,g){var f=B(h);if(c){var j=d[Math.min(g,d.length-1)];if(f){f.nodeValue=j}else{f=h.appendChild(document.createTextNode(j))}}else{if(f){d+=(d==""?"":"\n")+f.nodeValue}}});return(c?true:d)}function U(c){var b=D("head");return(b.length==1?b[0].appendChild(c):null)}function Z(c){var b=D("head");return(b.length==1?b[0].removeChild(c):null)}function W(b){var c=document.createElement("script");c.setAttribute("type","text/javascript");c.setAttribute("src",b);return U(c)}function N(c){var b=document.createElement("link");b.setAttribute("type","text/css");b.setAttribute("rel","stylesheet");b.setAttribute("media","screen");b.setAttribute("href",c);return U(b)}return{ElementNode:T,AttributeNode:Q,TextNode:S,CommentNode:L,Get:D,Descendents:P,Clone:A,RemoveIDs:Y,RemoveChildren:C,FindAncestor:K,Text:V,HeadAppend:U,HeadRemove:Z,LoadJS:W,LoadCSS:N}}()}if(owl&&!owl.Xml){owl.Xml=function(){var F=1;var H=2;var G=3;var E=8;function A(){var I=null;if(document.implementation&&document.implementation.createDocument){I=document.implementation.createDocument("","xml",null)}else{owl.Each(["MSXML2.DOMDocument","MSXML.DOMDocument","Microsoft.XMLDOM"],function(K){try{I=new ActiveXObject(K)}catch(J){}return !!I})}return I}function C(J){var I=null;if(!J){I=A()}else{if(typeof DOMParser!="undefined"){I=(new DOMParser()).parseFromString(J,"application/xml")}else{I=A();if(I){I.loadXML(J)}}}return I}function D(S,J,I){if(typeof I=="undefined"){I=1}if(I>1){if(S.nodeType==1){var L=document.createElement(S.nodeName);for(var P=0,N=S.attributes.length;P<N;P++){var R=S.attributes[P].name,K=S.attributes[P].value;switch(R){case"class":L.className=K;break;case"for":L.htmlFor=K;break;default:L.setAttribute(R,K);break}}J=J.appendChild(L)}else{if(S.nodeType==3){var Q=(S.nodeValue?S.nodeValue:"");var O=owl.String.Trim(Q);if(O.length<7||(O.indexOf("<!--")!=0&&O.indexOf("-->")!=(O.length-3))){J.appendChild(document.createTextNode(Q))}}}}for(var M=0;M<S.childNodes.length;M++){D(S.childNodes[M],J,I+1)}return(J.lastChild?J.lastChild:J)}function B(I,K){var J=null;if(window.XSLTProcessor){try{var M=new XSLTProcessor();M.importStylesheet(K);J=M.transformToDocument(I,document)}catch(L){}}else{try{J=this.New();J.loadXML(I.transformNode(K))}catch(L){}}return(J&&J.documentElement&&J.documentElement.childNodes.length?J:null)}return{ElementNode:F,AttributeNode:H,TextNode:G,CommentNode:E,New:A,Load:C,Copy:D,Transform:B}}()}if(owl&&owl.Dom&&owl.Xml&&!owl.innerHTML){owl.innerHTML=function(C,D,A){A=(A!=false);C=owl.Array.Make(C);if(C.length>0){var B=owl.Xml.Load("<root>"+D+"</root>");if(B&&B.documentElement){owl.Each(C,function(E){if(A){owl.Dom.RemoveChildren(E)}C=owl.Xml.Copy(B.documentElement,E)})}}return C}}if(owl&&!owl.Event){owl.Event=function(B,D,C,A){B=owl.Array.Make(B,[window]);C=(typeof C=="function"?C:null);A=(A||A==0?owl.Number.toInt(A):null);var E=[];owl.Each(B,function(F){E[E.length]=owl.EventRegister.Add(F,D,C,A)});this.Detach=function(){for(var G=0,F=B.length;G<F;G++){owl.EventRegister.Detach(B[G],D,E[G],true)}}};owl.EventRegister=function(){var B=[],I=[],A=[],E=0,F=false;var G="EventRegister";function K(O,Q,P,N){var L=owl.Property.Get(O,G);if(!L){L={};B[B.length]=O}if(!L[Q]){E++;I[E]=[];L[Q]=E;owl.Property.Set(O,G,L);var M=O["on"+Q];if(M){new owl.Event(O,Q,M)}O["on"+Q]=owl.EventRegister.Handler;if(E==1){new owl.Event(window,"unload",owl.EventRegister.CleanUp,1e+100)}}var R=L[Q];var S=I[R].length;I[R][S]={Handler:P,Priority:N};C(O,Q,R);return{Reg:R,Func:S}}function C(M,O,P){var L=[];for(var Q=0,N=I[P].length;Q<N;Q++){if(I[P][Q].Handler!=null){L[L.length]={Index:Q,Priority:I[P][Q].Priority}}}if(L.length>0){L.sort(function(S,R){return S.Priority-R.Priority})}else{M["on"+O]=null;delete M.owlP[G][O];L=null}A[P]=L;F=false}function D(O){var M=true,Q=new owl.EventInformation(this,O);if(Q.Index&&Q.Index.Reg){var L=A[Q.Index.Reg].slice();for(var P=0,N=L.length;P<N;P++){Q.Index.Func=L[P].Index;if(Q.AllowNext&&I[Q.Index.Reg][Q.Index.Func].Handler){M&=(I[Q.Index.Reg][Q.Index.Func].Handler(Q)!==false)}}}if(F){C(Q.Element,Q.Type,Q.Index.Reg)}return M}function H(N,O,L,M){I[L.Reg][L.Func].Handler=null;if(M){C(N,O,L.Reg)}else{F=true}}function J(){for(var O=0,N=B.length,L=B[0];O<N;L=B[++O]){for(var M in owl.Property.Get(L,G)){L["on"+M]=null}owl.Property.Delete(L,G)}B=null;I=null;A=null}return{Namespace:G,Add:K,Handler:D,Detach:H,CleanUp:J}}();owl.EventInformation=function(A,B){this.Element=A;this.Event=(B?B:window.event);if(this.Event){this.Type=this.Event.type.toLowerCase();this.Target=(this.Event.target?this.Event.target:this.Event.srcElement);this.Index={Reg:this.Element.owlP[owl.EventRegister.Namespace][this.Type],Func:null};this.AllowNext=true}};owl.EventInformation.prototype.Key=function(){if(!this.KeySet){this.KeySet={Pressed:"",Function:"",Shift:this.Event.shiftKey,Ctrl:this.Event.ctrlKey,Alt:this.Event.altKey};if(owl.EventKey.test(this.Type)){var B=this.Event.keyCode;var A=(typeof this.Event.charCode!="undefined"?this.Event.charCode:null);if(A>0){this.KeySet.Pressed=String.fromCharCode(A)}else{if(owl.EventCK[B]&&(A!=null||B<32||(this.Type!="keypress"||(!this.Shift&&B<112&&B!=35&&B!=39&&B!=45&&B!=46)))){this.KeySet.Function=owl.EventCK[B]}else{if(B>=32){this.KeySet.Pressed=String.fromCharCode(B)}}}}}return this.KeySet};owl.EventInformation.prototype.Mouse=function(){if(!this.MouseSet){this.MouseSet={X:0,Y:0};if(owl.EventMouse.test(this.Type)){this.MouseSet.X=(this.Event.pageX?this.Event.pageX:this.Event.clientX+Math.max(document.documentElement.scrollLeft,document.body.scrollLeft));this.MouseSet.Y=(this.Event.pageY?this.Event.pageY:this.Event.clientY+Math.max(document.documentElement.scrollTop,document.body.scrollTop))}}return this.MouseSet};owl.EventInformation.prototype.Detach=function(){owl.EventRegister.Detach(this.Element,this.Type,this.Index)};owl.EventInformation.prototype.StopHandlers=function(){this.AllowNext=false};owl.EventInformation.prototype.StopPropagation=function(){if(this.Event.stopPropagation){this.Event.stopPropagation()}this.Event.cancelBubble=true};owl.EventInformation.prototype.StopDefaultAction=function(){if(this.Event.preventDefault){this.Event.preventDefault()}this.Event.returnValue=false};owl.EventKey=/^key/i;owl.EventMouse=/mouse|click/i;owl.EventCK=[];owl.EventCK[8]="backspace";owl.EventCK[9]="tab";owl.EventCK[13]="enter";owl.EventCK[19]="break";owl.EventCK[27]="esc";owl.EventCK[33]="pageup";owl.EventCK[34]="pagedown";owl.EventCK[35]="end";owl.EventCK[36]="home";owl.EventCK[37]="left";owl.EventCK[38]="up";owl.EventCK[39]="right";owl.EventCK[40]="down";owl.EventCK[45]="insert";owl.EventCK[46]="delete";owl.EventCK[112]="f1";owl.EventCK[113]="f2";owl.EventCK[114]="f3";owl.EventCK[115]="f4";owl.EventCK[116]="f5";owl.EventCK[117]="f6";owl.EventCK[118]="f7";owl.EventCK[119]="f8";owl.EventCK[120]="f9";owl.EventCK[121]="f10";owl.EventCK[122]="f11";owl.EventCK[123]="f12";owl.EventCK[144]="numlock";owl.EventCK[145]="scrolllock";if(history&&history.navigationMode){history.navigationMode="compatible"}}if(owl&&!owl.Timer){owl.Timer=function(A,L,D,N,F,C,M){var B=null,E=(D||D==0?D:(A<L?1:-1));var I=(N?N:20),K=(F?F:0),J=(C?C:0);this.StartValue=(A?A:0);this.StopValue=(L||L==0?L:100);this.Value=this.StartValue;this.CallBack=(M?M:null);this.OnStart=null;this.OnStop=null;this.OnReverse=null;var H=false;var G=this;this.SetStep=function(O){if(O==0){this.Stop();E=0}else{if((O<0&&this.StartValue<this.StopValue)||(O>0&&this.StartValue>this.StopValue)){E=-O;this.Reverse()}else{E=O}this.Start()}};this.GetStep=function(){return E};this.Start=function(){if(!B){H=false;var P=function(Q){if(!H){if(Q){if(G.OnStart){G.OnStart(G)}if(G.CallBack){G.CallBack(G)}}B=setInterval(function(){G.Run()},I)}};var O=(this.Value==this.StartValue);if(O&&K>0){setTimeout(function(){P(O)},K)}else{P(O)}}};this.Run=function(){this.Value+=E;this.Value=(E>0?Math.min(this.Value,this.StopValue):Math.max(this.Value,this.StopValue));if(this.CallBack){this.CallBack(this)}if(this.Value==this.StopValue){this.Stop()}};this.Reverse=function(){var O=this.StartValue;this.StartValue=this.StopValue;this.StopValue=O;E=-E;if(this.OnReverse){this.OnReverse(this)}};this.Stop=function(){H=true;if(B){B=clearInterval(B);if(this.Value==this.StopValue){setTimeout(function(){if(G.OnStop){G.OnStop(G)}},J)}}};if(this.CallBack){this.Start()}}}if(owl&&owl.Dom&&owl.Timer&&!owl.Screen){owl.Screen=function(){var I=function(){var K=owl.Dom.Get("body");if(K.length==1){I=function(){return K[0]};return I()}else{return null}};function F(K){var L={X:K.offsetLeft,Y:K.offsetTop};while((K=K.offsetParent)){L.X+=K.offsetLeft;L.Y+=K.offsetTop}return L}var H;function G(){if(!H){if(window.innerWidth){H=function(){return{Width:window.innerWidth,Height:window.innerHeight}}}else{if(document.documentElement&&document.documentElement.clientWidth){H=function(){return{Width:document.documentElement.clientWidth,Height:document.documentElement.clientHeight}}}else{H=function(){return{Width:(I()?I().clientWidth:0),Height:(I()?I().clientHeight:0)}}}}}return H()}function B(){return{X:window.pageXOffset||(document.documentElement&&document.documentElement.scrollLeft)||(I()&&I().scrollLeft),Y:window.pageYOffset||(document.documentElement&&document.documentElement.scrollTop)||(I()&&I().scrollTop)}}function J(){var K={Width:0,Height:0};if(I()){if(document.documentElement&&document.documentElement.scrollWidth){K.Width=document.documentElement.scrollWidth;K.Height=document.documentElement.scrollHeight}else{if(I().offsetWidth){K.Width=I().offsetWidth;K.Height=I().offsetHeight}}}return K}var A=function(){var K={};K.Width=(screen.width?screen.width:null);K.Height=(screen.height?screen.height:null);K.AvailWidth=(screen.availWidth?screen.availWidth:K.Width);K.AvailHeight=(screen.availHeight?screen.availHeight:K.Height);K.AvailLeft=(screen.availLeft?screen.availTop:0);K.AvailTop=(screen.availTop?screen.availTop:0);K.ColorDepth=(screen.colorDepth?screen.colorDepth:(screen.pixelDepth?screen.pixelDepth:null));A=function(){return K};return A()};var E=null;function C(M,L,K,N){if(K===false){window.scrollTo(M,L);if(typeof N=="function"){N()}}else{if(E){E.Stop()}E=new owl.Timer(owl.Screen.Config.MoveFrames,1,-1,owl.Screen.Config.MovePause,0,0,function(Q){var P=B();var R=Math.sqrt(Q.Value);window.scrollTo(P.X+Math.ceil((M-P.X)/R),P.Y+Math.ceil((L-P.Y)/R));var O=B();if(O.X==P.X&&O.Y==P.Y){Q.Stop();if(typeof N=="function"){N();N=null}}})}}function D(O,N,U,R,K,T,M,V){if(T!==true){var L=G();N=Math.floor((N/100)*L.Width);U=Math.ceil((U/100)*L.Width);R=Math.floor((R/100)*L.Height);K=Math.ceil((K/100)*L.Height)}var P=F(O);var W=B();var S=(P.X<W.X+N?P.X-N:(P.X>W.X+U?P.X-U:W.X));var Q=(P.Y<W.Y+R?P.Y-R:(P.Y>W.Y+K?P.Y-K:W.Y));C(S,Q,M,V)}return{Location:F,ViewPort:G,ViewScroll:B,Page:J,Resolution:A,ScrollTo:C,ScrollToElement:D}}();owl.Screen.Config={MoveFrames:50,MovePause:20}}if(owl&&owl.Css&&owl.Dom&&owl.Screen&&owl.Timer&&!owl.Overlay){owl.Overlay=function(){var A={PageFadeID:"lb_pageoverlay",PageFadeMax:80,PageFadeStep:(owl.Browser.IE?20:5),PageFadePause:20};var H=null,G=null,E=null,D="opacity";function F(R,J,I,L,M){if(!H){var P=owl.Dom.Get("body");if(P.length==1){H=P[0].appendChild(document.createElement("div"));H.style.position="absolute";H.style.top="0px";H.style.left="0px"}}if(H){H.id=A.PageFadeID;owl.Property.Set(H,D,0);owl.Css.Opacity(H,0);H.style.width="100%";H.style.height="100%";var N=owl.Screen.Page();var O=owl.Screen.ViewPort();var K=Math.max(H.offsetWidth,N.Width,(owl.Browser.IE?O.Width:0));var Q=Math.max(H.offsetHeight,N.Height,(owl.Browser.IE?O.Height:0));G=new owl.Overlay.Elements(0,0,K,Q);H.style.width=K+"px";H.style.height=Q+"px";I=(I?I:A.PageFadeMax);E=new owl.Timer(0,I,(L?L:A.PageFadeStep),(M?M:A.PageFadePause));E.CallBack=function(S){owl.Css.Opacity(H,S.Value)};if(R){E.OnStop=function(S){if(S.Value>=I){R()}}}E.Start()}}function B(I){if(E){E.Reverse();E.OnStop=function(J){G.Show();H.style.width="0px";H.style.height="0px";if(I){I()}};E.Start()}}function C(){var I=document.createElement("iframe");I.src="javascript:false;";I.frameBorder="0";I.scrolling="no";I.style.position="absolute";I.style.padding="0px";I.style.margin="0px";I.style.width="50px";I.style.height="50px";I.style.top="0px";I.style.left="0px";I.style.filter="progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)";return I}return{Config:A,PageFadeOut:F,PageFadeIn:B,CreateIframe:C}}();owl.Overlay.Elements=function(B,A,D,C){if(owl.Browser.IE&&owl.Browser.VerNum<7){this.Hidden=null;this.HideTags="select, iframe, applet";this.HideID="owlframe";this.TX=B;this.TY=A;this.BX=D;this.BY=C;this.Cover()}};owl.Overlay.Elements.prototype.Cover=function(){if(this.HideTags&&!this.Hidden){var A=this;this.Hidden=[];owl.Each(owl.Dom.Get(this.HideTags),function(E){if(!owl.Property.Exists(E,A.HideID)){var F=owl.Screen.Location(E);var B={TX:F.X,TY:F.Y,BX:F.X+E.offsetWidth,BY:F.Y+E.offsetHeight};if(B.BX>A.TX&&B.BY>A.TY&&A.BX>B.TX&&A.BY>B.TY){if(owl.Browser.VerNum<5.5){if(E.style.visibility!="hidden"){E.style.visibility="hidden";owl.Array.Push(A.Hidden,{Element:E,Iframe:false})}}else{var C=(E.offsetParent.nodeName.toLowerCase()=="body");var D=E.parentNode.appendChild(owl.Overlay.CreateIframe());D.style.left=(C?B.TX:E.offsetLeft)+Math.max(0,A.TX-B.TX)+"px";D.style.top=(C?B.TY:E.offsetTop)+Math.max(0,A.TY-B.TY)+"px";D.style.width=Math.min(A.BX,B.BX)-Math.max(A.TX,B.TX)+"px";D.style.height=Math.min(A.BY,B.BY)-Math.max(A.TY,B.TY)+"px";owl.Property.Set(D,A.HideID,true);owl.Array.Push(A.Hidden,{Element:E,Iframe:D})}}}})}};owl.Overlay.Elements.prototype.Show=function(){if(this.Hidden){owl.Each(this.Hidden,function(A){if(A.Iframe){A.Element.parentNode.removeChild(A.Iframe)}else{A.Element.style.visibility="visible"}})}this.Hidden=null}}if(owl&&owl.Event&&owl.innerHTML&&owl.Image&&owl.Overlay&&!owl.Lightbox){owl.Lightbox=function(j){if(!owl.Css.ClassExists(j,owl.Lightbox.Config.Container.ActiveClass)){var g=owl.Dom;var f=owl.Event;var X=owl.Timer;var s=owl.Lightbox.Config;var V=s.Animation;owl.Css.ClassApply(j,s.Container.ActiveClass);var d={shown:false,win:null,img:null,bar:null};var p={};var B=0,E=0,o=0,Y=0,H=0,I=0,i=null;var J=[],u=null,t=0;var r=null,G=false,c=null,K=false;var R=0,P=0,y=0,v=0;var k=null,n=null,T=null,b=null,h=null;owl.Each(owl.Dom.Get("a",j),function(A,z){J[z]=new owl.Lightbox.Image(A);owl.Property.Set(A,"LBindex",z);new f(A,"click",function(AA){Q(AA)})});if(!s.Preload.All&&s.Preload.Next&&J.length>0){J[0].Load()}}function Q(AA){if(s.Enabled){S(AA);var z=owl.Property.Get(AA.Element,"LBindex");J[z].Load();if(!d.shown){d.shown=true;owl.Overlay.PageFadeOut(function(){q(z)});var A=owl.Screen.ViewPort();H=A.Width;I=A.Height;o=Math.max(s.Size.Minimum,Math.ceil(H-s.Size.WidthPad));Y=Math.max(s.Size.Minimum,Math.ceil(I-s.Size.HeightPad))}}}function O(A){S(A);owl.Each(p,function(z){z.Detach()});if(k){k.Stop()}if(n){n.Stop()}d.win.style.display="none";owl.Overlay.PageFadeIn(function(){d.shown=false})}function q(A){if(d.win===null){d.win=owl.Lightbox.CreateWindow();d.img=g.Get("img",d.win)[0];d.bar=g.Get("#lb_bar",d.win)[0];if(J.length<2){owl.Each(g.Get("a[id!=lb_close]",d.bar),function(z){z.style.display="none"})}owl.Css.Opacity(d.bar,s.Animation.BarOpacity)}l();B=s.Size.Start;E=B;i=owl.Screen.ViewScroll();d.win.style.display="block";Z(B,E);F(A);p.KeyDown=new f(document,"keydown",M);p.Next=new f(g.Get("#lb_next",d.bar),"click",L);p.Back=new f(g.Get("#lb_back",d.bar),"click",L);p.Close=new f(g.Get("#lb_close",d.bar),"click",O);p.MouseOver=new f(d.win,"mouseover",U);p.Focus=new f(d.win,"focus",U);p.MouseOut=new f(d.win,"mouseout",U);p.Blur=new f(d.win,"blur",U);p.MouseMove=new f(d.win,"mousemove",w);p.Overlay=new f(g.Get("#"+owl.Overlay.Config.PageFadeID),"click",O);p.WinFocus=new f(document,"focus",C)}function C(z){var A=z.Target;while(A!=d.win&&A.parentNode){A=A.parentNode}if(A!=d.win){S(z);d.win.focus();U(z)}}function M(z){var AA=z.Key().Function;if(z.Key().Pressed==" "){AA="right"}var A={esc:99,left:-1,up:-1,pageup:-1,right:1,down:1,pagedown:-1};if(A[AA]){if(A[AA]==99){O()}else{L(z,A[AA])}}}function L(AB,z){S(AB);if(!z){z=(AB.Element&&AB.Element.id=="lb_back"?-1:1)}if(u!==null){var AA=u+z;var A=J.length-1;AA=(AA>A?0:(AA<0?A:AA));if(AA!=u){F(AA)}}}function F(A){l();if(h){h.Stop()}h=null;if(k){k.Stop()}if(n){n.Stop()}G=false;u=A;J[u].Load(x);if(t>0){n=new X(t,0,-V.FadeStep,V.FramePause,0,0,function(z){m(z.Value)})}if(!s.Preload.All&&s.Preload.Next&&u+1<J.length){J[u+1].Load()}}function x(){if(n){n.Stop()}m(0);J[u].Resize(o,Y);d.img.width=J[u].Width;d.img.height=J[u].Height;d.img.src=J[u].Src;i=owl.Screen.ViewScroll();Z(B,E);var A=V.SizeStep*(B>J[u].Width?-1:1);var z=V.SizeStep*(E>J[u].Height?-1:1);if(k){k.Stop()}k=new X(B,J[u].Width,A,V.FramePause,s.Throttle,0);k.CallBack=function(AA){Z(AA.Value,E)};k.OnStop=function(){k=new X(E,J[u].Height,z,V.FramePause,0,0);k.CallBack=function(AA){Z(B,AA.Value)};k.OnStop=function(){var AA=owl.Screen.Location(d.img);R=AA.X;P=AA.Y;G=true;if(n){n.Stop()}n=new X(0,100,V.FadeStep,V.FramePause,0,0);n.CallBack=function(AB){m(AB.Value)};n.OnStop=function(){if(r){N();D()}};n.Start()};k.Start()};k.Start()}function Z(A,z){d.img.style.left=((A-d.img.width)/2)+"px";d.img.style.top=((z-d.img.height)/2)+"px";d.win.style.left=((H-A)/2+i.X)+"px";d.win.style.top=((I-z)/2+i.Y)+"px";d.win.style.width=A+"px";d.win.style.height=z+"px";B=A;E=z}function U(A){if(b){clearInterval(b)}r=!(A.Type=="mouseout"||A.Type=="blur");b=setTimeout(function(){if(r){N();D()}else{l();W()}},s.Throttle)}function N(){if(s.ShowInfo&&G){if(c!=u){if(T){T.Stop();T=null}c=u;var AA=g.Get("p",d.bar)[0];g.Clone(J[c].Node,AA,false,true);var A=g.Get("img",AA);if(A.length>0){A[0].parentNode.removeChild(A[0])}}if(T){if(T.OnStop){T.OnStop=null;T.Reverse()}}else{var z=-d.bar.offsetHeight;T=new X(z,-1,V.BarStep,V.FramePause,0,0);T.CallBack=function(AB){K=AB.Value;d.bar.style.bottom=K+"px"};d.bar.style.visibility="visible"}T.Start()}}function l(){if(T&&!T.OnStop){T.Reverse();T.OnStop=function(){T=null};T.Start()}else{d.bar.style.visibility="hidden"}}function D(){if(s.Magnify&&G){if(h){if(h.OnStop){h.OnStop=null;h.Reverse()}}else{if(J[u].Ratio<1){h=new X(J[u].Ratio,1,(1-J[u].Ratio)/V.ZoomSteps,V.FramePause,0,0);h.CallBack=function(A){a(A.Value)}}}if(h){h.Start()}}}function W(){if(h&&!h.OnStop){h.Reverse();h.OnStop=function(){h=null};h.Start()}}function w(z){if(s.Magnify&&G&&r&&J[u].Ratio<1){var A=z.Mouse();y=Math.max(0,Math.min(B,A.X-R));v=Math.max(0,Math.min(E,A.Y-P));if(!h||h.Value==1){a()}}}function a(AA){var A,z;if(AA){A=Math.ceil(J[u].RealWidth*AA);z=Math.ceil(J[u].RealHeight*AA)}else{A=d.img.width;z=d.img.height}d.img.style.left=((1-((B-y)/B))*(B-A))+"px";d.img.style.top=((1-((E-v)/E))*(E-z))+"px";if(AA){d.img.width=A;d.img.height=z}}function m(A){owl.Css.Opacity(d.img,A);t=A}function S(A){if(A){A.StopDefaultAction();A.StopPropagation();if(A.Element&&A.Element.blur){A.Element.blur()}}}};owl.Lightbox.CreateWindow=function(){var A=owl.innerHTML(owl.Dom.Get("body"),owl.Lightbox.Config.WindowHTML,false);owl.Lightbox.CreateWindow=function(){return A};return owl.Lightbox.CreateWindow()};owl.Lightbox.Image=function(A){this.Node=A;this.Src=this.Node.href;this.Pic=null;this.RealWidth=0;this.RealHeight=0;this.Ratio=1;this.Width=0;this.Height=0;this.Loading=false;this.LoadCallback=null;if(owl.Lightbox.Config.Preload.All){this.Load()}};owl.Lightbox.Image.prototype.Load=function(C){if(C){var B=this.LoadCallback;if(B){this.LoadCallback=function(){B();C()}}else{this.LoadCallback=C}}if(this.Pic===null){if(!this.Loading){this.Loading=true;var A=this;owl.Image.Load(this.Src,function(D){A.Pic=D;A.Loading=false;A.RealWidth=D.width;A.RealHeight=D.height;if(A.LoadCallback){A.LoadCallback();A.LoadCallback=null}})}}else{if(this.LoadCallback){this.LoadCallback();this.LoadCallback=null}}};owl.Lightbox.Image.prototype.Resize=function(B,A){if(this.RealWidth>0&&this.RealHeight>0){this.Ratio=Math.min(Math.min(B/this.RealWidth,1),Math.min(A/this.RealHeight,1));this.Width=Math.floor(this.RealWidth*this.Ratio);this.Height=Math.floor(this.RealHeight*this.Ratio)}};owl.Lightbox.Config={AutoStart:true,Enabled:true,ShowInfo:true,Magnify:true,Throttle:200,Container:{Element:".lightbox",ActiveClass:"active"},Preload:{All:false,Next:false},Size:{Start:40,Minimum:200,WidthPad:30,HeightPad:50},Animation:{FramePause:10,FadeStep:5,SizeStep:10,BarOpacity:60,BarStep:2,ZoomSteps:20},WindowHTML:'<div id="lb_window"><div id="lb_image"><img tabindex="0" /><div id="lb_bar"><p></p><a id="lb_close" href="#" title="'+setup.text.imageclose+'"><strong>'+setup.text.imageclose+'</strong></a><a  id="lb_next" href="#" title="'+setup.text.imagenext+'"><strong>'+setup.text.imagenext+'</strong></a><a id="lb_back" href="#" title="'+setup.text.imageback+'"><strong>'+setup.text.imageback+"</strong></a></div></div></div>"};if(owl.Lightbox.Config.AutoStart){new owl.Event(window,"load",function(A){owl.Each(owl.Dom.Get(owl.Lightbox.Config.Container.Element),function(B){new owl.Lightbox(B)})},99999)}}new owl.Event(window,"load",ADstart);

