/* ty_v9_javascript_core */

var G={gecko:navigator.product=='Gecko',flashVer:'9.0.0',hasFla:false,autoFla:false,ie6:(!!document.all && !(typeof window.XMLHttpRequest=='object')),
init:function(){G.detectFlash();for(var n in G)if(G[n].init)G[n].init()},
set:function(a,b,c){for(var o in b)a[o]=b[o];if(c){for(var o in c)a.style[o]=c[o]};return a},
create:function(a,b,c,d){var o=(d||document).createElement(a);G.set(o,b);G.set(o.style,c);return o},
append:function(a,b,c,d){var o=b.tagName?b:G.create(b,c,d,a.ownerDocument);a.appendChild(o);return o},
time:function(){return new Date().getTime()},
fn:function(a){return(0.5-Math.cos(a*Math.PI)/2)},
middle:function(o,a,b){o=o.split(a);return(o.length<2)?'':o[1].split(b)[0]},
pos:function(a){var x=0,y=0;if(a.y)return{x:a.x,y:a.y};while(a!=null){x+=a.offsetLeft;y+=a.offsetTop;a=a.offsetParent};return{x:x,y:y}},
stop:function(a){if(a){clearTimeout(a);a=null}},
sub:function(a,b,c){var o=a.split(b);return(o.length>1)?o[1].split(c)[0]:''},
remove:function(a){var o=a.tagName?a:Tme.get(a);o.parentNode.removeChild(o)},
absTop:function(a){var y=0;if(a.y)return a.y;while(a!=null){y+=a.offsetTop;a=a.offsetParent};return y},
absLeft:function(a){var x=0;if(a.x)return a.x;while(a!=null){x+=a.offsetLeft;a=a.offsetParent};return x},
detectFlash:function(){if(G.middle(document.cookie,'acc_type=',';')=='html'){G.noFlash=true;return};var o=G.flash._o;G.hasFla=o.has(G.flashVer);G.autoFla=o.has('6.0.65')&&(o.ua.win||o.ua.mac)}
}
function $(a){return document.getElementById(a)}
function $$(a,b){return (b||document).getElementsByTagName(a)}
window.onload=G.init

G.sifr={movie:'http://www.toyota-europe.com/images/toyota-display.swf',
set:function(a,b){
	var m=this,o,v=[],p,s,se=$('_SE_Script'),o2,o3;if(!a)return
	a.style.visibility='visible'
	if(se)return
	if(G.noFlash)return
	o={movie:m.movie,height:22,width:a.offsetWidth}
	for(p in b)v.push(p+'='+b[p])
	s=a.innerHTML.replace('&nbsp;',' ')
	s=escape(s).replace(/\+/g,'%2B').replace(/%25/g,'%2525')
	v.push('content='+s)	
	v.push('version=beta2')
	v.push('width='+o.width)
	v.push('height='+o.height)
	o.flashvars=v.join('&amp;')
	o2=G.create('span',{innerHTML:a.innerHTML})
	G.append(a,o2)
	G.flash.render([o,o2])
	//alert(a.innerHTML)
}
}

