/** streamdrag.com JS-File; (c) Streamdrag Music Service - automatically generated **/
var FormController = {clearOnValue: function(o,val){if(o.value==val){o.value = '';}},fillOnEmpty: function(o,val){if(o.value==0 || o.value==' '){o.value = val;}},toggleCheckbox: {e: function(o){if(o.checked){o.checked=false;}else{o.checked=true;}},inElement: function(el){$(el).find('input[type=checkbox]').each(function(){if(this.checked){this.checked=false;}else{this.checked=true;}});}},searchInpOverlay: {f: function(){return $('#search_form_top');},show: function(){this.f().find('.sBx_atSearch_Overlay').show();},hide: function(){this.f().find('.sBx_atSearch_Overlay').hide();}},fillValue_search: function(val){var f = $('#search_form_top');$('#topSearchInpHld>input').val(val);FormController._search.submittal(f);},_search: {sResElmId: 'dvSearch_searchResults',submittal: function(f){f = $(f);var val = Base64.encode(f.find('input[name=search]').val());var par = $('#'+this.sResElmId);if(val!=0){if(ENV.current_site!='dv_search' && ENV.current_site!='dv_track' && ENV.current_site!='dv_playlist'){var url = ENV.base_url+'/Search/'+val+'/relevance/1';window.location.href = url;}else{if(ENV.current_site=='dv_track' || ENV.current_site=='dv_playlist'){if(ENV.current_site=='dv_track'){var contId = '#sgTrackDetails';}else{var contId = '#sgPlstDetails';}$('div.contentTabbingLinks>a').removeAttr('class').each(function(ind){var _self = $(this);if(ind===0){_self.unbind().bind('click',function(){_self.siblings().removeAttr('class');_self.attr('class','tc_active');$(contId).show();$('#searchResultsAdded_Hld').hide();});}else if(_self.attr('name')=='searchResultsTab'){_self.show().attr('class','tc_active');_self.unbind().bind('click',function(){_self.siblings().removeAttr('class');_self.attr('class','tc_active');$(contId).hide();$('#searchResultsAdded_Hld').show();});}});$(contId).hide();var dvSearch_exists = ($('#dvSearch_searchResults').length > 0) ? true : false;if(!dvSearch_exists){var htmlElementsData_encoded = $('#searchResultsAdded_Hld').html().replace(/(\<\!--|--\>)/gi,'');var htmlDataPrepared= Base64.decode(htmlElementsData_encoded);$('#searchResultsAdded_Hld').html(htmlDataPrepared).show();}else{$('#searchResultsAdded_Hld').show();}FormController.Adapter.search.dvAjaxSearch(val, 'relevance', 1, false);}else{FormController.Adapter.search.dvAjaxSearch(val, par.find('.searchRes_orderBy_Slct').val(), 1, false);}}}}},searchResults: {changeOrderBy: function(sObj){var preUrl = $('#currentUserSearch_baseURI').val()+'/'+sObj.value+'/1';if(ENV.current_site!='dv_search' && ENV.current_site!='dv_track' && ENV.current_site!='dv_playlist'){var url = ENV.base_url+'/'+preUrl;window.location.href = url;}else{FormController.Adapter.search.dvAjaxSearch(null, null, null, ENV.base_url+'/AJAX/'+preUrl);}}},Adapter: {search: {dvAjaxSearch: function(b64_val,orderBy_val,page_offset,URI_ONLY){SearchController.dvAjaxSearch(b64_val, orderBy_val, page_offset, URI_ONLY);}}}};
