mobile.initializePage("videoportal",function(){var d='<div id="inner" class="inner">';
var g="";
var f="";
var k=0;
var i=0;
if(activeSpotrailsId){var m=activeSpotrailsId;
var a=dataByVideoId[activeSpotrailsId].makeName.toLowerCase();
var k=dataByMakeName[a].length;
var b=0;
dataByMakeName[a].each(function(n){b+=1;
g="";
if(m==n.spotrailsId){i=b;
g=" selected";
f='<strong class="highlight" id="'+n.spotrailsId+'">'+n.makeName+" "+n.modelName+"</strong>"
}else{f='<a href="#" class="infoLink videolistlink" title="Testvideo" alt="Testvideo" rel="'+n.spotrailsId+'"><strong id="'+n.spotrailsId+'">'+n.makeName+" "+n.modelName+"</strong></a>"
}d+='<div class="listItem'+g+'"><img src="'+getPlayListItemImagePath(imagePath,"thumb_67x50_",n.makeName,n.modelName,n.constructionYearLowerLimit)+'.jpg" width="67" height="50" alt="" title=""/><p class="listItemText">'+f+"<span>"+getPlayListItemConstructionYearText(n.constructionYearLowerLimit,n.constructionYearUpperLimit)+"</span></p></div>"
})
}else{var m=Object.values(dataByMakeName)[0][0].spotrailsId;
Object.values(dataByMakeName).each(function(n){k+=n.length;
n.each(function(o){g="";
if(m==o.spotrailsId){g=" selected";
f='<strong class="highlight" id="'+o.spotrailsId+'">'+o.makeName+" "+o.modelName+"</strong>"
}else{f='<a href="#" class="infoLink videolistlink" title="'+o.makeName+" "+o.modelName+'" alt="'+o.makeName+" "+o.modelName+'" rel="'+o.spotrailsId+'"><strong id="'+o.spotrailsId+'">'+o.makeName+" "+o.modelName+"</strong></a>"
}d+='<div class="listItem'+g+'"><img src="'+getPlayListItemImagePath(imagePath,"thumb_67x50_",o.makeName,o.modelName,o.constructionYearLowerLimit)+'.jpg" width="67" height="50" alt="'+o.makeName+" "+o.modelName+'" title="'+o.makeName+" "+o.modelName+'"/><p class="listItemText">'+f+"<span>"+getPlayListItemConstructionYearText(o.constructionYearLowerLimit,o.constructionYearUpperLimit)+"</span></p></div>"
})
});
d+="</div>"
}if(k>4){var e=k%4;
if(e==0){var h=-((Math.floor(k/4)-1)*248)
}else{var h=-((Math.floor(k/4))*248)
}}$("scroll-up").rel="0";
$("scroll-down").rel=h;
$("inner").replace(d);
$("object").replace(getVideoplayerHtml(m));
listenerOnPage();
if(i>4){var j=i%4;
if(j==0){var l=-((Math.floor(i/4)-1)*248)
}else{var l=-((Math.floor(i/4))*248)
}$("inner").setStyle({top:l+"px"})
}var c=$("makeSelector");
c.getElements("makeList").invoke("observe","change",(function(n){var t=$("makeList").getValue();
var o='<div id="inner" class="inner">';
var r="";
var q="";
var s=0;
if(t=="all"){var v=Object.values(dataByMakeName)[0][0].spotrailsId;
var u=0;
Object.values(dataByMakeName).each(function(w){u+=w.length;
w.each(function(x){r="";
if(v==x.spotrailsId){r=" selected";
q='<strong class="highlight" id="'+x.spotrailsId+'">'+x.makeName+" "+x.modelName+"</strong>"
}else{q='<a href="#" class="infoLink videolistlink" title="Testvideo" alt="Testvideo" rel="'+x.spotrailsId+'"><strong id="'+x.spotrailsId+'">'+x.makeName+" "+x.modelName+"</strong></a>"
}o+='<div class="listItem'+r+'"><img src="'+getPlayListItemImagePath(imagePath,"thumb_67x50_",x.makeName,x.modelName,x.constructionYearLowerLimit)+'.jpg" width="67" height="50" alt="" title=""/><p class="listItemText">'+q+"<span>"+getPlayListItemConstructionYearText(x.constructionYearLowerLimit,x.constructionYearUpperLimit)+"</span></p></div>"
})
})
}else{var v=dataByMakeName[t][0].spotrailsId;
var u=dataByMakeName[t].length;
dataByMakeName[t].each(function(w){r="";
if(v==w.spotrailsId){r=" selected";
q='<strong class="highlight" id="'+w.spotrailsId+'">'+w.makeName+" "+w.modelName+"</strong>"
}else{q='<a href="#" class="infoLink videolistlink" title="Testvideo" alt="Testvideo" rel="'+w.spotrailsId+'"><strong id="'+w.spotrailsId+'">'+w.makeName+" "+w.modelName+"</strong></a>"
}o+='<div class="listItem'+r+'"><img src="'+getPlayListItemImagePath(imagePath,"thumb_67x50_",w.makeName,w.modelName,w.constructionYearLowerLimit)+'.jpg" width="67" height="50" alt="" title=""/><p class="listItemText">'+q+"<span>"+getPlayListItemConstructionYearText(w.constructionYearLowerLimit,w.constructionYearUpperLimit)+"</span></p></div>"
})
}o+="</div>";
if(u>4){var p=u%4;
if(p==0){var s=-((Math.floor(u/4)-1)*248)
}else{var s=-((Math.floor(u/4))*248)
}}$("scroll-up").rel="0";
$("scroll-down").rel=s;
$("inner").replace(o);
$("object").replace(getVideoplayerHtml(v));
listenerOnPage();
n.stop()
}).bindAsEventListener(this))
});
function getVideoplayerHtml(a){return'<div id="object" class="videoplayer"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="386" height="290" id="videoPlayer" align="middle"><param name="allowScriptAccess" value="always"></param><param name="wmode" value="transparent" ></param><param name="allowFullScreen" value="true"></param><param name="id" value="testberichte_player"></param><param name="movie" value="http://engine.spotrails.com/vdp/bb3fe75e6395407ab7792186a99f530c/'+a+'"></param><param name="quality" value="best" ></param><param name="scale" value="noscale" ></param><param name="salign" value="lt" ></param><param name="bgcolor" value="#000000" ></param><param name="FlashVars" value="videoUrl=http://anchor.spotrails.com/creatives/mobile/video.flv&videoLogoUrl=none&showStandardAds=true&keywords=private,de"></param><embed src="http://engine.spotrails.com/vdp/bb3fe75e6395407ab7792186a99f530c/'+a+'" wmode="transparent" quality="best" scale="noscale" salign="lt" bgcolor="#cccccc" width="386" height="290" name="videoPlayer" align="middle" allowScriptAccess="always" allowFullScreen="true" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" FlashVars="videoUrl=http://anchor.spotrails.com/creatives/mobile/video.flv&videoLogoUrl=none&showStandardAds=true&keywords=private,de"></embed></object></div>'
}function getPlayListItemImagePath(e,f,a,b,d){var c="";
e.endsWith("/")?c=e:c=e+"/";
return c+a+"_"+b.replace(" ","")+"_"+d+"/"+f+a+"-"+b.replace(" ","")
}function getPlayListItemConstructionYearText(c,b){var a="";
(c!=1900&&b==2100)?a="ab "+c:a=c;
if(b!=2100){if(c==1900){a+="bis "
}else{a+=" - "
}a+=b
}return a
}function listenerOnPage(){$("scroll-up").observe("click",function(event){if(eval($("inner").getStyle("top").replace(/px/g,""))<eval($("scroll-up").rel)){new Effect.Move($("inner"),{x:0,y:248,duration:1,mode:"relative"})
}Event.stop(event)
});
$("scroll-down").observe("click",function(event){if(eval($("inner").getStyle("top").replace(/px/g,""))>eval($("scroll-down").rel)){new Effect.Move($("inner"),{x:0,y:-248,duration:1,mode:"relative"})
}Event.stop(event)
});
$$("a.videolistlink").invoke("observe","click",(function(event){var element=Event.findElement(event,"a");
$$(".selected").each(function(target){target.removeClassName("selected");
var relValueIdActive=target.down("strong").id;
var makeModelNameActive=target.down("strong").firstChild.nodeValue;
target.down("strong").replace('<a href="#" class="infoLink videolistlink" title="Testvideo" alt="Testvideo" rel="'+relValueIdActive+'"><strong id="'+relValueIdActive+'">'+makeModelNameActive+"</strong></a>")
}.bind(this));
element.up("div").addClassName("selected");
videoId=element.rel;
var makeModelNameSelected=element.down("strong").firstChild.nodeValue;
var spotrailsIdSelected=element.down("strong").id;
element.replace('<strong class="highlight" id="'+spotrailsIdSelected+'">'+makeModelNameSelected+"</strong>");
$("object").replace(getVideoplayerHtml(videoId));
event.stop()
}).bindAsEventListener());
$$("div.listItem").invoke("observe","click",(function(event){var element=Event.findElement(event);
var videoId="";
if(!element.hasClassName("selected")&&!element.up("div").hasClassName("selected")){$$(".selected").each(function(target){target.removeClassName("selected");
var relValueIdActive=target.down("strong").id;
var makeModelNameActive=target.down("strong").firstChild.nodeValue;
target.down("strong").replace('<a href="#" class="infoLink videolistlink" title="Testvideo" alt="Testvideo" rel="'+relValueIdActive+'"><strong id="'+relValueIdActive+'">'+makeModelNameActive+"</strong></a>")
}.bind(this));
if(element.up("div").hasClassName("listItem")){element.up("div").addClassName("selected");
videoId=element.up("div").down("a").rel;
var makeModelNameSelected=element.up("div").down("strong").firstChild.nodeValue;
var spotrailsIdSelected=element.up("div").down("strong").id;
element.up("div").down("a").replace('<strong class="highlight" id="'+spotrailsIdSelected+'">'+makeModelNameSelected+"</strong>")
}if(element.up("div").hasClassName("inner")){element.addClassName("selected");
videoId=element.down("a").rel;
var makeModelNameSelected=element.down("strong").firstChild.nodeValue;
var spotrailsIdSelected=element.down("strong").id;
element.down("a").replace('<strong class="highlight" id="'+spotrailsIdSelected+'">'+makeModelNameSelected+"</strong>")
}$("object").replace(getVideoplayerHtml(videoId))
}event.stop()
}).bindAsEventListener())
};