G.flash={items:[],
init:function(){setTimeout(G.flash.exec,200)},
exec:function(){
	if(G.noFlash)return
	var m=G.flash,o=m.items,i;if(o.length<1)return
	if(m._o.has('9.0.0'))for(i=0;i<o.length;i++)m.render(o[i],i)
	else m.alert()
},
add:function(a,b){this.items.push([a,b])},
render:function(a,b){
	var v=[],q=G.set({wmode:'transparent',quality:'high',AllowScriptAccess:'always'},a[0]),x,pp
	pp=location.search.substr(1);if(pp!='')q.flashvars+='&amp;'+pp
	if(G.gecko)q.flashvars+='&amp;agent=Firefox'
	v.push('<object type="application/x-shockwave-flash" id="obj_flash_'+b+'" width="'+q.width+'" height="'+q.height+'" data="'+q.movie+'">');for(x in q){switch(x){case'height':case'width':break;default:v.push('<param name="'+x+'" value="'+q[x]+'" />')}};v.push('</object>')
	if(a[1].tagName)a[1].innerHTML=v.join('\n')
	else try{$(a[1]).innerHTML=v.join('\n')}catch(e){}
},
 alert:function(){
	var m=this,o=m._o,q,v='/sys/flash_html_detection.aspx'
/*
	flash auto update
if(o.has('6.0.65')&&(o.ua.win||o.ua.mac)){m.render([{height:340,width:770,movie:'inc/expressInstall.swf',flashvars:'MMredirectURL='+location.href  },'flash1'])};else{} 
*/
	q=G.append($('cnv'),'iframe',{id:'fl-install',src:v,allowTransparency:'true',frameBorder:'0'})
}, 
_o:function(){
var SF="Shockwave Flash",SX="ShockwaveFlash.ShockwaveFlash",win=window,D=document,B=navigator,N=null,F=false,T=true,i$=function(a){return typeof a!='undefined'};var ua=function(){var w3cdom=i$(D.getElementById)&&i$(D.getElementsByTagName)&&i$(D.createElement)&&i$(D.appendChild)&&i$(D.replaceChild)&&i$(D.removeChild)&&i$(D.cloneNode),playerVersion=[0,0,0],d=N;
if(i$(B.plugins)&&typeof B.plugins[SF]=='object'){d=B.plugins[SF].description;if(d){d=d.replace(/^.*\s+(\S+\s+\S+$)/,"$1");playerVersion[0]=parseInt(d.replace(/^(.*)\..*$/,"$1"),10);playerVersion[1]=parseInt(d.replace(/^.*\.(.*)\s.*$/,"$1"),10);playerVersion[2]=/r/.test(d)?parseInt(d.replace(/^.*r(.*)$/,"$1"),10):0}}else if(i$(win.ActiveXObject)){var a=N,fp6Crash=F;try{a=new ActiveXObject(SX+".7")}catch(e){try{a=new ActiveXObject(SX+".6");playerVersion=[6,0,21];a.AllowScriptAccess="always"}catch(e){if(playerVersion[0]==6){fp6Crash=T}};if(!fp6Crash){try{a=new ActiveXObject(SX)}catch(e){}}};if(!fp6Crash&&a){try{d=a.GetVariable("$version");if(d){d=d.split(" ")[1].split(",");playerVersion=[parseInt(d[0],10),parseInt(d[1],10),parseInt(d[2],10)]}}catch(e){}}};var u=B.userAgent.toLowerCase(),p=B.platform.toLowerCase(),webkit=/webkit/.test(u)?parseFloat(u.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):F,ie=F,windows=p?/win/.test(p):/win/.test(u),mac=p?/mac/.test(p):/mac/.test(u);/*@cc_on;ie=true;@if(@_win32)windows=true;@elif(@_mac)mac=true;@end;@*/return{w3cdom:w3cdom,pv:playerVersion,webkit:webkit,ie:ie,win:windows,mac:mac}}();function hasPlayerVersion(rv){var pv=ua.pv,v=rv.split(".");v[0]=parseInt(v[0],10);v[1]=parseInt(v[1],10);v[2]=parseInt(v[2],10);return(pv[0]>v[0]||(pv[0]==v[0]&&pv[1]>v[1])||(pv[0]==v[0]&&pv[1]==v[1]&&pv[2]>=v[2]))?T:F};return{get:function(){return{major:ua.pv[0],minor:ua.pv[1],release:ua.pv[2]}},has:hasPlayerVersion,ua:ua}}()
}

G.qcomp={
init:function(){this.setAll()},
setAll:function(){var m=this;m.set(1);m.set(2);m.set(3)},
set:function(a){
	var o=$('ccTitle'+a),v='666666',q
	if(!o)return
	q=o.className
	if(q=='life')v='959062'
	else if(q=='together')v='c49647'
	else if(q=='recreation')v='a69a82'
	else if(q.indexOf('urban')==0)v='000000'
	else if(q=='energy')v='0686d'
	else if(q=='work')v='ff913d'
	G.sifr.set(o,{css:'.sIFR-root{color:#'+v+';font-weight:bold}',size:15})
}
}

function dcsTrk2(a,b,c){dcsTrk(a.replace(/&amp;WT./g,'&WT.'),b,c)}

G.dlg={
showLoading:function(a){
	var m=G.dlg,o=m.div,q
	if(o)q=m.body
	else{
		o=m.div=G.append(document.body,'div',{className:'dlg'})
		q=m.body=G.append(G.append(o,'div',{className:'dlgA'}),'div',{className:'dlgC'})
		G.append(o,'div',{className:'dlgB'})
	}
	q.innerHTML='<div class="dlgL">'+(a||'Loading...')+'</div>'
	o.style.display='block'
},
hideLoading:function(){var m=G.dlg;m.div.style.display='none'}
}

