dojo.require("dojo.data.ItemFileWriteStore");
dojo.require("dojo.fx");
dojo.require("dojox.data.FlickrRestStore");
dojo.require("dojo.io.script");
function SnoovelDisplayController(_1){
this.rt=new Array("zero","one","two","three","four","five");
this.descField;
var _2;
this.textField;
var _3;
var _4=false;
var _5=false;
var _6=750;
var _7=440;
var _8=null;
this.init=function(_9){
var _a=dojo.byId("mysl_descon");
if(_a){
_a.checked="";
dojo.connect(_a,"onchange",dojo.hitch(this,this.toggledesc));
}
this.descField=document.createElement("div");
this.descField.id="gis_border2";
_2=document.createElement("div");
_2.id=geAutostartDiv;
this.textField=document.createElement("div");
this.textField.id=domSidepanel;
this.descField.appendChild(_2);
this.descField.appendChild(this.textField);
_3=dojo.byId("gis_content");
geWidth=dojo.style(dojo.byId("gis_content"),"width");
nodedescField=dojo.byId(this.descField.id);
if(nodedescField){
descWidth=dojo.style(nodedescField,"width");
}
if(geWidth){
this.bigGeWidth=geWidth;
if(typeof descWidth!="undefined"&&descWidth!=null){
contWidth=dojo.style(dojo.byId("map3d_container"),"width");
if(contWidth){
//contWidth=contWidth.substring(0,contWidth.indexOf("px"));
this.smallGeWidth;
}else{
this.smallGeWidth=geWidth-descWidth;
}
}else{
this.smallGeWidth=geWidth;
}
}
if(_9!=undefined&&_9){
_5=true;
dojo.byId("map3d_container").style.width=this.bigGeWidth+"px";
}else{
_3.insertBefore(this.descField,dojo.byId("playerbar_wrapper"));
}
dojo.byId("map3d_container").style.border="1px solid silver";
};
this.showDropdown=function(_b,_c){
this.fillScenes(_b);
};
this.initThumbnailPicker=function(_d){
htmlId="thumbPicker";
var _e=dijit.byId(htmlId);
if(typeof thumbPickerSize!="undefined"){
var _f={query:{},count:1};
var _10={imageThumbAttr:"thumb",imageLargeAttr:"large"};
function updateDiv(_11){
geController.moveTo(_11.link);
var _12="mediaPicker";
var _13=dijit.byId(_12);
_13.reset();
};
if(typeof thumbPickerSize!="undefined"){
_e.setSize=thumbPickerSize;
}
_e.setDataStore(_d,_f,_10);
var _14=dojo.subscribe(_e.getClickTopicName(),updateDiv);
}
return dojo.byId(htmlId);
};
this.initMediaPicker=function(){
htmlId="mediaPicker";
var _15=dijit.byId(htmlId);
function updateDiv(_16){
if(_16.data["type"]=="images"||_16.data["type"]=="movies"||_16.data["type"]=="sounds"){
var _17=400;
var _18=330;
var _19="";
var _1a=380;
var _1b=300;
if(!isNaN(parseFloat(_16.data["xsize"]))){
_17=parseFloat(_16.data["xsize"])+20;
_1a=parseFloat(_16.data["xsize"]);
}
if(!isNaN(parseFloat(_16.data["ysize"]))){
_18=parseFloat(_16.data["ysize"])+30;
_1b=parseFloat(_16.data["ysize"])+30;
}
if(_16.data["title"]!=undefined){
_19=_16.data["title"];
}
wunschGroessenFaktor=0.6;
var _1c=screen.availWidth*wunschGroessenFaktor;
var _1d=screen.availHeight*wunschGroessenFaktor;
if(_17>_1c||_18>_1d){
var _1e=_1d/_18;
var _1f=_1c/_17;
if(_1e>_1f){
_1b=_1d;
_1a=_1e*_17;
}else{
_1a=Math.round(_1c);
_1b=Math.round(_1f*_18);
}
_17=_1a+20;
_18=_1b+30;
}
var url="index.php?id=";
if(_16.data["type"]=="images"){
url=url+mediaImageUrl;
}else{
if(_16.data["type"]=="movies"){
url=url+mediaVideoUrl;
}else{
if(_16.data["type"]=="sounds"){
url=url+mediaSoundUrl;
}
}
}
var _21="location=0,status=1,scrollbars=1,menubar=0,toolbar=1,resizable=1";
_21=_21+",width="+(parseInt(_17)+50)+",height="+(parseInt(_18)+30);
window.open(url+"&media="+_16.largeUrl+"&width="+_1a+"&height="+_1b+"&name="+_19,"snoovelMedia",_21);
}
};
defaultMedia=new Array();
defaultMedium=new Array();
defaultMedium["thumb"]=mediaNomediaThumb;
defaultMedium["large"]=mediaNomediaThumb;
defaultMedium["title"]="no media";
defaultMedia.push(defaultMedium);
defaultMediaItems=new Array();
defaultMediaItems["items"]=defaultMedia;
var _22=new dojo.data.ItemFileReadStore({data:defaultMediaItems});
var _23={query:{},count:1};
var _24={imageThumbAttr:"thumb",imageLargeAttr:"large",titleAttr:"title"};
if(_15){
_15.setDataStore(_22,_23,_24);
}
_8=dojo.subscribe(_15.getClickTopicName(),updateDiv);
return dojo.byId(htmlId);
};
this.setMediaDatastore=function(_25){
defaultMedia=new Array();
var len=_25.length;
var j=0;
for(var i=0;i<len;i++){
if(_25[i]["type"]!=undefined){
defaultMedia[j]=new Array();
if(_25[i]["type"]=="images"){
defaultMedia[j]["thumb"]=_25[i]["thumb"];
defaultMedia[j]["large"]=geAutostartPath+_25[i]["href"];
}else{
if(_25[i]["type"]=="movies"){
if(_25[i]["thumb"]){
defaultMedia[j]["thumb"]=_25[i]["thumb"];
}else{
defaultMedia[j]["thumb"]=mediaVideoThumb;
}
defaultMedia[j]["large"]=geAutostartPath+_25[i]["href"];
}else{
if(_25[i]["type"]=="sounds"){
defaultMedia[j]["thumb"]=mediaSoundThumb;
defaultMedia[j]["large"]=geAutostartPath+_25[i]["href"];
}
}
}
defaultMedia[j]["type"]=_25[i]["type"];
defaultMedia[j]["title"]=_25[i]["name"];
defaultMedia[j]["xsize"]=_25[i]["xsize"];
defaultMedia[j]["ysize"]=_25[i]["ysize"];
j++;
}
}
defaultMediaItems=new Array();
defaultMediaItems["items"]=defaultMedia;
var _29=new dojo.data.ItemFileReadStore({data:defaultMediaItems});
var _2a={query:{},count:1};
var _2b={imageThumbAttr:"thumb",imageLargeAttr:"large",titleAttr:"title"};
var _2c=dijit.byId("mediaPicker");
_2c.reset();
_2c.reset();
_2c.setDataStore(_29,_2a,_2b);
snConsole.debug("datastore debug.");
};
this.setGeomovieTitle=function(_2d,_2e,_2f){
div=dojo.byId("geomovie_title");
if(div!=null){
if(_2d==undefined||_2d==null||_2d.length==0){
div.style.display="none";
}else{
if(_2e!=undefined&&_2e!=null&&_2e.length!=0){
var _30=document.createElement("span");
_30.innerHTML=_2d;
_30.className="tt";
var br=document.createElement("br");
var _32=document.createElement("span");
_32.className="header_small";
var _33=i18n.LIST_CREATE+" ";
_33+=dateString(_2f);
_33+=" "+i18n.LIST_BY+" "+_2e;
_32.innerHTML=_33;
div.innerHTML="";
div.appendChild(_30);
div.appendChild(br);
div.appendChild(_32);
}else{
var _34=document.createElement("h1");
_34.innerHTML=_2d;
div.innerHTML="";
div.appendChild(_34);
}
div.style.display="block";
}
}
};
this.setSceneUI=function(_35,_36,_37,_38,_39,_3a){
div=dojo.byId("statusscene");
_36=parseFloat(_36)+1;
div.innerHTML=i18n.PLAYER_STATUS_SCENE+_36+"/"+_37;
this.textField.innerHTML="";
if(_3a){
return;
}
_4=false;
if(_35 instanceof geMovieScene){
var _3b=_35.getAutostart();
if(_3b!=null){
if(_5){
this.fadeGeWinSmall();
var me=this;
setTimeout(function(){
_3.insertBefore(me.descField,dojo.byId("playerbar_wrapper"));
if(_3b.type=="sounds"){
dojo.byId(domSidepanel).setAttribute("class","sound");
me.autostartWipeToggle(true,_3b.type);
}else{
dojo.byId(domSidepanel).setAttribute("class","video");
me.autostartWipeToggle(true);
}
if(tp.isPlaying){
flashMoviePlayer.play(geAutostartDiv,geAutostartPath+_3b.href,_3b.type);
}
},1000);
tp.delay(1000);
}else{
tp.delay(10);
if(_3b.type=="sounds"){
this.textField.setAttribute("class","sound");
this.autostartWipeToggle(true,_3b.type);
}else{
this.textField.setAttribute("class","video");
this.autostartWipeToggle(true);
}
if(tp.isPlaying){
flashMoviePlayer.play(geAutostartDiv,geAutostartPath+_3b.href,_3b.type);
}
}
_5=false;
_4=true;
}else{
this.textField.setAttribute("class","text");
this.autostartWipeToggle(false);
}
}else{
this.textField.setAttribute("class","text");
this.autostartWipeToggle(false);
}
};
this.autostartWipeToggle=function(_3d,_3e){
var _3f=dojo.byId(geAutostartDiv);
if(_3f==undefined){
return;
}
var _40=_3f.style.display;
if(_3e==undefined){
_3f.style.height="200px";
}else{
if(_3e=="sounds"){
_3f.style.height="0px";
}else{
if(_3e=="video"){
_3f.style.height="200px";
}
}
}
_3f.style.width="288px";
if(_3d==true){
if(_40=="none"||_40==""){
_3f.style.display="block";
}
}else{
if(_40!="none"){
_3f.innerHTML="";
_3f.style.display="none";
}
}
};
this.setTransUI=function(_41,_42,_43,_44){
var des=_42.getDescription();
if(des.length>0&&des!="<br />"){
if(_5){
this.fadeGeWinSmall();
var me=this;
setTimeout(function(){
_3.insertBefore(me.descField,dojo.byId("playerbar_wrapper"));
},1000);
tp.delay(1000);
}else{
tp.delay(10);
}
_5=false;
this.setDescription(_41,des,_43,_44);
}else{
if(!_4){
if(!_5){
_3.removeChild(this.descField);
tp.delay(1000);
this.fadeGeWinBig();
}else{
tp.delay(10);
}
_5=true;
}
}
};
this.ensureDescription=function(){
changed=false;
if(_5){
this.fadeGeWinSmall();
var me=this;
setTimeout(function(){
_3.insertBefore(me.descField,dojo.byId("playerbar_wrapper"));
},1000);
_5=false;
changed=true;
}
return changed;
};
this.setDescription=function(_48,_49,_4a,_4b){
descElem=this.textField;
if(_4a!=undefined&&_4b!=undefined){
_4a=parseInt(_4a)+1;
waiheader=_4a+"/"+_4b;
}
waiheader="";
if(_49!="#"&&_49!=undefined){
var _4c=_49.length;
if(_49.substring(0,3)!="<p>"&&_49.substring(_4c-4,_4c)!="</p>"){
_49="<p>"+_49+"</p>";
}
_49="<div id=\"whereamiHeader\" >"+waiheader+"</div>"+_49;
descElem.innerHTML="";
ues=document.createElement("div");
ues.setAttribute("id","headline");
desc=document.createElement("div");
ues.innerHTML=_48;
desc.innerHTML=_49;
}else{
try{
ues=dojo.byId("headline");
ues.innerHTML=_48;
wai=dojo.byId("whereamiHeader");
wai.innerHTML=waiheader;
}
catch(e){
descElem.innerHTML="";
ues=document.createElement("div");
ues.setAttribute("id","headline");
desc=document.createElement("div");
ues.innerHTML=_48;
desc.innerHTML="&nbsp;";
}
}
descElem.appendChild(ues);
descElem.appendChild(desc);
};
this.fillScenes=function(_4d){
myDataArr=new Array();
sceneElem=dojo.byId(domScene);
if(sceneElem){
dropCount=_4d.length;
for(i=0;i<dropCount;i++){
if(_4d[i].imageMedium!=undefined){
var _4e=_4d[i].imageMedium[0];
arr=new Array();
arr["thumb"]=_4e.thumb;
arr["large"]=_4e.thumb;
arr["title"]=i18n.SCENE+" "+(i+1)+": "+_4d[i].name;
arr["link"]=i;
arr["muid"]=_4d[i].uid;
myDataArr.push(arr);
}
}
}
itemArr=new Array();
itemArr["items"]=myDataArr;
var _4f=new dojo.data.ItemFileReadStore({data:itemArr});
thDiv=this.initThumbnailPicker(_4f);
parDiv=thDiv.parentNode;
parDiv.removeChild(thDiv);
if(sceneElem){
sceneElem.appendChild(thDiv);
}
mediumDiv=dojo.byId(domMediaPicker);
medDiv=this.initMediaPicker();
parDiv=medDiv.parentNode;
parDiv.removeChild(medDiv);
if(mediumDiv!=null){
mediumDiv.appendChild(medDiv);
}
};
this.fillSidepanel=function(_50){
sceneElem=dojo.byId(domSidepanel);
sceneElem.innerHTML="";
dropCount=_50.length;
picDiv=document.createElement("div");
picDiv.setAttribute("id","SidepanelText");
picDiv.innerHTML=_50[i].description;
sceneElem.appendChild(picDiv);
};
this.setElevationChart=function(uid){
var _52=service+"&service=chartservice&pid="+uid+"&L="+i18n.LANGUAGE_ID;
try{
var _53=dojo.byId("gis_heigth");
var img=_53.firstChild;
img.src=_52;
}
catch(e){
}
};
this.showList=function(_55,id,map,_58){
snConsole.debug("showList BEGIN"+_55.length);
var _59=dojo.byId("list");
if(_58==undefined){
_58="";
}
var _5a=document.createElement("div");
for(var i=0;i<_55.length;i++){
var tr=document.createElement("tr");
var _5d=document.createElement("td");
var _5e=document.createElement("td");
_5e.nodeValue=_55[i][1];
_5a.innerHTML="<a href=\"index.php?id="+id+"&tour="+_55[i][0]+_58+"\">"+_55[i][1]+"</a>";
_5a.innerHTML=_55[i][1];
_5d.appendChild(_5a.firstChild);
_5d.innerHTML="<a href=\"index.php?id="+id+"&tour="+_55[i][0]+_58+"\">"+_55[i][1]+"</a>";
_5a.innerHTML="<a href=\"index.php?id="+id+"&tour="+_55[i][0]+_58+"\">"+_55[i][2]+"</a>";
_5e.appendChild(_5a.firstChild);
tr.appendChild(_5d);
tr.appendChild(_5e);
var xy=new bean(id,_55[i][0]);
dojo.connect(tr,"onclick",dojo.hitch(xy,"callback"));
var _60=document.createElement("tbody");
_60.appendChild(tr);
_59.appendChild(_60);
}
snConsole.debug("showList BEGIN");
};
this.setPlayerLast=function(){
};
this.setPlayerNormal=function(){
var btn=dojo.byId("ge_nextTP");
btn.src="/fileadmin/snoovel/gfx/tourplayer/next.png";
btn=dojo.byId("ge_lastTP");
btn.src="/fileadmin/snoovel/gfx/tourplayer/last.png";
btn=dojo.byId("ge_previousTP");
btn.src="/fileadmin/snoovel/gfx/tourplayer/previous.png";
btn=dojo.byId("ge_firstTP");
btn.src="/fileadmin/snoovel/gfx/tourplayer/first.png";
};
this.setPlayerFirst=function(){
};
this.switchMediaTab=function(_62){
snConsole.debug(_62,"swtichMediaTab");
for(var i=0;i<mediaTabs.length;i++){
var _64=dojo.byId(mediaTabs[i]["reiter"]);
var _65=dojo.byId(mediaTabs[i]["content"]);
if(_64!=null&&_65!=null){
if(mediaTabs[i]==_62){
attr=_64.getAttribute("class");
if(attr!=null){
attr=attr.replace(/reiterDisabled/,"reiterEnabled");
setEnabled=attr.search(/reiterEnabled/);
if(!setEnabled){
_64.setAttribute("class",attr+" reiterEnabled");
}else{
_64.setAttribute("class",attr);
}
}else{
_64.setAttribute("class","reiterEnabled");
}
_65.style.display="block";
}else{
_65.style.display="none";
}
}
}
};
this.switchSceneTab=function(_66){
};
this.callbackLoadStats=function(_67){
var _68=dojo.fromJson(_67);
if(_68.status!="success"){
return;
}
var _69=dojo.byId("stat_con");
_69.removeChild(dojo.byId("stat_lo"));
var _6a=_68.data;
_69.innerHTML="<div id=\"stat_con1\" style=\"float: left; width: 220px;\">"+"<p><b>Author:</b> "+_6a.creator+"</p>"+"<p><b>Erstellt am:</b> "+dateString(_6a.crdate)+"</p>"+"<p><b>Besuche:</b> "+_6a.visits+"</p>"+"</div><div id=\"stat_con2\" style=\"float: left; width: 220px;\">"+"<p><b>Bewertung</b></p>"+"<p class=\"small\">Aktuelle Bewertung: <span id=\"rate\">"+_6a.rating+"</span></p>"+"<p id=\"rating_system\">Bewerte diese Tour: "+" (<a href=\"#\" id=\"rate1\">1</a>)"+" (<a href=\"#\" id=\"rate2\">2</a>)"+" (<a href=\"#\" id=\"rate3\">3</a>)"+" (<a href=\"#\" id=\"rate4\">4</a>)"+" (<a href=\"#\" id=\"rate5\">5</a>)"+"</p>"+"</div>";
var r1=dojo.byId("rate1");
var r2=dojo.byId("rate2");
var r3=dojo.byId("rate3");
var r4=dojo.byId("rate4");
var r5=dojo.byId("rate5");
dojo.connect(r1,"onclick",function(){
sc.rateMovie(TOUR_ID,1);
});
dojo.connect(r2,"onclick",function(){
sc.rateMovie(TOUR_ID,2);
});
dojo.connect(r3,"onclick",function(){
sc.rateMovie(TOUR_ID,3);
});
dojo.connect(r4,"onclick",function(){
sc.rateMovie(TOUR_ID,4);
});
dojo.connect(r5,"onclick",function(){
sc.rateMovie(TOUR_ID,5);
});
};
this.callbackSubmitRating=function(_70){
var _71=dojo.fromJson(_70);
if(_71.status!="success"){
return;
}
var _72=dojo.byId("rate");
ratec=new showRate(dojo.byId("rating"),_71.data.rate);
};
this.callbackLoadComments=function(_73){
var _74=dojo.fromJson(_73);
if(_74.status!="success"){
return;
}
var img=dojo.byId("com_lo");
var _76=dojo.byId("com_li");
_76.removeChild(img);
var _77=_74.data;
for(var i=0;i<_77.length;i++){
_76.appendChild(_79(_77[i]));
}
};
var _79=function(_7a){
var li=document.createElement("li");
var txt="<cite>";
if(_7a.author_url){
txt+="<a class=\"url\" rel=\"external nofollow\" href=\""+_7a.author_url+"\">"+_7a.author+"</a></cite> "+i18n.COM_SAYS+":";
}else{
txt+=_7a.author+"</cite> "+i18n.COM_SAYS+":";
}
txt+="<br/>";
txt+="<small class=\"commentmetadata\">"+dateString(_7a.crdate)+"</small>";
txt+="<p>"+_7a.content+"</p>";
li.innerHTML=txt;
return li;
};
this.callbackAddedComment=function(_7d){
var _7e=dojo.fromJson(_7d);
var err=dojo.byId("com_err");
if(_7e.status!="success"){
var _80=_7e.errors;
var txt="<ul>";
for(var i=0;i<_80.length;i++){
txt+="<li>"+i18n.COM_ERROR[_80[i]]+"</li>";
}
txt+="</ul>";
err.innerHTML=txt;
err.style.display="block";
return;
}
err.style.display="none";
var _83=dojo.byId("com_li");
var li=_79(_7e.data);
_83.insertBefore(li,_83.firstChild);
var cf=dojo.byId("commentform");
cf.reset();
};
this.loadingVisible=function(_86){
var _87=dojo.byId("statusloader");
if(_86){
dojo.fx.wipeIn({node:_87,duration:300}).play();
}else{
if(_87.style.display!="none"){
dojo.fx.wipeOut({node:_87,duration:300}).play();
}
}
};
this.callbackListCountries=function(_88){
var _89=dojo.fromJson(_88);
var _8a=dojo.byId("langs");
if(_89.status!="success"){
_8a.innerHTML="";
return;
}
var _88=_89.data;
_8a.innerHTML="";
var opt=document.createElement("option");
opt.innerHTML=i18n.LANG_FILTER_ALL;
opt.value="*";
_8a.appendChild(opt);
for(var i=0;i<_88.length;i++){
_8a.appendChild(_8d(_88[i]));
}
};
var _8d=function(_8e){
var opt=document.createElement("option");
if(Language==null||Language==0){
opt.innerHTML=_8e.languageDe;
}else{
if(Language==1){
opt.innerHTML=_8e.languageEn;
}
}
opt.value=_8e.code;
return opt;
};
this.rateButton=function(_90){
return "<button class=\"snoovelrate "+this.rt[_90]+"\" >&nbsp;</button>";
};
this.fadeGeWinBig=function(){
dojo.animateProperty({node:"map3d_container",duration:500,properties:{width:{end:this.bigGeWidth}}}).play();
};
this.fadeGeWinSmall=function(){
var _91=dojo.byId("map3d_container");
dojo.animateProperty({node:"map3d_container",duration:499,properties:{width:{end:this.smallGeWidth}}}).play();
};
this.activateLightBox=function(_92,_93,_94){
geController.pause();
_92=_92.replace(/^.*v[=|\/](.*)/,"$1");
_92=_92.replace(/^([-A-Za-z0-9]*)&+.*/,"$1");
_92="http://www.youtube.com/v/"+_92;
_92+="&autoplay="+_94;
var _95=new YouTubeLightBox();
_95.create();
_95.activate(_93,function(){
var box=dojo.byId("box");
var _97=parseInt(_93);
var _98=geDControl.getYouTubeHeight(_93);
var _99=document.createElement("embed","wmode");
_99.setAttribute("src",_92+"&fs=1&");
_99.setAttribute("width",_97);
_99.setAttribute("height",_98);
_99.setAttribute("wmode","transparent");
_99.setAttribute("id","myid");
box.appendChild(_99);
});
};
this.showFlickrAlbumLb=function(_9a,_9b,_9c){
var lb=new FlickrLightbox(_9a,_9b,_9c);
lb.create();
lb.activate(500,function(){
});
};
this.showPicasaAlbumLb=function(_9e,_9f,_a0){
var plb;
plb=new PicasaLightbox(_9e,_9f);
plb.create();
plb.activate(500,function(){
});
};
this.getYouTubeHeight=function(_a2){
_a2=parseInt(_a2);
if(Number(_a2)){
switch(_a2){
case 320:
return 265;
break;
case 425:
return 344;
break;
case 480:
return 385;
break;
case 640:
return 505;
break;
default:
return 344;
break;
}
}else{
return 344;
}
};
this.showMySlCustomization=function(){
var _a3=dojo.byId("myslcustom");
_a3.style.display=_a3.style.display=="none"?"block":"none";
};
this.updateMysl=function(){
var _a4="<iframe src=\"http://www.snoovel.com?id=mysl&cid="+TOUR_ID+"&key=";
var _a5="\" ";
var _a6="></iframe>";
var key=dojo.byId("mysl_url").value;
var w=parseFloat(dojo.byId("mysl_width").value);
var h=parseFloat(dojo.byId("mysl_height").value);
var don=dojo.byId("mysl_descon").checked;
var _ab=dojo.byId("mysl_descpos").value;
var tp=dojo.byId("mysl_tp").checked;
if(w>=350&&w<=600&&h>=300&&h<=600){
_a4+=key+"&ge_width="+w+"&ge_height="+h;
}else{
dojo.byId("mysnoovellink").value="Error: Width between 350-600, Height between 300-600";
return;
}
tp=tp?1:0;
_a4+="&tourpreview="+tp;
if(!don){
_ab="hidden";
}
_a4+="&description_pos="+_ab;
var _ad=" height=\""+(h+10)+"\" width=\""+(w+10)+" \"";
dojo.byId("mysnoovellink").value=_a4+_a5+_ad+_a6;
};
this.initGeomovieStatistic=function(_ae){
if(dojo.byId("rating")){
ratec=new rateControl(dojo.byId("rating"),_ae.rating);
}
if(dojo.byId("visits")){
if(_ae.counter){
dojo.byId("visits").innerHTML=_ae.counter;
}else{
dojo.byId("visits").innerHTML="0";
}
}
};
this.toggledesc=function(){
dojo.byId("mysl_descpos").disabled=!dojo.byId("mysl_descon").checked;
};
};
function MySlDisplayController(){
this.init=function(){
this.descField=document.createElement("div");
this.descField.id="gis_border2";
autostartField=document.createElement("div");
autostartField.id=geAutostartDiv;
this.textField=document.createElement("div");
this.textField.id=domSidepanel;
this.descField.appendChild(autostartField);
this.descField.appendChild(this.textField);
try{
mapContainer=dojo.byId("content_right");
mapContainer.appendChild(this.descField);
}
catch(e){
mapContainer=dojo.byId("gis_description");
if(mapContainer){
mapContainer.appendChild(this.descField);
}
}
};
this.setTransUI=function(_af,_b0,_b1,_b2){
var des=_b0.getDescription();
if(des.length>0){
this.setDescription(_af,des,_b1,_b2);
}else{
this.setDescription(_af,aktScene.description);
}
};
};
MySlDisplayController.prototype=new SnoovelDisplayController();
function tabContainer(_b4,_b5){
var _b6=_b4;
var _b7=_b5;
this.init=function(){
for(var i=0;i<_b6.length;i++){
aktTab=dojo.byId(_b6[i]["reiter"]);
if(aktTab!==undefined&&aktTab!=null){
dummy=new tabContainer_data(_b7,_b6[i]);
dojo.connect(aktTab,"onclick",dummy,"show");
if(_b6[i]["visible"]=="true"){
if(_b6[i]["initVisibility"]=="true"){
attr=aktTab.getAttribute("class");
if(attr!=null){
aktTab.setAttribute("class",attr+" reiterEnabled");
}else{
aktTab.setAttribute("class","reiterEnabled");
}
var div=dojo.byId(_b6[i]["content"]);
div.style.display="block";
}else{
attr=aktTab.getAttribute("class");
if(attr!=null){
aktTab.setAttribute("class",attr+" reiterDisabled");
}else{
aktTab.setAttribute("class","reiterDisabled");
}
var div=dojo.byId(_b6[i]["content"]);
div.style.display="none";
}
}else{
try{
var div=dojo.byId(_b6[i]["reiter"]);
var par=div.parentNode;
par.removeChild(div);
var div=dojo.byId(_b6[i]["content"]);
var par=div.parentNode;
par.removeChild(div);
}
catch(e){
}
}
}
}
};
this.init();
};
function tabContainer_data(fkt,val,_bd){
var _be=val;
var _bf=fkt;
var _c0=_bd;
this.show=function(){
geDControl[_bf](_be);
};
};
function bean(_id,_c2,_c3){
var _c4=_id;
var _c5=_c2;
var _c6=_c3;
this.callback=function(){
window.location="index.php?id="+_c4+"&tour="+_c5+"&L="+i18n.LANGUAGE_ID;
};
this.highlight=function(){
_c6.setImage("http://www.google.com/intl/en_us/mapfiles/ms/micons/red-dot.png");
};
this.lowlight=function(){
_c6.setImage("http://www.google.com/intl/en_us/mapfiles/ms/micons/blue-dot.png");
};
};
function showRate(_c7,_c8){
var rp="<div style=\"margin-top: 1px; float: left\">";
rp+=geDControl.rateButton(_c8);
rp+="</div><div style=\"margin-left: 10px; float: left;\" id=\"rateinw\">"+i18n.RATING_FINISHED+"</div>";
_c7.innerHTML=rp;
};
function rateControl(_ca,_cb){
var _cc=_cb;
var rp="<div style=\"margin-top: 1px; float: left\">";
for(var i=1;i<=5;i++){
var id="rate"+i;
if(i<=_cb){
rp+="<button onmouseout=\"ratec.ll()\" onclick=\"ratec.cl("+i+")\" onmouseover=\"ratec.hl("+i+")\" id=\""+id+"\" class=\"snoovelball one\" title=\"\"/></button>";
}else{
rp+="<button onmouseout=\"ratec.ll()\" onclick=\"ratec.cl("+i+")\" onmouseover=\"ratec.hl("+i+")\" id=\""+id+"\" class=\"snoovelball zero\" title=\"\"/></button>";
}
}
rp+="</div><div style=\"margin-left: 10px; float: left;\" id=\"rateinw\"></div>";
_ca.innerHTML=rp;
var w=i18n.RATING_WORDS;
this.hl=function(_d1){
for(var i=1;i<=5;i++){
var id="rate"+i;
if(i<=_d1){
dojo.byId(id).className="snoovelball one";
}else{
dojo.byId(id).className="snoovelball zero";
}
}
dojo.byId("rateinw").innerHTML=w[_d1];
};
this.ll=function(){
for(var i=1;i<=5;i++){
var id="rate"+i;
if(i<=_cc){
dojo.byId(id).className="snoovelball one";
}else{
dojo.byId(id).className="snoovelball zero";
}
}
dojo.byId("rateinw").innerHTML=w[_cc];
};
this.cl=function(_d6){
sc.rateMovie(TOUR_ID,_d6);
};
};
function AbstractLightbox(){
this.keyConnection;
this.create=function(){
this.createClose();
this.initEvents();
};
this.createClose=function(){
var box=dojo.byId("box");
var _d8=document.createElement("div");
_d8.innerHTML="close x";
_d8.setAttribute("id","closebtn");
_d8.setAttribute("class","lbnend");
_d8.setAttribute("style","bgcolor:white;text-align:right;margin-right:10px;");
if(box.hasChildNodes()){
box.insertBefore(_d8,box.firstChild);
}else{
box.appendChild(_d8);
}
};
this.closeBox=function(){
var box=dojo.byId("box");
box.innerHTML="";
dojo.animateProperty({node:dojo.byId("bg"),duration:1000,properties:{opacity:{start:0.8,end:0}},onEnd:function(){
dojo.byId("map3d").style.width="100%";
dojo.byId("map3d").style.height="100%";
var box=dojo.byId("box");
var bg=dojo.byId("bg");
bg.style.zIndex="-1";
box.style.zIndex="-1";
geApi.getGeInstance().getWindow().setVisibility(true);
geController.start();
}}).play();
dojo.disconnect(this.keyConnection);
};
this.initEvents=function(){
var me=this;
dojo.connect(dojo.byId("closebtn"),"onclick",dojo.hitch(this,this.closeBox));
this.keyConnection=dojo.connect(dojo.byId("closebtn"),"onkeypress",function(evt){
if(evt.charOrCode==dojo.keys.ESCAPE){
me.closeBox();
}
});
};
this.resizeImageContainer=function(_de,_df){
var vp=dijit.getViewport();
var _e1=_de;
var _e2=_df;
var _e3=20;
var box=dojo.byId("box");
box.style.left=((vp.w/2)-((_e1+_e3)/2))+"px";
box.style.top=((vp.h/2)-((_e2+_e3)/2))+"px";
box.style.width=(_e1+_e3/2)+"px";
box.style.height=(_e2+_e3+30/2)+"px";
box.style.paddingLeft=_e3/2+"px";
box.style.paddingTop=_e3/2+"px";
};
this.activate=function(_e5,_e6){
var me=this;
geApi.getGeInstance().getWindow().setVisibility(false);
dojo.byId("map3d").style.width="0px";
dojo.byId("map3d").style.height="1px";
var vp=dijit.getViewport();
var bg=dojo.byId("bg");
bg.style.zIndex="999";
var bg=dojo.byId("box");
bg.style.zIndex="1000";
var _ea=parseInt(_e5);
var _eb=geDControl.getYouTubeHeight(_e5);
this.resizeImageContainer(_ea,_eb);
dojo.animateProperty({node:dojo.byId("bg"),duration:1000,properties:{opacity:{start:0,end:0.8}},onEnd:_e6}).play();
};
};
function YouTubeLightBox(){
};
YouTubeLightBox.prototype=new AbstractLightbox();
function AbstractAlbumLightBox(){
this.index=0;
this.image;
this.box;
this.navigation;
this.resultItems;
this.create=function(){
this.createClose();
this.createUI();
this.initEvents();
this.getItems();
};
this.createUI=function(){
this.box=dojo.byId("box");
this.image=document.createElement("img");
this.image.setAttribute("id","lbimage");
this.box.appendChild(this.image);
this.navigation=document.createElement("div");
this.navigation.innerHTML=""+"<span id=\"btnprev\" class=\"lbndis\">&lt;&lt; "+i18n.PREV+"</span>"+" - "+"<span id=\"btnnext\" class=\"lbnend\">"+i18n.NEXT+"&gt;&gt;</span>";
this.box.appendChild(this.navigation);
};
this.onNext=function(){
if(this.index+1<0||this.index+1>=this.resultItems.length){
return;
}
this.loadImage(++this.index);
this.updateNavigation();
};
this.updateNavigation=function(){
if(this.index<this.resultItems.length-1){
dojo.byId("btnnext").setAttribute("class","lbnend");
}else{
dojo.byId("btnnext").setAttribute("class","lbndis");
}
if(this.index==0){
dojo.byId("btnprev").setAttribute("class","lbndis");
}else{
dojo.byId("btnprev").setAttribute("class","lbnend");
}
};
this.onPrevious=function(){
if(this.index-1<0||this.index-1>=this.resultItems.length){
return;
}
this.loadImage(--this.index);
this.updateNavigation();
};
this.loadImage=function(_ec){
};
this.initEvents=function(){
var me=this;
dojo.connect(dojo.byId("btnprev"),"onclick",dojo.hitch(this,this.onPrevious));
dojo.connect(dojo.byId("btnnext"),"onclick",dojo.hitch(this,this.onNext));
dojo.connect(dojo.byId("closebtn"),"onclick",dojo.hitch(this,this.closeBox));
this.keyConnection=dojo.connect(document.body,"onkeypress",function(evt){
switch(evt.charOrCode){
case dojo.keys.ESCAPE:
me.closeBox();
break;
case dojo.keys.LEFT_ARROW:
me.onPrevious();
break;
case dojo.keys.RIGHT_ARROW:
me.onNext();
break;
}
});
};
this.showError=function(msg){
var _f0=document.createElement("div");
_f0.innerHTML=msg;
_f0.setAttribute("style","color: red;");
this.box.appendChild(_f0);
};
};
AbstractAlbumLightBox.prototype=new AbstractLightbox();
function FlickrLightbox(_f1,_f2,_f3){
var _f4=_f1;
var _f5=_f2;
var _f6=_f3;
var _f7=new dojox.data.FlickrRestStore();
this.fetchFailed=function(_f8,_f9){
this.showError("An error occured! Press close.");
};
this.getItems=function(){
var me=this;
_f7.fetch({query:{userid:_f4,setid:_f5,apikey:"0c2dc11caae2ff87ea156bcb01bb0a18"},onComplete:dojo.hitch(me,"gotItems"),onError:dojo.hitch(this,this.fetchFailed),timeout:5000});
};
this.loadImage=function(_fb){
if(_fb<0||_fb>=this.resultItems.length){
return;
}
if(this.box){
var _fc=this.resultItems[this.index];
var _fd=new Image();
_fd.onload=dojo.hitch(this,function(){
this.image.setAttribute("src",_fd.src);
this.resizeImageContainer(_fd.width,_fd.height);
});
var _fe;
switch(_f6){
case "small":
_fe="imageUrlSmall";
break;
case "large":
_fe="imageUrl";
break;
case "middle":
default:
_fe="imageUrlMedium";
break;
}
_fd.src=_f7.getValue(_fc,_fe);
}
};
this.gotItems=function(_ff,_100){
var me=this;
this.resultItems=_ff;
this.index=0;
this.updateNavigation();
me.loadImage(this.index);
};
};
FlickrLightbox.prototype=new AbstractAlbumLightBox();
function PicasaLightbox(_102,_103,_104){
var _105=_102;
var _106=_103;
var _107=_104;
this.getItems=function(){
var me=this;
var _109="http://picasaweb.google.com/data/feed/api/user/"+_105+"/album/"+_106;
_109+="?kind=photo&access=public";
var _10a={alt:"json-in-script",pp:"1",psc:"G"};
_10a["start-index"]="1";
if(_105==undefined||_105==""){
this.showError("Sorry, the auther missed to fill an User Id");
return;
}
if(_106==undefined||_106==""){
this.showError("Sorry, the auther missed to fill an Set Id");
return;
}
var _10b=dojo.hitch(this,function(data){
this.gotItems(data);
});
var _10d={url:_109,preventCache:true,callbackParamName:"callback",content:_10a,json:true,timeout:5000};
var _10e=dojo.io.script.get(_10d);
_10e.addCallback(_10b);
_10e.addErrback(function(_10f){
dojo.hitch(me,me.showError("An error occured! Press close."));
});
};
this.loadImage=function(_110){
if(_110<0||_110>=this.resultItems.length){
return;
}
if(this.box){
var item=this.resultItems[_110];
var _112=new Image();
_112.onload=dojo.hitch(this,function(){
this.image.setAttribute("src",_112.src);
this.resizeImageContainer(_112.width,_112.height);
});
var _113;
switch(_107){
case "small":
_113="320";
break;
case "large":
_113="800";
break;
case "middle":
default:
_113="640";
break;
}
_112.src=this.resultItems[_110]+"?imgmax="+_113;
}
};
this.gotItems=function(_114){
var me=this;
this.resultItems=new Array();
for(var i=0;i<_114.feed.entry.length;i++){
this.resultItems[i]=_114.feed.entry[i].content.src;
}
this.index=0;
this.updateNavigation();
me.loadImage(this.index);
};
this.fetchFailed=function(_117,_118){
this.showError("An error occured! Press close.");
};
};
PicasaLightbox.prototype=new AbstractAlbumLightBox();


