var checkForChangesDelay=30000;var checkThumbsDelay=20000;var updateThumbs=0;var cycleParams={};var countLoaded=0;var sumLoaded=0;var periodicallyCheckers=new Hash({});var countEmailFields=1;var active_music_ids=new Hash();var active_music_paused_ids=new Hash();var savedHeight=0;var $imgW=0;var $imgH=0;var $thumbW=0;var $thumbH=0
jQuery().ready(function(){try{initShareThis("sharethisbutton");jQuery('.box_searchInput').makeSearchInput();}catch(e){}});(function($){$.fn.makeSearchInput=function(){return this.each(function(){var $searchInput=jQuery(this);var $boxHeader=$searchInput.parents(".box");if($boxHeader.length==0)
$boxHeader=$searchInput.parents(".box_small");$boxHeader.hover(function(){$searchInput.show();$searchInput.siblings('input[type=button]').show();},function(){$searchInput.hide();$searchInput.siblings('input[type=button]').hide();});});};})(jQuery);function getProperty(index){var value='custom'
$$('input[name~=typeOfNewBox]').each(function(item){if(item.checked){value=item.value;value=value.split("#");value=value[index];}});return value;}
function startCallback(){return true;}
function completeCallback(response){$('bottomContent').update(response);initThumb();}
function setVariablesForImageCrop(imgW,imgH,thumbW,thumbH){$imgW=imgW;$imgH=imgH;$thumbW=thumbW;$thumbH=thumbH;}
function preview(img,selection){var scaleX=$thumbW/selection.width;var scaleY=$thumbW/selection.height;try{jQuery('#thumbnailPreview > img').css({width:Math.round(scaleX*$imgW)+'px',height:Math.round(scaleY*$imgH)+'px',marginLeft:'-'+Math.round(scaleX*selection.x1)+'px',marginTop:'-'+Math.round(scaleY*selection.y1)+'px'});}catch(e){}
jQuery('#x1').val(selection.x1);jQuery('#y1').val(selection.y1);jQuery('#x2').val(selection.x2);jQuery('#y2').val(selection.y2);jQuery('#w').val(selection.width);jQuery('#h').val(selection.height);}
function initThumb(){jQuery('#save_thumb').click(function(){var x1=jQuery('#x1').val();var y1=jQuery('#y1').val();var x2=jQuery('#x2').val();var y2=jQuery('#y2').val();var w=jQuery('#w').val();var h=jQuery('#h').val();if(x1==""||y1==""||x2==""||y2==""||w==""||h==""||x1==0||y1==0||x2==0||y2==0||w==0||h==0){alert('Please choose a area to crop...');return false;}else{jQuery('.imgareaselect-outer').remove();jQuery('.imgareaselect-selection').remove();jQuery('.imgareaselect-border1').remove();jQuery('.imgareaselect-border2').remove();return true;}});jQuery('#thumbnail').imgAreaSelect({aspectRatio:'1:1',onSelectChange:preview});}
function forwardPage(url){window.location.href=url;}
function setDetailLayerPos(e,obj){var posx=0;var posy=0;try{if(!e)var e=window.event;}catch(e){return;}
if(e.pageX||e.pageY){posx=e.pageX;posy=e.pageY;}
else if(e.clientX||e.clientY){posx=e.clientX+document.body.scrollLeft
+document.documentElement.scrollLeft;posy=e.clientY+document.body.scrollTop
+document.documentElement.scrollTop;}
var detailDiv=$('detailDiv');if(detailDiv!=null&&typeof detailDiv!="undefined"&&typeof detailDiv.style!="undefined"){posy-=(e.screenY-150);if(posy<0)
posy=10;detailDiv.style.top=posy+"px";}
var userContentDiv=$('userContentDiv');if(userContentDiv!=null&&typeof userContentDiv!="undefined"&&typeof userContentDiv.style!="undefined"){var oldPos=160;userContentDiv.style.top=(parseInt(oldPos)+posy)+"px";userContentDiv.update('');}}
function showUserInsert(url,refElem,buttonActive,buttonInactive,paramObj){try{new Ajax.Request(url,{method:'post',parameters:paramObj,onSuccess:function(transport){if(transport.responseText.search(/You are not logged in/)==-1){if(isNotNull('overDiv'))
$('overDiv').show();$(buttonInactive).hide();$(buttonActive).show();return overlib(transport.responseText,STICKY,BORDER,0,BGCLASS,'userInsertDialogBorder',REF,refElem,REFC,'LL',REFP,'UL',REFY,-2,REFX,-2,FGCLASS,'userInsertDialogContent',TEXTFONTCLASS,'videoTooltipText',NOJUSTY);}else{$('userContentDiv').update(transport.responseText);$('userContentDiv').show();}}});}catch(e){}}
function sendUserInsert(formId,entity,type,urlOfAction,paramObject){new Ajax.Updater(formId,urlOfAction,{asynchronous:true,evalScripts:true,parameters:Form.serialize(formId+''),requestHeaders:['X-Update',formId+''],onComplete:function(transport){new Ajax.Updater(entity+'Div'+type+'','/detail_view/ajaxPagination/'+entity,{parameters:paramObject});if(isNotNull('flagButtonActive'))
$('flagButtonActive').hide();if(isNotNull('flagButtonInactive'))
$('flagButtonInactive').show();if(isNotNull('commentsButtonActive'))
$('commentsButtonActive').hide();if(isNotNull('commentsButtonInactive'))
$('commentsButtonInactive').show();}});}
function changeStateOfUserMenu(elem,type){if(type==1){var comm=Element.down(elem,'.comm');var flag=Element.down(elem,'.flag');var heart=Element.down(elem,'.heart');if(typeof comm!="undefined"&&comm!=null)
comm.addClassName('comm_hover');if(typeof flag!="undefined"&&flag!=null)
flag.addClassName('flag_hover');if(typeof heart!="undefined"&&heart!=null)
heart.addClassName('heart_hover');}else if(type==2){var comm=Element.down(elem,'.comm_hover');var flag=Element.down(elem,'.flag_hover');var heart=Element.down(elem,'.heart_hover');if(typeof comm!="undefined"&&comm!=null)
comm.removeClassName('comm_hover');if(typeof flag!="undefined"&&flag!=null)
flag.removeClassName('flag_hover');if(typeof heart!="undefined"&&heart!=null)
heart.removeClassName('heart_hover');}}
function handler(e){var elem=Event.element(e);try{var div=Element.up(elem,'#containerDiv');var div_overlib=Element.up(elem,'.userInsertDialogBorder');if(typeof div=="undefined"&&typeof div_overlib=="undefined"&&isNotNull('containerDiv')&&typeof $('containerDiv').style!="undefined"&&$('containerDiv').style.display==""&&elem.id!="textareaUserInput"&&elem.id!="sendUserInput"){cClick();if(isNotNull('containerDiv'))
$('containerDiv').hide();if(isNotNull('opaqueMilk'))
$('opaqueMilk').hide();}else{if(typeof div_overlib=="undefined"){cClick();if(isNotNull('flagButtonActive'))
$('flagButtonActive').hide();if(isNotNull('flagButtonInactive'))
$('flagButtonInactive').show();if(isNotNull('commentsButtonActive'))
$('commentsButtonActive').hide();if(isNotNull('commentsButtonInactive'))
$('commentsButtonInactive').show();}}}catch(e){}}
function ajaxCall(divName,url,paramObj,showOverlay){if(divName==''){new Ajax.Request(url,{method:'post',parameters:paramObj,onSuccess:function(transport){}});}else{new Ajax.Updater(divName,url,{parameters:paramObj,evalScripts:true,onLoading:function(){if(showOverlay&&isNotNull(divName))
showOverlay(divName);},onComplete:function(transport){if(isNotNull(divName)){var $div=$(divName);if($div.hasClassName('dontShow'))
return;$div.show();}}});}}
function isNotNull(elem){var e=document.getElementById(elem);if(e!=null)
return true;return false;}
function startGenerateUrlForBoxes(sharelet){var sessionid=$('tempSessionid').value;var search=$('tempSearch').value;var searchid=$('tempSearchid').value;generateUrlForBoxes(sessionid,search,searchid,0);return true;}
function initShareThis(name){var element=$(name);if(element!=null){var sessionid=$('tempSessionid').value;var search=$('tempSearch').value;var searchid=$('tempSearchid').value;var shareThisObject=null;if(search!=""){shareThisObject=SHARETHIS.addEntry({title:'Eine Starpage',summary:'Hier sehen sie eine Starpage zum Thema: '+search+'.',url:'http://'+window.location.host+'/search/load/'+sessionid+'/'+searchid+''},{button:false,onclick:startGenerateUrlForBoxes,popup:false});}else{shareThisObject=SHARETHIS.addEntry({title:'share'},{button:false,popup:false});}
shareThisObject.attachButton(element);}}
function onAfter(curr,next,opts){var index=opts.currSlide;}
function loadHoverwindow(randomElementId,objId,text){return overlib(text,REF,randomElementId,REFC,'LL',REFP,'UL',WRAP,WRAPMAX,330,BORDER,0,BGCLASS,'videoTooltipBorder',REFY,5,REFX,-192,FGCLASS,'videoTooltipContent',TEXTFONTCLASS,'videoTooltipText',NOJUSTY);}
function loadDetailView(source,objId,path){new Ajax.Updater('detailDiv','/detail_view/'+source,{method:'post',onCreate:function(transport){},onSuccess:function(transport){$("containerDiv").show();$("opaqueMilk").show();},parameters:{"searchobjectId":objId,"path":path}});}
function loadPage(modelname,urlOfObject,page,type){new Ajax.Updater(modelname+'Div'+type,'/detail_view/ajaxPagination/'+modelname,{method:'post',onCreate:function(transport){},onLoading:showOverlay(modelname+'Div'+type),onSuccess:function(transport){},parameters:{"url":urlOfObject,"page":page,"type":type}});}
function loadCircler(type,source,term,searchId,searchengineId,engineNumber,order){jQuery("#initNavPrev"+type+engineNumber).hide();jQuery("#initNavNext"+type+engineNumber).hide();jQuery("#normalNavPrev"+type+engineNumber).show();jQuery("#normalNavNext"+type+engineNumber).show();var nextZeroBasedSlideIndex=0;var page=0;if(type=='Image'){nextZeroBasedSlideIndex=0;page=3;}else{nextZeroBasedSlideIndex=1;nextPage=3;}
cycleParams=getCycleParams(type,source,term,nextZeroBasedSlideIndex,page,searchId,searchengineId,engineNumber,order);cycleParams.prevNextClick=function(isNext,zeroBasedSlideIndex,slideElement){};jQuery('#cycleContainer'+type+engineNumber).cycle(cycleParams);jQuery("#next"+type+engineNumber).trigger('click');jQuery('#cycleContainer'+type+engineNumber).cycle('stop');jQuery("#next"+type+engineNumber).unbind("click");jQuery("#prev"+type+engineNumber).unbind("click");var startpage=3;var url='/searchApi/'+type.toLowerCase()+'/'+source+'/'+term+'/'+searchengineId+'/'+engineNumber+'/'+startpage+'/'+order;url+='/1';new Ajax.Request(url,{method:'post',parameters:{searchid:searchId},onCreate:function(transport){setCursorForAll('wait');},onSuccess:function(transport){var addContent=transport.responseText;if(type=='Image')
loadNext(type,source,term,1,4,1,searchId,searchengineId,engineNumber,order,addContent);else
loadNext(type,source,term,2,4,1,searchId,searchengineId,engineNumber,order,addContent);}});}
function loadNext(type,source,term,nextZeroBasedSlideIndex,page,initCycle,searchId,searchengineId,engineNumber,order,addContent){var url='/searchApi/'+type.toLowerCase()+'/'+source+'/'+term+'/'+searchengineId+'/'+engineNumber+'/'+page+'/'+order;url+='/1';new Ajax.Request(url,{method:'post',parameters:{searchid:searchId},onCreate:function(transport){setCursorForAll('wait');},onSuccess:function(transport){if(transport.responseText.indexOf('Keine Ergebnisse')!=-1){setCursorForAll('default');return;}
if(type=='Image'){if(addContent!="")
jQuery(jQuery(".sliderDiv"+type+engineNumber)[jQuery(".sliderDiv"+type+engineNumber).length-1]).after(addContent);jQuery(jQuery(".sliderDiv"+type+engineNumber)[jQuery(".sliderDiv"+type+engineNumber).length-1]).after(transport.responseText);}else{if(addContent!="")
jQuery(jQuery(".sliderDiv"+type+engineNumber)[0]).before(addContent);jQuery(jQuery(".sliderDiv"+type+engineNumber)[0]).before(transport.responseText);}
if(!initCycle){jQuery('#cycleContainer'+type+engineNumber).cycle('stop');jQuery("#next"+type+engineNumber).unbind("click");jQuery("#prev"+type+engineNumber).unbind("click");}
cycleParams=getCycleParams(type,source,term,nextZeroBasedSlideIndex,page,searchId,searchengineId,engineNumber,order);jQuery('#cycleContainer'+type+engineNumber).cycle(cycleParams);if(initCycle){}
setCursorForAll('default');}});}
function getCycleParams(type,source,term,nextZeroBasedSlideIndex,page,searchId,searchengineId,engineNumber,order){var startingSlideInt=nextZeroBasedSlideIndex;var scrollDirection='scrollHorz';scrollDirection=(type!='Image')?'scrollVert':scrollDirection;cycleParams={startingSlide:startingSlideInt,fx:scrollDirection,prevNextClick:function(isNext,zeroBasedSlideIndex,slideElement){if(zeroBasedSlideIndex==0){loadNext(type,source,term,(zeroBasedSlideIndex+1),(page+1),0,searchId,searchengineId,engineNumber,order,"");}},before:function onBefore(curr,next,opts){},speed:'slow',timeout:0,nowrap:1,after:onAfter,next:'#prev'+type+engineNumber,prev:'#next'+type+engineNumber};if(type=='Image'){cycleParams.next='#next'+type+engineNumber;cycleParams.prev='#prev'+type+engineNumber;cycleParams.prevNextClick=function(isNext,zeroBasedSlideIndex,slideElement){if(isNext){jQuery("#next"+type+engineNumber).unbind("click");loadNext(type,source,term,(nextZeroBasedSlideIndex+1),(page+1),0,searchId,searchengineId,engineNumber,order,"");}};}
return cycleParams;}
function setCursorForAll(cursorState){$$("body").first().setStyle({cursor:cursorState});$$("a").each(function(item){item.setStyle({cursor:cursorState});});$$("input").each(function(item){item.setStyle({cursor:cursorState});});}
function setSelectedForSource(sourceObject,jsonObject){sourceObject=jsonObject;}
function applyDragBehaviour(type){try{jQuery('div.sortWrapper1').sortable({axis:'y',handle:'img.box_move',forceHelperSize:true,placeholder:'sortHelper',stop:function(event,ui){var elem=jQuery(ui.item);jQuery('#'+elem.attr('id')+' .sourceNavDiv').focus();},update:function(event,ui){},zIndex:5,appendTo:'body'});jQuery('div.sortWrapper2').sortable({axis:'y',handle:'img.box_move',forceHelperSize:true,placeholder:'sortHelperSmall',stop:function(event,ui){var elem=jQuery(ui.item);jQuery('#'+elem.attr('id')+' .sourceNavDiv').focus();},update:function(event,ui){},zIndex:5,appendTo:'body'});}catch(e){}}
jQuery(document).ready(function(){applyDragBehaviour(null);if(typeof FB!="undefined"&&FB!=null&&typeof FB.init!="undefined")
FB.init("3ff5adfaba069eadbf053248513e5730");});function setLoadingImage(name){$(name).update('<img src="/img/ajax_load_2.gif">');}
function checkCountLoaded(transport){countLoaded++;if(countLoaded==4){var infoDiv=$('infoDiv');if(infoDiv!=null){Effect.Fade('infoDiv');}}
if(sumLoaded!=0&&sumLoaded>4){$('bottomContentOverlay').fade();}}
var W3CDOM=(document.createElement&&document.getElementsByTagName);function initFileUploads(){if(!W3CDOM)return;var fakeFileUpload=document.createElement('div');fakeFileUpload.className='fakefile';var div=new Element('div',{'class':'loginbox',style:'float:left;'});var input=new Element('input',{'class':'loginfield'});div.appendChild(input);fakeFileUpload.appendChild(div);var image=document.createElement('img');image.src='/img/userpage/select_image.png';fakeFileUpload.appendChild(image);var x=document.getElementsByTagName('input');for(var i=0;i<x.length;i++){if(x[i].type!='file')continue;if(x[i].parentNode.className!='fileinputs')continue;x[i].className='file hidden';var clone=fakeFileUpload.cloneNode(true);x[i].parentNode.appendChild(clone);x[i].relatedElement=clone.getElementsByTagName('input')[0];x[i].onchange=x[i].onmouseout=function(){this.relatedElement.value=this.value;}}}
function periodicallyCheckForChanges(divName,source,term,searchengineid,searchid){var lastcheckSocialcommunityTime=0;var timeInput=$(divName+'Time');if(timeInput)
timeInput.value;var periodicallyChecker=periodicallyCheckers.get(divName);if(typeof periodicallyChecker=="undefined"){periodicallyCheckers.set(divName,{time:lastcheckSocialcommunityTime,isChecking:false});setTimeout("checkForChanges('"+divName+"','"+source+"','"+term+"',"+searchengineid+","+searchid+")",checkForChangesDelay);}
else{periodicallyCheckers.set(divName,{time:lastcheckSocialcommunityTime,isChecking:true});}}
function checkForChanges(divName,source,term,searchengineid,search_id){var periodicallyChecker=periodicallyCheckers.get(divName);if(typeof periodicallyChecker=="undefined"){return;}
var lastcheckSocialcommunityTime=periodicallyChecker.time;if(lastcheckSocialcommunityTime!=0&&(periodicallyChecker.isChecking==false)){var url='/search_api/periodicallyCheckForChanges/'+source+'/'+term+'/'+searchengineid+'/'+lastcheckSocialcommunityTime;new Ajax.Request(url,{method:'POST',evalJSON:'force',parameters:{searchid:search_id},onSuccess:function(transport){periodicallyCheckers.set(divName,{time:lastcheckSocialcommunityTime,isChecking:true});if(transport.headerJSON!=null){var newLastChecked=parseSocialWebResponse(divName,transport.headerJSON);if(newLastChecked!=0)
lastcheckSocialcommunityTime=newLastChecked;}
periodicallyCheckers.set(divName,{time:lastcheckSocialcommunityTime,isChecking:false});}});setTimeout("checkForChanges('"+divName+"','"+source+"','"+term+"',"+searchengineid+","+search_id+")",checkForChangesDelay);}else{}}
function parseSocialWebResponse(divName,jsonObject){if(jsonObject.htmlContent!=""){var content=$$('#'+divName+' * .socialcommunityElement');var oldElems=content.toArray();var lastElem=oldElems[oldElems.length-1];var firstElem=oldElems[0];if(lastElem!=null&&firstElem!=null&&lastElem!=firstElem){$(lastElem).remove();$(firstElem).insert({'before':jsonObject.htmlContent});var lastcheckSocialcommunityTime=jsonObject.time;return lastcheckSocialcommunityTime;}}
return 0;}
function loadContentForDiv(name,url,type,params,fadeIn,idOfBox){sumLoaded++;new Ajax.Updater(name,url,{parameters:params,onLoading:showOverlay(name),evalScripts:true,encoding:'UTF-8',requestHeaders:['Accept-Charset','utf-8'],onComplete:function(transport){if(parseInt(fadeIn)==1){}
checkCountLoaded(transport);if((type=="blog"||type=="bookmark")&&(updateThumbs==0)){window.setTimeout("update_thumbs()",checkThumbsDelay);updateThumbs=1;}
if(type=="socialweb"){var lastcheckSocialcommunityTime=$(name+'Time').value;var periodicallyChecker=periodicallyCheckers.get(name);if(typeof periodicallyChecker=="undefined"){periodicallyCheckers.set(name,{time:lastcheckSocialcommunityTime,isChecking:false});setTimeout("checkForChanges('"+name+"','"+params.source+"','"+params.search+"',"+params.searchengineid+","+params.searchid+")",checkForChangesDelay);}
else{periodicallyCheckers.set(name,{time:lastcheckSocialcommunityTime,isChecking:true});}}}});return false;}
function showOverlay(name){$(name).makePositioned();var div=new Element('div',{'style':'position:absolute;top:0px;left:0px;width:100%;height:100%;background: #eeeeee url(\'/img/loading/ajax-loader.gif\') no-repeat;background-position:center center;'}).setOpacity(0.5);$(name).insert(div);}
function attachNavEvents(i,pos,image,width,groupname,functionname,enginenumber,source){jQuery("#sourceNavLink"+i).mouseover(function(){if(jQuery("#sourceNavDivHover"+i).length==0){hoverDivContent='<span id="sourceNavDivHover'+i+'" class="sourceNavDiv '+groupname+enginenumber+' '+source+'" style="right:'+pos+'px;display:none;z-index:2;background: url(/img/tabs/'+image+') no-repeat 0px -26px;width:'+width+'px;"></span>';jQuery("#sourceNavDiv"+i).before(hoverDivContent);jQuery("#sourceNavDivHover"+i).mouseout(function(){jQuery("#sourceNavDivHover"+i).fadeOut(600,function(){try{jQuery(this).remove();}catch(e){}});}).fadeIn(100,function(){});jQuery("#sourceNavDivHover"+i).click(function(){jQuery('.'+groupname+enginenumber).each(function(){jQuery(this).fadeOut(100,function(){try{jQuery(this).remove();}catch(e){}});});activeDivContent='<span id="sourceNavDivActive'+i+'" class="sourceNavDiv '+groupname+enginenumber+' '+source+'" style="right:'+pos+'px;display:none;z-index:3;background: url(/img/tabs/'+image+') no-repeat 0px -52px;width:'+width+'px;"></span>';jQuery("#sourceNavDiv"+i).before(activeDivContent);jQuery("#sourceNavDivActive"+i).fadeIn(300);});}}).mouseout(function(){}).bind("mouseleave",function(){jQuery("#sourceNavDivHover"+i).fadeOut(600,function(){try{jQuery(this).remove();}catch(e){}});});}
function addNewEmailField(){countEmailFields++;var htmlStr='<div class="inputLeft"></div>';htmlStr+='<div class="inputMiddle"><input type="text" value="" name="data[Search][emailOfFriend#{emailFieldPos}]" id="emailOfFriend#{emailFieldPos}" class="searchtermfield" /></div>';htmlStr+='<a href="#" onclick="addNewEmailField();return false;"><div class="inputPlus"></div></a><div class="inputRight"></div><br class="clearer">';var myTemplate=new Template(htmlStr);var values={emailFieldPos:countEmailFields};htmlStr=myTemplate.evaluate(values);$('inputFields').insert({bottom:htmlStr});$('optionsMenu').style.marginBottom=(((countEmailFields-1)*27)+365)+"px";}
function copy(text2copy,sessionId,search,searchid){generateUrlForBoxes(sessionId,search,searchid,1);if(window.clipboardData){window.clipboardData.setData("Text",text2copy);}else{var flashvars={clipboard:text2copy};swfobject.embedSWF("/img/FLASH/_clipboard.swf","flashcontent","0","0","9.0.0","/img/FLASH/expressInstall.swf",flashvars);}}
function generateUrlForBoxes(sessionId,search,searchid,showMessage){var serializedBoxes=jQuery('div.sortWrapper1').sortable('serialize');serializedBoxes+="&"+jQuery('div.sortWrapper2').sortable('serialize');var oldlocation=window.location;oldlocation=oldlocation+"";var obj=serializedBoxes.toQueryParams();var i=1;var selectedSourcesObj=new Hash();try{Object.keys(obj).each(function(key){var line=obj[key]+"";var selectedSourceColumn=new Array();var j=1;line.gsub(/(\w+)[,]?/,function(match){var sourceString=match[1]+"";var selectedSource=$(sourceString+'SelectedSource').value;var selectedOrderForSource=$(sourceString+'SelectedOrderForSource');if(selectedOrderForSource!=null&&typeof selectedOrderForSource.value!="undefined")
selectedOrderForSource=selectedOrderForSource.value;else
selectedOrderForSource="";var searchForSource=$(sourceString+'SearchForSource');if(searchForSource!=null&&typeof searchForSource.value!="undefined")
searchForSource=searchForSource.value;else
searchForSource="";var selectedSourceElem=new Hash();selectedSourceElem.set("source",selectedSource);selectedSourceElem.set("order",selectedOrderForSource);selectedSourceElem.set("search",searchForSource);selectedSourceElem.set("type",sourceString.gsub(/\d+/,''));if(selectedSource=="custom"){var contentFieldID="";sourceString.sub(/\d+/,function(match){contentFieldID='content'+match[0];});var htmlContent="";if(typeof FCKeditorAPI!="undefined"){var oEditor=FCKeditorAPI.GetInstance('data[Custom]['+contentFieldID+']');htmlContent=oEditor.GetHTML();}
selectedSourceElem.set("html",htmlContent);}
selectedSourceColumn.push(selectedSourceElem);j++;});selectedSourcesObj.set(i,selectedSourceColumn);i++;});var saveAs='';if($('saveSearchAs')!=null)
saveAs=$('saveSearchAs').value;new Ajax.Request('/search/save',{parameters:{json:selectedSourcesObj.toJSON(),session_id:sessionId,search_string:search,search_id:searchid,save_as:saveAs},onComplete:function(transport){if(showMessage){$('saveSearchContent').hide();$('sendSearchContent').update(transport.responseText);$('optionsMenu').style.marginBottom='381px';}}});$('saveSearchAs').value='';}catch(e){}}
var videoIdToCue=null;function showPlayer(divName,width,height,newObjectId,playerUrl){var params={allowScriptAccess:"always",bgcolor:"#cccccc",wmode:'transparent',allowFullScreen:true};var flashvars={};var atts={id:newObjectId};swfobject.embedSWF(playerUrl,divName,width,height,"8","/img/FLASH/expressInstall.swf",flashvars,params,atts);}
function loadNewVideo(divName,videoId,startSeconds,newObjectId,playerUrl,width,height){var ytplayer=$(newObjectId);if(ytplayer==null){videoIdToCue=videoId;showPlayer(divName,width,height,newObjectId,playerUrl);}
else if(typeof $(newObjectId).loadVideoById=='function'){ytplayer.loadVideoById(videoId,parseInt(startSeconds));}else{var att={data:playerUrl,width:width,height:height};var par={menu:"false",wmode:'transparent'};var id=newObjectId;swfobject.createSWF(att,par,id);if(typeof swfs!="undefined"){var s=swfs.shift();swfs.push(s);}}}
function play(newObjectId){var ytplayer=$(newObjectId);if(ytplayer){ytplayer.playVideo();}}
function pause(newObjectId){var ytplayer=$(newObjectId);if(ytplayer){ytplayer.pauseVideo();}}
function stop(newObjectId){var ytplayer=$(newObjectId);if(ytplayer){ytplayer.stopVideo();}}
function tryToPlay(newObjectId,videoId){if(typeof $(newObjectId).loadVideoById=='function'){$(newObjectId).loadVideoById(videoId,0);}else{window.setTimeout(function()
{tryToPlay(newObjectId,videoId)},"1000");}}
function music_toggle(video_id,id,musicplayerDiv,musicplayerId)
{var active_music_id=active_music_ids.get(musicplayerDiv);var active_music_paused=active_music_paused_ids.get(musicplayerDiv);if(typeof active_music_id=="undefined"||id!=active_music_id)
{loadNewVideo(musicplayerDiv,video_id,0,musicplayerId,'http://www.youtube.com/apiplayer?enablejsapi=1&playerapiid='+musicplayerId,100,80);active_music_paused_ids.set(musicplayerDiv,false);if(id==10000&&$('music_'+id)){$('music_'+id).className="song_aktiv";}else{var start=id-10;var end=id+10;for(i=start;i<end;i++)
{if($('music_'+i)&&i==id)
$('music_'+i).className="song_aktiv";else if($('music_'+i))
$('music_'+i).className="song";}}
if(typeof active_music_id=="undefined"){tryToPlay(musicplayerId,video_id);}}
else if(active_music_paused==false)
{pause(musicplayerId);$('music_'+id).className="song_aktiv_paused";active_music_paused_ids.set(musicplayerDiv,true);}
else if(active_music_paused==true)
{play(musicplayerId);$('music_'+id).className="song_aktiv";active_music_paused_ids.set(musicplayerDiv,false);}
active_music_ids.set(musicplayerDiv,id);}
function openMessageDetail(randId){var detailHeight=$('detail'+randId).getHeight();savedHeight=$('parentMessageRow'+randId).getHeight();$('messageRow'+randId).hide();$('parentMessageRow'+randId).setStyle({height:detailHeight+'px'});$('detail'+randId).show()}
function closeMessageDetail(randId){$('parentMessageRow'+randId).setStyle({height:savedHeight+'px'});$('detail'+randId).hide()
$('messageRow'+randId).show();}