/**
* ty_v10_modules.js
* version 2.80
* 2012-02-13
* iframe pass query vars
*/

/* Flash */
J.flash={
version:9,
downloadLink:'/sys/flash_html_detection.aspx',
count:0,
init:function(){
	var m=this;o=m.hasFlash=(J.getCookie('acc_type')!='html');
	if(o)setTimeout(J.flash.exec,200)
},
exec:function(){
	var m=J.flash,o;
	o=J.tags('figure');if(!o)return;
	o=o.filter(function(c,a){return a.data('movie')});
	if(o.arr.length==0)return;
	if(m.ua.pv[0]<m.version){J.tmOvl.launch(m.downloadLink,200);return}
	o.each(m.expand)
},
ua:function(){
var UN="undefined",SF="Shockwave Flash",FMT="application/x-shockwave-flash",
	win=window,doc=document,nav=navigator,plugin=false,dec=function(a){return parseInt(a,10)},
	w3cdom=typeof doc.getElementById!=UN&&typeof doc.getElementsByTagName!=UN&&typeof doc.createElement!=UN,u=nav.userAgent.toLowerCase(),
	p=nav.platform.toLowerCase(),
	windows=p?/win/.test(p):/win/.test(u),
	mac=p?/mac/.test(p):/mac/.test(u),
	webkit=/webkit/.test(u)?parseFloat(u.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,
	ie=!+"\v1",PV=[0,0,0],
	d=null;
	if(typeof nav.plugins!=UN&&typeof nav.plugins[SF]=='object'){
		d=nav.plugins[SF].description;
		if(d&&!(typeof nav.mimeTypes!=UN&&nav.mimeTypes[FMT]&&!nav.mimeTypes[FMT].enabledPlugin)){
			plugin=true;
			ie=false;
			d=d.replace(/^.*\s+(\S+\s+\S+$)/,"$1");
			PV[0]=dec(d.replace(/^(.*)\..*$/,"$1"));
			PV[1]=dec(d.replace(/^.*\.(.*)\s.*$/,"$1"));
			PV[2]=/[a-zA-Z]/.test(d)?dec(d.replace(/^.*[a-zA-Z]+(.*)$/,"$1")):0;
		}
	}
	else if(typeof win.ActiveXObject!=UN){
		try{
			var a=new ActiveXObject('ShockwaveFlash.ShockwaveFlash');
			if(a){
				d=a.GetVariable("$version");
				if(d){ie=true;d=d.split(" ")[1].split(",");PV=[dec(d[0]),dec(d[1]),dec(d[2])]}
			}
		}catch(e){}
	}
	return{w3:w3cdom,pv:PV,wk:webkit,ie:ie,win:windows,mac:mac}
}(),
which:function(){return this.ua.pv},
expand:function(c,a){
	var m=J.flash,q=a.getStyle(),v=a.data(),o={
		height:parseInt(q.height),
		width:parseInt(q.width),
		movie:v.movie,
		id:v.id||'tmFlash_'+m.count++
	};
	if(v.flashvars)o.flashvars=v.flashvars;
	if(v.wmode)o.wmode=v.wmode;
	if(v.bgcolor)o.bgcolor=v.bgcolor;
	if(v.scale)o.scale=v.scale;
	m.render(a.obj,o)
},
render:function(a,b){
	if(!J.flash.hasFlash)return;
	var q=J.set({wmode:'transparent',quality:'high',AllowScriptAccess:'always',allowfullscreen:'true',bgcolor:'#000000'},b),v=[],x;
	v.push('<object type="application/x-shockwave-flash" id="'+q.id+'" width="'+q.width+'" height="'+q.height+'" data="'+q.movie+'">');
	for(x in q){
		switch(x){
			case'height':case'width':case'id':break;
			default:v.push('<param name="'+x+'" value="'+q[x]+'">')
		}
	};
	v.push('</object>');
	return J(a).fill(v.join('\n')).tags('object').first().obj
}
}

var _EXTERNAL=(function(){
function $(a){return document.getElementById(a)}
function mid(o,a,b){o=o.split(a);return(o.length<2)?'':o[1].split(b)[0]}
function listener(){
	var o=location.hash+';',p=mid(o,'extdiv=',';'),v;if(!p||!binds[p])return;
	v=mid(o,'exthight=',';');
	if(v&&binds[p].resize)binds[p].resize(v);
	else if(binds[p].close)binds[p].close();
	location.hash=''
}
var binds={},listening;
return{
link:function(a,b){return a+'#outerlink='+location.href.split('#')[0]+';outerdiv='+b},
bind:function(a,b,c){binds[a]={resize:b,close:c}},
listen:function(){listening=setInterval(listener,500)},
stop:function(){var o=listening;if(o){clearTimeout(o);o=null}}
}})();

/* fullfilment column */
J.tmMoreActions={
init:function(){
	var m=this,o=J('ffMore');if(!o)return;
	if(J.ie6)J('aaWrap').css({height:J.viewport().h-6+'px'});
	J('all-act').first('ul').tags('a').each(function(c,a){a.click(J.tmMoreActions.track)});
	o.click(m.open)
},
open:function(){
	J.tmMoreActions.open=true;
	J('aaWrap').expand();
	J('all-act').animate({left:0});
	if(J.tmWebtrends.on)J.tmWebtrends.track(J('ffMore'));
	return false
},
close:function(){
	J.tmMoreActions.open=false;
	J('all-act').animate({left:790},null,function(){J('aaWrap').collapse()});
	return false
},
track:function(){if(J.tmWebtrends.on)J.tmWebtrends.track(J(this))}
}


/* my cars 2.0 */
J.tmMyCars={
userServ:'/components/webuser/',
carServ:'/components/UserCars/',
sendServ:'/components/Form?form=/sys/dotnet/xml/form-s2d.xml',
forms:'/forms/webuserui.tmex',
init:function(){
	var m=this,o=J('myCar'),q;if(!o)return;
	m.trans=J.tmConfig.dialog;
	m.loggedIn=!!J.getCookie('TmeUserID');
	m.ready=true;
	if(J('mcStart'))J('mcStart').click(m.trackStart);
	//m.refresh()
},
loadForms:function(){
	var m=this,o=J('CCFf'),v;if(!o)return;
	if(o.isEmpty()){
		v=J.ajax(m.forms).send().text;
		o.fill(v);
	}
	J('CCFf').css({top:J('myCar').dim().y-50+J.viewport().oy+'px'});
},
refresh:function(){
	var m=this,v=[],n=0,q;
	if(!m.ready)return;
	J('mcLogin').css({display:m.loggedIn?'none':'block'});
	q=J.ajax(m.carServ+'list?tm='+J.timeStamp()).send();
	o=m.cars=q.json();
	if(o && o.cars)o=o.cars;
	else return;
	if(o.saved)n+=o.saved.length;
	if(o.history)n+=o.history.length;
	J('myCar').setClass((n>0)?'detail':'');
	if(n==0)return;
	J('mcAll').first('b').fill(n);
	if(o.saved)J.array(o.saved).each(m.getEntry,v);
	if(o.history){
		v.push('<div class="myHist">');
		J.array(o.history).each(m.getEntry2,v);
		v.push('</div>')
	}
	J('mCCdetail').fill(v.join(''))
},
getEntry:function(c,a,i){
	var t=J.tmConfig.dialog,tV=t.LBL_view_car,tD=t.LBL_delete;
	c.push('<span><a href="javascript:J.tmMyCars.askDelete(\''+a.id+'\');" class="del" title="'+tD+'"></a><a href="/cc/'+a.id+'" target="_blank" title="'+tV+'" onclick="J.tmMyCars.track()">'+a.time+'<b> '+a.name+'</b> <em>'+a.price+'</em></a></span>')
},
getEntry2:function(c,a,i){
	var t=J.tmConfig.dialog,tV=t.LBL_view_car;
	c.push('<span><a href="/cc/'+a.id+'" target="_blank" title="'+tV+'" onclick="J.tmMyCars.track()">'+a.time+'<b> '+a.name+'</b> <em>'+a.price+'</em></a></span>')
},
track:function(){
	if(J.tmWebtrends.on)J.tmWebtrends.trackObj({'WT.cg_n':'E_GetStarted','WT.pc':'Quick Link','WT.pn':'Configured Car'})
},
trackStart:function(){
	if(J.tmWebtrends.on)J.tmWebtrends.trackObj({'WT.cg_n':'E_GetStarted','WT.pn':'Start Now','WT.si_n':'AdvancedFilterTool','WT.si_x':1})
},
askDelete:function(a){
	var m=J.tmMyCars;
	m.loadForms();
	m.sKey=a;
	m.active=J('mCdelete').expand()
},
doDelete:function(){
	var m=J.tmMyCars,q;
	q=J.ajax(m.carServ+'delete').post({id:m.sKey}).json();
	if(!q.cars)alert('Error deleting configuration.');
	m.doCancel();
	m.refresh()
},
showAll:function(){
	var m=J.tmMyCars,o=J('mCContent');
	if(m.isHidden){
		o.expand();
		J('mcAll').setClass('')
	}
	else{
		o.collapse();
		J('mcAll').setClass('on')
	}
	m.isHidden=!m.isHidden
},
askLogin:function(){
	var m=J.tmMyCars;
	m.loadForms();
	m.active=J('CCF_login').expand()
},
doLogin:function(){
	var m=J.tmMyCars,o=J.form(m.active),q;
	if(!o.validate())return;
	q=J.ajax(m.userServ+'login').post(o.data());
	q=q.json();
	if(q.user){
		m.loggedIn=true;
		m.doCancel();
		m.refresh();
		if(m.pending)m.active=m.pending.expand()
	}
	else m.active.first('p').fill(m.trans['MSG_'+q.message]).setClass('error')
},
doRegister:function(){
	var m=J.tmMyCars,o=J.form(m.active),q;
	if(!o.validate())return;
	if(J.$('fPassword2').value!=J.$('fPassword3').value){
		J.$('fPassword3').parentNode.className='error';
		return
	}
	q=J.ajax(m.userServ+'register').post(o.data()).json();
	if(q.user){
		m.loggedIn=true;
		m.doCancel();
		if(m.pending)m.active=m.pending.expand()
	}
	else m.active.first('p').fill(m.trans['MSG_'+q.message]).setClass('error');
},
doRecover:function(){
	var m=J.tmMyCars,o=J.form(m.active),q;
	if(!o.validate())return;
	q=J.ajax(m.userServ+'recover').post(o.data()).json();
	if(q.user)m.alert('',m.trans['MSG_PW_SENT']);
	else m.active.first('p').fill(m.trans['MSG_'+q.message]).setClass('error')
},
alert:function(a,b){
	var m=J.tmMyCars,o=m.active,v=a,q=J('CCF_alert');
	m.loadForms();
	if(v=='')v=m.active.first('h1').content();
	q.first('h1').fill(v);
	q.first('p').fill(b);
	if(m.active)m.active.collapse();
	m.active=q.expand()	
},
show:function(a){var m=J.tmMyCars;if(m.active)m.active.collapse();m.active=J(a).expand()},
doCancel:function(){var m=J.tmMyCars;m.active.collapse();m.active=null}
}

/* inline carconfig 3.0 with WebTrends */
J.tmCarConfig={buff:{},
url:'/components/carconfigurator',
model:['model','body','engine','transmission','grade','colour'],
wtData:{'WT.cg_n':'A_MiniCarConfig','WT.pc':'MiniCarConfig','WT.si_n':'MiniCarConfig'},
init:function(){
	var m=this,o=J('mcSelect');if(!o)return;
	m.fields=o.tags('a').each(function(c,a,i){a.set({index:i}).click(m.click)});
	m.getTrans();
	if(o.data('value')){
		m.fields.first().fill(o.data('label')).setClass('blur');
		m.lockModel=true;
		m.active=0;
		m.model[0].value=o.data('modelid');
		m.updateView()
	}
},
getTrans:function(){
	var m=this,q=J.tmConfig.miniCC,v;
	v=J.array(m.model).map(function(c,a){return{field:a,label:q['LBL_'+a.toUpperCase()]}});
	m.model=v;
},
click:function(){
	var m=J.tmCarConfig,o=this,oo=J(o.parentNode);
	if(J(this).hasClass('blur'))return false;
	if(m.hasDrop)m.stopDrop();
	else{
		var dm=m.prepDrop(),p=oo.pos(),h=oo.obj.offsetHeight-2;
		m.active=o.index*1;
		dm.css({left:p.x+'px',top:p.y+h+'px'}).fill(m.getChoices(m.active));
		dm.tags('a').each(function(c,a){a.click(m.setChoice)});
		dm.drop();
		m.hasDrop=true
	}
	return false
},
stopDrop:function(){var m=this;m.drop.hide().css({height:'auto'});m.hasDrop=false},
setChoice:function(){
	var m=J.tmCarConfig,o=J(this),v,p;
	m.model[m.active].value=o.data('value');
	m.fields.item(m.active).fill('<i></i>'+o.data('label'));
	m.stopDrop();
	m.updateView();
	if(m.active<5){
		if(J.tmWebtrends.on){
			p=m.active;
			v=J.set(m.wtData,{'WT.si_x':p+1,'WT.pn':m.model[p].field+' selected','WT.ModelID':m.model[0].value});
			J.tmWebtrends.trackObj(v);
		}
		m.getChoices(m.active+1)
	}
	else m.showResult();
	return false
},
getObj:function(p){var m=this,o={},i,a=m.model;for(i=0;i<p;i++)o[a[i].field]=a[i].value;return o},
getChoices:function(a){
	var m=this,q=m.getObj(a),bu=m.hash(q),v=m.buff[bu],r;if(v)return v;
	r=J.ajax(m.url).post(q);
	v=m.buff[bu]=J.array(r.json()).map(function(c,a,i){
		var cc,v,q=a.label;
		if(a.rgb){
			cc='<i style="background:#'+a.rgb+'"></i>';
			cc+=(a.price?'<b>'+a.label+'</b> '+a.price:a.label);
		}
		else{
			cc=(a.price?'<b>'+a.label+'</b> '+a.price:a.label);
			if(a.energy){
				v=J.array(a.energy).map(function(c,a){
					return '<br>'+a.label+': '+a.min+' '+a.unit+' - '+a.max+' '+a.unit
				},cc);
				cc+=v.join('\n');
				q+='<u>'+v.join('\n')+'</u>'
			}
		}
		return '<a href="" data-label="'+q+'" data-value="'+a.value+'"'+((i%2==0)?' class="odd"':'')+'>'+cc+'</a>'
	}).join('\n');
	return v
},
hash:function(a){var v=['id'],p;for(p in a)v.push(a[p]);return v.join('~')},
prepDrop:function(){var m=this,o=m.drop;if(!o){o=m.drop=J.body.append('div',{id:'tmCCdrop'})}return o},
updateView:function(){
	var m=J.tmCarConfig;
	J('mcSelect').tags('a').each(function(c,a,i){
		var o=J.tmCarConfig.model[i];
		if(i>c){o.value=null;a.fill('<i></i>'+o.label)};
		a.obj.parentNode.className=(i>c+1)?'blur':''
	},this.active)
},
startAgain:function(){
	var m=J.tmCarConfig;
	m.active=J('mcSelect').data('value')?0:-1;
	m.updateView();
	J('miniCcf').setClass('');
	J.tmEnergy.hideEco();
},
showResult:function(){
	var m=this,q=m.getObj(6),r,o,v,x,mid,mcl;
	r=J.ajax(m.url).post(q);
	o=m.resultData=r.json();
	J.tmEnergy.showEco(o.configid);
	J('mcImg').set({src:o.image+'.resize?width=163'});
	if(J('ccfModelName'))J('ccfModelName').fill(o.model);
	var v=J.array('model body engine tranmission grade wheeldrive colour'.split(' ')).map(m.listI,o);
	J('ccfData').fill(v.join('\n'));
	J('ccfCarPrice').fill(o.carprice);
	J('ccfPaintPrice').fill(o.paintprice);
	J('ccfPrice').fill(o.price);
	J('miniCcf').setClass('result');
	if(J('cfView'))J('cfView').set({href:o.carchapter});
	J.tmMyCars.refresh();
	if(J.tmWebtrends.on){
		x=J.xml(o.config);
		m.modelId=mid=x.select('//model/@id').value();
		mcl=x.select('//configuration/@countrycode').value()+x.select('//configuration/@language').value();
		v=J.set(m.wtData,{'WT.si_x':6,'WT.pn':'color selected',
			'WT.cg_s':o.model,'WT.cc_bt':o.body,'WT.cc_eng':o.engine,'WT.cc_tr':o.tranmission,'WT.cc_grd':o.grade,'WT.cc_extclr':o.colour,
			'WT.ModelID':mid,
			'WT.CarID':x.select('//car/@id').value()+'_'+mcl,
			'WT.ExtColorID':x.select('//model/@id').value()+'_'+x.select('//exteriorcolor/@id').value()+'_'+mcl
		});
		J.tmWebtrends.trackObj(v);
	}
},
getFull:function(){
	var m=J.tmCarConfig,v;
	if(J.tmWebtrends.on){
		v=J.set(m.wtData,{'WT.si_x':7,'WT.pn':'Car Configurator','WT.si_cs':1,'WT.ModelID':m.modelId});
		J.tmWebtrends.trackObj(v);
	};
	window.open('/cc/'+m.resultData.configid)
},
getFinance:function(){
	var m=J.tmCarConfig,r,o=J.$('FinCform'),q;
	r=J.ajax('/components/carconfiguration/'+m.resultData.configid+'/classic').send();
	o.action=J.tmConfig.miniCC.URL_FINANCE;

// temporary fix
	q=r.text;
	if(q.indexOf('<page>')>-1)q='<configuration'+J.mid(q, '<configuration', '</configuration>')+'</configuration>';

	J.$('fFinConfig').value=q;
	if(J.tmWebtrends.on){
		v=J.set(m.wtData,{'WT.si_x':7,'WT.pn':'Finance Calculator','WT.si_cs':1,'WT.ModelID':m.modelId});
		J.tmWebtrends.trackObj(v);
	};
	o.submit()
},
listI:function(a,b){return '<li>'+a[b]+'</li>'}
}

/* home feature section */
J.tmFeature={width:770,pos:0,
init:function(){
	var m=this,o=m.content=J('ftContent'),v=[];if(!o)return;
	m.items=o.tags('section');
	m.items.each(function(a){a.push('<b></b>')},v);
	m.index=J('ftIndex').fill(v.join('')).tags('b');
	m.bPrev=J('ftPrev').click(m.prev);
	m.bNext=J('ftNext').click(m.next);
	m.nav(0)
},
prev:function(){return J.tmFeature.nav(-1)},
next:function(){return J.tmFeature.nav(1)},
nav:function(a){
	var m=this,n=m.items.arr.length-1,p=m.pos;
	m.index.item(m.pos).setClass('');
	m.pos+=a;
	m.bPrev.setClass((m.pos>0)?'':'na');
	m.bNext.setClass((m.pos<n)?'':'na');
	m.pos=J.between(m.pos,0,n);
	m.index.item(m.pos).setClass('on');
	if(m.pos!=p)m.content.animate({left:-m.pos*m.width});
	return false
}
}

/* prime nav dropdowns */
J.tmNav={
init:function(){
	var m=this,o=J('primeNav');if(!o)return;
	if(!o.hasClass('home'))m.prepare(J('pnRange'),J('rangeCt'));
	o=J('prnT');if(o.hasClass('prn2'))m.prepMore(J('pnMore'));else m.prepSubs(o);
	m.prepSearch(J('pnSearch'),J('tmSearch'))
},
prepare:function(a,b){var m=this;if(!a)return;a.hover(m.over,m.out);b.hover(m.subOver,m.out)},
prepSubs:function(a){
	var m=this;
	J('prnCn').append('div',{id:'tmNavSub'}).hover(m.subOver,m.out);
	a.tags('a').each(function(c,a,i,o){if(i>0&&i<o.length-1)a.set({index:i-1,id:'pnTab_'+i,oldClass:a.obj.className}).hover(J.tmNav.over2,J.tmNav.out)})
},
prepMore:function(a){
	var m=this,o,q,v=[],h;if(!a)return;
	o=J('prnCn').append('div',{id:'tmNavMore'});
	q=o.append('div',{id:'tmNavMCn'});
	o.append('div',{id:'ie_tmNavMore'});
	J.array(J.tmConfig.nav_other).each(function(v,a,i){
	if(a.type=='external'||a.id=='NavMsubExt'){
			v.push('<div class="NavMsub_'+i+'" id="NavMsubExt"><i></i><h3>'+a.label+'</h3>');
		}
		else{
			v.push('<div class="NavMsub_'+i+'"><h3><a href="'+a.url+'">'+a.label+'</a></h3>');
		}
		J.array(a.children).each(function(v,a){v.push('<a href="'+a.url.replace(/"/g,'&quot;')+'">'+a.label+'</a>')},v);
		v.push('</div>')
	},v)
	q.fill(v.join('\n'))
	m.prepare(a,o)
},
prepSearch:function(a,b){var m=this;if(!a)return;b.css({left:769-b.obj.offsetWidth+'px'});m.prepare(a,b)},
over:function(e){
	var m=J.tmNav,n=this.id,o=J(this),q,h;
	q=(n=='pnRange')?'rangeCt':(n=='pnMore')?'tmNavMore':'tmSearch';
	m.timer=J.stop(m.timer);
	if(m.sub==q)return;
	if(m.sub)m.stop();
	o.setClass('on');
	switch(q){
		case'rangeCt':case'tmNavMore':case'tmSearch':
			h=m[q+'h']=m[q+'h']||J(q).obj.offsetHeight;
			J(q).css({height:0}).show().animate({height:h});
			break;
		default:
			J(q).drop();
	}
	m.tab=n;
	m.sub=q
},
over2:function(){
	var m=J.tmNav,n=this.id,i=this.index*1,o=J(n),q='tmNavSub';
	m.timer=J.stop(m.timer);
	if(m.index==i)return;
	if(m.sub)m.stop();
	o.setClass('on');
	var x=o.dim().x-J('cn').dim().x-6;
	x=(x>568)?568:x;
	J(q).css({height:'',left:x+'px'}).fill(m.getSub(J.tmConfig.nav_other[i])).drop();
	m.tab=n;m.index=i;m.sub=q
},
getSub:function(a,b){var v=['<div id="tmNSa">'];J.array(a.children).each(function(v,a){v.push('<a href="'+a.url.replace(/"/g,'&quot;')+'">'+a.label+'</a>')},v);return v.join('\n')+'</div>'},
subOver:function(e){var m=J.tmNav;m.timer=J.stop(m.timer)},
out:function(){J.tmNav.timer=setTimeout(J.tmNav.stop,300)},
stop:function(){var m=J.tmNav;m.timer=J.stop(m.timer);J(m.sub).hide();J(m.tab).setClass(J(m.tab).obj.oldClass);m.sub=null;m.index=null}
}

/* promo section */
J.tmPromo={width:776,pos:0,
init:function(){
	var m=this,o=m.content=J('promoCn'),v=[];if(!o)return;
	m.items=o.tags('ul');
	if(m.items.arr.length<2){
		J('pgPromo').first('nav').hide();
		return
	}
	m.items.each(function(a){a.push('<b></b>')},v);
	m.index=J('prIndex').fill(v.join('')).tags('b');
	m.bPrev=J('prPrev').click(m.prev);
	m.bNext=J('prNext').click(m.next);
	J('prAll').click(m.viewAll)
	//J('prTotal').fill(o.tags('a').arr.length)
	m.nav(0)
},
viewAll:function(){
	var o=J('promoCn'),b=J('prAll'),q=J('pgPromo').tags('nav').first();
	if(b.hasClass('on')){q.show();b.setClass('');o.setClass('')}
	else{
		q.hide();
		b.setClass('on');
		o.css({left:0}).setClass('all');
		}
	return false
},
prev:function(){return J.tmPromo.nav(-1)},
next:function(){return J.tmPromo.nav(1)},
nav:function(a){
	var m=this,n=m.items.arr.length-1,p=m.pos;
	m.index.item(m.pos).setClass('');
	m.pos+=a;
	m.bPrev.setClass((m.pos>0)?'':'na');
	m.bNext.setClass((m.pos<n)?'':'na');
	m.pos=J.between(m.pos,0,n);
	m.index.item(m.pos).setClass('on');
	if(m.pos!=p)m.content.animate({left:-m.pos*m.width});
	return false
}
}

/* share popups */
J.tmShare={
init:function(){
	var m=this;
	if(J('smShare'))m.prepare('sht-panel',J.tmConfig.social.share,J('smShare'));
	if(J('smFollow'))m.prepare('flw-panel',J.tmConfig.social.follow,J('smFollow'))
},
prepare:function(a,b,c){
	if(!c)return;
	var m=this,o=J.body.append('div',{id:a}),v=[],x=(a=='flw-panel')?'2':'';
	v.push('<div class="w2"><div class="T"><ul class="sbi">');
	J.array(b).each(function(c,a,i){
		if(a=='-')c.push('</ul><ul class="sbi">');
		else{var p=a.split('~'),dd;dd=(p[0].indexOf('img')==0)?' style="background-image:url(' +p[0].substr(4)+ ')"':' class="'+p[0]+'"';v.push('<li><a href="javascript:void(null)" onclick="J.tmShare.exec'+x+'('+i+',0)"><i'+dd+'></i>'+p[1]+'</a></li>')}
	},v);
	v.push('</ul><div class="clear"></div></div><div class="B"></div></div>');
	o.fill(v.join('\n')).hover(m.subOver,m.out);
	c.hover(m.over,m.out);
},
over:function(){
	var m=J.tmShare,x=this.id=='smShare',o=J(x?'sht-panel':'flw-panel');
	try{J(x?'flw-panel':'sht-panel').hide();J.stop(m.timer);}catch(e){};
	var p=J(this).dim(),d=o.dim();
	o.css({left:188+p.x-406+'px',top:p.y-d.h+'px'});
	o.show()
},
out:function(e){
	var m=J.tmShare,t,o,q=window.event;
	e=e||q;
	t=(q)?e.srcElement:e.target;
	o=(e.relatedTarget)?e.relatedTarget:e.toElement;
	if(o.parentNode.id.indexOf('sm')==0)return;
	m.timer=setTimeout(m.stop,500)
},
stop:function(){
	if(J('sht-panel'))J('sht-panel').hide();
	if(J('flw-panel'))J('flw-panel').hide()
},
subOver:function(){var m=J.tmShare;J.stop(m.timer)},
exec:function(a,b){
	var m=J.tmShare,v=J.tmConfig.social[b?'follow':'share'][a].split('~'),v2,vu=location.href,vt=encodeURI(document.title);
	v2=v[2].replace('[%1]',vu).replace('[%2]',vt);
	window.open(v2,'sharewin');
	return false
},
exec2:function(a){return J.tmShare.exec(a,true)}
}

/* misc functions */
J.frame={init:function(){var m=this,o=J('cpFrame');if(o)J.append(o.obj,'iframe',{src:o.data('link'),height:o.data('height'),frameBorder:'0'})}}

/* ie fixes */
J.ieOnly={
init:function(){
	var m=this;
	if(!J.ie6)return;
	m.fixLogo();
	m.fixStrap();
	if(J('ieScn')){
		m.fix();
		setInterval(J.ieOnly.fix,500)
	}
	var o=J('pnCars');if(o)o.tags('img').each(function(m,a){m.fixImg(a)},m)
},
fix:function(){
	var m=J.ieOnly,v=J.viewport(),hh=v.h-137,tt=document.documentElement.scrollTop+6;
	if(hh!=m.height)J('ieScn').css({height:hh+'px'});
	m.height=hh;
	if(tt!=m.top)J.tags('aside').first().animate({top:tt});
	m.top=tt
},
fixLogo:function(){
	var m=this,o=J('top'),q;if(!o)return;
	if(!J('cn').hasClass('vi12'))m.fixImg(o.tags('img').first())
},
fixImg:function(a){
	a.obj.parentNode.style.filter='progid:DXImageTransform.Microsoft.AlphaImageLoader(src='+a.obj.src+')';
	a.hide()
},
fixStrap:function(){
	var o=J('strapline'),v;if(!o)return;
	v=o.getStyle().backgroundImage.split('"')[1].split('"')[0];
	J('strap_ie6').obj.style.filter='progid:DXImageTransform.Microsoft.AlphaImageLoader(src='+v+')'
}
}

/* v10 overlayer */
J.tmOvl={
init:function(){
	var m=this,v;
	m.box=J('tmOVL');
	v=decodeURIComponent(J.mid(location.href,'form=','#'));
	if(v && m.isForm(v))m.launch(v,1500,null,true)
},
isForm:function(a){
	var v=J.tmConfig.jsForms;
	if(!(v && v.length && v.length>0))return true;
	for(i=0;i<v.length;i++)if(a.indexOf(v[i])==0)return true;
	return false;
},
launch:function(url,h,x,ext){
	var m=J.tmOvl,o=m.box,v=url,ht;
	if(J.tmMoreActions.open && m.ie() && m.ie()<8)J('aaWrap').collapse()
	if(ext){
		v=_EXTERNAL.link(v,'tmOVL')
		_EXTERNAL.bind('tmOVL',null,J.tmOvl.close)
		_EXTERNAL.listen()
	}
	if(h=='100%')ht=h
	else ht=h+'px'
	o.fill('').append('iframe',{src:v,height:ht,frameBorder:'0',allowTransparency:'true'},{left:x?'-6px':0,width:x?'788px':'782px'});
	o.expand()
},
close:function(){
	var m=J.tmOvl;
	if(J.tmMoreActions.open && m.ie() && m.ie()<8)J('aaWrap').expand();
	m.box.collapse();
	/* survey hook */
	if(m.onClose)m.onClose();
	m.onClose=null
},
ie:function(){var a=/MSIE (\d+\.\d+);/.test(navigator.userAgent);return(a)?+RegExp.$1:null}
}

/* facebook like */
J.tmFaceBox={
init:function(){
	var m=this,o=J.tags('div');
	if(o)o.each(function(c,a){if(a.hasClass('fbBox_v9'))m.render(a)})
},
render:function(a){
	a.append('iframe',{src:'http://www.facebook.com/plugins/likebox.php?id='+a.obj.id.substr(3)+'&amp;connections=0&amp;stream=false&amp;header=false&amp;height=62',frameBorder:0})
}
}

/* iframes v2 */
J.tmFrame={
init:function(){
	var m=this,o=J('iFrame'),q;if(!o)return;
	q=o.data();
	m.iframe=o.append('iframe',{src:m.transform(q.url)+'#outer='+location,frameBorder:0}).css({height:q.height+'px'});
	window.setInterval(J.tmFrame.resize,500)
},
resize:function(){
	var m=J.tmFrame,h=J.mid(location.hash,'#height=','#');if(!h)return;
	m.iframe.css({height:h+'px'});
	location.hash=''
},
query:function(a){
	var o=a.split('&'),n=o.length,q={},v;
	for(i=0;i<n;i++){v=(o[i]+'=').split('=')[0];q[v]=decodeURIComponent(o[i].slice(v.length+1))};
	return q
},
queryString:function(a){
	var v=[],p;
	for(p in a){v.push(p+'='+encodeURIComponent(a[p]))};
	v=v.join('&');
	return v?'?'+v:''
},
transform:function(a){
	var m=this,v='http'+J.mid(a,'http','?'),q=m.query(J.mid(a,'?'));
	J.set(q,J.query());
	v+=m.queryString(q)
	return v
}
}

/* dealerfinder (updated) */
J.tmDealer={
mdPath:'/components/userdealer/',
init:function(){
	var m=this,o=J('dlrSubmit');
	m.link=J.tmConfig.dealers.url;
	if(o)o.click(m.launch);
	if(J('mdChange'))J('mdChange').click(m.track)
},
track:function(){
	if(J.tmWebtrends.on)J.tmWebtrends.trackObj({'WT.cg_n':'E_GetStarted','WT.pc':'QuickLink','WT.pn':'Dealer_Finder','WT.si_n':'dealerfinder','WT.si_x':1})
},
launch:function(){
	var m=J.tmDealer,v=J('dlrQuery'),o={},q;
	if(v){
		o.city=v.obj.value;
		q=m.getServices();if(q!='')o.services=q;
	}
	/* survey hook */
	if(m.onClose)J.tmOvl.onClose=m.onClose;
	J.tmOvl.launch(m.link+m.toQuery(o),700,true);
	return false
},
getServices:function(){var v=[],o=J('dlrSrvLi').tags('input');o.each(function(c,a){var o=a.obj;if(o.checked)c.push(o.value)},v);return v.join(',')},
toQuery:function(a){
	var v=[],p;
	for(p in a)v.push(p+'='+encodeURIComponent(a[p]));
	if(v.length>0)return '&'+v.join('&');
	return ''
	},
save:function(a){
	var m=this,o,v=[],tt;if(!J('myDealer'))return;
	tt=J('myDealer').data('website');
	o=J.ajax(m.mdPath+'save/'+a).send().json().dealer;
	if(o.url)v.push('<a href="'+m.getLink(o.url)+'" title="'+tt+'" target="_blank">'+o.name+'</a>');
	else v.push('<em>'+o.name+'</em>');
	v.push(o.address+'<br>')
	v.push(o.zip+' '+o.city)
	v.push('<b>'+o.phone+'</b>');
	J('mdDetail2').fill(v.join('\n'));
	J('myDealer').setClass('detail')
},
askRemove:function(){J('mdRDialog').expand()},
doDelete:function(){
	var m=J.tmDealer;
	J.ajax(m.mdPath+'delete').send();
	J('myDealer').setClass('');	
	J('mdRDialog').collapse()
},
cancelDelete:function(){J('mdRDialog').collapse()},
getLink:function(a){
	var v='http://'
	if(a.indexOf('javascript:window.open(')>-1)return a.split("'")[1].split("'")[0]
	else return ((a.toLowerCase().indexOf(v)==0)?'':v)+a
}
}

/* reasons to own */
J.tmOwn={pos:0,
init:function(){
	var m=this,o=J('pgOwnIndex'),v=[];if(!o)return
	m.items=o.tags('li').each(function(c,a,i){a.set({index:i}).click(m.go);c.push('<b></b>')},v);
	m.index=J('owIndex').fill(v.join('')).tags('b');
	m.bPrev=J('owPrev').click(m.prev);
	m.bNext=J('owNext').click(m.next);
	J('owAll').click(m.viewAll);
	J('owDetails').tags('section').each(function(c,a,i){
		var v=c.items.item((i+1)%5).first('em').content();
		a.first('nav').click(c.next).first('span').fill(v);
	},m)
	m.indexH=J('pgOwnCn').obj.offsetHeight;
	m.prepareFlash();
},
prepareFlash:function(){
	var m=this,b='/images/inc/';
	m.player=J.flash.render(J('owPlay').obj,{id:'owFlashPlayer',width:770,height:340,movie:b+'reasons-to-own.swf',flashvars:'jsCallback=J.tmOwn'});
},
viewAll:function(){
	var m=J.tmOwn;
	if(J('owAll').hasClass('on'))return false;
	J('pgOwn').setClass('');
	J('owAll').setClass('on');
	J('pgOwnIndex').show();
	J('pgOwnCn').animate({height:m.indexH})
	return false
},
go:function(){
	var m=J.tmOwn;
	J('pgOwn').setClass('detail');
	J('owAll').setClass('');
	J('pgOwnIndex').hide();
	return m.nav(null,this.index*1)
},
prev:function(){return J.tmOwn.nav(-1)},
next:function(){return J.tmOwn.nav(1)},
nav:function(a,b){
	a=(a)?parseInt(a):a;
	var m=this,n=m.items.arr.length-1,q;
	m.index.item(m.pos).setClass('');
	J('owDetails').tags('section').item(m.pos).collapse();
	if(J.isSet(b))m.pos=b;else m.pos+=a;if(m.pos<0)m.pos=n;if(m.pos>n)m.pos=0;
	m.index.item(m.pos).setClass('on');
	q=m.items.item(m.pos).data('movie');
	if(q){
		J('owPlay').opacity(0).animate({opacity:1});
		J('pgOwn').setClass('play')
		J('pgOwnCn').animate({height:340});
		m.player.setNextButton(J.tmConfig.reasons_to_own['next'], m.items.arr[(m.pos+1)%5].first('em').content(), 1);
		setTimeout(function(){m.player.loadVideo(q)},10)
	}
	else{
		try{if(m.player.pauseVideo)m.player.pauseVideo()}
		catch(e){}
		J('pgOwn').setClass('detail')
		J('pgOwnCn').animate({height:500});
		J('owDetails').tags('section').item(m.pos).opacity(0).expand().animate({opacity:1})
	}
	return false
}
}

/* reviews & opinions */
J.tmReview={
init:function(){
	var m=this,o=J('rvMore');if(!o)return;
	o.hover(m.over,m.out);
	J('rvMoreSub').hover(m.subOver,m.subOut);
	J('rvMoreSub').tags('a').each(function(c,a){a.click(m.subClick)})
},
over:function(){
	var m=J.tmReview,o=J('rvMore');
	clearTimeout(m.timer);
	o.setClass('on');
	J('rvMoreSub').show()
},
subOver:function(){var m=J.tmReview;clearTimeout(m.timer)},
out:function(ev){
	var m=J.tmReview,e=ev||window.event,o=e.relatedTarget||e.toElement;
	while(o){if(o.id=='rvMore')return;o=o.parentNode};
	m.timer=setTimeout(m.stop,300)
},
subOut:function(ev){
	var m=J.tmReview,e=ev||window.event,o=e.relatedTarget||e.toElement;
	while(o){if(o.id=='rvMoreSub')return;o=o.parentNode};
	m.timer=setTimeout(m.stop,300)
},
stop:function(){J('rvMore').setClass('');J('rvMoreSub').hide()},
subClick:function(){
	var m=J.tmReview,o=this,q;
	q=J.ajax(o.href).send();
	try{J('sRvCn2').fill(m.render(q.json().article))}catch(e){};
	return false
},
render:function(a){
	var v=[];
	v.push('<img src="'+a.image+'" alt="">');
	v.push('<h4>'+a.title+' <span class="posted">'+a.date+'</span></h4>');
	v.push('<p>'+a.text+'</p>');
	v.push('<a href="'+a.link+'" class="sRvMore">'+J.tmConfig.dialog.READ_MORE+'</a>');
	return v.join('\n')
}
}

/* homepage slideshow */
J.tmHomeSlide={width:770,height:340,pos:0,
init:function(){
	var m=this,o=m.content=J('hsContent'),v=[];if(!o)return;
	m.items=o.tags('li');
	m.items.each(function(a){a.push('<b></b>')},v);
	m.index=J('hsIndex').fill(v.join('')).tags('b');
	m.bPrev=J('hsPrev').click(m.prev);
	m.bNext=J('hsNext').click(m.next);
	m.items.each(function(c,a){a.css({background:'url('+a.first('img').attr('src')+')'});});
	m.prepare(o.data('anim'))
},
prepare:function(a){
	var m=this;if(!a)return;
	m.animType=a;
	m.items.each(function(c,a,i){a.css({position:'absolute',top:0,left:0,zIndex:100-i})});
	J('hsNav').css({zIndex:100});
	m.nav(0)
},
prev:function(){var m=J.tmHomeSlide;m.reverse=true;return m.nav(-1)},
next:function(){var m=J.tmHomeSlide;m.reverse=false;return m.nav(1)},
nav:function(a){
	var m=this,n=m.items.arr.length-1,p=m.pos,o;
	m.index.item(m.pos).setClass('');
	o=m.items.item(m.pos);
	if(o.data('movie'))o.fill('');
	m.pos+=a;
	m.bPrev.setClass((m.pos>0)?'':'na');
	m.bNext.setClass((m.pos<n)?'':'na');
	m.pos=J.between(m.pos,0,n);
	m.index.item(m.pos).setClass('on');
	o=m.items.item(m.pos);
	//if(o.data('movie'))J.flash.expand(o,o);
	if(m.pos!=p)m.animate();
	return false
},

animate:function(){
	var m=this,v=m.animType,o=m.items,q=o.item(m.pos),q2=o.item(m.pos-1),r=m.reverse;
	switch(v){
		case'slide':
			if(r)q.animate({top:0});
			else q2.animate({top:m.height});
			break;
		case'slide2':
			if(r)q.animate({left:0});
			else q2.animate({left:-m.width});
			break;
		case'slide3':
			if(r)q.animate({left:0,top:0});
			else q2.animate({left:-m.width,top:-m.height});
			break;
		case'fade':
			if(r)q.animate({opacity:1},800);
			else q2.animate({opacity:0},800);
			break;
		case'clip':
			if(r)q.animClip([170,770,170,0],[0,770,340,0]);
			else q2.animClip([0,770,340,0],[170,770,170,0]);
			break;
		case'clip2':
			if(r)q.animClip([0,385,340,385],[0,770,340,0]);
			else q2.animClip([0,770,340,0],[0,385,340,385]);
			break;
		case'clip3':
			if(r)q.animClip([170,385,170,385],[0,770,340,0],800);
			else q2.animClip([0,770,340,0],[170,385,170,385],800);
			break;
		default: // old animation
			m.content.animate({left:-m.pos*m.width});
	}
}
}


/* facebook like */
J.tmIframe={
init:function(){
	var o=J.tags('figure');
	if(o)o.each(function(c,a){var v=a.data('iframe');if(v)a.append('iframe',{src:v,frameBorder:0})})
}
}

/* 3 col picture gallery */
J.pics3={imgNum:0,
init:function(){
	var m=this,o=J('g-list'),q;if(!o)return;
	q=m.imgList=o.tags('a');
	m.listLen=q.arr.length;
	q.each(function(c,a,i){a.set({imgNum:i}).click(m.imgClick)});
	m.prev=J('ccPicPrev').click(m.doPrev);
	m.next=J('ccPicNext').click(m.doNext);
	m.imgSet(0);
},
imgClick:function(){var m=J.pics3,o=this;if(m.imgNum!=o.imgNum)m.imgSet(o.imgNum);return false},
doPrev:function(){var m=J.pics3,v=m.imgNum-1;if(v>-1)m.imgSet(v);return false},
doNext:function(){var m=J.pics3,v=m.imgNum+1;if(v<m.listLen)m.imgSet(v);return false},
getImg:function(a){var m=this,o=m.imgList.item(a);return{preview:o.attr('href'),download:o.attr('title'),desc:o.first('img').attr('alt')}},
imgSet:function(a){
	var m=this,o=m.getImg(a),q;
	J('sm-img').set({src:o.preview});
	m.imgList.item(m.imgNum).setClass('');
	m.imgList.item(a).setClass('on');
	m.imgNum=a;
	J('ccPicPrev').css({visibility:(a>0)?'visible':'hidden'});
	J('ccPicNext').css({visibility:(a<m.listLen-1)?'visible':'hidden'});
	if(o.download){J('ccPicDwn').set({href:o.download}).show()}
	else J('ccPicDwn').hide();
	q=J('gal-text');
	if(o.desc.replace(/\s+/g,'')!=''){
		q.fill(o.desc);
		if(J.ie6)q.css({top:248-q.obj.offsetHeight+'px'});
		q.show()
	}
	else q.hide();
}
}

J.youtube={
init:function(){
	var m=this;
	if(J.tags('a')){
		J.tags('a').each(function(c,a){if(a.hasClass('youtube'))m.set(a.obj)})
	}
},
set:function(a){
	var o=a.parentNode,v=J.mid(a.href+'','v=');
	v=(v)?('http://www.youtube.com/v/'+v):a;
	J.flash.render(o,{movie:v,height:340,width:560})
}
}
J.tmNewsTabs={
init:function(){
	var m=this,o=J('nwsTabs');if(!o)return;
	m.tabs=o.tags('a');
	m.tabs.each(function(c,a,i){a.set({index:i}).click(J.tmNewsTabs.click)});
	m.pages=J('nwsPages').tags('ul');
	m.on=0
},
click:function(){
	var m=J.tmNewsTabs,n=this.index*1,p=m.tabs,q=m.pages;
	p.item(m.on).setClass('');
	p.item(n).setClass('on');
	q.item(m.on).setClass('');
	q.item(n).setClass('on');
	m.on=n;
	return false
}
}

/*** v9 compatibility ***/

/* glossary popup */
J.tmGlosV9={
init:function(){
	var m=this,o=J('pop-glos');if(!o)return;
	o.tags('a').each(function(c,a){a.click(m.click)})
},
click:function(){J.tmGlosV9.launch(this.href);return false},
prepare:function(){
	var m=this,o=m.div=J.tags('article').first().append('div',{id:'glosWin'});
	m.win=o.append('iframe',{allowTransparency:'true',frameBorder:'0'},{width:'886px',height:'500px',display:'block'})
},
launch:function(a){
	var m=this,t=document.documentElement.scrollTop||document.body.scrollTop||window.scrollY;
	if(!m.win)m.prepare()
	m.win.set({src:a})	
	m.div.css({top:t+100+'px',display:'block'})
},
close:function(){J.tmGlosV9.div.collapse()}
}		

function pop_glos(a){J.tmGlosV9.launch(a)}

var G={
glos:{
close:function(){J.tmGlosV9.close()}
},
cta:{
launch:function(a,b){
	J.tmOvl.launch(b,1500)
}
}
}


J.tmWebtrends={
init:function(){
	var m=this,v=m.on=!!window.TM_WT,o;if(!v)return;
	if(J.body.data('trackscroll'))m.prepScroll();
	o=J('ctaGll');
	if(o){
		o.tags('a').each(function(c,a){if(!a.hasClass('more'))a.click(J.tmWebtrends.trackLink)});
		//m.trackObj({'WT.cg_n':'???','WT.pc':'Get Started','WT.pn':'???'})
	}
	TM_WT.dcsTrk();
},
trackLink:function(){
	var m=J.tmWebtrends,o=J(this);
	m.track(o)
},
track:function(a){
	var m=this,o=a.data(),v=[],q;;if(!m.on)return;
	for(q in o){if(q.indexOf('wt-')==0)v.push(q.replace('wt-','WT.')+'='+encodeURIComponent(o[q]))}
	TM_WT.dcsTrk(v.join('&'));
},
prepScroll:function(){
	var m=this,o=m.blocks={};
	J.tags('section').each(function(c,a){var v=a.data('key');if(v)c.blocks[v]=a},m);
	if(m.count()>0)m.trackScroll()
},
count:function(){var m=this,q,v=0;for(q in m.blocks)v++;return v},
trackScroll:function(){
	var m=J.tmWebtrends,o=J.viewport(),p,q,v=[];
	for(p in m.blocks){q=m.blocks[p];if(m.inView(q.obj,o)>70){m.trackSection(q);delete m.blocks[p]}}
	if(m.count()>0)setTimeout(J.tmWebtrends.trackScroll,1000)
},
trackObj:function(a){var v=[];for(q in a){v.push(q+'='+encodeURIComponent(a[q]))};TM_WT.dcsTrk(v.join('&'))},
trackSection:function(a){
	var m=this,o=a.data(),q;
	switch(o.key){
	case'take_a_look':
		q=J.set(m.wtData(o),m.getActive('talTabs'));m.trackObj(q);break;
	case'top_features':
		q=J.set(m.wtData(o),m.getActive('ccMDlinks'));m.trackObj(q);break;
	default:
		m.track(a)
	}
},
wtData:function(a){
	var v={};
	for(q in a){if(q.indexOf('wt-')==0)v[q.replace('wt-','WT.')]=encodeURIComponent(a[q])};
	return v
},
getActive:function(a){
	var m=this;m.tmp={};
	J(a).tags('a').each(function(c,a){if(a.hasClass('on'))c.tmp=a.data()},m)
	return m.wtData(m.tmp)
},
inView:function(a,b){
	var v=[],p=a.offsetTop,h=a.scrollHeight,ho;
	if(a.offsetTop>b.oy+b.h||a.offsetTop+a.scrollHeight<b.oy)return 0;
	else{ho=a.offsetTop-b.oy;if(ho<0)h=h+ho;ho=b.oy+b.h-a.offsetTop-a.scrollHeight;if(ho<0)h=h+ho}
	return Math.round(h/a.scrollHeight*100);
}
}

/* hybrid reasons to own */
J.HyOwnClass=function(o){
	var m=this,v=[],q;
	m.items=o.tags('li');
	m.items.each(function(a){a.push('<b></b>')},v);
	m.index=o.first('nav').first('span').fill(v.join('')).tags('b');
	q=o.first('nav').tags('a');
	m.bPrev=q.first().set({obj:m}).click(m.prev);
	m.bNext=q.item(1).set({obj:m}).click(m.next);
	q=J.$$('div',o.obj.parentNode.parentNode);
	m.canvasDiv=J(q[0]);
	m.movieDiv=J(q[q.length-2]);
	m.content=o.first('ul');
	m.content.tags('a').each(function(c,a){
		switch(a.obj.className){
			case'play':a.set({obj:m}).click(m.doPlay);break;
			case'more':a.click(m.doMore);break;
			default:a.click(m.doCloseMore)
		}
	});
	m.nav(0)
}
J.set(J.HyOwnClass.prototype,{
width:382,pos:0,
prev:function(){this.obj.nav(-1);return false},
next:function(){this.obj.nav(1);return false},
nav:function(a){
	var m=this,n=m.items.arr.length-1,p=m.pos,o;
	m.index.item(m.pos).setClass('');
	o=m.items.item(m.pos);
	m.pos+=a;
	m.bPrev.setClass((m.pos>0)?'hcPrev':'hcPrevNa');
	m.bNext.setClass((m.pos<n)?'hcNext':'hcNextNa');
	m.pos=J.between(m.pos,0,n);
	m.index.item(m.pos).setClass('on');
	o=m.items.item(m.pos);
	if(m.pos!=p)m.content.animate({left:-m.pos*m.width})
},
doPlay:function(){
	var m=this.obj,o=J(this.parentNode),t=m.movieDiv;
	m.canvasDiv.setClass('playMovie');
	t.expand();
	J.flash.render(t.obj,{height:340,width:770,movie:o.data('movie'),flashvars:o.data('flashvars')});
	t.append('a',{href:''}).fill('<i></i><b>' + J.tmConfig.global.GLOBAL_CLOSE + '</b>').set({obj:m}).click(m.doClose);
	return false;
},
doClose:function(){var m=this.obj;m.movieDiv.fill('').collapse();m.canvasDiv.setClass('');return false},
doMore:function(){this.parentNode.parentNode.parentNode.className='readMore';return false},
doCloseMore:function(){this.parentNode.parentNode.className='';return false}
})

J.tmHyOwn={
init:function(){
	var m=this,o=J.tags('section');if(!o)return;
	o.each(function(c,a){
		if(a.hasClass('ccHyOwn'))a.tags('section').each(function(c,a){return new J.HyOwnClass(a)})
	})
}
}

J.tmEnergy={
ecoServ:'/Components/CarEnergyLabel/',
showEco:function(a){
	var m=this,o=J('ecoL'),q;
	if(!o)return;
	q=(a)?J.ajax(m.ecoServ+a).send():'';
	o.fill(q.text);
},
hideEco:function(){
	var o=J('ecoL');if(!o)return;
	o.fill('');
}}

J.tmFullConfig={
launch:function(a){
	var m=J.tmFullConfig;
	window.open(a,'configurator','width=1010,height=960,scrollbars=1,resize=yes,status=yes');
	if(m.onLaunch)m.onLaunch()
}
}
