/*
	Copyright (c) 2009 - 2012 W�hlke EDV-Beratung GmbH, Weyhe, Germany - All Rights Reserved.
	http://www.woehlke-edv.de
*/

if(!dojo._hasResource["custom.atHome.video.LectureButton"]){dojo._hasResource["custom.atHome.video.LectureButton"]=true;dojo.provide("custom.atHome.video.LectureButton");dojo.declare("custom.atHome.video.LectureButton",[dijit._Widget,dijit._Templated],{widgetsInTemplate:true,templatePath:dojo.moduleUrl("custom.atHome.video","templates/LectureButton.html"),id:"csi_atHome_video_lectureButton",no:0,lectureId:0,title:"",sessionTitle:"",speaker:"",videoUrl:"",videoId:0,disabled:false,_onClickButton:function(){this.onSelectLecture({no:this.no,lectureId:this.lectureId,videoUrl:this.videoUrl,videoId:this.videoId});},onSelectLecture:function(_1){},postMixInProperties:function(){this.inherited("postMixInProperties",arguments);this.speaker=this.speaker.replace(/ •/g,"; <br />");if(82<=this.sessionTitle.length){this.shortSessionTitle=this.sessionTitle.slice(0,this.sessionTitle.slice(0,79).lastIndexOf(" "))+" ...";}else{this.shortSessionTitle=this.sessionTitle;}if(82<=this.title.length){this.shortTitle=this.title.slice(0,this.title.slice(0,79).lastIndexOf(" "))+" ...";}else{this.shortTitle=this.title;}this.title=this.sessionTitle+" • "+this.title;},startup:function(){this.inherited("startup",arguments);if(this.disabled){this.buttonWidget.attr("disabled",true);dojo.style(this.registeredOnlyNode,{"display":"block"});}}});}if(!dojo._hasResource["custom.atHome.video.LiveCaseButton"]){dojo._hasResource["custom.atHome.video.LiveCaseButton"]=true;dojo.provide("custom.atHome.video.LiveCaseButton");dojo.declare("custom.atHome.video.LiveCaseButton",[dijit._Widget,dijit._Templated],{widgetsInTemplate:true,templatePath:dojo.moduleUrl("custom.atHome.video","templates/LiveCaseButton.html"),id:"csi_atHome_video_liveCaseButton",no:0,liveCaseId:0,liveCaseSubtitle:"",liveCaseTitle:"",liveCaseYear:"",location:"",locationCity:"",videoUrl:"",videoId:0,disabled:false,_onClickButton:function(){this.onSelectLiveCase({no:this.no,liveCaseId:this.liveCaseId,videoUrl:this.videoUrl,videoId:this.videoId});},onSelectLiveCase:function(_2){},postMixInProperties:function(){this.inherited("postMixInProperties",arguments);if(0<this.liveCaseTitle.length){this.liveCaseTitle=this.liveCaseTitle.replace(/CASE/g,"Case");}if(110<=this.liveCaseSubtitle.length){this.shortLiveCaseSubtitle=this.liveCaseSubtitle.slice(0,this.liveCaseSubtitle.slice(0,109).lastIndexOf(" "))+" ...";}else{this.shortLiveCaseSubtitle=this.liveCaseSubtitle;}this.title=this.liveCaseTitle+" • "+this.liveCaseSubtitle;if(0<this.liveCaseYear.length){this.liveCaseYear="• "+this.liveCaseYear;}},startup:function(){this.inherited("startup",arguments);if(this.disabled){this.buttonWidget.attr("disabled",true);dojo.style(this.registeredOnlyNode,{"display":"block"});}}});}if(!dojo._hasResource["custom.atHome.video.Tag"]){dojo._hasResource["custom.atHome.video.Tag"]=true;dojo.provide("custom.atHome.video.Tag");dojo.declare("custom.atHome.video.Tag",[dijit._Widget,dijit._Templated],{widgetsInTemplate:false,templatePath:dojo.moduleUrl("custom.atHome.video","templates/Tag.html"),id:"csi_atHome_video_tag",browseByType:"Topic",tagLabel:"",tagValue:"",tagRanking:100,_onClickTag:function(){this.onSelectTag({browseByType:this.browseByType,tagLabel:this.tagLabel,tagValue:this.tagValue});},onSelectTag:function(_3){},postMixInProperties:function(){this.inherited("postMixInProperties",arguments);if(!this.tagLabel.length){this.tagLabel=this.tagValue;}if(!this.tagValue.length){this.tagValue=this.tagLabel;}},startup:function(){this.inherited("startup",arguments);}});}if(!dojo._hasResource["custom.atHome.video.Comment"]){dojo._hasResource["custom.atHome.video.Comment"]=true;dojo.provide("custom.atHome.video.Comment");dojo.declare("custom.atHome.video.Comment",[dijit._Widget,dijit._Templated],{widgetsInTemplate:true,templatePath:dojo.moduleUrl("custom.atHome.video","templates/Comment.html"),id:"csi_atHome_video_comment",commentId:0,videoId:0,parentId:0,children:null,childrenCount:0,comment:"",created:"",createdTooltip:"",modified:"",modifiedTooltip:"",editable:false,commentLevel:0,maxNesting:2,editImmediately:false,isGuest:false,isAdmin:false,_onCancelEditing:function(){if(!this.commentId){this.onDelete({id:this.id,domNode:this.domNode});}},_onChangeComment:function(_4){var _5=0;if(!this.parentId){_5=this.videoId;}dojo.xhrPost({url:"/at-home/video-comment/add-or-modify/format/json/commentId/"+this.commentId+"/",handleAs:"json",content:{comment:_4,parentId:this.parentId,videoId:_5},preventCache:true,load:dojo.hitch(this,function(_6,_7){var _8=_6.items;var _9=_6.isGuest;var _a=_6.isAdmin;if(_6.error){alert("Your are not allowed to add or modify this comment.\n\n"+"Please log in again to add or modify this comment.");if(!this.commentId){this._onCancelEditing();}}if(_8.length){for(var _b in _8){var _c=_8[_b];this.childrenCount=_c.childrenCount;this.comment=_c.comment;this.commentWidget.attr("displayedValue",_c.comment);this.created=_c.created;this.createdTooltip=_c.createdTooltip;this.createdNode.innerHTML="Created: "+_c.created;dojo.attr(this.createdNode,"title",_c.createdTooltip);this.editable=_c.editable;this.commentId=_c.id;this.modified=_c.modified;this.modifiedTooltip=_c.modifiedTooltip;this.parentId=_c.parentId;this.videoId=_c.videoId;this.setupControl();}}}),error:dojo.hitch(this,function(_d){alert("An error occurred! Please try again later.");})});},_onAddComment:function(){this.onAddComment();},onAddComment:function(){},_onEdit:function(){this.commentWidget.edit();},_onDelete:function(){if(confirm("Deleting\n»"+this.comment.replace(/<br \/>/g,"")+"«\n\n"+"Please click 'Ok' to delete this comment.")){dojo.xhrGet({url:"/at-home/video-comment/delete/format/json/commentId/"+this.commentId+"/",handleAs:"json",preventCache:true,load:dojo.hitch(this,function(_e,_f){if(!_e.error){this.onDelete({id:this.id,domNode:this.domNode});}else{alert("Your are not allowed to delete this comment.\n\n"+"Please log in again to delete this comment.");}}),error:dojo.hitch(this,function(_10){alert("An error occurred! Please try again later.");})});}},onDelete:function(_11){},_onDeleteChild:function(_12){this.childrenNode.removeChild(_12.domNode);this.childrenCount--;this.setupControl();this.setupChildrenNode();if(this.childrenNode.lastChild){dojo.addClass(this.childrenNode.lastChild,"lastComment");}},_onReply:function(){if(this.childrenNode.lastChild){dojo.removeClass(this.childrenNode.lastChild,"lastComment");}this.childrenCount++;this.setupChildrenNode();this._addChild({commentId:0,videoId:null,childrenCount:0,parentId:this.commentId,created:"Now",createdTooltip:"Now",modified:null,modifiedTooltip:null,comment:"",editable:true,commentLevel:this.commentLevel+1,lastComment:true,editImmediately:true});console.warn("XHR für den neuen Kind-Kommentar einfügen");this.setupControl();},_addChildren:function(){this.childrenNode.innerHTML="";dojo.xhrGet({url:"/at-home/video-comment/data/format/json/parentId/"+this.commentId+"/",handleAs:"json",preventCache:true,load:dojo.hitch(this,function(_13,_14){var _15=_13.items;var _16=_13.isGuest;var _17=_13.isAdmin;if(_15){for(var key in _15){var _19=_15[key];this._addChild({commentId:_19.id,videoId:null,childrenCount:_19.childrenCount,parentId:this.commentId,created:_19.created,createdTooltip:_19.createdTooltip,modified:_19.modified,modifiedTooltip:_19.modifiedTooltip,comment:_19.comment,editable:_19.editable,commentLevel:this.commentLevel+1,isGuest:_16,isAdmin:_17});}dojo.query("#"+this.id+" div.atHomeVideoCommentWidget:last-child").forEach(function(_1a,_1b,arr){dojo.addClass(_1a,"lastComment");});}}),error:dojo.hitch(this,function(_1d){alert("An error occurred! Please try again later.");})});},_addChild:function(_1e){var _1f=document.createElement("div");this.childrenNode.appendChild(_1f);if(_1e.editImmediately){var _20=true;}else{var _20=false;}if(_1e.isGuest){var _21=true;}else{var _21=false;}if(_1e.isAdmin){var _22=true;}else{var _22=false;}var _23=new custom.atHome.video.Comment({commentId:_1e.commentId,videoId:_1e.videoId,childrenCount:_1e.childrenCount,parentId:_1e.parentId,created:_1e.created,createdTooltip:_1e.createdTooltip,modified:_1e.modified,modifiedTooltip:_1e.modifiedTooltip,comment:_1e.comment,editable:_1e.editable,commentLevel:_1e.commentLevel,editImmediately:_20,isGuest:_21,isAdmin:_22},_1f);_23.startup();if(_1e.lastComment){dojo.addClass(_23.domNode,"lastComment");}this.connect(_23,"onDelete","_onDeleteChild");},postMixInProperties:function(){this.inherited("postMixInProperties",arguments);},setupControl:function(){dojo.style(this.controlNode,{"display":"none"});dojo.style(this.deleteNode,{"display":"none"});dojo.style(this.editNode,{"display":"none"});this.commentWidget.attr("disabled",true);dojo.style(this.replyNode,{"display":"none"});if(this.modified&&(this.modified!="0000-00-00 00:00:00")){this.modifiedNode.innerHTML="Modified: "+this.modified;dojo.attr(this.modifiedNode,"title",this.modifiedTooltip);}if(this.videoId&&!this.isGuest){dojo.style(this.controlNode,{"display":"block"});}if(this.editable){if(!this.childrenCount){dojo.style(this.deleteNode,{"display":"block"});}dojo.style(this.editNode,{"display":"block"});this.commentWidget.attr("disabled",false);dojo.style(this.controlNode,{"display":"block"});}if((!this.commentLevel&&this.commentId&&!this.isGuest)||((this.commentLevel<2)&&this.commentId&&this.isAdmin)){dojo.style(this.replyNode,{"display":"block"});dojo.style(this.controlNode,{"display":"block"});}},setupChildrenNode:function(){if(this.childrenCount){dojo.style(this.childrenNode,{"display":"block"});}else{dojo.style(this.childrenNode,{"display":"none"});}},startup:function(){this.inherited("startup",arguments);this.setupControl();this.setupChildrenNode();if(this.editImmediately){this.commentWidget.edit();}if((this.commentLevel<this.maxNesting)&&this.childrenCount){this._addChildren();}}});}if(!dojo._hasResource["custom.atHome.Video"]){dojo._hasResource["custom.atHome.Video"]=true;dojo.provide("custom.atHome.Video");dojo.declare("custom.atHome.Video",[dijit._Widget,dijit._Templated],{widgetsInTemplate:true,templatePath:dojo.moduleUrl("custom.atHome","templates/Video.html?nocache=2011-07-06"),id:"csi_atHome_video",firstStartup:true,day:0,lectureStore:null,lectureStoreUrl:"/at-home/lecture/data/format/json",lectures:{day1:[],day2:[],day3:[]},liveCaseStore:null,liveCaseStoreUrl:"/at-home/abstract-session/data/format/json",liveCases:{day1:[],day2:[],day3:[]},videoUrl:"http://www.csi-congress.org/medien_inhalt/flash/csiathome/",videoBaseUrl:"http://www.csi-congress.org/medien_inhalt/flash/csiathome/",player:null,overview:{day:1,type:"lecture"},previousVideo:null,nextVideo:null,caseDescriptionVisible:false,animationDurationOpen:500,lastSessionLabel:"",videoId:0,noCommentsText:"<br>Up to now there are no comments for this video.",_addCommentsToCommentNode:function(){this.commentsNode.innerHTML="<br />Loading ...";dojo.xhrGet({url:"/at-home/video-comment/data/format/json/videoId/"+this.videoId+"/",handleAs:"json",preventCache:true,load:dojo.hitch(this,function(_24,_25){var _26=_24.items;var _27=_24.isGuest;var _28=_24.isAdmin;if(_27){dojo.style(this.addNewCommentNode,{display:"none"});}else{dojo.style(this.addNewCommentNode,{display:"block"});}if(_26&&_26.length){dojo.style(this.commentsHeaderNode,{display:"block"});this.commentsNode.innerHTML="";for(var key in _26){var _2a=_26[key];this._addCommentToCommentNode({commentId:_2a.id,videoId:_2a.videoId,childrenCount:_2a.childrenCount,created:_2a.created,createdTooltip:_2a.createdTooltip,modified:_2a.modified,modifiedTooltip:_2a.modifiedTooltip,comment:_2a.comment,editable:_2a.editable,isGuest:_27,isAdmin:_28,prepend:true});}}else{this.commentsNode.innerHTML=this.noCommentsText;}}),error:dojo.hitch(this,function(_2b){this.commentsNode.innerHTML="<br>An error occurred! Please try again later.";alert("An error occurred! Please try again later.");})});},_addCommentToCommentNode:function(_2c){var _2d=document.createElement("div");if(_2c.prepend){this.commentsNode.insertBefore(_2d,this.commentsNode.firstChild);}else{this.commentsNode.appendChild(_2d);}if(_2c.editImmediately){var _2e=true;}else{var _2e=false;}if(_2c.isGuest){var _2f=true;}else{var _2f=false;}if(_2c.isAdmin){var _30=true;}else{var _30=false;}var _31=new custom.atHome.video.Comment({commentId:_2c.commentId,videoId:_2c.videoId,childrenCount:_2c.childrenCount,created:_2c.created,createdTooltip:_2c.createdTooltip,modified:_2c.modified,modifiedTooltip:_2c.modifiedTooltip,comment:_2c.comment,editable:_2c.editable,editImmediately:_2e,isGuest:_2f,isAdmin:_30},_2d);_31.startup();this.connect(_31,"onAddComment","_onAddNewComment");this.connect(_31,"onDelete","_onDeleteComment");},_onAddNewComment:function(_32){if(this.commentsNode.innerHTML==this.noCommentsText){this.commentsNode.innerHTML="";}this._addCommentToCommentNode({commentId:0,videoId:this.videoId,childrenCount:0,created:"Now",createdTooltip:"Now",modified:null,modifiedTooltip:null,comment:"",editable:true,prepend:true,editImmediately:true});},_onDeleteComment:function(_33){this.commentsNode.removeChild(_33.domNode);},_sendHit:function(_34){dojo.xhrGet({url:"/at-home/media/hit/format/json/"+_34.type.toLowerCase()+"/"+_34.value+"/",handleAs:"json",preventCache:true,load:dojo.hitch(this,function(_35,_36){}),error:dojo.hitch(this,function(_37){})});},_getTags:function(){dojo.xhrGet({url:"/at-home/video/tags/format/json",handleAs:"json",preventCache:true,load:dojo.hitch(this,function(_38,_39){if(_38){if(_38.topics){for(var i in _38.topics){this._addTagToNode(this.topicsNode,{"browseByType":"Topic","tagValue":_38.topics[i]},i);}}if(_38.devices){for(var i in _38.devices){this._addTagToNode(this.devicesNode,{"browseByType":"Device","tagValue":_38.devices[i]},i);}}if(_38.liveCaseCenter){for(var i in _38.liveCaseCenter){this._addTagToNode(this.locationsNode,{"browseByType":"Live Case Center","tagValue":_38.liveCaseCenter[i]},i);}}}}),error:dojo.hitch(this,function(_3b){alert("An error occurred while transferring the request!\n\nPlease reload this page and try again!");})});},_addTagToNode:function(_3c,_3d,no){if(no>0){var _3f=document.createTextNode(", ");_3c.appendChild(_3f);}var _40=document.createElement("span");_3c.appendChild(_40);var _41=new custom.atHome.video.Tag({browseByType:_3d.browseByType,tagValue:_3d.tagValue},_40);_41.startup();this.connect(_41,"onSelectTag","_onSelectTag");},_getLectures:function(){this.lectureStore=new dojo.data.ItemFileReadStore({url:this.lectureStoreUrl,urlPreventCache:"true"});this.lectureStore.fetch({query:{id:"*"},queryOptions:{ignoreCase:true},scope:this,onItem:this._onLectureFetched,onComplete:this._onFetchLecturesComplete,onError:this._onFetchError});},_onLectureFetched:function(_42,_43){switch(this.lectureStore.getValue(_42,"date")){case "2011-06-23":this._addLectureToNode(this.overviewLecturesDay1Node,_42);break;case "2011-06-24":this._addLectureToNode(this.overviewLecturesDay2Node,_42);break;case "2011-06-25":this._addLectureToNode(this.overviewLecturesDay3Node,_42);break;default:console.error("Invalid Date");}return _43;},_addLectureToNode:function(_44,_45){var _46=this.lectureStore.getValue(_45,"sessionLabel");if(this.lastSessionLabel!=_46){this.lastSessionLabel=_46;var _47=document.createElement("div");_44.appendChild(_47);dojo.attr(_47,"innerHTML","<p>"+_46+"</p>");dojo.addClass(_47,"sessionLabel");}var _47=document.createElement("div");_44.appendChild(_47);var _48=new custom.atHome.video.LectureButton({no:this.lectureStore.getValue(_45,"no"),lectureId:this.lectureStore.getValue(_45,"id"),title:this.lectureStore.getValue(_45,"title"),sessionTitle:this.lectureStore.getValue(_45,"sessionLabel"),speaker:this.lectureStore.getValue(_45,"speaker"),videoUrl:this.videoBaseUrl+this.lectureStore.getValue(_45,"videoUri"),videoId:this.lectureStore.getValue(_45,"videoId"),disabled:this.lectureStore.getValue(_45,"disabled")},_47);_48.startup();this.connect(_48,"onSelectLecture","_onSelectLecture");},_onFetchLecturesComplete:function(_49,_4a){dojo.style(this.overviewLoadingNode,{"display":"none"});dojo.style(this.overviewNode,{"display":"block"});return _4a;},_onFetchError:function(_4b,_4c){console.error("An error ocurred while loading data!");alert("Error\n\nAn error ocurred while loading data!\n\nPlease try again later.");return _4c;},_getLiveCases:function(){this.liveCaseStore=new dojo.data.ItemFileReadStore({url:this.liveCaseStoreUrl,urlPreventCache:"true"});this.liveCaseStore.fetch({query:{id:"*"},queryOptions:{ignoreCase:true},scope:this,onItem:this._onLiveCaseFetched,onComplete:this._onFetchLiveCasesComplete,onError:this._onFetchError});},_onLiveCaseFetched:function(_4d,_4e){switch(this.liveCaseStore.getValue(_4d,"date")){case "2011-06-23":this._addLiveCaseToNode(this.overviewLiveCasesDay1Node,_4d);break;case "2011-06-24":this._addLiveCaseToNode(this.overviewLiveCasesDay2Node,_4d);break;case "2011-06-25":this._addLiveCaseToNode(this.overviewLiveCasesDay3Node,_4d);break;default:console.error("Invalid Date");}return _4e;},_addLiveCaseToNode:function(_4f,_50){var _51=document.createElement("div");_4f.appendChild(_51);var _52=new custom.atHome.video.LiveCaseButton({no:this.liveCaseStore.getValue(_50,"no"),liveCaseId:this.liveCaseStore.getValue(_50,"id"),liveCaseTitle:this.liveCaseStore.getValue(_50,"title"),liveCaseSubtitle:this.liveCaseStore.getValue(_50,"subtitle"),location:this.liveCaseStore.getValue(_50,"location"),locationCity:this.liveCaseStore.getValue(_50,"locationCity"),videoUrl:this.videoBaseUrl+this.liveCaseStore.getValue(_50,"videoUri"),videoId:this.liveCaseStore.getValue(_50,"videoId"),disabled:this.liveCaseStore.getValue(_50,"disabled")},_51);_52.startup();this.connect(_52,"onSelectLiveCase","_onSelectLiveCase");var _53=this.liveCaseStore.getValue(_50,"description");if(_53&&""!=_53){var _54=_53.search(/<\/ul>\w/);if(_54>=0){_53=_53.slice(0,_54+5)+"<br />";}}else{_53="";}var _55=this.liveCaseStore.getValue(_50,"keywordsCsv");var _56="";if(_55&&""!=_55){_55=_55.replace(/;/,",");var _57=_55.split(",");if(1==_57.length){_56="<div class=\"topics\">TOPIC <ul>";}else{_56="<div class=\"topics\">TOPICS <ul>";}for(i in _57){_56+="<li>"+_57[i]+"</li>";}_56+="</ul></div><br />";}var _58=this.liveCaseStore.getValue(_50,"devicesCsv");var _59="";if(_58&&""!=_58){_58=_58.replace(/;/,",");var _5a=_58.split(",");if(_5a.length==1){_59="<div class=\"devices\">DEVICE <ul>";}else{_59="<div class=\"devices\">DEVICES <ul>";}for(i in _5a){_59+="<li>"+_5a[i]+"</li>";}_59+="</ul></div><br />";}var _5b="";if(this.liveCaseStore.getValue(_50,"disabled")){_5b="<div class='notAvailable' style='color: #95101C;'>This video is available for registered user only</div>";}var _5c="<div class=\"title\">"+this.liveCaseStore.getValue(_50,"subtitle")+"</div>"+_5b+"<br />"+_53+_56+_59;if(_5c.search(/<br \/>$/)==(_5c.length-6)){_5c=_5c.slice(0,_5c.length-6);}new dijit.Tooltip({connectId:[_52.id],label:"<div class=\"caseReportTooltip\">"+_5c+"</div>"});},_onFetchLiveCasesComplete:function(_5d,_5e){return _5e;},_onClickDay1:function(){this._hidePlayer();dojo.style(this.overviewNode,{"display":"block"});dojo.style(this.overviewLecturesDay1Node,{"display":"block"});dojo.style(this.overviewLecturesDay2Node,{"display":"none"});dojo.style(this.overviewLecturesDay3Node,{"display":"none"});dojo.style(this.overviewLecturesBrowseByTagNode,{"display":"none"});dojo.style(this.overviewLiveCasesDay1Node,{"display":"block"});dojo.style(this.overviewLiveCasesDay2Node,{"display":"none"});dojo.style(this.overviewLiveCasesDay3Node,{"display":"none"});dojo.style(this.overviewLiveCasesBrowseByTagNode,{"display":"none"});dojo.addClass(this.contentNode,"day1Active");dojo.addClass(this.day1ButtonNode,"active");dojo.removeClass(this.day2ButtonNode,"active");dojo.removeClass(this.day3ButtonNode,"active");dojo.style(this.overviewBrowseByTagHeader,{"display":"none"});dojo.style(this.overviewDayHeader,{"display":"block"});this.overviewDayLabelNode.innerHTML="1. DAY";this.overviewDayDateNode.innerHTML="23/06/2011";this.overview.day=1;},_onClickDay2:function(){this._hidePlayer();dojo.style(this.overviewNode,{"display":"block"});dojo.style(this.overviewLecturesDay1Node,{"display":"none"});dojo.style(this.overviewLecturesDay2Node,{"display":"block"});dojo.style(this.overviewLecturesDay3Node,{"display":"none"});dojo.style(this.overviewLecturesBrowseByTagNode,{"display":"none"});dojo.style(this.overviewLiveCasesDay1Node,{"display":"none"});dojo.style(this.overviewLiveCasesDay2Node,{"display":"block"});dojo.style(this.overviewLiveCasesDay3Node,{"display":"none"});dojo.style(this.overviewLiveCasesBrowseByTagNode,{"display":"none"});dojo.removeClass(this.contentNode,"day1Active");dojo.removeClass(this.day1ButtonNode,"active");dojo.addClass(this.day2ButtonNode,"active");dojo.removeClass(this.day3ButtonNode,"active");dojo.style(this.overviewBrowseByTagHeader,{"display":"none"});dojo.style(this.overviewDayHeader,{"display":"block"});this.overviewDayLabelNode.innerHTML="2. DAY";this.overviewDayDateNode.innerHTML="24/06/2011";this.overview.day=2;},_onClickDay3:function(){this._hidePlayer();dojo.style(this.overviewNode,{"display":"block"});dojo.style(this.overviewLecturesDay1Node,{"display":"none"});dojo.style(this.overviewLecturesDay2Node,{"display":"none"});dojo.style(this.overviewLecturesDay3Node,{"display":"block"});dojo.style(this.overviewLecturesBrowseByTagNode,{"display":"none"});dojo.style(this.overviewLiveCasesDay1Node,{"display":"none"});dojo.style(this.overviewLiveCasesDay2Node,{"display":"none"});dojo.style(this.overviewLiveCasesDay3Node,{"display":"block"});dojo.style(this.overviewLiveCasesBrowseByTagNode,{"display":"none"});dojo.removeClass(this.contentNode,"day1Active");dojo.removeClass(this.day1ButtonNode,"active");dojo.removeClass(this.day2ButtonNode,"active");dojo.addClass(this.day3ButtonNode,"active");dojo.style(this.overviewBrowseByTagHeader,{"display":"none"});dojo.style(this.overviewDayHeader,{"display":"block"});this.overviewDayLabelNode.innerHTML="3. DAY";this.overviewDayDateNode.innerHTML="25/06/2011";this.overview.day=3;},_onSelectTag:function(_5f){this._hidePlayer();this.overviewLiveCasesBrowseByTagNode.innerHTML="";dojo.style(this.overviewNode,{"display":"block"});dojo.style(this.overviewLecturesDay1Node,{"display":"none"});dojo.style(this.overviewLecturesDay2Node,{"display":"none"});dojo.style(this.overviewLecturesDay3Node,{"display":"none"});dojo.style(this.overviewLecturesBrowseByTagNode,{"display":"block"});dojo.style(this.overviewLiveCasesDay1Node,{"display":"none"});dojo.style(this.overviewLiveCasesDay2Node,{"display":"none"});dojo.style(this.overviewLiveCasesDay3Node,{"display":"none"});dojo.style(this.overviewLiveCasesBrowseByTagNode,{"display":"block"});dojo.removeClass(this.contentNode,"day1Active");dojo.removeClass(this.day1ButtonNode,"active");dojo.removeClass(this.day2ButtonNode,"active");dojo.removeClass(this.day3ButtonNode,"active");dojo.style(this.overviewDayHeader,{"display":"none"});dojo.style(this.overviewBrowseByTagHeader,{"display":"block"});this.overviewLiveCaseButton.attr("value",true);this.overviewBrowseByTypeNode.innerHTML="Live Cases by "+_5f.browseByType;this.overviewBrowseByTagLabelNode.innerHTML=_5f.tagLabel;this.overviewLiveCaseButton.focus();this._getCasesByTag(_5f);this.overview.day="tag";this.overview.params=_5f;this._sendHit({"type":_5f.browseByType,"value":_5f.tagLabel});},_onMouseOverDay1:function(){dojo.addClass(this.day1ButtonNode,"hover");dojo.addClass(this.contentNode,"day1Hover");},_onMouseOutDay1:function(){dojo.removeClass(this.day1ButtonNode,"hover");dojo.removeClass(this.contentNode,"day1Hover");},_onMouseOverDay2:function(){dojo.addClass(this.day2ButtonNode,"hover");},_onMouseOutDay2:function(){dojo.removeClass(this.day2ButtonNode,"hover");},_onMouseOverDay3:function(){dojo.addClass(this.day3ButtonNode,"hover");},_onMouseOutDay3:function(){dojo.removeClass(this.day3ButtonNode,"hover");},_onBackToOverview:function(){switch(this.overview.day){case 1:this._onClickDay1();break;case 2:this._onClickDay2();break;case 3:this._onClickDay3();break;case "tag":this._onSelectTag(this.overview.params);break;default:this._onClickDay1();break;}},_onChangeOverviewType:function(){if(this.overviewLectureButton.attr("value")){this.overview.type="lecture";dojo.style(this.overviewLiveCasesNode,{"display":"none"});dojo.style(this.overviewLecturesNode,{"display":"block"});dojo.addClass(this.overviewLecturesHeader,"active");dojo.removeClass(this.overviewLiveCasesHeader,"active");if("tag"==this.overview.day){this._onClickDay1();}}else{this.overview.type="live case";dojo.style(this.overviewLecturesNode,{"display":"none"});dojo.style(this.overviewLiveCasesNode,{"display":"block"});dojo.addClass(this.overviewLiveCasesHeader,"active");dojo.removeClass(this.overviewLecturesHeader,"active");}},_getCasesByTag:function(_60){var _61={id:"*"};switch(_60.browseByType){case "Topic":_61={keywordsCsv:"*"+_60.tagValue+"*"};break;case "Device":_61={devicesCsv:"*"+_60.tagValue+"*"};break;case "Live Case Center":_61={locationCity:"*"+_60.tagValue+"*"};break;default:console.error("_getCasesByTag(): Unknown params.browseByType value!");}this.liveCaseStore.fetch({query:_61,queryOptions:{ignoreCase:true},scope:this,onItem:this._onLiveCaseByTagFetched,onComplete:this._onFetchLiveCasesComplete,onError:this._onFetchError});},_onLiveCaseByTagFetched:function(_62,_63){this._addLiveCaseToNode(this.overviewLiveCasesBrowseByTagNode,_62);return _63;},_onClickPrevious:function(){if(this.overview.type=="lecture"){if(this.previousVideo){this._onSelectLecture({no:this.lectureStore.getValue(this.previousVideo,"no"),lectureId:this.lectureStore.getValue(this.previousVideo,"id"),videoUrl:this.videoBaseUrl+this.lectureStore.getValue(this.previousVideo,"videoUri"),videoId:this.lectureStore.getValue(this.previousVideo,"videoId")});}}else{if(this.overview.type=="live case"){if(this.previousVideo){this._onSelectLiveCase({no:this.liveCaseStore.getValue(this.previousVideo,"no"),liveCaseId:this.liveCaseStore.getValue(this.previousVideo,"id"),videoUrl:this.videoBaseUrl+this.liveCaseStore.getValue(this.previousVideo,"videoUri"),videoId:this.liveCaseStore.getValue(this.previousVideo,"videoId")});}}}},_onClickNext:function(){if(this.overview.type=="lecture"){if(this.nextVideo){this._onSelectLecture({no:this.lectureStore.getValue(this.nextVideo,"no"),lectureId:this.lectureStore.getValue(this.nextVideo,"id"),videoUrl:this.videoBaseUrl+this.lectureStore.getValue(this.nextVideo,"videoUri"),videoId:this.lectureStore.getValue(this.nextVideo,"videoId")});}}else{if(this.overview.type=="live case"){if(this.nextVideo){this._onSelectLiveCase({no:this.liveCaseStore.getValue(this.nextVideo,"no"),liveCaseId:this.liveCaseStore.getValue(this.nextVideo,"id"),videoUrl:this.videoBaseUrl+this.liveCaseStore.getValue(this.nextVideo,"videoUri"),videoId:this.liveCaseStore.getValue(this.nextVideo,"videoId")});}}}},_onSelectLecture:function(_64){dojo.style(this.liveCaseVideoTitleNode,{"display":"none"});dojo.style(this.lectureVideoTitleNode,{"display":"block"});dojo.style(this.overviewNode,{"display":"none"});dojo.style(this.playerNode,{"display":"block"});this.videoTitleNode.innerHTML="Loading ...";this.videoSubtitleNode.innerHTML="&nbsp;";this.videoSpeakerNode.innerHTML="&nbsp;";this.videoUrl=_64.videoUrl;this.lectureStore.fetchItemByIdentity({identity:_64.lectureId,scope:this,onItem:this._lectureFetched});this.previousVideo=null;this.nextVideo=null;dojo.attr(this.previousVideoNode,"title","");dojo.attr(this.nextVideoNode,"title","");dojo.addClass(this.nextVideoNode,"disabledNext");dojo.addClass(this.previousVideoNode,"disabledPrevious");this.lectureStore.fetch({query:{no:_64.no-1},scope:this,onItem:this._previousLectureFetched});this.lectureStore.fetch({query:{no:_64.no+1},scope:this,onItem:this._nextLectureFetched});this._sendHit({"type":"video","value":_64.videoId});this.videoId=_64.videoId;this._addCommentsToCommentNode();},_lectureFetched:function(_65){this.videoTitleNode.innerHTML=this.lectureStore.getValue(_65,"title");this.videoSubtitleNode.innerHTML=this.lectureStore.getValue(_65,"sessionLabel");this.videoSpeakerNode.innerHTML=this.lectureStore.getValue(_65,"speaker");this._startVideo();},_previousLectureFetched:function(_66){if(_66){if(!this.lectureStore.getValue(_66,"disabled")){this.previousVideo=_66;dojo.removeClass(this.previousVideoNode,"disabledPrevious");var _67=this.lectureStore.getValue(_66,"sessionLabel")+" • "+this.lectureStore.getValue(_66,"title")+" • "+this.lectureStore.getValue(_66,"speaker");}else{_67="More videos are available for registered user only";}dojo.attr(this.previousVideoNode,"title",_67);}},_nextLectureFetched:function(_68){if(_68){if(!this.lectureStore.getValue(_68,"disabled")){this.nextVideo=_68;dojo.removeClass(this.nextVideoNode,"disabledNext");var _69=this.lectureStore.getValue(_68,"sessionLabel")+" • "+this.lectureStore.getValue(_68,"title")+" • "+this.lectureStore.getValue(_68,"speaker");}else{_69="More videos are available for registered user only";}dojo.attr(this.nextVideoNode,"title",_69);}},_onSelectLiveCase:function(_6a){this._liveCaseHideDescription();dojo.style(this.lectureVideoTitleNode,{"display":"none"});dojo.style(this.liveCaseVideoTitleNode,{"display":"block"});dojo.style(this.overviewNode,{"display":"none"});dojo.style(this.playerNode,{"display":"block"});this.videoTitleNode.innerHTML="Loading ...";this.videoSubtitleNode.innerHTML="&nbsp;";this.videoSpeakerNode.innerHTML="&nbsp;";this.videoUrl=_6a.videoUrl;this.liveCaseStore.fetchItemByIdentity({identity:_6a.liveCaseId,scope:this,onItem:this._liveCaseFetched});this.previousVideo=null;this.nextVideo=null;dojo.attr(this.previousVideoNode,"title","");dojo.attr(this.nextVideoNode,"title","");dojo.addClass(this.nextVideoNode,"disabledNext");dojo.addClass(this.previousVideoNode,"disabledPrevious");this.liveCaseStore.fetch({query:{no:_6a.no-1},scope:this,onItem:this._previousLiveCaseFetched});this.liveCaseStore.fetch({query:{no:_6a.no+1},scope:this,onItem:this._nextLiveCaseFetched});this._sendHit({"type":"video","value":_6a.videoId});this.videoId=_6a.videoId;this._addCommentsToCommentNode();},_liveCaseFetched:function(_6b){this.caseTitleNode.innerHTML=this.liveCaseStore.getValue(_6b,"title").replace(/CASE/g,"Case")+" • "+this.liveCaseStore.getValue(_6b,"locationCity");this.caseSubtitleNode.innerHTML=this.liveCaseStore.getValue(_6b,"subtitle");this.caseLocationNode.innerHTML=this.liveCaseStore.getValue(_6b,"location");this.liveCaseDescriptionNode.innerHTML=this.liveCaseStore.getValue(_6b,"description");if(this.liveCaseStore.getValue(_6b,"keywordsCsv")&&""!=this.liveCaseStore.getValue(_6b,"keywordsCsv")){this.liveCaseDescriptionNode.innerHTML+="<div class='topics'><span class='label'>Topics:</span> "+this.liveCaseStore.getValue(_6b,"keywordsCsv")+"</div>";}if(this.liveCaseStore.getValue(_6b,"devicesCsv")&&""!=this.liveCaseStore.getValue(_6b,"devicesCsv")){this.liveCaseDescriptionNode.innerHTML+="<div class='devices'><span class='label'>Devices:</span> "+this.liveCaseStore.getValue(_6b,"devicesCsv")+"</div>";}this._startVideo();},_previousLiveCaseFetched:function(_6c){if(_6c){if(!this.liveCaseStore.getValue(_6c,"disabled")){this.previousVideo=_6c;dojo.removeClass(this.previousVideoNode,"disabledPrevious");var _6d=this.liveCaseStore.getValue(_6c,"subtitle")+" • "+this.liveCaseStore.getValue(_6c,"title")+" • "+this.liveCaseStore.getValue(_6c,"location");}else{_6d="More videos are available for registered user only";}dojo.attr(this.previousVideoNode,"title",_6d);}},_nextLiveCaseFetched:function(_6e){if(_6e){if(!this.liveCaseStore.getValue(_6e,"disabled")){this.nextVideo=_6e;dojo.removeClass(this.nextVideoNode,"disabledNext");var _6f=this.liveCaseStore.getValue(_6e,"subtitle")+" • "+this.liveCaseStore.getValue(_6e,"title")+" • "+this.liveCaseStore.getValue(_6e,"location");}else{_6f="More videos are available for registered user only";}dojo.attr(this.nextVideoNode,"title",_6f);}},_liveCaseToggleDescription:function(){if(this.caseDescriptionVisible){this._liveCaseHideDescription();}else{this._liveCaseShowDescription();}},_liveCaseShowDescription:function(){this.caseDescriptionVisible=true;this._pausePlayer();dojo.style(this.liveCaseShowDescriptionNode,{"display":"none"});dojo.style(this.liveCaseHideDescriptionNode,{"display":"block"});dojo.fx.wipeIn({node:this.liveCaseDescriptionNode,duration:this.animationDurationOpen}).play();},_liveCaseHideDescription:function(){this.caseDescriptionVisible=false;this._startPlayer();dojo.style(this.liveCaseDescriptionNode,{"display":"none"});dojo.style(this.liveCaseShowDescriptionNode,{"display":"block"});dojo.style(this.liveCaseHideDescriptionNode,{"display":"none"});},_hidePlayer:function(){if(this.player){if(this.player.sendEvent){this.player.sendEvent("STOP","true");}}dojo.style(this.playerNode,{"display":"none"});},_pausePlayer:function(){if(this.player){if(this.player.sendEvent){this.player.sendEvent("PLAY","false");}}},_startPlayer:function(){if(this.player){if(this.player.sendEvent){this.player.sendEvent("PLAY","true");}}},_startVideo:function(){if(this.player){if(this.player.sendEvent){this.player.sendEvent("LOAD",this.videoUrl);this.player.sendEvent("PLAY","true");this.player.sendEvent("VOLUME","75");}}},_playerReady:function(_70){if(!this.player){this.player=dojo.byId(_70.id);}this._startVideo();},startup:function(){this.inherited("startup",arguments);if(this.firstStartup){this.firstStartup=false;this._onClickDay1();dojo.style(this.overviewNode,{"display":"none"});dojo.style(this.playerNode,{"display":"none"});this._getLiveCases();this._getLectures();this._onChangeOverviewType();var _71=new SWFObject("/player/player-licensed.swf","mpl","423","330","9");_71.addParam("allowscriptaccess","always");_71.addParam("allowfullscreen","true");_71.addParam("flashvars","&file=/player/video.flv&autostart=false&bufferlength=2&stretching=fill&image=medien_inhalt/slices/player_loader_423_340.jpg&backcolor=0x4f4f4f&lightcolor=0xffffff&frontcolor=0xffffff");_71.write(this.id+"_player");dojo.connect(null,"playerReady",this,"_playerReady");this._getTags();}}});}if(!dojo._hasResource["custom.atHome.SystemRequirements"]){dojo._hasResource["custom.atHome.SystemRequirements"]=true;dojo.provide("custom.atHome.SystemRequirements");dojo.declare("custom.atHome.SystemRequirements",[dijit._Widget,dijit._Templated],{widgetsInTemplate:false,templatePath:dojo.moduleUrl("custom.atHome","templates/SystemRequirements.html"),id:"csi_atHome_systemRequirements",firstStartup:true,onBrowserCheckFailed:function(_72){},onBrowserCheckSuccess:function(_73){},browserCheck:function(_74){var _75=true;var _76="";if(dojo.isOpera<9.8){alert("No support for Opera Browsers\nYour Opera Version is "+dojo.isOpera);_76="Opera Vers. "+dojo.isOpera;_75=false;}if(dojo.isIE<6){alert("No support for obsolete MS Internet Explorer\nYour MS Internet Explorer Version is "+dojo.isIE);_76="MS IE Vers. "+dojo.isIE;_75=false;}if(!_75){dojo.style(this.domNode,{"display":"block"});this.onBrowserCheckFailed({"browser":_76});}else{this.onBrowserCheckSuccess({"success":true});}},showRequirements:function(){dojo.style(this.domNode,{"display":"block"});},startup:function(){this.inherited("startup",arguments);if(this.firstStartup){this.firstStartup=false;}}});}if(!dojo._hasResource["custom.atHome.Registration"]){dojo._hasResource["custom.atHome.Registration"]=true;dojo.provide("custom.atHome.Registration");dojo.declare("custom.atHome.Registration",[dijit._Widget,dijit._Templated],{widgetsInTemplate:true,templatePath:dojo.moduleUrl("custom.atHome","templates/Registration.html?nocache=2011-07-04"),id:"atHome_Registration",firstStartup:true,characters:{"basicLatinLetters":{"regExp":"A-Za-z","eregi":"A-Za-z","list":"A-Z a-z"},"lettersWithDiacritics":{"regExp":"ÄÖÜäöüßÁÂÀÉÊÈÍÎÌÓÔÒÚÛÙáâàéêèíîìóôòúûùÑñ","eregi":"ÄÖÜäöüßÁÂÀÉÊÈÍÎÌÓÔÒÚÛÙáâàéêèíîìóôòúûùÑñ","list":"Ä Ö Ü ä ö ü ß Á Â À É Ê È Í Î Ì Ó Ô Ò Ú Û Ù á â à é ê è í î ì ó ô ò ú û ù Ñ ñ"},"numbers":{"regExp":"0-9","eregi":"0-9","list":"0-9"},"specialChars":{"regExp":"&\\-'().,;/°#","eregi":"-&'().,;/°#","list":"& - ' ( ) . , ; / ° #"},"specialCharsPhone":{"regExp":"-+()","eregi":"-+()","list":"- + ( )"}},baseMessage:"There are only the following characters allowed:<br>",charset:null,_validateForm:function(){this._validateCardIssuedAdress();if(!this._cardIssuedAdressIsValid()){this.cardIssuedAdressWidget.focus();}this._validateCreditCard();if(!this._creditCardIsValid()){this.creditCardVisacardWidget.focus();}if(!this.bankTransferWidget.attr("checked")){if(""==this.expiryDateMonthWidget.attr("value")){this.expiryDateMonthWidget.attr("displayedValue","?");}if(""==this.expiryDateYearWidget.attr("value")){this.expiryDateYearWidget.attr("displayedValue","?");}}this.formWidget.validate();this._validateSalutation();if(!this._salutationIsValid()){this.salutationMsWidget.focus();}},_formIsValid:function(){return (this.formWidget.isValid()&&this._salutationIsValid()&&this._creditCardIsValid()&&this._cardIssuedAdressIsValid());},_resetForm:function(){this.formWidget.reset();this._resetSalutationInvalidFlag();this._resetCreditCardInvalidFlag();this._resetCardIssuedAdressInvalidFlag();},_onSubmit:function(){dojo.stopEvent(arguments[0]);if(this._formIsValid()){if(confirm("Click 'ok' to submit your registration.")){dojo.xhrPost({url:"/at-home/user/registration/format/json",preventCache:true,form:this.formWidget.domNode,handleAs:"json",load:dojo.hitch(this,function(_77,_78){if(_77){if(_77.htmlMessage){this.messageNode.innerHTML=_77.htmlMessage;}else{this.messageNode.innerHTML="";}if(_77.textMessage){alert(_77.textMessage);}if(_77.success){dojo.style(this.formNode,{display:"none"});dojo.style(this.successNode,{display:"block"});this.usernameNode.innerHTML=_77.username;this.passwordNode.innerHTML=_77.password;this.emailNode.innerHTML=_77.email;}}}),error:dojo.hitch(this,function(_79){alert("An error occurred while transferring the request!\n\nPlease reload this page and try again!");})});this._buttonCheck();}else{}}else{alert("Please fill out the form completely!\n\n"+"The entered values are not complete or invalid");this._validateForm();}},_onChange:function(_7a){this._buttonCheck();},_onChangeCreditCard:function(_7b){if(!this.bankTransferWidget.attr("checked")){this.cardNumberWidget.attr("required",true);this.expiryDateMonthWidget.attr("required",true);this.expiryDateYearWidget.attr("required",true);this.securityCodeWidget.attr("required",true);this.cardholderNameWidget.attr("required",true);var _7c="";if(""!=this.firstNameWidget.attr("value")){_7c+=this.firstNameWidget.attr("value")+" ";}if(""!=this.nameWidget.attr("value")){_7c+=this.nameWidget.attr("value");}if(""==this.cardholderNameWidget.attr("value")){this.cardholderNameWidget.attr("value",_7c);}var _7d="";if(""!=this.streetWidget.attr("value")){_7d+=this.streetWidget.attr("value")+" "+this.noWidget.attr("value")+"\n";}if(""!=this.zipCodeWidget.attr("value")){_7d+=this.zipCodeWidget.attr("value")+" ";}if(""!=this.cityWidget.attr("value")){_7d+=this.cityWidget.attr("value")+"\n";}if(""!=this.countryWidget.attr("value")){_7d+=this.countryWidget.attr("value");}if(""==this.cardIssuedAdressWidget.attr("value")){this.cardIssuedAdressWidget.attr("value",_7d);}}else{this.cardNumberWidget.attr("required",false);this.expiryDateMonthWidget.attr("displayedValue","");this.expiryDateMonthWidget.attr("required",false);this.expiryDateYearWidget.attr("displayedValue","");this.expiryDateYearWidget.attr("required",false);this.securityCodeWidget.attr("required",false);this.cardholderNameWidget.attr("required",false);}this._validateCardIssuedAdress();this._validateCreditCard();},_onChangeSalutation:function(_7e){this._validateSalutation();},_onChangeCardIssuedAdress:function(_7f){this._validateCardIssuedAdress();},_buttonCheck:function(){this.submitWidget.attr("disabled",false);},_salutationIsValid:function(){var _80=false;if(this.salutationMrWidget.attr("checked")||this.salutationMrsWidget.attr("checked")||this.salutationMsWidget.attr("checked")){var _80=true;}return _80;},_validateSalutation:function(){if(this._salutationIsValid()){dojo.removeClass(this.salutationNode,"invalid");}else{dojo.addClass(this.salutationNode,"invalid");}},_resetSalutationInvalidFlag:function(){dojo.removeClass(this.salutationNode,"invalid");},_creditCardIsValid:function(){var _81=false;if(this.bankTransferWidget.attr("checked")||this.creditCardVisacardWidget.attr("checked")||this.creditCardMastercardWidget.attr("checked")){var _81=true;}return _81;},_validateCreditCard:function(){if(this._creditCardIsValid()){this._resetCreditCardInvalidFlag();}else{dojo.addClass(this.bankTransferNode,"invalid");dojo.addClass(this.creditCardVisacardNode,"invalid");dojo.addClass(this.creditCardMastercardNode,"invalid");}},_resetCreditCardInvalidFlag:function(){dojo.removeClass(this.bankTransferNode,"invalid");dojo.removeClass(this.creditCardVisacardNode,"invalid");dojo.removeClass(this.creditCardMastercardNode,"invalid");},_cardIssuedAdressIsValid:function(){var _82=false;if(""!=this.cardIssuedAdressWidget.attr("value")||this.bankTransferWidget.attr("checked")){_82=true;}return _82;},_validateCardIssuedAdress:function(){if(this._cardIssuedAdressIsValid()){dojo.removeClass(this.cardIssuedAdressWidget.domNode,"invalid");}else{dojo.addClass(this.cardIssuedAdressWidget.domNode,"invalid");}},_resetCardIssuedAdressInvalidFlag:function(){dojo.removeClass(this.cardIssuedAdressWidget.domNode,"invalid");},postMixInProperties:function(){this.inherited("postMixInProperties",arguments);this.charset={"text":{"regExp":"["+this.characters.basicLatinLetters.regExp+this.characters.lettersWithDiacritics.regExp+this.characters.numbers.regExp+this.characters.specialChars.regExp+"]"+"["+this.characters.basicLatinLetters.regExp+this.characters.lettersWithDiacritics.regExp+this.characters.numbers.regExp+this.characters.specialChars.regExp+" "+"]*","regExpLength":"["+this.characters.basicLatinLetters.regExp+this.characters.lettersWithDiacritics.regExp+this.characters.numbers.regExp+this.characters.specialChars.regExp+"]"+"["+this.characters.basicLatinLetters.regExp+this.characters.lettersWithDiacritics.regExp+this.characters.numbers.regExp+this.characters.specialChars.regExp+" "+"]","eregi":"^["+this.characters.specialChars.eregi+this.characters.basicLatinLetters.eregi+this.characters.lettersWithDiacritics.eregi+this.characters.numbers.eregi+" "+"]*$","message":"<div style='width: 160px;'>"+this.baseMessage+this.characters.basicLatinLetters.list+" "+this.characters.lettersWithDiacritics.list+" "+this.characters.numbers.list+" "+this.characters.specialChars.list+" "+"</div>"},"phone":{"regExp":"["+this.characters.numbers.regExp+this.characters.specialCharsPhone.regExp+" "+"]{0,50}","regExpLength":"["+this.characters.numbers.regExp+this.characters.specialCharsPhone.regExp+" "+"]","eregi":"^["+this.characters.specialCharsPhone.eregi+this.characters.numbers.eregi+" "+"]*$","message":"<div style='width: 160px;'>"+this.baseMessage+this.characters.numbers.list+" "+this.characters.specialCharsPhone.list+" "+"</div>"},"email":{"regExp":"^[a-zA-Z][\\w.+-]{1,26}[@][\\w.-]{2,26}[.].{2,6}$","eregi":"","message":"<div style='width: 160px;'>"+"Invalid e-mail!"+"</div>"}};},startup:function(){this.inherited("startup",arguments);if(this.firstStartup){this.firstStartup=false;this._buttonCheck();this.requirementsWidget.showRequirements();this.requirementsWidget.browserCheck();}}});}if(!dojo._hasResource["custom.atHome.Authentification"]){dojo._hasResource["custom.atHome.Authentification"]=true;dojo.provide("custom.atHome.Authentification");dojo.declare("custom.atHome.Authentification",[dijit._Widget,dijit._Templated],{widgetsInTemplate:true,templatePath:dojo.moduleUrl("custom.atHome","templates/Authentification.html"),id:"csi_authentification",_onLogin:function(){dojo.xhrPost({url:"/at-home/authentification/login/format/json",form:this.formWidget.domNode,content:{domId:this.id,action:"login"},handleAs:"json",preventCache:true,timeout:5000,load:function(_83,_84){return dijit.byId(_84.args.content.domId)._onLoad(_83,_84);},error:function(_85,_86){return dijit.byId(_86.args.content.domId)._onError(_85,_86);}});this.passwordWidget.attr("value","");},_onLoad:function(_87,_88){if(_87.success){dojo.style(this.loginFormNode,{"display":"none"});dojo.style(this.logoutFormNode,{"display":"block"});if("admin"==_87.user.usergroup){dojo.style(this.adminNode,{"display":"block"});}this.messageNode.innerHTML=_87.message;var _89=false;if(_87.user&&_87.user.termsConfirmed){_89=true;}this.onLoginSuccess({"termsAndConditionsConfirmed":_89});}else{this.messageNode.innerHTML=_87.message;dojo.style(this.loginFormNode,{"display":"block"});}},onLoginSuccess:function(_8a){},_onError:function(_8b,_8c){dojo.style(this.loginFormNode,{"display":"none"});this.messageNode.innerHTML="<h2 class='errormessage'>An error occurred</h2>"+"<p>Possibly the database is currently unavailable. Please try again later!</p>";},_onLogout:function(){dojo.xhrPost({url:"/at-home/authentification/logout/format/json",content:{domId:this.id,action:"logout"},handleAs:"json",preventCache:true,timeout:5000,load:function(_8d,_8e){return dijit.byId(_8e.args.content.domId)._onLogoutLoad(_8d,_8e);},error:function(_8f,_90){return dijit.byId(_90.args.content.domId)._onError(_8f,_90);}});},_onLogoutLoad:function(_91,_92){if(_91.success){dojo.style(this.loginFormNode,{"display":"block"});dojo.style(this.logoutFormNode,{"display":"none"});dojo.style(this.adminNode,{"display":"none"});this.messageNode.innerHTML=_91.message;this.onLogoutSuccess();}else{this.messageNode.innerHTML=_91.message;}},onLogoutSuccess:function(){},_onKeyDownUsername:function(obj){if(obj){if(obj.keyCode){if((13==obj.keyCode)||(40==obj.keyCode)||(38==obj.keyCode)){this.passwordWidget.focus();}}}},_onKeyDownPassword:function(obj){if(obj){if(obj.keyCode){if(13==obj.keyCode){this._onLogin();}else{if((40==obj.keyCode)||(38==obj.keyCode)){this.usernameWidget.focus();}}}}},startup:function(){this.inherited("startup",arguments);dojo.xhrPost({url:"/at-home/authentification/login/format/json/check/status",form:this.formWidget.domNode,content:{domId:this.id,action:"login"},handleAs:"json",preventCache:true,timeout:5000,load:function(_95,_96){return dijit.byId(_96.args.content.domId)._onLoad(_95,_96);},error:function(_97,_98){return dijit.byId(_98.args.content.domId)._onError(_97,_98);}});}});}if(!dojo._hasResource["custom.atHome.TermsAndConditions"]){dojo._hasResource["custom.atHome.TermsAndConditions"]=true;dojo.provide("custom.atHome.TermsAndConditions");dojo.declare("custom.atHome.TermsAndConditions",[dijit._Widget,dijit._Templated],{widgetsInTemplate:true,templatePath:dojo.moduleUrl("custom.atHome","templates/TermsAndConditions.html"),id:"csi_atHome_termsAndConditions",firstStartup:true,_onClickConfirm:function(){dojo.xhrPost({url:"/at-home/user/confirm-terms-and-conditions/format/json",content:{confirm:true},handleAs:"json",load:dojo.hitch(this,function(_99,_9a){if(_99){if(_99.success){this.confirmed();}else{this.notConfirmed();}}}),error:dojo.hitch(this,function(_9b){alert("An error occurred while transferring the request!\n\nPlease reload this page and try again!");})});},confirmed:function(){},notConfirmed:function(){this.confirmed();},startup:function(){this.inherited("startup",arguments);if(this.firstStartup){this.firstStartup=false;}}});}if(!dojo._hasResource["custom.atHome.ContentPaneTerms"]){dojo._hasResource["custom.atHome.ContentPaneTerms"]=true;dojo.provide("custom.atHome.ContentPaneTerms");dojo.declare("custom.atHome.ContentPaneTerms",[dijit._Widget,dijit._Templated],{widgetsInTemplate:true,templatePath:dojo.moduleUrl("custom.atHome","templates/ContentPaneTerms.html?nocache=2011-07-06"),id:"csi_atHome_contentPaneTerms",loginHref:"",logoutHref:"",loginContent:"",logoutContent:"<h2>This is a protected area for the users of CSI@Home.<h2><br />",showLogout:true,startupMessage:"<h2>This is a protected area for the users of CSI@Home.<h2><br />",_onLoginLimitedAccess:function(_9c){dojo.style(this.limitedAccessNode,{"display":"none"});if(_9c&&_9c.termsAndConditionsConfirmed){if(this.loginHref){this.contentWidget.attr("href",this.loginHref);}else{this.contentWidget.attr("content",this.loginContent);}if(!this.showLogout){dojo.style(this.authentificationWidget.domNode,{"display":"none"});}}else{dojo.style(this.termsAndConditionsWidget.domNode,{"display":"block"});this.contentWidget.attr("content","");}},_onLoginSuccess:function(_9d){dojo.style(this.limitedAccessNode,{"display":"none"});if(_9d&&_9d.termsAndConditionsConfirmed){if(this.loginHref){this.contentWidget.attr("href",this.loginHref);}else{this.contentWidget.attr("content",this.loginContent);}if(!this.showLogout){dojo.style(this.authentificationWidget.domNode,{"display":"none"});}}else{dojo.style(this.termsAndConditionsWidget.domNode,{"display":"block"});this.contentWidget.attr("content","");}},_confirmed:function(){dojo.style(this.termsAndConditionsWidget.domNode,{"display":"none"});this._onLoginSuccess({"termsAndConditionsConfirmed":true});},_onLogoutSuccess:function(){dojo.style(this.termsAndConditionsWidget.domNode,{"display":"none"});if(this.logoutHref){this.contentWidget.attr("href",this.logoutHref);}else{this.contentWidget.attr("content",this.logoutContent);}},_onBrowserCheckFailed:function(){dojo.style(this.authentificationWidget.domNode,{"display":"none"});dojo.style(this.limitedAccessNode,{"display":"none"});},startup:function(){this.inherited("startup",arguments);this.contentWidget.attr("content",this.startupMessage);this.systemRequirementsWidget.browserCheck();if(dojo.isOpera){dojo.addClass(this.contentWidget.domNode,"overflowHiddenImportant");}}});}

