/*--------------------- http://www.zojam.com/scripts/scripts.js, v1.12, 11/2/11 ---------------------------*/

try { window.onerror = function(error, file, line) { return true; } } catch (err) {} var xmlhttp; var xmlhttptwo; var currenttab = 'home'; var browseartistcolor = ''; var browsesongcolor = ''; var decided = false; var searched = false; var pastsearch = '-'; var searchstate = 'regular'; var advancedartist = '-'; var advancedsong = '-'; var advancedtuning = '-'; var advancedportion = '-'; var advancedrating = '-'; var advancedusername = '-'; var popularsearch = ''; var recentsearch = ''; var browsesearch = ''; var searchsearch = ''; var jamlistsearch = ''; var popularartist = ''; var popularsong = ''; var recentartist = ''; var recentsong = ''; var searchartist = ''; var searchsong = ''; var popularsortcolumn = ''; var popularsortby = ''; var recentsortcolumn = ''; var recentsortby = ''; var browsesortcolumn = ''; var browsesortby = ''; var searchsortcolumn = ''; var searchsortby = ''; var currentjamlist = ''; var jamlistarray = new Array(); jamlistarray[0] = new Array(); var highlightjamlist = ''; var jamlisterror = false; var disablebrowsing = false; var deletedcontent = ''; var droppablehover = false; var globalvideostate = 'open'; var rating = false; var rated = false; var currentautocomplete = ''; var NonASCIIKeyID = ''; var autocompleteover = false; var memberloggedin = false;var usertabs = ''; var ytplayer = null; var containerMap = new Map(); containerMap.insert('popular', new contentContainer('popular_browse.php', '-', '-', '', '-', '', '', 'initial', 'initial', '', '', 0, 1)); containerMap.insert('recent', new contentContainer('recent_browse.php', '-', '-', '', '-', '', '', 'initial', 'initial', '', '', 0, 1)); containerMap.insert('browse', new contentContainer('browse_all.php', '-', '-', '', '-', '', '', 'initial', 'initial', '', '', 0, 1)); containerMap.insert('search', new contentContainer('browse_search.php', '-', '-', '', '-', '', '', 'initial', 'initial', '', '', 0, 1)); containerMap.insert('user_tabs', new contentContainer('user_tabs.php', '-', '-', '', '-', '', '', 'initial', 'initial', '', '', 0, 1)); var windowMap = new Map(); windowMap.insert('login', new windowContainer('browse_login.php', 350, 200)); windowMap.insert('sign_up', new windowContainer('browse_signup.php', 450, 350)); windowMap.insert('profile', new windowContainer('browse_profile.php', 550, 415)); windowMap.insert('advanced_search', new windowContainer('advanced_search.php', 400, 300)); windowMap.insert('upload', new windowContainer('UserUpload.php', 700, 560)); windowMap.insert('new_jamlist', new windowContainer('new_jamlist.php', 350, 200)); windowMap.insert('delete_jamlist', new windowContainer('jamlist_names.php', 350, 170)); windowMap.insert('about_us', new windowContainer('/about_us/', 750, 375)); windowMap.insert('terms_of_use', new windowContainer('/terms_of_use/', 640, 525)); windowMap.insert('site_map', new windowContainer('/site_map/', 300, 140)); windowMap.insert('contact_us', new windowContainer('/contact_us/', 600, 490)); windowMap.insert('tabs_for_picks', new windowContainer('tabs_for_picks.php', 500, 320)); var currenthash = ''; var pasthash = ''; var changinghash = false; var cyclingactive = false; var overinputs = false; var ajaxloading = false; var overwindow = false; var mouseovernotification = false; document.onmousemove = GlobalOnMouseMove; document.onmousedown = GlobalOnMouseDown; function checkHash() { if(window.location.hash != currenthash && !changinghash) { newHash(window.location.hash); } setTimeout("checkHash()", 250); } function newHash(hash) { changinghash = true; var hashsplit = hash.split("/"); var oldhashsplit = currenthash.split("/"); if(oldhashsplit.length <= 1 || oldhashsplit[1] != "window") { pasthash = currenthash; } if( (hash == "") || (hashsplit.length > 1 && hashsplit[1] != "") ) { var pastcontainer = null; if(oldhashsplit.length > 2 && oldhashsplit[1] == "jamlist") { pastcontainer = containerMap.retrieve('jamlist-'+oldhashsplit[2]); } else if(oldhashsplit.length > 1 && oldhashsplit[1] != "window") { pastcontainer = containerMap.retrieve(oldhashsplit[1]); } if(ytplayer != null && hashsplit[1] != "window") { pastcontainer.ytvideostate = ytplayer.getPlayerState(); ytplayer.pauseVideo(); pastcontainer.ytvideotime = ytplayer.getCurrentTime(); ytplayer = null; } var tempcontainer = null; var url = ''; var data = {}; if(hash == "") { currenttab = 'home'; url = 'home_page.php'; } else { if(hashsplit[1] == "window" && hashsplit.length > 2) { tempcontainer = windowMap.retrieve(hashsplit[2]); if(tempcontainer == null) { return; } url = tempcontainer.url; if( (hashsplit[2] == 'login' || hashsplit[2] == 'signup') && memberloggedin) { window.location.hash = currenthash; changinghash = false; return; } else if(hashsplit[2] == 'delete_jamlist' && hashsplit.length > 3) { var confirmdelete = hashsplit[3].split("_").join(" "); data.confirm_delete = confirmdelete; } else if(hashsplit[2] == 'profile' && hashsplit.length > 3 && hashsplit[3] != "") { data.member = hashsplit[3]; } else if(hashsplit[2] == 'tabs_for_picks') { data.display = '1'; } } else { var index = 2; var regularsearch = false; if(hashsplit[1] == "jamlist" && hashsplit.length > 2 && hashsplit[2] != "") { tempcontainer = containerMap.retrieve('jamlist-'+hashsplit[2]); data.jamlist_name = (hashsplit[2].split("_").join(" ")); index++; if(tempcontainer != null) { currenttab = 'jamlist-'+hashsplit[2]; } else { return; } } else if(hashsplit[1] == "search") { tempcontainer = containerMap.retrieve(hashsplit[1]); if(tempcontainer != null) { currenttab = hashsplit[1]; } else { return; } searched = true; if(hashsplit.length > 3 && hashsplit[2] == "regular" && hashsplit[3] != "") { searchstring = hashsplit[3]; pastsearch = searchstring; data.browse_search = searchstring; index = index + 2; } else if(hashsplit.length > 8 && hashsplit[2] == "advanced") { searchstate = 'advanced'; advancedartist = hashsplit[3]; advancedsong = hashsplit[4]; advancedtuning = hashsplit[5]; advancedportion = hashsplit[6]; advancedrating = hashsplit[7]; advancedusername = hashsplit[8]; data.advanced_artist = (hashsplit[3] == "-") ? '' :hashsplit[3]; data.advanced_song = (hashsplit[4] == "-") ? '' : hashsplit[4]; data.advanced_tuning = (hashsplit[5] == "-") ? 'none' : hashsplit[5]; data.advanced_portion = (hashsplit[6] == "-") ? 'none' : hashsplit[6]; data.advanced_rating = (hashsplit[7] == "-") ? 'none' : hashsplit[7]; data.advanced_username = (hashsplit[8] == "-") ? '' : hashsplit[8]; index = index + 7; } else { data.browse_search = pastsearch; index++; } } else if(hashsplit[1] == "user_tabs" && hashsplit.length > 2 && hashsplit[2] != "") { tempcontainer = containerMap.retrieve(hashsplit[1]); data.member = hashsplit[2]; usertabs = hashsplit[2]; index++; if(tempcontainer != null) { currenttab = 'user_tabs'; } else { return; } } else { tempcontainer = containerMap.retrieve(hashsplit[1]); if(tempcontainer != null) { currenttab = hashsplit[1]; } else { return; } } url = tempcontainer.url; var artist = '-'; var song = '-'; var file = ''; var onlyloadyoutube = false; if(hashsplit.length > index && hashsplit[index] != "" && !regularsearch) { artist = hashsplit[index]; data.browse_artist = artist; index++; if(hashsplit.length > index && hashsplit[index] != "") { song = hashsplit[index]; data.browse_song = song; index++; if(hashsplit.length > index && hashsplit[index] != "") { file = hashsplit[index]; data.browse_file = file; data.browse_height = getBrowseHeight(); data.browse_width = getBrowseWidth(); if(tempcontainer.artist == hashsplit[ ( index - 2) ] && tempcontainer.song == hashsplit[ ( index - 1 ) ] && tempcontainer.file == hashsplit[index]) { data.open_tab = '1'; } if( (oldhashsplit.length > index) && (oldhashsplit[ ( index - 2 ) ]+oldhashsplit[ ( index - 1 ) ]+oldhashsplit[index] == hashsplit[ ( index - 2 ) ]+hashsplit[ ( index - 1 ) ]+hashsplit[index]) ) { onlyloadyoutube = true; } index++; if(hashsplit.length <= index || hashsplit[index] == "") { tempcontainer.previousytstate = tempcontainer.ytstate; tempcontainer.ytstate = 'initial'; data.youtube_state = 'results'; } else if(hashsplit.length > index && hashsplit[index] == "search") { tempcontainer.previousytstate = tempcontainer.ytstate; tempcontainer.ytstate = 'search'; data.youtube_state = 'search'; } else if( (hashsplit.length > index && hashsplit[index] != "") && (hashsplit.length > ( index+1 ) && hashsplit[ ( index + 1 ) ] != "") ) { if(hashsplit[index] == 'results') { tempcontainer.previousytstate = tempcontainer.ytstate; tempcontainer.ytstate = 'results'; tempcontainer.ytsearch = hashsplit[ ( index+1) ]; data.youtube_state = 'results'; } else if(hashsplit[index] == 'video') { tempcontainer.previousytstate = tempcontainer.ytstate; tempcontainer.ytstate = 'video'; if(tempcontainer.ytvideoid != hashsplit[ ( index+1) ]) { tempcontainer.ytvideotime = 0; tempcontainer.ytvideostate = 1; } tempcontainer.ytvideoid = hashsplit[ ( index+1) ]; data.youtube_state = 'video'; } } else { return; } if(onlyloadyoutube) { currenthash = hash; window.location.hash = currenthash; changinghash = false; if($(currenttab+'_navigation')) { $(currenttab+'_navigation').setAttribute("onClick", "newHash('"+currenthash+"'); return false;"); } loadYouTube(tempcontainer); return; } else { data.youtube_type = (tempcontainer.ytstate == 'initial') ? 'results' : tempcontainer.ytstate; } } } } tempcontainer.artist = artist; tempcontainer.song = song; tempcontainer.file = file; if(tempcontainer.filter != "-") { data.browse_input = tempcontainer.filter; } if(tempcontainer.sortcolumn != "" && tempcontainer.orderby != "") { data.sort_column = tempcontainer.sortcolumn; data.sort_by = tempcontainer.orderby; } if(!searched) { data.not_searched = '1'; } data.content_height = ($('content').offsetHeight - 77)+"px"; } } jQuery.ajax({ type: 'GET', url: url, data: data, beforeSend: function() { if(hashsplit[1] == "window") { if(hashsplit[2] == 'upload' && !memberloggedin) { $('window_container').style.top = (($('test').offsetHeight - 200) / 2)+'px'; $('window_background').style.display = 'block'; $('window_loading').style.display = 'block'; $('window_container').style.width = '370px'; $('window_container').style.height = '70px'; $('window').style.width = '350px'; $('window').style.height = '50px'; } else { $('window_container').style.top = (($('test').offsetHeight - (tempcontainer.height + 20)) / 2)+'px'; $('window_background').style.display = 'block'; $('window_loading').style.display = 'block'; $('window_container').style.width = (tempcontainer.width + 20)+'px'; $('window_container').style.height = '70px'; $('window').style.width = tempcontainer.width+'px'; $('window').style.height = '50px'; } } else if(!onlyloadyoutube) { $('browse_loading').style.display = 'block'; ajaxloading = true; $('ajax_loading').style.display = 'block'; } }, success: function(data) { if($('notifications')) { $('notifications').style.display = 'none'; $('notification_container').innerHTML = '<div id="notifications_loading" style="display: none;"><table cellspacing="0" cellpadding="0" border="0" width="100%" height="100%"><tr valign="top"><td align="center"><div id="notifications_loading_container"><table cellspacing="0" cellpadding="0" border="0" width="100%" height="100%"><tr valign="middle"><td align="center">Loading...</td></tr></table></div></td></tr></table></div>'; } currenthash = hash; window.location.hash = currenthash; changinghash = false; changeTitle(); if(trackAnalytics()) { _gaq.push(['_trackPageview', '/'+currenthash]); } if(hashsplit[1] == "window") { window.location.hash = currenthash; changinghash = false; $('window_loading').style.display = 'none'; $('window').innerHTML = data; var currenthashsplit = currenthash.split("/"); if(hashsplit[2] == 'upload' && !memberloggedin) { $('window_container').style.width = '370px'; $('window_container').style.height = '220px'; $('window').style.width = '350px'; $('window').style.height = '200px'; } else if(hashsplit[2] == 'profile' && currenthashsplit.length > 3 && currenthashsplit[3] != "") { $('window_container').style.width = (tempcontainer.width + 20)+'px'; $('window_container').style.height = '230px'; $('window').style.width = tempcontainer.width+'px'; $('window').style.height = '210px'; } else { $('window_container').style.width = (tempcontainer.width + 20)+'px'; $('window_container').style.height = (tempcontainer.height + 20)+'px'; $('window').style.width = tempcontainer.width+'px'; $('window').style.height = tempcontainer.height+'px'; } if(hashsplit[2] == 'login' || (hashsplit[2] == 'new_jamlist' && !memberloggedin) || (hashsplit[2] == 'upload' && !memberloggedin)) { $('login_username').focus(); } else if(hashsplit[2] == 'sign_up') { $('signup_username').focus(); } else if(hashsplit[2] == 'contact_us') { Recaptcha.create("6LfTrcESAAAAAIGDJv9p9a3OBXGZHew2DgIdC_Vo", "recaptcha_refresh", { theme : 'custom', custom_theme_widget: 'recaptcha_widget' } ); } } else { $('browse').innerHTML = data; if(currenttab != 'home') { if($(currenttab+'_navigation')) { $(currenttab+'_navigation').setAttribute("onClick", "newHash('"+currenthash+"'); return false;"); } addscript(); if(hashsplit[1] == "browse") { if(tempcontainer.artist != '-' && tempcontainer.song == '-') { Position.prepare(); var artistcontainer = Position.cumulativeOffset($('content_height_1'))[1]; var artistelement = Position.cumulativeOffset($(''+tempcontainer.artist+'_artist'))[1]; new Effect.Scroll('content_height_1', { x: 0, y: (artistelement - artistcontainer) }); browseartistcolor = $(''+tempcontainer.artist+'_artist').className; $(''+tempcontainer.artist+'_artist').setAttribute("onmouseout", "this.style.backgroundColor = '#56A5EC'"); setTimeout(function() { new Effect.Morph(''+tempcontainer.artist+'_artist', { style: 'background: #56A5EC;' }); }, 850); } else if(tempcontainer.artist != '-' && tempcontainer.song != '-') { Position.prepare(); var artistcontainer = Position.cumulativeOffset($('content_height_1'))[1]; var artistelement = Position.cumulativeOffset($(''+tempcontainer.artist+'_artist'))[1]; new Effect.Scroll('content_height_1', { x: 0, y: (artistelement - artistcontainer) }); browseartistcolor = $(''+tempcontainer.artist+'_artist').className; $(''+tempcontainer.artist+'_artist').setAttribute("onmouseout", "this.style.backgroundColor = '#56A5EC'"); setTimeout(function() { new Effect.Morph(''+tempcontainer.artist+'_artist', { style: 'background: #56A5EC;' }); }, 850); var songcontainer = Position.cumulativeOffset($('content_height_2'))[1]; var songelement = Position.cumulativeOffset($(''+tempcontainer.song+'_song'))[1]; new Effect.Scroll('content_height_2', { x: 0, y: (songelement - songcontainer) }); browsesongcolor = $(''+tempcontainer.song+'_song').className; $(''+tempcontainer.song+'_song').setAttribute("onmouseout", "this.style.backgroundColor = '#56A5EC'"); setTimeout(function() { new Effect.Morph(''+tempcontainer.song+'_song', { style: 'background: #56A5EC;' }); }, 850); } } else if(hashsplit[1] == "search") { if(!searched) { $('search_tab').appear(); searched = true; decided = true; } } if(tempcontainer.file != "") { $('tab_information').style.display = 'none'; $('tab_display_container').appear(); setTimeout(function() { $('tab_display_container').style.display = 'block'; }, 850); setTimeout(function() { loadYouTube(tempcontainer); }, 850); gapi.plusone.render("plusone-div", {"href": "http://www.zojam.com/"+currenthash+"", "state": "on", "size": "medium", "count": "false"}); } } else { jQuery(function() { rainbows.init({ selector: '#landing_page_link', shadow: true, from: '#032677', to: '#00aeff' }); }); $('landing_page_link').style.width = ($('landing_page_link_container').offsetWidth - 100)+'px'; } var tempkeyarray = containerMap.keySet(); for(var i=0; i < tempkeyarray.length; i++) { var tempkeyarraysplit = tempkeyarray[i].split('-'); if(tempkeyarraysplit[0] == "jamlist") { var loopthrough = $('hidden_jamlist').value; for(var j=0; j < loopthrough; j++) { if('jamlist-'+$('droppable_'+j+'').className == currenttab) { $('droppable_'+j+'').style.backgroundColor = '#CEE3F6'; $('droppable_'+j+'').setAttribute("onMouseOut", "this.style.backgroundColor = '#CEE3F6'"); } else { $('droppable_'+j+'').style.backgroundColor = ''; $('droppable_'+j+'').setAttribute("onMouseOut", "this.style.backgroundColor = ''"); } } } else if(tempkeyarray[i] != "user_tabs") { if(tempkeyarray[i] == hashsplit[1]) { $(tempkeyarray[i]+'_link').style.backgroundColor = '#CEE3F6'; $(tempkeyarray[i]+'_link').setAttribute("onMouseOut", "this.style.backgroundColor = '#CEE3F6'"); } else { $(tempkeyarray[i]+'_link').style.backgroundColor = ''; $(tempkeyarray[i]+'_link').setAttribute("onMouseOut", "this.style.backgroundColor = ''"); } if($('inner_'+tempkeyarray[i]+'_navigation')) { var newhash = '#!/'+tempkeyarray[i]+'/'; if(tempkeyarray[i] == "search" && searchstate == "regular") { newhash += 'regular/'+pastsearch+'/'; } else if(tempkeyarray[i] == "search" && searchstate == "advanced") { newhash += 'advanced/'; newhash += (advancedartist == '') ? '-/' : advancedartist+'/'; newhash += (advancedsong == '') ? '-/' : advancedsong+'/'; newhash += (advancedtuning == 'none') ? '-/' : advancedtuning+'/'; newhash += (advancedportion == 'none') ? '-/' : advancedportion+'/'; newhash += (advancedrating == 'none') ? '-/' : advancedrating+'/'; newhash += (advancedusername == '') ? '-/' : advancedusername+'/'; } var tempkeycontainer = containerMap.retrieve(tempkeyarray[i]); if(tempkeycontainer.artist != '-') { newhash += tempkeycontainer.artist+'/'; if(tempkeycontainer.song != '-') { newhash += tempkeycontainer.song+'/'; if(tempkeycontainer.file != '') { newhash += tempkeycontainer.file+'/'; if(tempkeycontainer.ytstate == 'search') { newhash += 'search/'; } else if(tempkeycontainer.ytstate == 'results') { newhash += 'results/'+tempkeycontainer.ytsearch+'/'; } else if(tempkeycontainer.ytstate == 'video') { newhash += 'video/'+tempkeycontainer.ytvideoid+'/'; } } } } $('inner_'+tempkeyarray[i]+'_navigation').setAttribute("onClick", "newHash('"+newhash+"'); return false;"); } } } $('window_background').style.display = 'none'; $('window').innerHTML = ''; $('window_container').style.width = '0px'; $('window_container').style.height = '0px'; $('window').style.width = '0px'; $('window').style.height = '0px'; $('browse_loading').style.display = 'none'; ajaxloading = false; $('ajax_loading').style.display = 'none'; } } }); } else { changinghash = false; } } function openTab(tab) { currenttab = tab; changinghash = true; var newcurrenthash = '#!/'; if(tab == 'popular') { newcurrenthash+='popular/'; xmlhttp=GetXmlHttpObject(); if (xmlhttp==null) { alert ("Your browser does not support XMLHTTP!"); return; } var url="/popular_browse.php?browse_input="+popularsearch+"&sort_column="+popularsortcolumn+"&sort_by="+popularsortby+"&open_tab=1&content_height="+getContentHeight(); if(!searched) { url+="&not_searched=1"; } if(popularcontainer.artist != "-" && popularcontainer.artist != "") { url+="&browse_artist="+popularcontainer.artist; newcurrenthash+=popularcontainer.artist+'/'; } if(popularcontainer.song != "-" && popularcontainer.song != "") { url+="&browse_song="+popularcontainer.song; newcurrenthash+=popularcontainer.song+'/'; } if(popularcontainer.file != "") { url+="&browse_file="+popularcontainer.file; url+="&browse_height="+getBrowseHeight(); url+="&browse_width="+getBrowseWidth(); newcurrenthash+=popularcontainer.file+'/'; if(popularcontainer.overallvideostate == 'initial' && popularcontainer.initialvideostate == 'results') { if(popularcontainer.uservideostate == 'results') { url+="&alt_youtube_state=user_results&alt_youtube_input="+popularcontainer.uservideoinput; } else if(popularcontainer.uservideostate == 'video') { url+="&alt_youtube_state=user_video&alt_youtube_input="+popularcontainer.uservideoinput; } } else if(popularcontainer.overallvideostate == 'initial' && popularcontainer.initialvideostate == 'video') { url+="&youtube_state=initial_video&youtube_input="+popularcontainer.initialvideoinput+"&youtube_type=initial"; if(popularcontainer.uservideostate == 'results') { url+="&alt_youtube_state=user_results&alt_youtube_input="+popularcontainer.uservideoinput; } else if(popularcontainer.uservideostate == 'video') { url+="&alt_youtube_state=user_video&alt_youtube_input="+popularcontainer.uservideoinput; } } else if(popularcontainer.overallvideostate == 'user' && popularcontainer.uservideostate == 'search') { url+="&youtube_state=user_search"; if(popularcontainer.initialvideostate == 'video') { url+="&alt_youtube_state=initial_video&alt_youtube_input="+popularcontainer.initialvideoinput; } } else if(popularcontainer.overallvideostate == 'user' && popularcontainer.uservideostate == 'results') { url+="&youtube_state=user_results&youtube_input="+popularcontainer.uservideoinput; if(popularcontainer.initialvideostate == 'video') { url+="&alt_youtube_state=initial_video&alt_youtube_input="+popularcontainer.initialvideoinput; } } else if(popularcontainer.overallvideostate == 'user' && popularcontainer.uservideostate == 'video') { url+="&youtube_state=user_video&youtube_input="+popularcontainer.uservideoinput+"&youtube_type=user"; if(popularcontainer.initialvideostate == 'video') { url+="&alt_youtube_state=initial_video&alt_youtube_input="+popularcontainer.initialvideoinput; } } if(popularcontainer.openstate == 'closed') { url+="&youtube_closed=1"; } } currenthash = newcurrenthash; xmlhttp.onreadystatechange=openTabStateChanged; xmlhttp.open("GET",url,true); xmlhttp.send(null); } else if(tab == 'recent') { newcurrenthash+='recent/'; xmlhttp=GetXmlHttpObject(); if (xmlhttp==null) { alert ("Your browser does not support XMLHTTP!"); return; } var url="/recent_browse.php?browse_input="+recentsearch+"&sort_column="+recentsortcolumn+"&sort_by="+recentsortby+"&open_tab=1&content_height="+getContentHeight(); if(!searched) { url+="&not_searched=1"; } if(recentcontainer.artist != "-" && recentcontainer.artist != "") { url+="&browse_artist="+recentcontainer.artist; newcurrenthash+=recentcontainer.artist+'/'; } if(recentcontainer.song != "-" && recentcontainer.song != "") { url+="&browse_song="+recentcontainer.song; newcurrenthash+=recentcontainer.song+'/'; } if(recentcontainer.file != "") { url+="&browse_file="+recentcontainer.file; url+="&browse_height="+getBrowseHeight(); url+="&browse_width="+getBrowseWidth(); newcurrenthash+=recentcontainer.file+'/'; if(recentcontainer.overallvideostate == 'initial' && recentcontainer.initialvideostate == 'results') { if(recentcontainer.uservideostate == 'results') { url+="&alt_youtube_state=user_results&alt_youtube_input="+recentcontainer.uservideoinput; } else if(recentcontainer.uservideostate == 'video') { url+="&alt_youtube_state=user_video&alt_youtube_input="+recentcontainer.uservideoinput; } } else if(recentcontainer.overallvideostate == 'initial' && recentcontainer.initialvideostate == 'video') { url+="&youtube_state=initial_video&youtube_input="+recentcontainer.initialvideoinput+"&youtube_type=initial"; if(recentcontainer.uservideostate == 'results') { url+="&alt_youtube_state=user_results&alt_youtube_input="+recentcontainer.uservideoinput; } else if(recentcontainer.uservideostate == 'video') { url+="&alt_youtube_state=user_video&alt_youtube_input="+recentcontainer.uservideoinput; } } else if(recentcontainer.overallvideostate == 'user' && recentcontainer.uservideostate == 'search') { url+="&youtube_state=user_search"; if(recentcontainer.initialvideostate == 'video') { url+="&alt_youtube_state=initial_video&alt_youtube_input="+recentcontainer.initialvideoinput; } } else if(recentcontainer.overallvideostate == 'user' && recentcontainer.uservideostate == 'results') { url+="&youtube_state=user_results&youtube_input="+recentcontainer.uservideoinput; if(recentcontainer.initialvideostate == 'video') { url+="&alt_youtube_state=initial_video&alt_youtube_input="+recentcontainer.initialvideoinput; } } else if(recentcontainer.overallvideostate == 'user' && recentcontainer.uservideostate == 'video') { url+="&youtube_state=user_video&youtube_input="+recentcontainer.uservideoinput+"&youtube_type=user"; if(recentcontainer.initialvideostate == 'video') { url+="&alt_youtube_state=initial_video&alt_youtube_input="+recentcontainer.initialvideoinput; } } if(recentcontainer.openstate == 'closed') { url+="&youtube_closed=1"; } } currenthash = newcurrenthash; xmlhttp.onreadystatechange=openTabStateChanged; xmlhttp.open("GET",url,true); xmlhttp.send(null); } else if(tab == 'browse') { newcurrenthash+='browse/'; xmlhttp=GetXmlHttpObject(); if (xmlhttp==null) { alert ("Your browser does not support XMLHTTP!"); return; } var url="/browse_all.php?browse_input="+browsesearch+"&sort_column="+browsesortcolumn+"&sort_by="+browsesortby+"&open_tab=1&content_height="+getContentHeight(); if(!searched) { url+="&not_searched=1"; } if(browsecontainer.artist != "-") { newcurrenthash+=browsecontainer.artist+'/'; url+="&browse_artist="+browsecontainer.artist; } if(browsecontainer.song != "-") { newcurrenthash+=browsecontainer.song+'/'; url+="&browse_song="+browsecontainer.song; } if(browsecontainer.file != "") { url+="&browse_file="+browsecontainer.file; url+="&browse_height="+getBrowseHeight(); url+="&browse_width="+getBrowseWidth(); newcurrenthash+=browsecontainer.file+'/'; if(browsecontainer.overallvideostate == 'initial' && browsecontainer.initialvideostate == 'results') { if(browsecontainer.uservideostate == 'results') { url+="&alt_youtube_state=user_results&alt_youtube_input="+browsecontainer.uservideoinput; } else if(browsecontainer.uservideostate == 'video') { url+="&alt_youtube_state=user_video&alt_youtube_input="+browsecontainer.uservideoinput; } } else if(browsecontainer.overallvideostate == 'initial' && browsecontainer.initialvideostate == 'video') { url+="&youtube_state=initial_video&youtube_input="+browsecontainer.initialvideoinput+"&youtube_type=initial"; if(browsecontainer.uservideostate == 'results') { url+="&alt_youtube_state=user_results&alt_youtube_input="+browsecontainer.uservideoinput; } else if(browsecontainer.uservideostate == 'video') { url+="&alt_youtube_state=user_video&alt_youtube_input="+browsecontainer.uservideoinput; } } else if(browsecontainer.overallvideostate == 'user' && browsecontainer.uservideostate == 'search') { url+="&youtube_state=user_search"; if(browsecontainer.initialvideostate == 'video') { url+="&alt_youtube_state=initial_video&alt_youtube_input="+browsecontainer.initialvideoinput; } } else if(browsecontainer.overallvideostate == 'user' && browsecontainer.uservideostate == 'results') { url+="&youtube_state=user_results&youtube_input="+browsecontainer.uservideoinput; if(browsecontainer.initialvideostate == 'video') { url+="&alt_youtube_state=initial_video&alt_youtube_input="+browsecontainer.initialvideoinput; } } else if(browsecontainer.overallvideostate == 'user' && browsecontainer.uservideostate == 'video') { url+="&youtube_state=user_video&youtube_input="+browsecontainer.uservideoinput+"&youtube_type=user"; if(browsecontainer.initialvideostate == 'video') { url+="&alt_youtube_state=initial_video&alt_youtube_input="+browsecontainer.initialvideoinput; } } if(browsecontainer.openstate == 'closed') { url+="&youtube_closed=1"; } } currenthash = newcurrenthash; xmlhttp.onreadystatechange=openTabStateChanged; xmlhttp.open("GET",url,true); xmlhttp.send(null); } else if(tab == 'search') { xmlhttp=GetXmlHttpObject(); if (xmlhttp==null) { alert ("Your browser does not support XMLHTTP!"); return; } if(searchstate == 'regular') { currenthash = '#!/search/'; if(pastsearch != "-") { currenthash+='?zs='+pastsearch; } var url="/browse_search.php?browse_search="+pastsearch+"&sort_column="+searchsortcolumn+"&sort_by="+searchsortby; } else if(searchstate == 'advanced') { var url="/browse_search.php?advanced_artist="+advancedartist+"&sort_column="+searchsortcolumn+"&sort_by="+searchsortby; if(advancedsong != "-") { url+="&advanced_song="+advancedsong; } url+="&advanced_tuning="+advancedtuning; url+="&advanced_portion="+advancedportion; url+="&advanced_rating="+advancedrating; url+="&advanced_username="+advancedusername; } if(!searched) { url+="&not_searched=1"; } url+="&content_height="+getContentHeight(); xmlhttp.onreadystatechange=searchStateChanged; xmlhttp.open("GET",url,true); xmlhttp.send(null); } } function keyUpSearch(value) { var tempcontainer = containerMap.retrieve(currenttab); tempcontainer.filter = (value == '') ? '-' : value; var url = '/'+tempcontainer.url+'?'; if(currenttab == "search") { if(searchstate == 'regular') { url += 'browse_search='+pastsearch+'&browse_input='+tempcontainer.filter+'&active_delineation=1'; } else if(searchstate == 'advanced') { url+='advanced_artist='+advancedartist; url+='&advanced_song='+advancedsong; url+="&advanced_tuning="+advancedtuning; url+="&advanced_portion="+advancedportion; url+="&advanced_rating="+advancedrating; url+="&advanced_username="+advancedusername; url+="&browse_input="+tempcontainer.filter; } } else if(currenttab == 'browse') { url += 'browse_artist='+tempcontainer.artist+'&browse_song='+tempcontainer.song+'&browse_input='+tempcontainer.filter+'&browse_navigation=1'; } else if(currenttab == 'user_tabs') { url += 'member='+usertabs+'&browse_input='+tempcontainer.filter+'&active_delineation=1'; } else { url += 'browse_input='+tempcontainer.filter+'&active_delineation=1'; } if(tempcontainer.sortcolumn != '' && tempcontainer.orderby != '') { url+='&sort_column='+tempcontainer.sortcolumn+'&sort_by='+tempcontainer.orderby; } if(!searched) { url+="&not_searched=1"; } url += '&content_height='+getContentHeight(); xmlhttp=GetXmlHttpObject(); if (xmlhttp==null) { alert ("Your browser does not support XMLHTTP!"); return; } xmlhttp.onreadystatechange=keyUpStateChanged; xmlhttp.open("GET",url,true); xmlhttp.send(null); } function browseAll(artist, song) { changinghash = true; var tempcontainer = containerMap.retrieve('browse'); if(song == '-' && tempcontainer.artist != '-' && artist != tempcontainer.artist && browseartistcolor != '') { if(browseartistcolor == '#ffffff') { $(''+tempcontainer.artist+'_artist').setAttribute("onmouseout", "this.style.backgroundColor = '#ffffff'"); } else { $(''+tempcontainer.artist+'_artist').setAttribute("onmouseout", "this.style.backgroundColor = '#dddddd'"); } new Effect.Morph(''+tempcontainer.artist+'_artist', { style: 'background: '+browseartistcolor+';' }); } else if(song != '-' && tempcontainer.song != '-' && song != tempcontainer.song && browsesongcolor != '') { if(browsesongcolor == '#ffffff') { $(''+tempcontainer.song+'_song').setAttribute("onmouseout", "this.style.backgroundColor = '#ffffff'"); } else { $(''+tempcontainer.song+'_song').setAttribute("onmouseout", "this.style.backgroundColor = '#dddddd'"); } new Effect.Morph(''+tempcontainer.song+'_song', { style: 'background: '+browsesongcolor+';' }); } tempcontainer.artist = artist; tempcontainer.song = song; if(artist == '-' && song == '-') { new Effect.Scroll('content_height_1', { x: 0, y: 0 }); } else if(artist != '-' && song == '-') { var artistcontainer = Position.cumulativeOffset($('content_height_1'))[1]; var artistelement = Position.cumulativeOffset($(''+tempcontainer.artist+'_artist'))[1]; new Effect.Scroll('content_height_1', { x: 0, y: (artistelement - artistcontainer) }); browseartistcolor = $(''+tempcontainer.artist+'_artist').className; $(''+tempcontainer.artist+'_artist').setAttribute("onmouseout", "this.style.backgroundColor = '#56A5EC'"); setTimeout("new Effect.Morph(''+tempcontainer.artist+'_artist', { style: 'background: #56A5EC;' })", 850); } else if(artist != '-' && song != '-') { var songcontainer = Position.cumulativeOffset($('content_height_2'))[1]; var songelement = Position.cumulativeOffset($(''+tempcontainer.song+'_song'))[1]; new Effect.Scroll('content_height_2', { x: 0, y: (songelement - songcontainer) }); browsesongcolor = $(''+tempcontainer.song+'_song').className; $(''+tempcontainer.song+'_song').setAttribute("onmouseout", "this.style.backgroundColor = '#56A5EC'"); setTimeout("new Effect.Morph(''+tempcontainer.song+'_song', { style: 'background: #56A5EC;' })", 850); } if(tempcontainer.artist != '-') { xmlhttp=GetXmlHttpObject(); if (xmlhttp==null) { alert ("Your browser does not support XMLHTTP!"); return; } var url="/browse_all.php?browse_artist="+tempcontainer.artist+"&browse_song="+tempcontainer.song+"&browse_navigation=1"; xmlhttp.onreadystatechange=browseAllStateChanged; xmlhttp.open("GET",url,true); xmlhttp.send(null); } else { currenthash = '#!/browse/'; window.location.hash = currenthash; changinghash = false; changeTitle(); $('content_height_2').innerHTML = "<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" width=\"100%\"><tr valign=\"top\"><td width=\"2%\" style=\"height: 18px; background-color: #ffffff\"></td><td align=\"center\" width=\"96%\" style=\"height: 18px; background-color: #ffffff\">- No Artist Selected -</td><td width=\"2%\" style=\"height: 18px; background-color: #ffffff\"></td></tr></table>"; $('content_height_3').innerHTML = "<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" width=\"100%\"><tr valign=\"top\"><td width=\"2%\" style=\"height: 18px; background-color: #ffffff\"></td><td align=\"center\" width=\"96%\" style=\"height: 18px; background-color: #ffffff\">- No Song Selected -</td><td width=\"2%\" style=\"height: 18px; background-color: #ffffff\"></td></tr></table>"; } if(tempcontainer.artist == '-' || tempcontainer.song == '-') { browsesearch = '-'; } } function searchTabs(location) { var tempcontainer = containerMap.retrieve('search'); tempcontainer.artist = '-'; tempcontainer.song = '-'; tempcontainer.file = ''; if(location == 'header') { var search = $('input_style').value; if(search == "" || search == "Search for a tab") { return; } } else if(location == 'browse') { var search = $('browse_search_input').value; if(search == "" || search == "Search for a tab") { return; } } else if(location == 'home') { var search = $('home_page_search').value; if(search == "" || search == "Search for an artist or song") { return; } } searchstate = 'regular'; xmlhttptwo=GetXmlHttpObject(); if (xmlhttptwo==null) { alert ("Your browser does not support XMLHTTP!"); return; } var url="/browse_search.php?search_check="+search; xmlhttptwo.open("GET",url,false); xmlhttptwo.send(null); if(xmlhttptwo.responseText == "false") { changinghash = true; pastsearch = search; currenthash = '#!/search/regular/'+search+'/'; xmlhttp=GetXmlHttpObject(); if (xmlhttp==null) { alert ("Your browser does not support XMLHTTP!"); return; } var url="/browse_search.php?browse_search="+search+"&content_height="+getContentHeight(); if(!searched) { url+="&not_searched=1"; } xmlhttp.onreadystatechange=searchStateChanged; xmlhttp.open("GET",url,true); xmlhttp.send(null); } else { changinghash = true; currenttab = 'browse'; var responsetextsplit = xmlhttptwo.responseText.split("+"); if(responsetextsplit.length > 1) { browsecontainer.song = responsetextsplit[0]; browsecontainer.artist = responsetextsplit[1]; currenthash = '#!/browse/'+browsecontainer.artist+'/'+browsecontainer.song+'/'; } else { browsecontainer.song = '-'; browsecontainer.artist = responsetextsplit[0]; currenthash = '#!/browse/'+browsecontainer.artist+'/'; } $('input_style').value = ''; $('auto_complete').innerHTML = ''; $('auto_complete').style.height = '0px'; $('auto_complete').style.display = 'none'; $('search_completion').innerHTML = ''; $('search_completion').style.visibility = 'hidden'; onBlurSearch($('input_style')); xmlhttp=GetXmlHttpObject(); if (xmlhttp==null) { alert ("Your browser does not support XMLHTTP!"); return; } var url="/browse_all.php?browse_input="+browsesearch+"&content_height="+getContentHeight()+"&browse_artist="+browsecontainer.artist+"&browse_song="+browsecontainer.song; if(!searched) { url+="&not_searched=1"; } xmlhttp.onreadystatechange=browseStateChanged; xmlhttp.open("GET",url,true); xmlhttp.send(null); } } function advancedSearch() { var artistsongempty = false; var artistsongshort = false; if($('advanced_artist').value == "" && $('advanced_song').value == "") { artistsongempty = true; } else if($('advanced_artist').value != "" && $('advanced_song').value == "") { var artistsplit = $('advanced_artist').value.split(""); if(artistsplit.length < 3) { artistsongshort = true; } } else if($('advanced_artist').value == "" && $('advanced_song').value != "") { var songsplit = $('advanced_song').value.split(""); if(songsplit.length < 3) { artistsongshort = true; } } else { var artistsplit = $('advanced_artist').value.split(""); var songsplit = $('advanced_song').value.split(""); if(artistsplit.length < 3 || songsplit.length < 3) { artistsongshort = true; } } if(artistsongempty) { new Effect.Morph('window_container', { duration: 0.5, style: 'height: 350px;' }); new Effect.Morph('window', { duration: 0.5, style: 'height: 330px;' }); if($('advanced_artist_song_short').style.display == 'block') { Effect.Fade('advanced_artist_song_short', { duration: 0.5 }); setTimeout("$('advanced_artist_song_short').style.display = 'none'", 550); Effect.Appear('advanced_artist_song_empty', { delay: 1.0 }); setTimeout("$('advanced_artist_song_empty').style.display = 'block'", 1050); } else { Effect.Appear('advanced_artist_song_empty', { delay: 0.5 }); setTimeout("$('advanced_artist_song_empty').style.display = 'block'", 550); setTimeout("$('advanced_search_errors').style.height='30px'", 550); } return; } else if(artistsongshort) { new Effect.Morph('window_container', { duration: 0.5, style: 'height: 350px;' }); new Effect.Morph('window', { duration: 0.5, style: 'height: 330px;' }); if($('advanced_artist_song_empty').style.display == 'block') { Effect.Fade('advanced_artist_song_empty', { duration: 0.5 }); setTimeout("$('advanced_artist_song_empty').style.display = 'none'", 550); Effect.Appear('advanced_artist_song_short', { delay: 1.0 }); setTimeout("$('advanced_artist_song_short').style.display = 'block'", 1050); } else { Effect.Appear('advanced_artist_song_short', { delay: 0.5 }); setTimeout("$('advanced_artist_song_short').style.display = 'block'", 550); setTimeout("$('advanced_search_errors').style.height='30px'", 550); } return; } $('advanced_search_loading').style.display = 'block'; searchstate = 'advanced'; xmlhttp=GetXmlHttpObject(); if (xmlhttp==null) { alert ("Your browser does not support XMLHTTP!"); return; } advancedartist = $('advanced_artist').value; advancedsong = $('advanced_song').value; advancedtuning = $('advanced_tuning').value; advancedportion = $('advanced_portion').value; advancedrating = $('advanced_rating').value; advancedusername = $('advanced_username').value; changinghash = true; currenthash = '#!/search/advanced/'; currenthash += (advancedartist == "") ? '-/' : advancedartist+'/'; currenthash += (advancedsong == "") ? '-/' : advancedsong+'/'; currenthash += (advancedtuning == "none") ? '-/' : advancedtuning+'/'; currenthash += (advancedportion == "none") ? '-/' : advancedportion+'/'; currenthash += (advancedrating == "none") ? '-/' : advancedrating+'/'; currenthash += (advancedusername == "") ? '-/' : advancedusername+'/'; var url="/browse_search.php?advanced_artist="+advancedartist; url+="&advanced_song="+advancedsong; url+="&advanced_tuning="+advancedtuning; url+="&advanced_portion="+advancedportion; url+="&advanced_rating="+advancedrating; url+="&advanced_username="+advancedusername; url+="&content_height="+getContentHeight(); if(!searched) { url+="&not_searched=1"; } xmlhttp.onreadystatechange=searchStateChanged; xmlhttp.open("GET",url,true); xmlhttp.send(null); } function displayTab(resourcefile, implode) { if(currenttab == 'search') { var resourcesplit = resourcefile.split("/"); if(resourcesplit.length >= 3) { var artist = resourcesplit[2]; searchcontainer.artist = artist; } if(resourcesplit.length >= 4) { var song = resourcesplit[3]; searchcontainer.song = song; } if(resourcesplit.length >= 5) { var resource = resourcesplit[4]; } } else if(currenttab == 'jamlist') { for(var i=0; i < jamlistarray.length; i++) { if(jamlistarray[i][0] == currentjamlist) { jamlistarray[i][1] = resourcefile; jamlistarray[i][10] = implode; } } var resourcesplit = resourcefile.split("/"); if(resourcesplit.length >= 3) { var artist = resourcesplit[2]; } if(resourcesplit.length >= 4) { var song = resourcesplit[3]; } if(resourcesplit.length >= 5) { var resource = resourcesplit[4]; } } else { return; } xmlhttp=GetXmlHttpObject(); if (xmlhttp==null) { alert ("Your browser does not support XMLHTTP!"); return; } var url="/browse_file.php?browse_artist="+artist+"&browse_song="+song+"&browse_file="+resource+"&cycling_implode="+implode+"&browse_width="+getBrowseWidth()+"&browse_height="+getBrowseHeight(); xmlhttp.onreadystatechange=fileStateChanged; xmlhttp.open("GET",url,true); xmlhttp.send(null); } function evalLogin() { var username = $('login_username').value; var password = $('login_password').value; xmlhttp=GetXmlHttpObject(); if (xmlhttp==null) { alert ("Browser does not support HTTP Request"); return; } var url="/LoginEval.php?username="+username+"&password="+password; xmlhttp.open("GET",url,false); xmlhttp.send(null); if(xmlhttp.responseText == 'true') { $('invalid_login').fade(); return true; } else if(username != "" && password != "") { new Effect.Morph('window_container', { duration: 0.5, style: 'height: 240px;' }); new Effect.Morph('window', { duration: 0.5, style: 'height: 220px;' }); $('invalid_login').appear(); return false; } else if(xmlhttp.responseText == 'false') { return false; } } function evalJamlistLogin() { var username = $('login_username').value; var password = $('login_password').value; xmlhttp=GetXmlHttpObject(); if (xmlhttp==null) { alert ("Browser does not support HTTP Request"); return; } var url="/LoginEval.php?username="+username+"&password="+password+"&jamlist_eval=1"; xmlhttp.open("GET",url,false); xmlhttp.send(null); if(xmlhttp.responseText == 'true' || xmlhttp.responseText == 'limit') { if(xmlhttp.responseText == 'limit') { $('large_jamlist_name').style.display = 'block'; } new Effect.Morph('window_container', { duration: 0.5, style: 'height: 220px;' }); new Effect.Morph('window', { duration: 0.5, style: 'height: 200px;' }); $('invalid_login').fade(); return true; } else { new Effect.Morph('window_container', { duration: 0.5, style: 'height: 240px;' }); new Effect.Morph('window', { duration: 0.5, style: 'height: 220px;' }); $('invalid_login').appear(); return false; } } function memberLogin() { var username = $('login_username').value; var password = $('login_password').value; if(document.loginform.memberremember.checked) { var remember = 1; } else { var remember = 0; } xmlhttp=GetXmlHttpObject(); if (xmlhttp==null) { alert ("Your browser does not support XMLHTTP!"); return; } var url="/member_links.php?username="+username+"&password="+password+"&remember="+remember; xmlhttp.onreadystatechange=loginStateChanged; xmlhttp.open("GET",url,true); xmlhttp.send(null); xmlhttptwo=GetXmlHttpObject(); if (xmlhttptwo==null) { alert ("Your browser does not support XMLHTTP!"); return; } var url="/jamlist_names.php?username="+username+"&password="+password; xmlhttptwo.onreadystatechange=jamlistsStateChanged; xmlhttptwo.open("GET",url,true); xmlhttptwo.send(null); } function memberLogout() { xmlhttp=GetXmlHttpObject(); if (xmlhttp==null) { alert ("Your browser does not support XMLHTTP!"); return; } var url="/member_links.php?logout=1"; xmlhttp.onreadystatechange=logoutStateChanged; xmlhttp.open("GET",url,true); xmlhttp.send(null); xmlhttptwo=GetXmlHttpObject(); if (xmlhttptwo==null) { alert ("Your browser does not support XMLHTTP!"); return; } var url="/jamlist_names.php?jamlist_logout=1"; xmlhttptwo.onreadystatechange=jamlistsStateChanged; xmlhttptwo.open("GET",url,true); xmlhttptwo.send(null); containerMap.removeJamlists(); if(currenttab != 'home' && currenttab != 'popular' && currenttab != 'recent' && currenttab != 'browse' && currenttab != 'search' && currenttab != 'user_tabs') { newHash(''); } } function jamlistLogin() { var username = $('login_username').value; var password = $('login_password').value; if(document.loginform.memberremember.checked) { var remember = 1; } else { var remember = 0; } xmlhttp=GetXmlHttpObject(); if (xmlhttp==null) { alert ("Your browser does not support XMLHTTP!"); return; } var url="/member_links.php?username="+username+"&password="+password+"&remember="+remember; xmlhttp.onreadystatechange=jamlistLoginStateChanged; xmlhttp.open("GET",url,true); xmlhttp.send(null); xmlhttptwo=GetXmlHttpObject(); if (xmlhttptwo==null) { alert ("Your browser does not support XMLHTTP!"); return; } var url="/jamlist_names.php?username="+username+"&password="+password; xmlhttptwo.onreadystatechange=jamlistsStateChanged; xmlhttptwo.open("GET",url,true); xmlhttptwo.send(null); } function toggleNotifications(refresh) { if($('notifications').style.display != 'none' && typeof refresh === 'undefined') { $('notifications').style.display = 'none'; $('notification_container').innerHTML = '<div id="notifications_loading" style="display: none;"><table cellspacing="0" cellpadding="0" border="0" width="100%" height="100%"><tr valign="top"><td align="center"><div id="notifications_loading_container"><table cellspacing="0" cellpadding="0" border="0" width="100%" height="100%"><tr valign="middle"><td align="center">Loading...</td></tr></table></div></td></tr></table></div>'; } else { jQuery.ajax({ type: 'POST', url: 'notifications.php', beforeSend: function() { $('notifications_loading').style.display = 'block'; $('notifications').style.display = 'block'; }, success: function(data) { $('notifications').innerHTML = data; var notified = $('notification_container').getElementsByTagName('div'); for(var i=0; i < notified.length; i++) { if(notified[i].className == 'notification_item') { notified[i].morph('background: #ffffff'); } } $('notification_count').style.display = 'none'; } }); } } function toggleNotificationInfo(id) { if($('notification_'+id+'_info').style.display != 'none') { $('notification_'+id+'_info').style.display = 'none'; $('notification_'+id+'_detail').style.display = 'block'; } else { $('notification_'+id+'_detail').style.display = 'none'; $('notification_'+id+'_info').style.display = 'block'; } } function submitUserSignUp() { if(document.signupform.termsofuseconfirmation.checked) { $('terms_of_use_error').fade(); setTimeout("$('terms_of_use_error').style.display = 'none'", 850); var username = $('signup_username').value; var password = $('signup_password').value; var confirm = $('signup_confirm').value; var question = $('signup_question').value; var answer = $('signup_answer').value; var email = $('signup_email').value; if(document.signupform.emailconfirmation.checked) { var notification = 1; } else { var notification = 0; } if(username != "" && password != "" && confirm != "" && question != "" && answer != "" && email != "") { xmlhttp=GetXmlHttpObject(); if (xmlhttp==null) { alert ("Your browser does not support XMLHTTP!"); return; } var url="/browse_signup.php?signup_username="+username+"&signup_password="+password+"&signup_confirm="+confirm+"&signup_question="+question+"&signup_answer="+answer+"&signup_email="+email+"&signup_notification="+notification; xmlhttp.open("GET",url,false); xmlhttp.send(null); if(xmlhttp.responseText == "true") { Effect.Fade('signup_refresh', { duration: 0.8 }); Effect.Appear('signup_success', { delay: 0.8, duration: 0.8 }); new Effect.Morph('window_container', { delay: 0.8, duration: 0.5, style: 'height: 190px;' }); new Effect.Morph('window', { delay: 0.8, duration: 0.5, style: 'height: 170px;' }); } else { var usernameerror = false; var passworderror = false; var emailerror = false; var errorcount = 0; var responsesplit = xmlhttp.responseText.split("+"); for(var i=0; i < responsesplit.length; i++) { var errorsplit = responsesplit[i].split("-"); if(errorsplit.length > 1) { var type = errorsplit[0]; var text = errorsplit[1]; if(type == 'username') usernameerror = true; if(type == 'password') passworderror = true; if(type == 'email') emailerror = true; if($('signup_'+type+'_error_one').style.display == 'block') { Effect.Fade('signup_'+type+'_error_one', { duration: 0.8 }); setTimeout("$('signup_'+type+'_error_one').style.display = 'none'", 850); $('signup_'+type+'_error_two').innerHTML = text; Effect.Appear('signup_'+type+'_error_two', { delay: 0.8, duration: 0.8 }); setTimeout("$('signup_'+type+'_error_two').style.display = 'block'", 1700); } else if($('signup_'+type+'_error_two').style.display == 'block') { Effect.Fade('signup_'+type+'_error_two', { duration: 0.8 }); setTimeout("$('signup_'+type+'_error_two').style.display = 'none'", 850); $('signup_'+type+'_error_one').innerHTML = text; Effect.Appear('signup_'+type+'_error_one', { delay: 0.8, duration: 0.8 }); setTimeout("$('signup_'+type+'_error_one').style.display = 'block'", 1700); } else { $('signup_'+type+'_error_one').innerHTML = text; Effect.Appear('signup_'+type+'_error_one', { duration: 0.8 }); setTimeout("$('signup_'+type+'_error_one').style.display = 'block'", 850); } errorcount++; } } if(!usernameerror) { Effect.Fade('signup_username_error_one', { duration: 0.8 }); setTimeout("$('signup_username_error_one').style.display = 'none'", 850); Effect.Fade('signup_username_error_two', { duration: 0.8 }); setTimeout("$('signup_username_error_two').style.display = 'none'", 850); } if(!passworderror) { Effect.Fade('signup_password_error_one', { duration: 0.8 }); setTimeout("$('signup_password_error_one').style.display = 'none'", 850); Effect.Fade('signup_password_error_two', { duration: 0.8 }); setTimeout("$('signup_password_error_two').style.display = 'none'", 850); } if(!emailerror) { Effect.Fade('signup_email_error_one', { duration: 0.8 }); setTimeout("$('signup_email_error_one').style.display = 'none'", 850); Effect.Fade('signup_email_error_two', { duration: 0.8 }); setTimeout("$('signup_email_error_two').style.display = 'none'", 850); } new Effect.Morph('window_container', { duration: 0.5, style: 'height: '+(370 + (25 * errorcount))+'px;' }); new Effect.Morph('window', { duration: 0.5, style: 'height: '+(350 + (25 * errorcount))+'px;' }); } } else { new Effect.Morph('window_container', { duration: 0.5, style: 'height: 370px;' }); new Effect.Morph('window', { duration: 0.5, style: 'height: 350px;' }); } } else { $('terms_of_use_error').appear(); setTimeout("$('terms_of_use_error').style.display = 'block'", 850); new Effect.Morph('window_container', { duration: 0.5, style: 'height: 395px;' }); new Effect.Morph('window', { duration: 0.5, style: 'height: 375px;' }); } } function openSignUpTermsOfUse() { jQuery.ajax({ type: 'POST', url: "/terms_of_use/index.php", data: 'signup_navigation=1', success: function(data) { Effect.Fade('signup_form', { duration: 0.8 }); setTimeout("$('signup_form').style.display = 'none'", 850); $('signup_terms_of_use').innerHTML = data; Effect.Appear('signup_terms_of_use', { delay: 0.8, duration: 0.8 }); setTimeout("$('signup_terms_of_use').style.display = 'block'", 1700); new Effect.Morph('window_container', { duration: 0.5, style: 'top: '+(($('test').offsetHeight - 545) / 2)+'px; width: 660px; height: 545px' }); new Effect.Morph('window', { duration: 0.5, style: 'width: 640px; height: 525px;' }); setTimeout("$('terms_of_use_error').style.display = 'none'", 850); setTimeout("$('signup_username_error_one').style.display = 'none'", 850); setTimeout("$('signup_username_error_two').style.display = 'none'", 850); setTimeout("$('signup_password_error_one').style.display = 'none'", 850); setTimeout("$('signup_password_error_two').style.display = 'none'", 850); setTimeout("$('signup_email_error_one').style.display = 'none'", 850); setTimeout("$('signup_email_error_two').style.display = 'none'", 850); changinghash = true; currenthash = '#!/window/terms_of_use/'; window.location.hash = currenthash; changinghash = false; } }); } function backToUserSignUp() { Effect.Fade('signup_terms_of_use', { duration: 0.8 }); setTimeout("$('signup_terms_of_use').style.display = 'none'", 850); Effect.Appear('signup_form', { delay: 0.8, duration: 0.8 }); setTimeout("$('signup_form').style.display = 'block'", 1700); new Effect.Morph('window_container', { duration: 0.5, style: 'top: '+(($('test').offsetHeight - 470) / 2)+'px; width: 470px; height: 370px' }); new Effect.Morph('window', { duration: 0.5, style: 'width: 450px; height: 350px;' }); changinghash = true; currenthash = '#!/window/sign_up/'; window.location.hash = currenthash; changinghash = false; } function resetPassword() { var username = $('reset_username').value; var email = $('reset_email').value; xmlhttp=GetXmlHttpObject(); if (xmlhttp==null) { alert ("Your browser does not support XMLHTTP!"); return; } var url="/browse_signup.php?reset_username="+username+"&reset_email="+email; xmlhttp.open("GET",url,false); xmlhttp.send(null); if(xmlhttp.responseText == "success") { $('reset_success').appear(); } else if(xmlhttp.responseText == "error") { if($('reset_failed').style.display == 'block') { $('reset_failed').fade(); setTimeout("$('reset_failed').style.display = 'none'", 850); setTimeout("$('reset_error').appear()", 850); setTimeout("$('reset_error').style.display = 'block'", 1700); } else { new Effect.Morph('window_container', { duration: 0.5, style: 'height: 275px;' }); new Effect.Morph('window', { duration: 0.5, style: 'height: 255px;' }); setTimeout("$('reset_error').appear()", 500); setTimeout("$('reset_error').style.display = 'block'", 1350); } } else { if($('reset_error').style.display == 'block') { $('reset_error').fade(); setTimeout("$('reset_error').style.display = 'none'", 850); setTimeout("$('reset_failed').appear()", 850); setTimeout("$('reset_failed').style.display = 'block'", 1700); } else { new Effect.Morph('window_container', { duration: 0.5, style: 'height: 275px;' }); new Effect.Morph('window', { duration: 0.5, style: 'height: 255px;' }); setTimeout("$('reset_failed').appear()", 500); setTimeout("$('reset_failed').style.display = 'block'", 1350); } } } function addJamlist() { var jamlistname = $('new_jamlist_name').value; containerMap.insert('jamlist-'+(jamlistname.split(" ").join("_")), new contentContainer('jamlist_content.php', '-', '-', '', '-', '', '', 'initial', 'initial', '', '', 0, 1)); xmlhttp=GetXmlHttpObject(); if (xmlhttp==null) { alert ("Your browser does not support XMLHTTP!"); return; } var url="/jamlist_names.php?add_jamlist="+jamlistname; xmlhttp.onreadystatechange=addJamlistStateChanged; xmlhttp.open("GET",url,true); xmlhttp.send(null); } function jamlistEval() { var jamlistname = $('new_jamlist_name').value; xmlhttp=GetXmlHttpObject(); if (xmlhttp==null) { alert ("Your browser does not support XMLHTTP!"); return; } var url="/new_jamlist.php?jamlist_eval="+jamlistname; xmlhttp.open("GET",url,false); xmlhttp.send(null); if(jamlistname == "" || jamlistname == "Enter your jamlist name") { displayJamlistError(''); new Effect.Morph('window_container', { duration: 0.5, style: 'height: 220px;' }); new Effect.Morph('window', { duration: 0.5, style: 'height: 200px;' }); return false; } else if(xmlhttp.responseText == "large") { displayJamlistError('large'); new Effect.Morph('window_container', { duration: 0.5, style: 'height: 250px;' }); new Effect.Morph('window', { duration: 0.5, style: 'height: 230px;' }); return false; } else if(xmlhttp.responseText == "duplicate") { displayJamlistError('duplicate'); new Effect.Morph('window_container', { duration: 0.5, style: 'height: 250px;' }); new Effect.Morph('window', { duration: 0.5, style: 'height: 230px;' }); return false; } else if(xmlhttp.responseText == "nonascii") { displayJamlistError('nonascii'); new Effect.Morph('window_container', { duration: 0.5, style: 'height: 250px;' }); new Effect.Morph('window', { duration: 0.5, style: 'height: 230px;' }); return false; } else if(xmlhttp.responseText == "ok") { displayJamlistError(''); return true; } } function openJamlist(jamlistname) { changinghash = true; var hashjamlistname = jamlistname.split(" ").join("_"); currenthash = '#!/jamlist/'+hashjamlistname+'/'; currenttab = 'jamlist'; currentjamlist = jamlistname; if(jamlistarray.length == 0) { jamlistarray[0][0]=jamlistname; jamlistarray[0][1]=''; jamlistarray[0][2]='initial'; jamlistarray[0][3]='results'; jamlistarray[0][4]=''; jamlistarray[0][5]='search'; jamlistarray[0][6]=''; jamlistarray[0][7]='open'; jamlistarray[0][8]=''; jamlistarray[0][9]=''; jamlistarray[0][10]=''; } xmlhttp=GetXmlHttpObject(); if (xmlhttp==null) { alert ("Your browser does not support XMLHTTP!"); return; } var url = "/jamlist_content.php?jamlist_name="+jamlistname+"&content_height="+getContentHeight(); if(!searched) { url+="&not_searched=1"; } for(var i=0; i < jamlistarray.length; i++) { if(jamlistarray[i][0] == jamlistname) { if(jamlistarray[i][1] != '') { var resourcesplit = jamlistarray[i][1].split("/"); if(resourcesplit.length >= 3) { url+="&browse_artist="+resourcesplit[2]; } if(resourcesplit.length >= 4) { url+="&browse_song="+resourcesplit[3]; } if(resourcesplit.length >= 5) { url+="&browse_file="+resourcesplit[4]+"&cycling_implode="+jamlistarray[i][10]+"&browse_width="+getBrowseWidth()+"&browse_height="+getBrowseHeight(); if(jamlistarray[i][7] == 'closed') { url+="&youtube_closed=1"; } } } url+="&sort_column="+jamlistarray[i][8]+"&sort_by="+jamlistarray[i][9]; break; } else if( (i+1) == jamlistarray.length) { jamlistarray[i+1]=new Array(); jamlistarray[i+1][0]=jamlistname; jamlistarray[i+1][1]=''; jamlistarray[i+1][2]='initial'; jamlistarray[i+1][3]='results'; jamlistarray[i+1][4]=''; jamlistarray[i+1][5]='search'; jamlistarray[i+1][6]=''; jamlistarray[i+1][7]='open'; jamlistarray[i+1][8]=''; jamlistarray[i+1][9]=''; jamlistarray[i+1][10]=''; } } xmlhttp.onreadystatechange=openTabStateChanged; xmlhttp.open("GET",url,true); xmlhttp.send(null); } function addToJamlist(jamlistid, resource, droppedid) { xmlhttp=GetXmlHttpObject(); if (xmlhttp==null) { alert ("Your browser does not support XMLHTTP!"); return; } var url = "/jamlist_content.php?add_jamlist="+jamlistid+"&add_resource="+resource+"&content_height="+getContentHeight(); xmlhttp.open("GET",url,false); xmlhttp.send(null); new Effect.Morph(''+droppedid+'', { delay: 0.8, duration: 1.0, style: 'background-color: #ffffff;' }); } function reorderJamlist(resources) { var jamlistid = $('hidden_jamlist_id').className; xmlhttp=GetXmlHttpObject(); if (xmlhttp==null) { alert ("Your browser does not support XMLHTTP!"); return; } var url="/jamlist_content.php"; var params="reorder_jamlistid="+jamlistid+"&reorder_resources="+resources; xmlhttp.open("POST", url, true); xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); xmlhttp.setRequestHeader("Content-length", params.length); xmlhttp.setRequestHeader("Connection", "close"); xmlhttp.send(params); } function deleteFromJamlist(jamlist, resource) { deletedcontent = resource; xmlhttp=GetXmlHttpObject(); if (xmlhttp==null) { alert ("Your browser does not support XMLHTTP!"); return; } var url = "/jamlist_content.php?delete_jamlist="+jamlist+"&delete_resource="+resource+"&content_height="+getContentHeight(); if(!searched) { url+="&not_searched=1"; } xmlhttp.onreadystatechange=deleteContentStateChanged; xmlhttp.open("GET",url,true); xmlhttp.send(null); } function deleteJamlist(jamlist) { xmlhttp=GetXmlHttpObject(); if (xmlhttp==null) { alert ("Your browser does not support XMLHTTP!"); return; } var underscorejamlist = jamlist.split(" ").join("_"); containerMap.removeAt(containerMap.findIt('jamlist-'+underscorejamlist)); for(var i=0; i < $('hidden_jamlist').value; i++) { if($('droppable_'+i).className == underscorejamlist) { Effect.BlindUp('droppable_'+i+''); } } var url = "/jamlist_names.php?delete_jamlist="+jamlist; xmlhttp.onreadystatechange=deletedJamlistContentStateChanged; xmlhttp.open("GET",url,true); xmlhttp.send(null); } function uploadLogin() { var username = $('login_username').value; var password = $('login_password').value; if(document.loginform.memberremember.checked) { var remember = 1; } else { var remember = 0; } xmlhttp=GetXmlHttpObject(); if (xmlhttp==null) { alert ("Your browser does not support XMLHTTP!"); return; } var url="/member_links.php?username="+username+"&password="+password+"&remember="+remember; xmlhttp.onreadystatechange=uploadLoginStateChanged; xmlhttp.open("GET",url,true); xmlhttp.send(null); xmlhttptwo=GetXmlHttpObject(); if (xmlhttptwo==null) { alert ("Your browser does not support XMLHTTP!"); return; } var url="/jamlist_names.php?username="+username+"&password="+password; xmlhttptwo.onreadystatechange=jamlistsStateChanged; xmlhttptwo.open("GET",url,true); xmlhttptwo.send(null); } function checkDBForArtist() { var artist = $('artist_upload').value; if(artist == "" || artist == "Artist") { return; } xmlhttp=GetXmlHttpObject(); if (xmlhttp==null) { alert ("Your browser does not support XMLHTTP!"); return; } var url="/UserUpload.php?check_artist="+artist; xmlhttp.open("GET",url,false); xmlhttp.send(null); if(xmlhttp.responseText == "true") { $('artist_exists').style.display = 'block'; $('artist_doesnt_exist').style.display = 'none'; } else if(xmlhttp.responseText == "false") { $('artist_exists').style.display = 'none'; $('artist_doesnt_exist').style.display = 'block'; } } function checkDBForSong() { var artist = $('artist_upload').value; var song = $('song_upload').value; if(artist == "" || artist == "Artist" || song == "" || song == "Song") { return; } xmlhttp=GetXmlHttpObject(); if (xmlhttp==null) { alert ("Your browser does not support XMLHTTP!"); return; } var url="/UserUpload.php?check_artist="+artist+"&check_song="+song; xmlhttp.open("GET",url,false); xmlhttp.send(null); if(xmlhttp.responseText == "true") { $('song_exists').style.display = 'block'; $('song_doesnt_exist').style.display = 'none'; } else if(xmlhttp.responseText == "false") { $('song_exists').style.display = 'none'; $('song_doesnt_exist').style.display = 'block'; } } function saveTab(overwrite) { var alphaExp = /^[0-9a-zA-Z ]+$/; if($('artist_upload').value == "" || $('song_upload').value == "" || $('tab_upload').value == "") { return; } else if($('artist_upload').value.match(alphaExp) && $('song_upload').value.match(alphaExp)) { new Effect.Morph('window_container', { duration: 0.8, style: 'height: 580px' }); new Effect.Morph('window', { duration: 0.8, style: 'height: 560px;' }); $('artist_song_upload_error').style.display = 'none'; var data = 'artist_save='+$('artist_upload').value+'&song_save='+$('song_upload').value+'&instrument_save='+$('instrument_upload').value+'&tuning_save='+$('tuning_upload').value+'&portion_save='+$('portion_upload').value+'&tab_save='+$('tab_upload').value; if($('tab_save_id').value != "") { data += '&save_id='+$('tab_save_id').value; } if($('tab_video_id').value != "") { data += '&video_save='+$('tab_video_id').value; } if(overwrite != null) { data += '&overwrite_save=1'; } jQuery.ajax({ type: 'POST', url: '/UserUpload.php', data: data, beforeSend: function() { $('save_loading').style.display = 'block'; $('save_status').style.display = 'none'; }, success: function(data) { $('save_loading').style.display = 'none'; if(data == "quota") { Effect.Appear('save_quota_container', { duration: 0.5 }); setTimeout("$('save_quota_container').style.display = 'block'", 550); } else if(data == "duplicate") { Effect.Appear('overwrite_save_container', { duration: 0.5 }); setTimeout("$('overwrite_save_container').style.display = 'block'", 550); } else if(data != "update") { $('saved_tabs_container').style.display = 'none'; var datasplit = data.split("-"); if(datasplit.length > 1) { $('tab_save_id').value = datasplit[0]; } $('saved_tabs').value = "Saved Tabs ("+datasplit[1]+")"; if($('saved_tabs').style.display == 'none') { $('saved_tabs').style.display = 'block'; } $('save_status').style.display = 'block'; } else { $('saved_tabs_container').style.display = 'none'; Effect.Fade('overwrite_save_container', { duration: 0.5 }); setTimeout("$('overwrite_save_container').style.display = 'none'", 550); $('save_status').style.display = 'block'; } } }); } else { new Effect.Morph('window_container', { duration: 0.8, style: 'height: 615px' }); new Effect.Morph('window', { duration: 0.8, style: 'height: 595px;' }); Effect.Appear('artist_song_upload_error', { delay: 0.8, duration: 0.8 }); setTimeout("$('artist_song_upload_error').style.display = 'block'", 850); } } function toggleSavedTabs() { if($('saved_tabs_container').style.display == 'none') { jQuery.ajax({ type: 'POST', url: '/UserUpload.php', data: 'load_saved_tabs=1', beforeSend: function() { $('saved_tabs_loading').style.display = 'block'; }, success: function(data) { $('saved_tabs_loading').style.display = 'none'; $('saved_tabs_container').innerHTML = data; Effect.Appear('saved_tabs_container', { duration: 0.5 }); setTimeout("$('saved_tabs_container').style.display = 'block'", 550); } }); } else { $('saved_tabs_container').style.display = 'none'; } } function loadSavedTab(id) { jQuery.ajax({ type: 'POST', url: '/UserUpload.php', data: 'save_id='+id, beforeSend: function() { $('upload_loading').style.display = 'block'; }, success: function(data) { $('upload_loading').style.display = 'none'; $('window').innerHTML = data; new Effect.Morph('window_container', { delay: 0.8, duration: 0.5, style: 'width: 720px; height: 580px; top: '+(($('test').offsetHeight - 580) / 2)+'px' }); new Effect.Morph('window', { delay: 0.8, duration: 0.5, style: 'width: 700px; height: 560px;' }); } }); } function confirmDeleteSavedTab(id) { $('delete_saved_tab_button').setAttribute("onClick", "deleteSavedTab('"+id+"')"); Effect.Appear('confirm_saved_tab_delete', { duration: 0.5 }); setTimeout(function() { $('confirm_saved_tab_delete').style.display = 'block'; }, 550); } function deleteSavedTab(id) { jQuery.ajax({ type: 'POST', url: '/UserUpload.php', data: 'delete_save_id='+id, beforeSend: function() { $('delete_saved_tab_loading').style.display = 'block'; }, success: function(data) { $('delete_saved_tab_loading').style.display = 'none'; $('saved_tabs').value = "Saved Tabs ("+data+")"; new Effect.BlindUp('saved_tab_'+id+''); Effect.Fade('confirm_saved_tab_delete', { duration: 0.5 }); setTimeout(function() { $('confirm_saved_tab_delete').style.display = 'none'; }, 550); if(data == '0') { setTimeout(function() { $('saved_tabs_list').innerHTML = '- No Saved Tabs -'; }, 600); } if($('tab_save_id').value == id) { $('save_status').style.display = 'none'; uploadAnotherTab(); } } }); } function newTab(newTabConfirm) { if($('tab_upload').value != "" && $('tab_save_id').value == "") { Effect.Appear('new_tab_confirm_container', { duration: 0.5 }); setTimeout("$('new_tab_confirm_container').style.display = 'block'", 550); } else { $('save_status').style.display = 'none'; $('saved_tabs_container').style.display = 'none'; uploadAnotherTab(); Effect.Fade('new_tab_confirm_container', { duration: 0.5 }); setTimeout("$('new_tab_confirm_container').style.display = 'none'", 550); } } function openUsersVideos() { jQuery.ajax({ type: 'POST', url: '/youtube_functionality.php', data: 'youtube_user_videos=1', beforeSend: function() { $('upload_loading').style.display = 'block'; }, success: function(data) { $('upload_loading').style.display = 'none'; $('users_videos_list').innerHTML = data; new Effect.Scroll('youtube_user_video_scroll', { x: 0, y: 0 }); Effect.Appear('users_videos', { duration: 0.5 }); setTimeout(function() { $('users_videos').style.display = 'block'; }, 550); } }); } function openYouTubeVideoPreview(id) { jQuery.ajax({ type: 'POST', url: '/youtube_functionality.php', data: 'youtube_video_preview='+id, beforeSend: function() { $('upload_loading').style.display = 'block'; }, success: function(data) { $('upload_loading').style.display = 'none'; $('youtube_video_preview').innerHTML = data; Effect.Appear('youtube_video_preview_container', { duration: 0.5 }); setTimeout(function() { $('youtube_video_preview_container').style.display = 'block'; }, 550); } }); } function highlistUserVideo(count) { for(var i=0; i < $('user_video_instance_count').value; i++) { if(i != count) { $('user_video_instance_'+i).style.backgroundColor = '#ffffff'; } else { $('user_video_instance_'+i).style.backgroundColor = '#DBEAEA'; } } } function linkYouTubeVideo() { var id = null; var selection = document.usersvideos.videoid; for(var i =0; i < selection.length; i++) { if(selection[i].checked) { id = selection[i].value; break; } } if(id != null) { $('tab_video_id').value = id; $('youtube_user_video_choice').style.display = 'none'; $('youtube_video_successfully_linked').style.display = 'block'; new Effect.Fade('users_videos', { duration: 0.5 }); setTimeout(function() { $('users_videos').style.display = 'none'; }, 550); } } function unlinkUserVideo() { $('tab_video_id').value = ''; new Effect.Fade('youtube_video_successfully_linked', { duration: 0.5 }); setTimeout(function() { $('youtube_video_successfully_linked').style.display = 'none'; }, 550); new Effect.Appear('youtube_user_video_choice', { delay: 0.6, duration: 0.5 }); setTimeout(function() { $('youtube_user_video_choice').style.display = 'block'; }, 1200); } function OpenUserVideoUpload(step) { var data = {}; if(step == null) { data.upload_video = 'start'; } else if(step == '1') { data.upload_video = 'start'; } else if(step == '2') { var tagsok = true; var fieldsok = true; if($('upload_title').value != '' && $('upload_category').value != '') { data.upload_video_title = $('upload_title').value; data.upload_video_description = $('upload_description').value; data.upload_video_category = $('upload_category').value; } else { fieldsok = false; } if($('upload_tags').value != "") { var tagssplit = $('upload_tags').value.split(","); for(var i=0; i < tagssplit.length; i++) { if( ( (i+1) != tagssplit.length ) && tagssplit[i] == "" || tagssplit[i] == " ") { tagsok = false; } else { var tagsplit = tagssplit[i].split(""); if(tagsplit[ (tagsplit.length - 1) ] == " ") { tagsplit.splice( (tagsplit.length - 1), 1); } if(tagsplit[0] == " ") { tagsplit.splice(0, 1); } var tag = tagsplit.join(""); var tagsplit = tag.split(" "); if(tagsplit.length > 1) { tagsok = false; } } } if(tagsok) { data.upload_tags = $('upload_tags').value; } } if(!fieldsok && tagsok) { Effect.Appear('upload_fields_error', { duration: 0.5 }); setTimeout(function() { $('upload_fields_error').style.display = 'block'; }, 550); Effect.Fade('upload_tags_error', { duration: 0.5 }); setTimeout(function() { $('upload_tags_error').style.display = 'none'; }, 550); new Effect.Morph('user_video_upload_container', { duration: 0.5, style: 'height: 480px' }); new Effect.Morph('user_video_upload_content', { duration: 0.5, style: 'height: 460px' }); return; } else if(fieldsok && !tagsok) { Effect.Fade('upload_fields_error', { duration: 0.5 }); setTimeout(function() { $('upload_fields_error').style.display = 'none'; }, 550); Effect.Appear('upload_tags_error', { duration: 0.5 }); setTimeout(function() { $('upload_tags_error').style.display = 'block'; }, 550); new Effect.Morph('user_video_upload_container', { duration: 0.5, style: 'height: 480px' }); new Effect.Morph('user_video_upload_content', { duration: 0.5, style: 'height: 460px' }); return; } else if(!fieldsok && !tagsok) { Effect.Appear('upload_fields_error', { duration: 0.5 }); setTimeout(function() { $('upload_fields_error').style.display = 'block'; }, 550); Effect.Appear('upload_tags_error', { duration: 0.5 }); setTimeout(function() { $('upload_tags_error').style.display = 'block'; }, 550); new Effect.Morph('user_video_upload_container', { duration: 0.5, style: 'height: 505px' }); new Effect.Morph('user_video_upload_content', { duration: 0.5, style: 'height: 485px' }); return; } } if(step == '2') { jQuery.ajax({ type: 'POST', url: "/youtube_functionality.php", data: data, beforeSend: function() { $('upload_loading').style.display = 'block'; }, success: function(data) { $('upload_loading').style.display = 'none'; $('user_video_upload_content').innerHTML = data; new Effect.Morph('user_video_upload_container', { duration: 0.5, style: 'height: 170px;' }); new Effect.Morph('user_video_upload_content', { duration: 0.5, style: 'height: 150px;' }); } }); } else { jQuery.ajax({ type: 'POST', url: "/youtube_functionality.php", data: data, beforeSend: function(data) { $('upload_loading').style.display = 'block'; }, success: function(data) { $('upload_loading').style.display = 'none'; $('user_video_upload_content').innerHTML = data; if(step == null) { $('user_video_upload_container').style.height = '455px'; $('user_video_upload_content').style.height = '435px'; Effect.Appear('user_video_upload', { duration: 0.5 }); setTimeout("$('user_video_upload').style.display = 'block'", 550); } else if(step == '1') { new Effect.Morph('user_video_upload_container', { duration: 0.5, style: 'height: 455px;' }); new Effect.Morph('user_video_upload_content', { duration: 0.5, style: 'height: 435px;' }); } } }); } } function stopVideoUpload(href) { $('upload_loading').style.display = 'none'; var hrefsplit = href.split("?"); if(hrefsplit.length > 1) { var variablesplit = hrefsplit[1].split("&"); var status = ''; var id = ''; var error = ''; for(var i=0; i < variablesplit.length; i++) { var tempsplit = variablesplit[i].split("="); if(tempsplit.length > 1 && tempsplit[0] == "status") { status = tempsplit[1]; } else if(tempsplit.length > 1 && tempsplit[0] == "id") { id = tempsplit[1]; } else if(tempsplit.length > 1 && tempsplit[0] == "error") { error = tempsplit[1]; } } if(id != '') { $('tab_video_id').value = id; $('youtube_user_video_choice').style.display = 'none'; $('youtube_video_successfully_linked').style.display = 'block'; new Effect.Fade('users_videos', { duration: 0.5 }); setTimeout(function() { $('users_videos').style.display = 'none'; }, 550); $('video_upload_step_2').style.display = 'none'; $('upload_finished').style.display = 'block'; $('upload_finished_status').innerHTML = "Your YouTube video has been successfully uploaded and linked to your tab!"; } else { $('video_upload_step_2').style.display = 'none'; $('upload_finished').style.display = 'block'; $('upload_finished_status').innerHTML = "There was an error uploading your video. Please try again later"; } } } function evalTab() { var error = false; var artist = $('artist_upload').value; var song = $('song_upload').value; var tab = $('tab_upload').value; if(artist == "" || song == "" || tab == "") { return false; } xmlhttp=GetXmlHttpObject(); if (xmlhttp==null) { alert ("Your browser does not support XMLHTTP!"); return; } var url="/UserUpload.php"; var params = "eval_artist="+artist+"&eval_song="+song; xmlhttp.open("POST", url, false); xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); xmlhttp.setRequestHeader("Content-length", params.length); xmlhttp.setRequestHeader("Connection", "close"); xmlhttp.send(params); if(xmlhttp.responseText == "true") { uploadTab(); } else { new Effect.Morph('window_container', { duration: 0.8, style: 'height: 610px' }); new Effect.Morph('window', { duration: 0.8, style: 'height: 590px;' }); Effect.Appear('artist_song_upload_error', { delay: 0.8, duration: 0.8 }); } } function uploadTab() { var artist = $('artist_upload').value; var song = $('song_upload').value; var instrument = $('instrument_upload').value; if($('custom_tuning').style.display == 'none') { var tuning = $('tuning_upload').value; } else { var tuning = $('string_six').value+"-"+$('string_five').value+"-"+$('string_four').value+"-"+$('string_three').value+"-"+$('string_two').value+"-"+$('string_one').value; } var portion = $('portion_upload').value; var tab = $('tab_upload').value; tab = tab.split("&").join("%26"); xmlhttptwo=GetXmlHttpObject(); if (xmlhttptwo==null) { alert ("Your browser does not support XMLHTTP!"); return; } var url="/UserUpload.php"; var params = "artist_upload="+artist+"&song_upload="+song+"&instrument_upload="+instrument+"&tuning_upload="+tuning+"&portion_upload="+portion+"&tab_upload="+tab; if($('tab_video_id').value != "") { params += "&video_upload="+$('tab_video_id').value; } if($('tab_save_id').value != "") { params += "&delete_save_id="+$('tab_save_id').value; } xmlhttptwo.onreadystatechange=tabUploadStateChanged; xmlhttptwo.open("POST", url, true); xmlhttptwo.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); xmlhttptwo.setRequestHeader("Content-length", params.length); xmlhttptwo.setRequestHeader("Connection", "close"); xmlhttptwo.send(params); } function searchYouTube() { var hashsplit = window.location.hash.split("/"); var hash = ''; if(hashsplit.length > 5 && hashsplit[1] == "jamlist") { hash = hashsplit[0]+'/'+hashsplit[1]+'/'+hashsplit[2]+'/'+hashsplit[3]+'/'+hashsplit[4]+'/'+hashsplit[5]+'/results/'+$('youtube_input').value+'/'; } else if(hashsplit.length > 0 && hashsplit[1] == "search" && hashsplit[2] == "advanced") { } else if(hashsplit.length > 4) { hash = hashsplit[0]+'/'+hashsplit[1]+'/'+hashsplit[2]+'/'+hashsplit[3]+'/'+hashsplit[4]+'/results/'+$('youtube_input').value+'/'; } newHash(hash); } function loadYouTube(tempcontainer) { var hash = ''; var hashsplit = window.location.hash.split("/"); if(hashsplit.length > 5 && (hashsplit[1] == "jamlist" || hashsplit[1] == "user_tabs")) { for(var i=0; i < 6; i++) { hash += hashsplit[i]+'/'; } } else if(hashsplit.length > 11 && hashsplit[1] == "search" && hashsplit[2] == "advanced") { for(var i=0; i < 12; i++) { hash += hashsplit[i]+'/'; } } else if(hashsplit.length > 4) { for(var i=0; i < 5; i++) { hash += hashsplit[i]+'/'; } } var data = {}; data.current_hash = hash; data.ytsearch = tempcontainer.ytsearch; data.ytvideoid = tempcontainer.ytvideoid; if(tempcontainer.ytstate == 'initial') { var artist = tempcontainer.artist.split("_").join(" "); var song = tempcontainer.song.split("_").join(" "); data.youtube_state = 'results'; data.youtube_key = artist+' '+song+' Guitar Instruction'; if($('current_youtube_resource')) { data.youtube_resource = $('current_youtube_resource').className; } } else if(tempcontainer.ytstate == 'search') { data.youtube_state = 'search'; } else if(tempcontainer.ytstate == 'results') { data.youtube_state = 'results'; data.youtube_key = tempcontainer.ytsearch; } else if(tempcontainer.ytstate == 'video') { data.youtube_state = 'video'; data.youtube_key = tempcontainer.ytvideoid; } if(data != '') { jQuery.ajax({ type: 'POST', url: 'youtube_functionality.php', data: data, beforeSend: function() { if(tempcontainer.previousytstate == 'closed') { $('expand_youtube_loading').style.display = 'block'; } else { $('delayed_youtube_loading').style.display = 'block'; } }, success: function(data) { if(tempcontainer.previousytstate == 'closed') { $('expand_youtube_loading').style.display = 'none'; } else { $('delayed_youtube_loading').style.display = 'none'; } if($('tab_rating_container').style.top != '0px') { new Effect.Morph('tab_rating_container', { duration: 0.5, style: 'top: 0px;' }); $('collapsed_youtube_navigation').innerHTML = ''; $('collapsed_youtube_navigation').style.display = 'none'; } $('youtube_container').innerHTML = data; if(tempcontainer.ytstate == 'search') { new Effect.Morph('youtube_container', { duration: 0.5, style: 'height: 70px;' }); new Effect.Morph('tab_contents', { duration: 0.5, style: 'top: 85px; height: '+(getBrowseHeight()-95)+'px;' }); new Effect.Morph('tab_overflow', { duration: 0.5, style: 'height: '+(getBrowseHeight()-160)+'px;' }); new Effect.Morph('left_arrow_container', { duration: 0.5, style: 'top: 142px; height: '+(getBrowseHeight()-167)+'px;' }); new Effect.Morph('right_arrow_container', { duration: 0.5, style: 'top: 142px; height: '+(getBrowseHeight()-167)+'px;' }); } else if(tempcontainer.ytstate == 'initial' || tempcontainer.ytstate == 'results') { new Effect.Morph('youtube_container', { duration: 0.5, style: 'height: 168px;' }); new Effect.Morph('tab_contents', { duration: 0.5, style: 'top: 193px; height: '+(getBrowseHeight()-193)+'px;' }); new Effect.Morph('tab_overflow', { duration: 0.5, style: 'height: '+(getBrowseHeight()-268)+'px;' }); new Effect.Morph('left_arrow_container', { duration: 0.5, style: 'top: 250px; height: '+(getBrowseHeight()-275)+'px;' }); new Effect.Morph('right_arrow_container', { duration: 0.5, style: 'top: 250px; height: '+(getBrowseHeight()-275)+'px;' }); } else if(tempcontainer.ytstate == 'video') { var params = { allowScriptAccess: "always", wmode: "transparent" }; var atts = { id: "myytplayer" }; swfobject.embedSWF("http://www.youtube.com/e/"+tempcontainer.ytvideoid+"?enablejsapi=1&playerapiid=ytplayer", "ytapiplayer", "400", "270", "8", null, null, params, atts); new Effect.Morph('youtube_container', { duration: 0.5, style: 'height: 300px;' }); new Effect.Morph('tab_contents', { duration: 0.5, style: 'top: 325px; height: '+(getBrowseHeight()-302)+'px;' }); new Effect.Morph('tab_overflow', { duration: 0.5, style: 'height: '+(getBrowseHeight()-400)+'px;' }); new Effect.Morph('left_arrow_container', { duration: 0.5, style: 'top: 380px; height: '+(getBrowseHeight()-405)+'px;' }); new Effect.Morph('right_arrow_container', { duration: 0.5, style: 'top: 380px; height: '+(getBrowseHeight()-405)+'px;' }); } if(currenttab != 'user_tabs') { $(currenttab+'_link').style.backgroundColor = '#CEE3F6'; $(currenttab+'_link').setAttribute("onmouseout", "this.style.backgroundColor = '#CEE3F6'"); } } }); } } function onYouTubePlayerReady(playerId) { ytplayer = $("myytplayer"); var tempcontainer = containerMap.retrieve(currenttab); ytplayer.seekTo(tempcontainer.ytvideotime); switch(tempcontainer.ytvideostate) { case 1: ytplayer.playVideo(); break; default: ytplayer.pauseVideo(); break; } } function rateTab(rating, resourceid) { xmlhttp=GetXmlHttpObject(); if (xmlhttp==null) { alert ("Your browser does not support XMLHTTP!"); return; } var url = "/browse_rating.php?rating="+rating+"&resource="+resourceid; xmlhttp.onreadystatechange=ratingStateChanged; xmlhttp.open("GET",url,true); xmlhttp.send(null); } function sortResults(sortcolumn, orderby) { var tempcontainer = containerMap.retrieve(currenttab); tempcontainer.sortcolumn = sortcolumn; tempcontainer.orderby = orderby; var url = tempcontainer.url; var data = {}; if(currenttab == "browse") { data.browse_artist = tempcontainer.artist; data.browse_song = tempcontainer.song; data.content_height = getContentHeight(); if(sortcolumn != '' && orderby != '') { data.sort_column = tempcontainer.sortcolumn; data.sort_by = tempcontainer.orderby; data.browse_navigation = '1'; } if(tempcontainer.filter != "-") { data.browse_input = tempcontainer.filter; } } else if(currenttab == "search") { if(searchstate == "regular") { data .browse_search = pastsearch; data.sort_column = tempcontainer.sortcolumn; data.sort_by = tempcontainer.orderby; data.content_height = getContentHeight(); } else if(searchstate == "advanced") { data.advanced_artist = advancedartist; data.advanced_song = advancedsong; data.advanced_tuning = advancedtuning; data.advanced_portion = advancedportion; data.advanced_rating = advancedrating; data.advanced_username = advancedusername; data.browse_input = tempcontainer.filter; data.sort_column = tempcontainer.sortcolumn; data.sort_by = tempcontainer.orderby; data.content_height = getContentHeight(); } if(tempcontainer.filter != "-") { data.browse_input = tempcontainer.filter; } } else if(currenttab == "user_tabs") { data.member = usertabs; data.sort_column = tempcontainer.sortcolumn; data.sort_by = tempcontainer.orderby; data.content_height = getContentHeight(); if(tempcontainer.filter != "-") { data.browse_input = tempcontainer.filter; } } else { data.sort_column = tempcontainer.sortcolumn; data.sort_by = tempcontainer.orderby; data.content_height = getContentHeight(); if(tempcontainer.filter != "-") { data.browse_input = tempcontainer.filter; } } if(!searched) { data.not_searched = '1'; } jQuery.ajax({ type: 'GET', url: url, data: data, beforeSend: function() { $('browse_loading').style.display = 'block'; ajaxloading = true; $('ajax_loading').style.display = 'block'; }, success: function(data) { if(currenttab == 'browse') { if(sortcolumn == "artist") { $('content_height_1').innerHTML = data; if(tempcontainer.artist != '-') { Position.prepare(); var artistcontainer = Position.cumulativeOffset($('content_height_1'))[1]; var artistelement = Position.cumulativeOffset($(''+tempcontainer.artist+'_artist'))[1]; new Effect.Scroll('content_height_1', { x: 0, y: (artistelement - artistcontainer) }); browseartistcolor = $(''+tempcontainer.artist+'_artist').className; $(''+tempcontainer.artist+'_artist').setAttribute("onmouseout", "this.style.backgroundColor = '#56A5EC'"); setTimeout("new Effect.Morph(''+tempcontainer.artist+'_artist', { style: 'background: #56A5EC;' })", 850); } if(orderby == "ASC") { $('artist_sort_asc').style.display = 'block'; $('artist_sort_desc').style.display = 'none'; $('artist_sort_click').style.backgroundImage = "url(/images/CellOut3.JPG)"; $('artist_sort_click').setAttribute("onmouseover", "this.style.backgroundImage = 'url(/images/CellOn3.JPG)'"); $('artist_sort_click').setAttribute("onmouseout", "this.style.backgroundImage = 'url(/images/CellOut3.JPG)'"); $('artist_sort_click').setAttribute("onclick", "sortResults('artist', 'DESC')"); } else if(orderby == "DESC") { $('artist_sort_asc').style.display = 'none'; $('artist_sort_desc').style.display = 'block'; $('artist_sort_click').style.backgroundImage = "url(/images/CellOut3.JPG)"; $('artist_sort_click').setAttribute("onmouseover", "this.style.backgroundImage = 'url(/images/CellOn3.JPG)'"); $('artist_sort_click').setAttribute("onmouseout", "this.style.backgroundImage = 'url(/images/CellOut3.JPG)'"); $('artist_sort_click').setAttribute("onclick", "sortResults('artist', 'ASC')"); } $('song_sort_asc').style.display = 'none'; $('song_sort_desc').style.display = 'none'; $('song_sort_click').style.backgroundImage = "url(/images/CellOn3.JPG)"; $('song_sort_click').setAttribute("onmouseover", "this.style.backgroundImage = 'url(/images/CellOut3.JPG)'"); $('song_sort_click').setAttribute("onmouseout", "this.style.backgroundImage = 'url(/images/CellOn3.JPG)'"); $('song_sort_click').setAttribute("onclick", "sortResults('song', 'DESC')"); $('reset_sort').style.display = 'block'; } else if(sortcolumn == "song") { $('content_height_2').innerHTML = data; if(tempcontainer.song != '-') { Position.prepare(); var songcontainer = Position.cumulativeOffset($('content_height_2'))[1]; var songelement = Position.cumulativeOffset($(''+tempcontainer.song+'_song'))[1]; new Effect.Scroll('content_height_2', { x: 0, y: (songelement - songcontainer) }); browsesongcolor = $(''+tempcontainer.song+'_song').className; $(''+tempcontainer.song+'_song').setAttribute("onmouseout", "this.style.backgroundColor = '#56A5EC'"); setTimeout("new Effect.Morph(''+tempcontainer.song+'_song', { style: 'background: #56A5EC;' })", 850); } if(orderby == "ASC") { $('song_sort_asc').style.display = 'block'; $('song_sort_desc').style.display = 'none'; $('song_sort_click').style.backgroundImage = "url(/images/CellOut3.JPG)"; $('song_sort_click').setAttribute("onmouseover", "this.style.backgroundImage = 'url(/images/CellOn3.JPG)'"); $('song_sort_click').setAttribute("onmouseout", "this.style.backgroundImage = 'url(/images/CellOut3.JPG)'"); $('song_sort_click').setAttribute("onclick", "sortResults('song', 'DESC')"); } else if(orderby == "DESC") { $('song_sort_asc').style.display = 'none'; $('song_sort_desc').style.display = 'block'; $('song_sort_click').style.backgroundImage = "url(/images/CellOut3.JPG)"; $('song_sort_click').setAttribute("onmouseover", "this.style.backgroundImage = 'url(/images/CellOn3.JPG)'"); $('song_sort_click').setAttribute("onmouseout", "this.style.backgroundImage = 'url(/images/CellOut3.JPG)'"); $('song_sort_click').setAttribute("onclick", "sortResults('song', 'ASC')"); } $('artist_sort_asc').style.display = 'none'; $('artist_sort_desc').style.display = 'none'; $('artist_sort_click').style.backgroundImage = "url(/images/CellOn3.JPG)"; $('artist_sort_click').setAttribute("onmouseover", "this.style.backgroundImage = 'url(/images/CellOut3.JPG)'"); $('artist_sort_click').setAttribute("onmouseout", "this.style.backgroundImage = 'url(/images/CellOn3.JPG)'"); $('artist_sort_click').setAttribute("onclick", "sortResults('artist', 'DESC')"); $('reset_sort').style.display = 'block'; } else { $('browse').innerHTML = data; if(tempcontainer.artist != '-' && tempcontainer.song == '-') { Position.prepare(); var artistcontainer = Position.cumulativeOffset($('content_height_1'))[1]; var artistelement = Position.cumulativeOffset($(''+tempcontainer.artist+'_artist'))[1]; new Effect.Scroll('content_height_1', { x: 0, y: (artistelement - artistcontainer) }); browseartistcolor = $(''+tempcontainer.artist+'_artist').className; $(''+tempcontainer.artist+'_artist').setAttribute("onmouseout", "this.style.backgroundColor = '#56A5EC'"); setTimeout(function() { new Effect.Morph(''+tempcontainer.artist+'_artist', { style: 'background: #56A5EC;' }); }, 850); } else if(tempcontainer.artist != '-' && tempcontainer.song != '-') { Position.prepare(); var artistcontainer = Position.cumulativeOffset($('content_height_1'))[1]; var artistelement = Position.cumulativeOffset($(''+tempcontainer.artist+'_artist'))[1]; new Effect.Scroll('content_height_1', { x: 0, y: (artistelement - artistcontainer) }); browseartistcolor = $(''+tempcontainer.artist+'_artist').className; $(''+tempcontainer.artist+'_artist').setAttribute("onmouseout", "this.style.backgroundColor = '#56A5EC'"); setTimeout(function() { new Effect.Morph(''+tempcontainer.artist+'_artist', { style: 'background: #56A5EC;' }); }, 850); var songcontainer = Position.cumulativeOffset($('content_height_2'))[1]; var songelement = Position.cumulativeOffset($(''+tempcontainer.song+'_song'))[1]; new Effect.Scroll('content_height_2', { x: 0, y: (songelement - songcontainer) }); browsesongcolor = $(''+tempcontainer.song+'_song').className; $(''+tempcontainer.song+'_song').setAttribute("onmouseout", "this.style.backgroundColor = '#56A5EC'"); setTimeout(function() { new Effect.Morph(''+tempcontainer.song+'_song', { style: 'background: #56A5EC;' }); }, 850); } } } else { $('browse').innerHTML = data; addscript(); } $('browse_loading').style.display = 'none'; ajaxloading = false; $('ajax_loading').style.display = 'none'; } }); } function cycleTab(direction, index, implode) { if(!cyclingactive) { cyclingactive = true; var tempcontainer = containerMap.retrieve(currenttab); var pastcycle = 0; var currentcycle = index; cyclingarray = implode.split(","); if(direction == 'left') { if(currentcycle == 0) { cyclingactive = false; return; } pastcycle = currentcycle; currentcycle--; } else if(direction == 'right') { if((currentcycle+1) == cyclingarray.length) { cyclingactive = false; return; } pastcycle = currentcycle; currentcycle++; } $('left_cycling_arrow').setAttribute("onClick", "cycleTab('left', '"+currentcycle+"', '"+implode+"')"); $('right_cycling_arrow').setAttribute("onClick", "cycleTab('right', '"+currentcycle+"', '"+implode+"')"); jQuery.ajax({ type: 'GET', url: "/browse_file.php", data: "cycle_tab="+cyclingarray[currentcycle]+"&youtube_state=results&browse_width="+getBrowseWidth()+"&browse_height="+getBrowseHeight(), beforeSend: function(data) { $('browse_loading').style.display = 'block'; ajaxloading = true; $('ajax_loading').style.display = 'block'; }, success: function(data) { var tempdata = data; jQuery.ajax({ type: 'GET', url: "/browse_file.php", data: "change_arrows="+cyclingarray[currentcycle-1]+"-"+cyclingarray[currentcycle+1], success: function(data) { var changearray = data.split("-"); var leftchange = changearray[0]; var rightchange = changearray[1]; if(leftchange == '0') { $('left_cycling_arrow').title = 'No More Tabs This Way'; } else { $('left_cycling_arrow').title = leftchange; } if(rightchange == '0') { $('right_cycling_arrow').title = 'No More Tabs This Way'; } else { $('right_cycling_arrow').title = rightchange; } $('cycle_container_'+currentcycle).innerHTML = tempdata; if(direction == 'left') { $('current_cycling_index').className = currentcycle; new Effect.Move('tab_cycle', { x: ($('tab_cycle').offsetLeft + (getBrowseWidth()-20)), y: 0, mode: 'absolute' }); } else if(direction == 'right') { $('current_cycling_index').className = currentcycle; new Effect.Move('tab_cycle', { x: ($('tab_cycle').offsetLeft - (getBrowseWidth()-20)), y: 0, mode: 'absolute' }); } setTimeout(function() { $('cycle_container_'+pastcycle).innerHTML = ''; var newhash = $('new_cycle_hash').className; var newhashsplit = newhash.split("/"); var hashsplit = window.location.hash.split("/"); changinghash = true; if(hashsplit.length > 2 && (hashsplit[1] == "jamlist" || hashsplit[1] == "user_tabs")) { currenthash = '#!/jamlist/'+hashsplit[2]+'/'+newhash; } else if(hashsplit.length > 2 && hashsplit[1] == "search" && hashsplit[2] == "advanced") { currenthash = '#!/search/advanced/'+advancedartist+'/'+advancedsong+'/'+advancedtuning+'/'+advancedportion+'/'+advancedrating+'/'+advancedusername+'/'+newhash; } else if(hashsplit.length > 4) { currenthash = '#!/'+currenttab+'/'+newhash; } window.location.hash=currenthash; changinghash = false; tempcontainer.artist = newhashsplit[0]; tempcontainer.song = newhashsplit[1]; tempcontainer.file = newhashsplit[2]; tempcontainer.ytstate='initial'; tempcontainer.previousytstate='initial'; tempcontainer.ytsearch=''; tempcontainer.ytvideoid=''; tempcontainer.ytvideotime=0; tempcontainer.ytvideostate=1; changeTitle(); if($(currenttab+'_navigation')) { $(currenttab+'_navigation').setAttribute("onClick", "newHash('"+currenthash+"')"); } loadYouTube(tempcontainer); if(trackAnalytics()) { _gaq.push(['_trackPageview', '/'+currenthash]); } $('browse_loading').style.display = 'none'; ajaxloading = false; $('ajax_loading').style.display = 'none'; cyclingactive = false; }, 850); } }); } }); } } function setCycleTabArrows(implode) { var cyclingarray = implode.split(","); } function storeSession() { xmlhttp=GetXmlHttpObject(); if (xmlhttp==null) { alert ("Your browser does not support XMLHTTP!"); return; } var tempbrowseartistcolor = ''; if(browseartistcolor != '') { var browseartistcolorsplit = browseartistcolor.split("#"); tempbrowseartistcolor = browseartistcolorsplit[1]; } var tempbrowsesongcolor = ''; if(browsesongcolor != '') { var browsesongcolorsplit = browsesongcolor.split("#"); tempbrowsesongcolor = browsesongcolorsplit[1]; } var url = "/stored_session.php?session_type=store&currenttab="+currenttab+ "&browseartist="+browsecontainer.artist+ "&browsesong="+browsecontainer.song+ "&browsecontainer.file="+browsecontainer.file+ "&browseartistcolor="+tempbrowseartistcolor+ "&browsesongcolor="+tempbrowsesongcolor+ "&decided="+decided+ "&searched="+searched+ "&paststate="+pastsearch+ "&searchstate="+searchstate+ "&advancedartist="+advancedartist+ "&advancedsong="+advancedsong+ "&advancedtuning="+advancedtuning+ "&advancedportion="+advancedportion+ "&advancedrating="+advancedportion+ "&advancedusername="+advancedusername+ "&popularsearch="+popularsearch+ "&recentsearch="+recentsearch+ "&browsesearch="+browsesearch+ "&searchsearch="+searchsearch+ "&jamlistsearch="+jamlistsearch+ "&popularartist="+popularcontainer.artist+ "&popularsong="+popularcontainer.song+ "&popularcontainer.file="+popularcontainer.file+ "&recentartist="+recentcontainer.artist+ "&recentsong="+recentcontainer.song+ "&recentcontainer.file="+recentcontainer.file+ "&searchartist="+searchcontainer.artist+ "&searchsong="+searchcontainer.song+ "&popularsortcolumn="+popularsortcolumn+ "&popularsortby="+popularsortby+ "&recentsortcolumn="+recentsortcolumn+ "&recentsortby="+recentsortby+ "&browsesortcolumn="+browsesortcolumn+ "&browsesortby="+browsesortby+ "&searchsortcolumn="+searchsortcolumn+ "&searchsortby="+searchsortby; xmlhttp.open("GET",url,false); xmlhttp.send(null); } function restoreSession() { xmlhttptwo=GetXmlHttpObject(); if (xmlhttptwo==null) { alert ("Your browser does not support XMLHTTP!"); return; } var url = "/stored_session.php?session_type=restore"; xmlhttptwo.onreadystatechange=restoreSessionTabStateChanged; xmlhttptwo.open("GET",url,true); xmlhttptwo.send(null); } function cancelRestoreSession() { $('restore_session').fade(); } function autoCompleteLink(artist, song) { if(disablebrowsing) { return; } changinghash = true; if(song != '-') { currenthash = '#!/browse/'+artist+'/'+song+'/'; } else { currenthash = '#!/browse/'+artist+'/'; } currenttab = 'browse'; var tempcontainer = containerMap.retrieve('browse'); tempcontainer.filter = ''; tempcontainer.file = ''; xmlhttp=GetXmlHttpObject(); if (xmlhttp==null) { alert ("Your browser does not support XMLHTTP!"); return; } var url="/browse_all.php?browse_input="+tempcontainer.filter+"&content_height="+getContentHeight(); if(!searched) { url+="&not_searched=1"; } tempcontainer.artist = artist; url+="&browse_artist="+artist; tempcontainer.song = song; url+="&browse_song="+song; xmlhttp.onreadystatechange=autoCompleteLinkStateChanged; xmlhttp.open("GET",url,true); xmlhttp.send(null); } function submitUserContact() { var email = $('contact_email').value; var subject = $('contact_subject').value; var message = $('contact_message').value; if(email != "" && message != "") { jQuery.ajax({ type: 'POST', url: "/contact_us/", data: { contact_email: email, contact_subject: subject, contact_message: message, recaptcha_challenge_field: Recaptcha.get_challenge(), recaptcha_response_field: Recaptcha.get_response() }, success: function(data) { if(data == "true") { Effect.Fade('contact_form', { duration: 0.8 }); Effect.Appear('contact_success', { delay: 0.8, duration: 0.8 }); new Effect.Morph('window_container', { delay: 0.8, duration: 0.5, style: 'width: 370px; height: 190px; top: '+(($('test').offsetHeight - 190) / 2)+'px' }); new Effect.Morph('window', { delay: 0.8, duration: 0.5, style: 'width: 350px; height: 170px;' }); return; } else { var contacterror = false; if($('contact_email_error').style.display == 'block' || $('contact_code_error').style.display == 'block' || $('contact_interval_error').style.display == 'block') { contacterror = true; } if(data == 'email' && contacterror) { $('contact_code_error').fade(); setTimeout("$('contact_code_error').style.display = 'none'", 850); $('contact_interval_error').fade(); setTimeout("$('contact_interval_error').style.display = 'none'", 850); Effect.Appear('contact_email_error', { delay: 0.9, duration: 0.8 }); setTimeout("$('contact_email_error').style.display = 'block'", 1750); } else if(data == 'email' && !contacterror) { $('contact_email_error').appear(); setTimeout("$('contact_email_error').style.display = 'block'", 850); } else if(data == 'interval' && contacterror) { $('contact_email_error').fade(); setTimeout("$('contact_email_error').style.display = 'none'", 850); $('contact_code_error').fade(); setTimeout("$('contact_code_error').style.display = 'none'", 850); Effect.Appear('contact_interval_error', { delay: 0.9, duration: 0.8 }); setTimeout("$('contact_interval_error').style.display = 'block'", 1750); } else if(data == 'interval' && !contacterror) { $('contact_interval_error').appear(); setTimeout("$('contact_interval_error').style.display = 'block'", 850); } else if(data == 'code' && contacterror) { $('contact_email_error').fade(); setTimeout("$('contact_email_error').style.display = 'none'", 850); $('contact_interval_error').fade(); setTimeout("$('contact_interval_error').style.display = 'none'", 850); Effect.Appear('contact_code_error', { delay: 0.9, duration: 0.8 }); setTimeout("$('contact_code_error').style.display = 'block'", 1750); } else if(data == 'code' && !contacterror) { $('contact_code_error').appear(); setTimeout("$('contact_code_error').style.display = 'block'", 850); } new Effect.Morph('window_container', { duration: 0.5, style: 'height: 550px;' }); new Effect.Morph('window', { duration: 0.5, style: 'height: 530px;' }); Recaptcha.reload(); } } }); } } function editProfile(type) { jQuery.ajax({ type: 'POST', url: "/browse_profile.php", data: "edit_profile_type="+type, beforeSend: function() { $('profile_loading').style.display = 'block'; }, success: function(data) { $('profile_loading').style.display = 'none'; $('edit_profile').innerHTML = data; Effect.Fade('profile_content', { duration: 0.8 }); setTimeout("$('profile_content').style.display = 'none'", 850); Effect.Appear('edit_profile', { delay: 0.8, duration: 0.8 }); setTimeout("$('edit_profile').style.display = 'block'", 1700); if(type == "Email" || type == "Notification" || type == "YouTube") { new Effect.Morph('window_container', { delay: 0.8, duration: 0.5, style: 'height: 160px;' }); new Effect.Morph('window', { delay: 0.8, duration: 0.5, style: 'height: 140px;' }); } else if(type == "Password") { new Effect.Morph('window_container', { delay: 0.8, duration: 0.5, style: 'height: 225px;' }); new Effect.Morph('window', { delay: 0.8, duration: 0.5, style: 'height: 205px;' }); } else if(type == "Question") { new Effect.Morph('window_container', { delay: 0.8, duration: 0.5, style: 'height: 190px;' }); new Effect.Morph('window', { delay: 0.8, duration: 0.5, style: 'height: 170px;' }); } } }); } function backToProfile(unlink) { var data = 'back_to_profile=1'; if(unlink != null) { data += '&unlink_youtube=1'; } jQuery.ajax({ type: 'POST', url: "/browse_profile.php", data: data, beforeSend: function() { $('profile_loading').style.display = 'block'; }, success: function(data) { $('profile_loading').style.display = 'none'; $('profile_content').innerHTML = data; Effect.Fade('edit_profile', { duration: 0.8 }); setTimeout("$('edit_profile').style.display = 'none'", 850); Effect.Appear('profile_content', { delay: 0.8, duration: 0.8 }); setTimeout("$('profile_content').style.display = 'block'", 1700); new Effect.Morph('window_container', { delay: 0.8, duration: 0.5, style: 'height: 435px;' }); new Effect.Morph('window', { delay: 0.8, duration: 0.5, style: 'height: 415px;' }); } }); } function saveProfile(type) { var data = {}; if(type == "Email") { if($('edit_profile_email').value != "") { data.edit_profile_email = $('edit_profile_email').value; } else { return; } } else if(type == "Password") { if($('edit_profile_old_password').value != "" && $('edit_profile_new_password').value != "" && $('edit_profile_confirm_password').value != "") { data.edit_profile_old_password = $('edit_profile_old_password').value; data.edit_profile_new_password = $('edit_profile_new_password').value; data.edit_profile_confirm_password = $('edit_profile_confirm_password').value; } else { return; } } else if(type == "Question") { if($('edit_profile_answer').value != "") { data.edit_profile_question = $('edit_profile_question').value; data.edit_profile_answer = $('edit_profile_answer').value; } else { return; } } else if(type == "Notification") { if(document.profileform.notificationcheckbox.checked) { data.edit_profile_notification = '1'; } else { data.edit_profile_notification = '0'; } } jQuery.ajax({ type: 'POST', url: "/browse_profile.php", data: data, beforeSend: function() { $('profile_loading').style.display = 'block'; }, success: function(data) { $('profile_loading').style.display = 'none'; if(data != "true") { $('edit_profile_error_content').innerHTML = data; $('edit_profile_error').appear(); setTimeout("$('edit_profile_error').style.display = 'block'", 850); if(type == "Email") { new Effect.Morph('window_container', { duration: 0.5, style: 'height: 185px;' }); new Effect.Morph('window', { duration: 0.5, style: 'height: 165px;' }); } else if(type == "Password") { new Effect.Morph('window_container', { duration: 0.5, style: 'height: 250px;' }); new Effect.Morph('window', { duration: 0.5, style: 'height: 230px;' }); } else if(type == "Question") { new Effect.Morph('window_container', { duration: 0.5, style: 'height: 215px;' }); new Effect.Morph('window', { duration: 0.5, style: 'height: 195px;' }); } else if(type == "Notification") { new Effect.Morph('window_container', { duration: 0.5, style: 'height: 185px;' }); new Effect.Morph('window', { duration: 0.5, style: 'height: 165px;' }); } } else { Effect.Fade('edit_profile_contents', { duration: 0.8 }); setTimeout("$('edit_profile_contents').style.display = 'none'", 850); Effect.Appear('profile_updated', { delay: 0.8, duration: 0.8 }); setTimeout("$('profile_updated').style.display = 'block'", 1700); new Effect.Morph('window_container', { delay: 0.8, duration: 0.5, style: 'height: 180px;' }); new Effect.Morph('window', { delay: 0.8, duration: 0.5, style: 'height: 160px;' }); } } }); } function tabsForPicks() { jQuery.ajax({ type: 'POST', url: 'tabs_for_picks.php', data: { check: '1' }, success: function(data) { if(data == "true") { new Effect.BlindDown('tabs_for_picks', { duration: 1.0 }); } } }); } function notParticipating() { jQuery.ajax({ type: 'POST', url: 'tabs_for_picks.php', data: { not_participating: '1' }, success: function(data) { $('tabs_for_picks_completed').style.display = 'none'; } }); } function sendPicks() { jQuery.ajax({ type: 'POST', url: 'tabs_for_picks.php', data: { name: $('name').value, street1: $('street1').value, street2: $('street2').value, city: $('city').value, state: $('state').value, zip: $('zip').value }, success: function(data) { $('address_not_sent').style.display = 'none'; $('address_sent').style.display = 'block'; new Effect.Morph('tabs_for_picks_completed_container', { duration: 0.5, style: 'height: 180px' }); new Effect.Morph('tabs_for_picks_completed_content', { duration: 0.5, style: 'height: 160px' }); } }); } function openDisapprovedSavedTab(id) { changinghash = true; var tempcontainer = windowMap.retrieve('upload'); jQuery.ajax({ type: 'POST', url: tempcontainer.url, data: { save_id: id }, beforeSend: function() { if(!memberloggedin) { $('window_container').style.top = (($('test').offsetHeight - 200) / 2)+'px'; $('window_background').style.display = 'block'; $('window_loading').style.display = 'block'; $('window_container').style.width = '370px'; $('window_container').style.height = '70px'; $('window').style.width = '350px'; $('window').style.height = '50px'; } else { $('window_container').style.top = (($('test').offsetHeight - (tempcontainer.height + 20)) / 2)+'px'; $('window_background').style.display = 'block'; $('window_loading').style.display = 'block'; $('window_container').style.width = (tempcontainer.width + 20)+'px'; $('window_container').style.height = '70px'; $('window').style.width = tempcontainer.width+'px'; $('window').style.height = '50px'; } }, success: function(data) { if($('notifications')) { $('notifications').style.display = 'none'; $('notification_container').innerHTML = '<div id="notifications_loading" style="display: none;"><table cellspacing="0" cellpadding="0" border="0" width="100%" height="100%"><tr valign="top"><td align="center"><div id="notifications_loading_container"><table cellspacing="0" cellpadding="0" border="0" width="100%" height="100%"><tr valign="middle"><td align="center">Loading...</td></tr></table></div></td></tr></table></div>'; } currenthash = '#!/window/upload/'; window.location.hash = currenthash; changinghash = false; changeTitle(); if(trackAnalytics()) { _gaq.push(['_trackPageview', '/'+currenthash]); } $('window_loading').style.display = 'none'; $('window').innerHTML = data; if(!memberloggedin) { $('window_container').style.width = '370px'; $('window_container').style.height = '220px'; $('window').style.width = '350px'; $('window').style.height = '200px'; } else { $('window_container').style.width = (tempcontainer.width + 20)+'px'; $('window_container').style.height = (tempcontainer.height + 20)+'px'; $('window').style.width = tempcontainer.width+'px'; $('window').style.height = tempcontainer.height+'px'; } } }); } function browseStateChanged() { if (xmlhttp.readyState==4) { ajaxloading = false; $('ajax_loading').style.display = 'none'; changeTitle(); if(window.location.hash != currenthash) { window.location.hash = currenthash; } $('browse').innerHTML = xmlhttp.responseText; addscript(); gapi.plusone.render("plusone-div", {"href": "http://www.zojam.com/"+currenthash+"", "state": "on", "size": "medium", "count": "false"}); $('popular_link').style.backgroundColor = '#ffffff'; $('popular_link').setAttribute("onmouseout", "this.style.backgroundColor = ''"); $('recent_link').style.backgroundColor = '#ffffff'; $('recent_link').setAttribute("onmouseout", "this.style.backgroundColor = ''"); $('browse_link').style.backgroundColor = '#ffffff'; $('browse_link').setAttribute("onmouseout", "this.style.backgroundColor = ''"); $('search_link').style.backgroundColor = '#ffffff'; $('search_link').setAttribute("onmouseout", "this.style.backgroundColor = ''"); var length = $('hidden_jamlist').value; for(var i=0; i < length; i++) { $('droppable_'+i+'').style.backgroundColor = '#ffffff'; $('droppable_'+i+'').setAttribute("onmouseout", "this.style.backgroundColor = ''"); } if(currenttab == 'home') { jQuery(function() { rainbows.init({ selector: '#landing_page_link', shadow: true, from: '#032677', to: '#00aeff' }); }); $('landing_page_link').style.width = ($('landing_page_link_container').offsetWidth - 100)+'px'; } else if(currenttab == 'popular') { $('popular_link').style.backgroundColor = '#CEE3F6'; $('popular_link').setAttribute("onmouseout", "this.style.backgroundColor = '#CEE3F6'"); popularcontainer.overallvideostate = 'initial'; } else if(currenttab == 'recent') { $('recent_link').style.backgroundColor = '#CEE3F6'; $('recent_link').setAttribute("onmouseout", "this.style.backgroundColor = '#CEE3F6'"); recentcontainer.overallvideostate = 'initial'; } else if(currenttab == 'browse') { $('browse_link').style.backgroundColor = '#CEE3F6'; $('browse_link').setAttribute("onmouseout", "this.style.backgroundColor = '#CEE3F6'"); browsecontainer.overallvideostate = 'initial'; $('input_style').value = "Search for a tab"; $('input_style').blur(); if(browsecontainer.artist != '-' && browsecontainer.song == '-') { Position.prepare(); var artistcontainer = Position.cumulativeOffset($('content_height_1'))[1]; var artistelement = Position.cumulativeOffset($(''+browsecontainer.artist+'_artist'))[1]; new Effect.Scroll('content_height_1', { x: 0, y: (artistelement - artistcontainer) }); browseartistcolor = $(''+browsecontainer.artist+'_artist').className; $(''+browsecontainer.artist+'_artist').setAttribute("onmouseout", "this.style.backgroundColor = '#56A5EC'"); setTimeout("new Effect.Morph(''+browsecontainer.artist+'_artist', { style: 'background: #56A5EC;' })", 850); } else if(browsecontainer.artist != '-' && browsecontainer.song != '-') { Position.prepare(); var artistcontainer = Position.cumulativeOffset($('content_height_1'))[1]; var artistelement = Position.cumulativeOffset($(''+browsecontainer.artist+'_artist'))[1]; new Effect.Scroll('content_height_1', { x: 0, y: (artistelement - artistcontainer) }); browseartistcolor = $(''+browsecontainer.artist+'_artist').className; $(''+browsecontainer.artist+'_artist').setAttribute("onmouseout", "this.style.backgroundColor = '#56A5EC'"); setTimeout("new Effect.Morph(''+browsecontainer.artist+'_artist', { style: 'background: #56A5EC;' })", 850); var songcontainer = Position.cumulativeOffset($('content_height_2'))[1]; var songelement = Position.cumulativeOffset($(''+browsecontainer.song+'_song'))[1]; new Effect.Scroll('content_height_2', { x: 0, y: (songelement - songcontainer) }); browsesongcolor = $(''+browsecontainer.song+'_song').className; $(''+browsecontainer.song+'_song').setAttribute("onmouseout", "this.style.backgroundColor = '#56A5EC'"); setTimeout("new Effect.Morph(''+browsecontainer.song+'_song', { style: 'background: #56A5EC;' })", 850); } } else if(currenttab == 'search') { $('search_link').style.backgroundColor = '#CEE3F6'; $('search_link').setAttribute("onmouseout", "this.style.backgroundColor = '#CEE3F6'"); } else if(currenttab == 'jamlist') { $('droppable_'+highlightjamlist+'').style.backgroundColor = '#CEE3F6'; $('droppable_'+highlightjamlist+'').setAttribute("onmouseout", "this.style.backgroundColor = '#CEE3F6'"); } if((currenttab == 'popular' && popularcontainer.file != "") || (currenttab == 'recent' && recentcontainer.file != "") || (currenttab == 'browse' && browsecontainer.file != "") || (currenttab == 'user_tabs' && usertabscontainer.file != "")) { $('tab_information').style.display = 'none'; $('tab_display_container').appear(); setTimeout("$('tab_display_container').style.display = 'block'", 850); setTimeout("loadYouTube()", 850); } if(trackAnalytics()) { _gaq.push(['_trackPageview', '/'+currenthash]); } changinghash = false; } else { $('browse_loading').style.display = 'block'; $('tab_information').style.display = 'none'; $('window_background').style.display = 'none'; ajaxloading = true; $('ajax_loading').style.display = 'block'; } } function openTabStateChanged() { if (xmlhttp.readyState==4) { changeTitle(); ajaxloading = false; $('ajax_loading').style.display = 'none'; if(window.location.hash != currenthash) { window.location.hash = currenthash; } $('browse').innerHTML = xmlhttp.responseText; $('popular_link').style.backgroundColor = '#ffffff'; $('popular_link').setAttribute("onmouseout", "this.style.backgroundColor = ''"); $('recent_link').style.backgroundColor = '#ffffff'; $('recent_link').setAttribute("onmouseout", "this.style.backgroundColor = ''"); $('browse_link').style.backgroundColor = '#ffffff'; $('browse_link').setAttribute("onmouseout", "this.style.backgroundColor = ''"); $('search_link').style.backgroundColor = '#ffffff'; $('search_link').setAttribute("onmouseout", "this.style.backgroundColor = ''"); var length = $('hidden_jamlist').value; for(var i=0; i < length; i++) { $('droppable_'+i+'').style.backgroundColor = '#ffffff'; $('droppable_'+i+'').setAttribute("onmouseout", "this.style.backgroundColor = ''"); } if(currenttab == 'popular') { $('popular_link').style.backgroundColor = '#CEE3F6'; $('popular_link').setAttribute("onmouseout", "this.style.backgroundColor = '#CEE3F6'"); if(popularcontainer.file != "") { loadYouTube(); } } else if(currenttab == 'recent') { $('recent_link').style.backgroundColor = '#CEE3F6'; $('recent_link').setAttribute("onmouseout", "this.style.backgroundColor = '#CEE3F6'"); if(recentcontainer.file != "") { loadYouTube(); } } else if(currenttab == 'browse') { $('browse_link').style.backgroundColor = '#CEE3F6'; $('browse_link').setAttribute("onmouseout", "this.style.backgroundColor = '#CEE3F6'"); if(browsecontainer.artist != '-' && browsecontainer.song == '-') { Position.prepare(); var artistcontainer = Position.cumulativeOffset($('content_height_1'))[1]; var artistelement = Position.cumulativeOffset($(''+browsecontainer.artist+'_artist'))[1]; new Effect.Scroll('content_height_1', { x: 0, y: (artistelement - artistcontainer) }); browseartistcolor = $(''+browsecontainer.artist+'_artist').className; $(''+browsecontainer.artist+'_artist').setAttribute("onmouseout", "this.style.backgroundColor = '#56A5EC'"); setTimeout("new Effect.Morph(''+browsecontainer.artist+'_artist', { style: 'background: #56A5EC;' })", 850); } else if(browsecontainer.artist != '-' && browsecontainer.song != '-') { Position.prepare(); var artistcontainer = Position.cumulativeOffset($('content_height_1'))[1]; var artistelement = Position.cumulativeOffset($(''+browsecontainer.artist+'_artist'))[1]; new Effect.Scroll('content_height_1', { x: 0, y: (artistelement - artistcontainer) }); browseartistcolor = $(''+browsecontainer.artist+'_artist').className; $(''+browsecontainer.artist+'_artist').setAttribute("onmouseout", "this.style.backgroundColor = '#56A5EC'"); setTimeout("new Effect.Morph(''+browsecontainer.artist+'_artist', { style: 'background: #56A5EC;' })", 850); var songcontainer = Position.cumulativeOffset($('content_height_2'))[1]; var songelement = Position.cumulativeOffset($(''+browsecontainer.song+'_song'))[1]; new Effect.Scroll('content_height_2', { x: 0, y: (songelement - songcontainer) }); browsesongcolor = $(''+browsecontainer.song+'_song').className; $(''+browsecontainer.song+'_song').setAttribute("onmouseout", "this.style.backgroundColor = '#56A5EC'"); setTimeout("new Effect.Morph(''+browsecontainer.song+'_song', { style: 'background: #56A5EC;' })", 850); } if(browsecontainer.file != "") { loadYouTube(); } } else if(currenttab == 'search') { $('search_link').style.backgroundColor = '#CEE3F6'; $('search_link').setAttribute("onmouseout", "this.style.backgroundColor = '#CEE3F6'"); } else if(currenttab == 'jamlist') { var temphighlightjamlist = currentjamlist.split(" ").join("_"); var length = $('hidden_jamlist').value; for(var i=0; i < length; i++) { if($('droppable_'+i+'').className == temphighlightjamlist) { $('droppable_'+i).style.backgroundColor = '#CEE3F6'; $('droppable_'+i).setAttribute("onmouseout", "this.style.backgroundColor = '#CEE3F6'"); } } for(var i=0; i < jamlistarray.length; i++) { if(jamlistarray[i][0] == currentjamlist && jamlistarray[i][1] != '') { loadYouTube(); } } } if(!searched && currenttab == 'search') { searched = true; $('search_tab').appear(); } addscript(); if(trackAnalytics()) { _gaq.push(['_trackPageview', '/'+currenthash]); } changinghash = false; } else { $('browse_loading').style.display = 'block'; $('tab_information').style.display = 'none'; ajaxloading = true; $('ajax_loading').style.display = 'block'; } } function keyUpStateChanged() { if (xmlhttp.readyState==4) { ajaxloading = false; $('ajax_loading').style.display = 'none'; if(currenttab != 'browse') { $('table_contents').innerHTML = xmlhttp.responseText; } else { var tempcontainer = containerMap.retrieve(currenttab); if(tempcontainer.artist == '-') { $('content_height_1').innerHTML = xmlhttp.responseText; } else { $('content_height_2').innerHTML = xmlhttp.responseText; } } addscript(); } else { ajaxloading = true; $('ajax_loading').style.display = 'block'; } } function keyUpResultsStateChanged() { if (xmlhttptwo.readyState==4) { $('result_numbers').innerHTML = xmlhttptwo.responseText; } } function browseAllStateChanged() { if (xmlhttp.readyState==4) { $('browse_loading').style.display = 'none'; ajaxloading = false; $('ajax_loading').style.display = 'none'; var tempcontainer = containerMap.retrieve('browse'); if(tempcontainer.song == '-') { $('content_height_2').innerHTML = xmlhttp.responseText; new Effect.Scroll('content_height_2', { x: 0, y: 0 }); $('content_height_3').innerHTML = "<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" width=\"100%\"><tr valign=\"top\"><td width=\"2%\" style=\"height: 18px; background-color: #ffffff\"></td><td align=\"center\" width=\"96%\" style=\"height: 18px; background-color: #ffffff\">- No Song Selected -</td><td width=\"2%\" style=\"height: 18px; background-color: #ffffff\"></td></tr></table>"; if(tempcontainer.sortcolumn == '') { $('song_sort_click').setAttribute("onclick", "sortResults('song', 'DESC')"); } } else { $('content_height_3').innerHTML = xmlhttp.responseText; } if(tempcontainer.artist == '-' && tempcontainer.song == '-') { currenthash = '#!/browse/'; $('current_browse_view').innerHTML = "<b>Viewing:</b> All"; } else if(tempcontainer.artist != '-' && tempcontainer.song == '-') { currenthash = '#!/browse/'+tempcontainer.artist+'/'; var artistsplit = tempcontainer.artist.split("_"); for(var i=0; i < artistsplit.length; i++) { artistsplit[i] = artistsplit[i].substring(0, 1).toUpperCase() + artistsplit[i].substring(1, artistsplit[i].length); } $('current_browse_view').innerHTML = "<b>Viewing:</b> Songs by "+(artistsplit.join(" ")); } else { currenthash = '#!/browse/'+tempcontainer.artist+'/'+tempcontainer.song+'/'; var artistsplit = tempcontainer.artist.split("_"); for(var i=0; i < artistsplit.length; i++) { artistsplit[i] = artistsplit[i].substring(0, 1).toUpperCase() + artistsplit[i].substring(1, artistsplit[i].length); } var songsplit = tempcontainer.song.split("_"); for(var i=0; i < songsplit.length; i++) { songsplit[i] = songsplit[i].substring(0, 1).toUpperCase() + songsplit[i].substring(1, songsplit[i].length); } $('current_browse_view').innerHTML = "<b>Viewing:</b> Tabs for "+(songsplit.join(" "))+" by "+(artistsplit.join(" ")); } window.location.hash = currenthash; addscript(); changeTitle(); if(trackAnalytics()) { _gaq.push(['_trackPageview', '/'+currenthash]); } changinghash = false; } else { $('browse_loading').style.display = 'block'; ajaxloading = true; $('ajax_loading').style.display = 'block'; } } function browseHeaderStateChanged() { if(xmlhttptwo.readyState==4) { $('browse_header').innerHTML = xmlhttptwo.responseText; } } function sortStateChanged() { if(xmlhttp.readyState==4) { if(browsesortcolumn == "artist") { $('content_height_1').innerHTML = xmlhttp.responseText; if(browsecontainer.artist != '-') { Position.prepare(); var artistcontainer = Position.cumulativeOffset($('content_height_1'))[1]; var artistelement = Position.cumulativeOffset($(''+browsecontainer.artist+'_artist'))[1]; new Effect.Scroll('content_height_1', { x: 0, y: (artistelement - artistcontainer) }); browseartistcolor = $(''+browsecontainer.artist+'_artist').className; $(''+browsecontainer.artist+'_artist').setAttribute("onmouseout", "this.style.backgroundColor = '#56A5EC'"); setTimeout("new Effect.Morph(''+browsecontainer.artist+'_artist', { style: 'background: #56A5EC;' })", 850); } if(browsesortby == "ASC") { $('artist_sort_asc').style.display = 'block'; $('artist_sort_desc').style.display = 'none'; $('artist_sort_click').style.backgroundImage = "url(/images/CellOut3.JPG)"; $('artist_sort_click').setAttribute("onmouseover", "this.style.backgroundImage = 'url(/images/CellOn3.JPG)'"); $('artist_sort_click').setAttribute("onmouseout", "this.style.backgroundImage = 'url(/images/CellOut3.JPG)'"); $('artist_sort_click').setAttribute("onclick", "sortResults('artist', 'DESC')"); } else if(browsesortby == "DESC") { $('artist_sort_asc').style.display = 'none'; $('artist_sort_desc').style.display = 'block'; $('artist_sort_click').style.backgroundImage = "url(/images/CellOut3.JPG)"; $('artist_sort_click').setAttribute("onmouseover", "this.style.backgroundImage = 'url(/images/CellOn3.JPG)'"); $('artist_sort_click').setAttribute("onmouseout", "this.style.backgroundImage = 'url(/images/CellOut3.JPG)'"); $('artist_sort_click').setAttribute("onclick", "sortResults('artist', 'ASC')"); } $('song_sort_asc').style.display = 'none'; $('song_sort_desc').style.display = 'none'; $('song_sort_click').style.backgroundImage = "url(/images/CellOn3.JPG)"; $('song_sort_click').setAttribute("onmouseover", "this.style.backgroundImage = 'url(/images/CellOut3.JPG)'"); $('song_sort_click').setAttribute("onmouseout", "this.style.backgroundImage = 'url(/images/CellOn3.JPG)'"); $('song_sort_click').setAttribute("onclick", "sortResults('song', 'DESC')"); $('reset_sort').style.display = 'block'; } else if(browsesortcolumn == "song") { $('content_height_2').innerHTML = xmlhttp.responseText; if(browsecontainer.song != '-') { Position.prepare(); var songcontainer = Position.cumulativeOffset($('content_height_2'))[1]; var songelement = Position.cumulativeOffset($(''+browsecontainer.song+'_song'))[1]; new Effect.Scroll('content_height_2', { x: 0, y: (songelement - songcontainer) }); browsesongcolor = $(''+browsecontainer.song+'_song').className; $(''+browsecontainer.song+'_song').setAttribute("onmouseout", "this.style.backgroundColor = '#56A5EC'"); setTimeout("new Effect.Morph(''+browsecontainer.song+'_song', { style: 'background: #56A5EC;' })", 850); } if(browsesortby == "ASC") { $('song_sort_asc').style.display = 'block'; $('song_sort_desc').style.display = 'none'; $('song_sort_click').style.backgroundImage = "url(/images/CellOut3.JPG)"; $('song_sort_click').setAttribute("onmouseover", "this.style.backgroundImage = 'url(/images/CellOn3.JPG)'"); $('song_sort_click').setAttribute("onmouseout", "this.style.backgroundImage = 'url(/images/CellOut3.JPG)'"); $('song_sort_click').setAttribute("onclick", "sortResults('song', 'DESC')"); } else if(browsesortby == "DESC") { $('song_sort_asc').style.display = 'none'; $('song_sort_desc').style.display = 'block'; $('song_sort_click').style.backgroundImage = "url(/images/CellOut3.JPG)"; $('song_sort_click').setAttribute("onmouseover", "this.style.backgroundImage = 'url(/images/CellOn3.JPG)'"); $('song_sort_click').setAttribute("onmouseout", "this.style.backgroundImage = 'url(/images/CellOut3.JPG)'"); $('song_sort_click').setAttribute("onclick", "sortResults('song', 'ASC')"); } $('artist_sort_asc').style.display = 'none'; $('artist_sort_desc').style.display = 'none'; $('artist_sort_click').style.backgroundImage = "url(/images/CellOn3.JPG)"; $('artist_sort_click').setAttribute("onmouseover", "this.style.backgroundImage = 'url(/images/CellOut3.JPG)'"); $('artist_sort_click').setAttribute("onmouseout", "this.style.backgroundImage = 'url(/images/CellOn3.JPG)'"); $('artist_sort_click').setAttribute("onclick", "sortResults('artist', 'DESC')"); $('reset_sort').style.display = 'block'; } } } function searchStateChanged() { if (xmlhttp.readyState==4) { $('browse_loading').style.display = 'none'; ajaxloading = false; $('ajax_loading').style.display = 'none'; CloseWindow('manual'); window.location.hash = currenthash; $('popular_link').style.backgroundColor = '#ffffff'; $('popular_link').setAttribute("onmouseout", "this.style.backgroundColor = ''"); $('recent_link').style.backgroundColor = '#ffffff'; $('recent_link').setAttribute("onmouseout", "this.style.backgroundColor = ''"); $('browse_link').style.backgroundColor = '#ffffff'; $('browse_link').setAttribute("onmouseout", "this.style.backgroundColor = ''"); $('search_link').style.backgroundColor = '#ffffff'; $('search_link').setAttribute("onmouseout", "this.style.backgroundColor = ''"); $('search_link').setAttribute("onClick", "newHash('"+window.location.hash+"'); return false;"); var length = $('hidden_jamlist').value; for(var i=0; i < length; i++) { $('droppable_'+i+'').style.backgroundColor = '#ffffff'; $('droppable_'+i+'').setAttribute("onmouseout", "this.style.backgroundColor = ''"); } $('search_link').style.backgroundColor = '#CEE3F6'; $('search_link').setAttribute("onmouseout", "this.style.backgroundColor = '#CEE3F6'"); $('auto_complete').innerHTML = ''; $('auto_complete').style.height = '0px'; $('auto_complete').style.display = 'none'; $('search_completion').innerHTML = ''; $('search_completion').style.visibility = 'hidden'; $('browse').innerHTML = xmlhttp.responseText; if(!searched) { $('search_tab').appear(); } currenttab = 'search'; changeTitle(); decided = true; searched = true; $('input_style').blur(); $('input_style').value = ''; $('auto_complete').innerHTML = ''; $('auto_complete').style.height = '0px'; $('auto_complete').style.display = 'none'; $('search_completion').innerHTML = ''; $('search_completion').style.visibility = 'hidden'; onBlurSearch($('input_style')); Effect.Fade('input_clear_style', { duration: 0.5 }); new Effect.Morph('input_style', { style: 'padding-left: 5px', duration: 0.5 }); new Effect.Morph('input_search_style', { style: 'left: 210px', duration: 0.5 }); searchsearch = ''; addscript(); if(trackAnalytics()) { _gaq.push(['_trackPageview', '/'+currenthash]); } changinghash = false; } else { $('browse_loading').style.display = 'block'; $('window_background').style.display = 'none'; ajaxloading = true; $('ajax_loading').style.display = 'block'; } } function fileStateChanged() { if(xmlhttp.readyState==4) { changeTitle(); $('tab_information').style.display = 'none'; $('browse_loading').style.display="none"; $('tab_display_container').appear(); $('file_contents').innerHTML = xmlhttp.responseText; setTimeout("$('tab_display_container').style.display = 'block'", 850); setTimeout("loadYouTube()", 850); } else { $('tab_information').style.display = 'none'; $('browse_loading').style.display = "block"; } } function loginStateChanged() { if(xmlhttp.readyState==4) { memberloggedin = true; CloseWindow('manual'); $('member_links').innerHTML = xmlhttp.responseText; addscript(); jQuery.ajax({ type: 'POST', url: 'tabs_for_picks.php', success: function(data) { $('tabs_for_picks_container').innerHTML = data; } }); } else { $('login_loading').style.display='block'; } } function logoutStateChanged() { if(xmlhttp.readyState==4) { memberloggedin = false; ajaxloading = false; $('ajax_loading').style.display = 'none'; $('tabs_for_picks_completed').style.display = 'none'; $('member_links').innerHTML = xmlhttp.responseText; setTimeout("addscript()", 900); } else { ajaxloading = true; $('ajax_loading').style.display = 'block'; } } function signupStateChanged() { if(xmlhttp.readyState==4) { $('signup_loading').style.display = 'none'; $('signup_refresh').innerHTML = xmlhttp.responseText; var errorcount = $('signup_error_count').value; new Effect.Morph('window_container', { duration: 0.5, style: 'height: '+(320 + (35 * errorcount))+'px;' }); new Effect.Morph('window', { duration: 0.5, style: 'height: '+(300 + (35 * errorcount))+'px;' }); for(var i=0; i < errorcount; i++) { Effect.Appear('signup_error_'+i+'', { delay: 0.5 }); } } else { $('signup_loading').style.display = 'block'; } } function jamlistsStateChanged() { if(xmlhttptwo.readyState==4) { $('jamlists').innerHTML = xmlhttptwo.responseText; addscript(); } else { $('jamlists_loading').style.display = 'block'; } } function jamlistLoginStateChanged() { if(xmlhttp.readyState==4) { memberloggedin = true; $('login_loading').fade(); $('member_links').innerHTML = xmlhttp.responseText; $('member_login').fade(); setTimeout("$('jamlist_logged_in').appear()", 850); addscript(); jQuery.ajax({ type: 'POST', url: 'tabs_for_picks.php', success: function(data) { $('tabs_for_picks_container').innerHTML = data; } }); } else { $('login_loading').style.display='block'; } } function addJamlistStateChanged() { if(xmlhttp.readyState==4) { CloseWindow('manual'); $('jamlists').innerHTML = xmlhttp.responseText; addscript(); var jamlistnum = $('hidden_jamlist').value; jamlistnum = jamlistnum - 1; Effect.BlindDown('jamlist_'+jamlistnum+'', { duration: 1.0 }); } } function exitJamlistStateChanged() { if(xmlhttpthree.readyState==4) { $('browse').innerHTML = xmlhttpthree.responseText; } } function deleteContentStateChanged() { if(xmlhttp.readyState==4) { $('browse_loading').style.display = 'none'; Effect.BlindUp('item_'+deletedcontent+'', { duration: 1.0 }); deletedcontent = ''; setTimeout("$('browse').innerHTML = xmlhttp.responseText", 850); setTimeout("addscript()", 900); } else { $('browse_loading').style.display = 'block'; } } function deletedJamlistContentStateChanged() { if(xmlhttp.readyState==4) { CloseWindow('manual'); setTimeout("$('jamlists').innerHTML = xmlhttp.responseText", 850); setTimeout("addscript()", 900); var hashlocation = window.location.hash.split("/"); if(hashlocation.length >= 3) { var tempjamlist = jamlistarray[getCurrentJamlistIndex()][0].split(" ").join("_"); if(tempjamlist == hashlocation[2]) { setTimeout("openTab('popular')", 1000); } } } } function uploadLoginStateChanged() { if(xmlhttp.readyState==4) { jQuery.ajax({ type: 'POST', url: '/UserUpload.php', success: function(data) { memberloggedin = true; $('user_upload').innerHTML = data; Effect.Fade('member_login', { duration: 0.8 }); Effect.Fade('login_loading', { duration: 0.8 }); Effect.Appear('user_upload', { delay: 0.8, duration: 0.8 }); new Effect.Morph('window_container', { delay: 0.8, duration: 0.5, style: 'width: 720px; height: 580px; top: '+(($('test').offsetHeight - 580) / 2)+'px' }); new Effect.Morph('window', { delay: 0.8, duration: 0.5, style: 'width: 700px; height: 560px;' }); $('member_links').innerHTML = xmlhttp.responseText; $('upload_login').fade(); addscript(); } }); jQuery.ajax({ type: 'POST', url: 'tabs_for_picks.php', success: function(data) { $('tabs_for_picks_container').innerHTML = data; } }); } else { $('login_loading').style.display='block'; } } function tabUploadStateChanged() { if (xmlhttptwo.readyState == 4 && xmlhttp.status == 200) { if($('upload_loading')) { $('upload_loading').style.display = 'none'; } Effect.Fade('user_upload', { duration: 0.8 }); Effect.Fade('upload_loading', { duration: 0.8 }); Effect.Appear('upload_success', { delay: 0.8, duration: 0.8 }); new Effect.Morph('window_container', { delay: 0.8, duration: 0.5, style: 'width: 370px; height: 220px; top: '+(($('test').offsetHeight - 220) / 2)+'px' }); new Effect.Morph('window', { delay: 0.8, duration: 0.5, style: 'width: 350px; height: 200px;' }); } else { $('upload_loading').style.display = 'block'; } } function youtubeSearchStateChanged() { if(xmlhttp.readyState==4) { if(currenttab == 'popular') { popularcontainer.uservideostate = 'results'; } else if(currenttab == 'recent') { recentcontainer.uservideostate = 'results'; } else if(currenttab == 'browse') { browsecontainer.uservideostate = 'results'; } else if(currenttab == 'jamlist') { } $('youtube_results_loading').style.display='none'; $('another_youtube_search').appear(); setTimeout("$('another_youtube_search').style.display='block'", 850); $('youtube_results').appear(); new Effect.Morph('youtube_container', { style: 'height: 168px;' }); new Effect.Morph('tab_contents', { style: 'top: 193px; height: '+(getBrowseHeight()-83)+'px;' }); new Effect.Morph('tab_overflow', { style: 'height: '+(getBrowseHeight()-145)+'px;' }); new Effect.Morph('left_arrow_container', { style: 'top: 250px; height: '+(getBrowseHeight()-250)+'px;' }); new Effect.Morph('right_arrow_container', { style: 'top: 250px; height: '+(getBrowseHeight()-250)+'px;' }); setTimeout("$('youtube_results').style.display='block'", 850); setTimeout("$('youtube_search').style.display='none'", 850); setTimeout("$('youtube_results').innerHTML = xmlhttp.responseText", 850); setTimeout("$('youtube_results').scrollLeft = 0", 850); setTimeout("$('youtube_state').innerHTML = $('youtube_results_title').value", 850); } else { $('youtube_results_loading').style.display='block'; } } function youtubeVideoStateChanged() { if(xmlhttp.readyState==4) { if(currenttab == 'popular') { popularcontainer.uservideostate = 'video'; } else if(currenttab == 'recent') { recentcontainer.uservideostate = 'video'; } else if(currenttab == 'browse') { browsecontainer.uservideostate = 'video'; } else if(currenttab == 'jamlist') { for(var i=0; i < jamlistarray.length; i++) { if(jamlistarray[i][0] == currentjamlist) { jamlistarray[i][5] = 'video'; } } } $('youtube_video_loading').style.display='none'; $('youtube_search_results').appear(); setTimeout("$('youtube_search_results').style.display='block'", 850); $('youtube_results').fade(); setTimeout("$('youtube_results').style.display='none'", 900); setTimeout("$('youtube_video').appear()", 900); setTimeout("$('youtube_video').style.display='block'", 1750); setTimeout("$('youtube_video').innerHTML = xmlhttp.responseText", 900); setTimeout("$('youtube_state').innerHTML = $('user_youtube_video_title').value", 900); setTimeout("new Effect.Morph('youtube_container', { style: 'height: 300px;' })", 900); setTimeout("new Effect.Morph('tab_contents', { style: 'top: 325px; height: '+(getBrowseHeight()-302)+'px;' })", 900); setTimeout("new Effect.Morph('tab_overflow', { style: 'height: '+(getBrowseHeight()-398)+'px;' })", 900); setTimeout("new Effect.Morph('left_arrow_container', { style: 'top: 380px; height: '+(getBrowseHeight()-405)+'px;' })", 900); setTimeout("new Effect.Morph('right_arrow_container', { style: 'top: 380px; height: '+(getBrowseHeight()-405)+'px;' })", 900); } else { $('youtube_video_loading').style.display='block'; } } function initialYoutubeVideoStateChanged() { if(xmlhttp.readyState==4) { if(currenttab == 'popular') { popularcontainer.initialvideostate = 'video'; } else if(currenttab == 'recent') { recentcontainer.initialvideostate = 'video'; } else if(currenttab == 'browse') { browsecontainer.initialvideostate = 'video'; } else if(currenttab == 'jamlist') { for(var i=0; i < jamlistarray.length; i++) { if(jamlistarray[i][0] == currentjamlist) { jamlistarray[i][3] = 'video'; } } } $('youtube_video_loading').style.display='none'; $('youtube_initial_results').appear(); setTimeout("$('youtube_initial_results').style.display='block'", 850); $('initial_youtube_results').fade(); setTimeout("$('initial_youtube_results').style.display='none'", 850); setTimeout("$('initial_youtube_video').appear()", 850); setTimeout("$('initial_youtube_video').style.display='block'", 1700); setTimeout("$('initial_youtube_video').innerHTML = xmlhttp.responseText", 850); setTimeout("$('youtube_state').innerHTML = $('initial_youtube_video_title').value", 850); setTimeout("new Effect.Morph('youtube_container', { style: 'height: 300px;' })", 850); setTimeout("new Effect.Morph('tab_contents', { style: 'top: 325px; height: '+(getBrowseHeight()-302)+'px;' })", 850); setTimeout("new Effect.Morph('tab_overflow', { style: 'height: '+(getBrowseHeight()-398)+'px;' })", 850); setTimeout("new Effect.Morph('left_arrow_container', { style: 'top: 380px; height: '+(getBrowseHeight()-405)+'px;' })", 850); setTimeout("new Effect.Morph('right_arrow_container', { style: 'top: 380px; height: '+(getBrowseHeight()-405)+'px;' })", 850); } else { $('youtube_video_loading').style.display='block'; } } function loadYouTubeStateChanged() { if(xmlhttptwo.readyState==4) { $('delayed_youtube_loading').style.display = 'none'; $('youtube_container').innerHTML = xmlhttptwo.responseText; if(currenttab == 'popular') { $('popular_link').style.backgroundColor = '#CEE3F6'; $('popular_link').setAttribute("onmouseout", "this.style.backgroundColor = '#CEE3F6'"); if(popularcontainer.file != "" && popularcontainer.overallvideostate == 'initial' && popularcontainer.initialvideostate == 'video') { $('youtube_state').innerHTML = $('initial_youtube_video_title').value; } else if(popularcontainer.file != "" && popularcontainer.overallvideostate == 'user' && popularcontainer.uservideostate == 'video') { $('youtube_state').innerHTML = $('user_youtube_video_title').value; } } else if(currenttab == 'recent') { $('recent_link').style.backgroundColor = '#CEE3F6'; $('recent_link').setAttribute("onmouseout", "this.style.backgroundColor = '#CEE3F6'"); if(recentcontainer.file != "" && recentcontainer.overallvideostate == 'initial' && recentcontainer.initialvideostate == 'video') { $('youtube_state').innerHTML = $('initial_youtube_video_title').value; } else if(recentcontainer.file != "" && recentcontainer.overallvideostate == 'user' && recentcontainer.uservideostate == 'video') { $('youtube_state').innerHTML = $('user_youtube_video_title').value; } } else if(currenttab == 'browse') { $('browse_link').style.backgroundColor = '#CEE3F6'; $('browse_link').setAttribute("onmouseout", "this.style.backgroundColor = '#CEE3F6'"); if(browsecontainer.file != "" && browsecontainer.overallvideostate == 'initial' && browsecontainer.initialvideostate == 'video') { $('youtube_state').innerHTML = $('initial_youtube_video_title').value; } else if(browsecontainer.file != "" && browsecontainer.overallvideostate == 'user' && browsecontainer.uservideostate == 'video') { $('youtube_state').innerHTML = $('user_youtube_video_title').value; } } else if(currenttab == 'user_tabs') { if(usertabscontainer.file != "" && usertabscontainer.overallvideostate == 'initial' && usertabscontainer.initialvideostate == 'video') { $('youtube_state').innerHTML = $('initial_youtube_video_title').value; } else if(usertabscontainer.file != "" && usertabscontainer.overallvideostate == 'user' && usertabscontainer.uservideostate == 'video') { $('youtube_state').innerHTML = $('user_youtube_video_title').value; } } } else { $('delayed_youtube_loading').style.display = 'block'; } } function ratingStateChanged() { if(xmlhttp.readyState==4) { $('tab_rating_container').innerHTML = xmlhttp.responseText; } else { $('tab_rating_loading').style.display = 'block'; } } function cycleTabStateChanged() { if(xmlhttp.readyState==4) { $('cycle_container_'+currentcycle).innerHTML = xmlhttp.responseText; setTimeout("$('cycle_container_"+pastcycle+"').innerHTML = ''", 850); var tempcontainer = containerMap.retrieve(currenttab); tempcontainer.ytstate='initial'; tempcontainer.previousytstate='initial'; tempcontainer.ytsearch=''; tempcontainer.ytvideoid=''; tempcontainer.ytvideotime=0; tempcontainer.ytvideostate=1; var newhash = $('new_cycle_hash').className; var newhashsplit = newhash.split("/"); if(newhashsplit.length > 2) { setTimeout(function() { changinghash = true; tempcontainer.artist = newhashsplit[0]; tempcontainer.song = newhashsplit[1]; tempcontainer.file = newhashsplit[2]; changeTitle(); var hashsplit = window.location.hash.split("/"); if(hashsplit.length > 2 && hashsplit[1] == "jamlist") { currenthash = '#!/jamlist/'+hashsplit[2]+'/'+newhash; } else if(hashsplit.length > 2 && hashsplit[1] == "search" && hashsplit[2] == "advanced") { currenthash = '#!/search/advanced/'+advancedartist+'/'+advancedsong+'/'+advancedtuning+'/'+advancedportion+'/'+advancedrating+'/'+advancedusername+'/'+newhash; } else if(hashsplit.length > 4) { currenthash = '#!/'+currenttab+'/'+newhash; } if($(currenttab+'_navigation')) { $(currenttab+'_navigation').setAttribute("onClick", "newHash('"+currenthash+"')"); } window.location.hash=currenthash; changinghash = false; cyclingactive = false; }, 900); setTimeout(function() { loadYouTube(tempcontainer); }, 950); if(trackAnalytics()) { _gaq.push(['_trackPageview', '/'+currenthash]); } } } } function restoreSessionTabStateChanged() { if(xmlhttptwo.readyState==4) { $('restore_session').fade(); var restorearray = xmlhttptwo.responseText.split("+"); currenttab = restorearray[0]; browsecontainer.artist = restorearray[1]; browsecontainer.song = restorearray[2]; browsecontainer.file = restorearray[3]; browseartistcolor = '#'+restorearray[4]; browsesongcolor = '#'+restorearray[5]; decided = restorearray[6]; searched = restorearray[7]; pastsearch = restorearray[8]; searchstate = restorearray[9]; advancedartist = restorearray[10]; advancedsong = restorearray[11]; advancedtuning = restorearray[12]; advancedportion = restorearray[13]; advancedportion = restorearray[14]; advancedusername = restorearray[15]; popularsearch = restorearray[16]; recentsearch = restorearray[17]; browsesearch = restorearray[18]; searchsearch = restorearray[19]; jamlistsearch = restorearray[20]; popularcontainer.artist = restorearray[21]; popularcontainer.song = restorearray[22]; popularcontainer.file = restorearray[23]; recentartist = restorearray[24]; recentcontainer.song = restorearray[25]; recentcontainer.file = restorearray[26]; searchcontainer.artist = restorearray[27]; searchcontainer.song = restorearray[28]; popularsortcolumn = restorearray[29]; popularsortby = restorearray[30]; recentsortcolumn = restorearray[31]; recentsortby = restorearray[32]; browsesortcolumn = restorearray[33]; browsesortby = restorearray[34]; searchsortcolumn = restorearray[35]; searchsortby = restorearray[36]; if(currenttab != 'jamlist') { openTab(''+currenttab+''); } } } function autoCompleteStateChanged() { if(xmlhttp.readyState==4) { if($('input_style').value != "") { $('auto_complete').innerHTML = xmlhttp.responseText; $('auto_complete').style.height = ($('auto_complete_count').className * 20) + 'px'; if($('auto_complete').style.height == '0px') { $('auto_complete').style.display = 'none'; } else { var outputstring = ''; $('auto_complete').style.display = 'block'; } } } } function inputAutoCompleteStateChanged() { if(xmlhttptwo.readyState==4) { if($('input_style').value != "") { $('search_completion').innerHTML = xmlhttptwo.responseText; currentautocomplete = xmlhttptwo.responseText; $('search_completion').style.visibility = 'visible'; } } else { $('search_completion').style.visibility = 'hidden'; } } function autoCompleteLinkStateChanged() { if(xmlhttp.readyState==4) { changeTitle(); if(window.location.hash != currenthash) { window.location.hash = currenthash; } autocompleteover = false; $('input_style').value = ''; onBlurSearch($('input_style')); $('auto_complete').style.display = 'none'; $('auto_complete').innerHTML = ''; $('auto_complete').style.display = '0px'; $('search_completion').style.visibility = 'hidden'; $('search_completion').innerHTML = ''; $('browse').innerHTML = xmlhttp.responseText; addscript(); var tempcontainer = containerMap.retrieve('browse'); $('popular_link').style.backgroundColor = '#ffffff'; $('popular_link').setAttribute("onmouseout", "this.style.backgroundColor = ''"); $('recent_link').style.backgroundColor = '#ffffff'; $('recent_link').setAttribute("onmouseout", "this.style.backgroundColor = ''"); $('browse_link').style.backgroundColor = '#ffffff'; $('browse_link').setAttribute("onmouseout", "this.style.backgroundColor = ''"); $('search_link').style.backgroundColor = '#ffffff'; $('search_link').setAttribute("onmouseout", "this.style.backgroundColor = ''"); var length = $('hidden_jamlist').value; for(var i=0; i < length; i++) { $('droppable_'+i+'').style.backgroundColor = '#ffffff'; $('droppable_'+i+'').setAttribute("onmouseout", "this.style.backgroundColor = ''"); } $('browse_link').style.backgroundColor = '#CEE3F6'; $('browse_link').setAttribute("onmouseout", "this.style.backgroundColor = '#CEE3F6'"); tempcontainer.ytstate = 'initial'; $('input_style').value = "Search for a tab"; $('input_style').blur(); if(tempcontainer.artist != '-' && tempcontainer.song == '-') { Position.prepare(); var artistcontainer = Position.cumulativeOffset($('content_height_1'))[1]; var artistelement = Position.cumulativeOffset($(''+tempcontainer.artist+'_artist'))[1]; new Effect.Scroll('content_height_1', { x: 0, y: (artistelement - artistcontainer) }); browseartistcolor = $(''+tempcontainer.artist+'_artist').className; $(''+tempcontainer.artist+'_artist').setAttribute("onmouseout", "this.style.backgroundColor = '#56A5EC'"); setTimeout(function() { new Effect.Morph(''+tempcontainer.artist+'_artist', { style: 'background-color: #56A5EC;' }); }, 850); } else if(tempcontainer.artist != '-' && tempcontainer.song != '-') { Position.prepare(); var artistcontainer = Position.cumulativeOffset($('content_height_1'))[1]; var artistelement = Position.cumulativeOffset($(''+tempcontainer.artist+'_artist'))[1]; new Effect.Scroll('content_height_1', { x: 0, y: (artistelement - artistcontainer) }); browseartistcolor = $(''+tempcontainer.artist+'_artist').className; $(''+tempcontainer.artist+'_artist').setAttribute("onmouseout", "this.style.backgroundColor = '#56A5EC'"); setTimeout(function() { new Effect.Morph(''+tempcontainer.artist+'_artist', { style: 'background-color: #56A5EC;' }); }, 850); var songcontainer = Position.cumulativeOffset($('content_height_2'))[1]; var songelement = Position.cumulativeOffset($(''+tempcontainer.song+'_song'))[1]; new Effect.Scroll('content_height_2', { x: 0, y: (songelement - songcontainer) }); browsesongcolor = $(''+tempcontainer.song+'_song').className; $(''+tempcontainer.song+'_song').setAttribute("onmouseout", "this.style.backgroundColor = '#56A5EC'"); setTimeout(function() { new Effect.Morph(''+tempcontainer.song+'_song', { style: 'background-color: #56A5EC;' }); }, 850); } changinghash = false; } else { $('browse_loading').style.display = 'block'; } } function windowStateChanged() { var currentwindowindex = getCurrentWindowIndex(); if(xmlhttp.readyState==4) { window.location.hash = currenthash; if(trackAnalytics()) { _gaq.push(['_trackPageview', '/'+currenthash]); } changinghash = false; $('window_loading').style.display = 'none'; $('window').innerHTML = xmlhttp.responseText; var currenthashsplit = currenthash.split("/"); if(windowArray[currentwindowindex].name == 'upload' && !memberloggedin) { $('window_container').style.width = '370px'; $('window_container').style.height = '220px'; $('window').style.width = '350px'; $('window').style.height = '200px'; } else if(windowArray[currentwindowindex].name == 'profile' && currenthashsplit.length >= 4 && currenthashsplit[3] != "") { $('window_container').style.width = (windowArray[currentwindowindex].width + 20)+'px'; $('window_container').style.height = '230px'; $('window').style.width = windowArray[currentwindowindex].width+'px'; $('window').style.height = '210px'; } else { $('window_container').style.width = (windowArray[currentwindowindex].width + 20)+'px'; $('window_container').style.height = (windowArray[currentwindowindex].height + 20)+'px'; $('window').style.width = windowArray[currentwindowindex].width+'px'; $('window').style.height = windowArray[currentwindowindex].height+'px'; } if(windowArray[currentwindowindex].name == 'login' || (windowArray[currentwindowindex].name == 'new_jamlist' && !memberloggedin) || (windowArray[currentwindowindex].name == 'upload' && !memberloggedin)) { $('login_username').focus(); } else if(windowArray[currentwindowindex].name == 'sign_up') { $('signup_username').focus(); } else if(windowArray[currentwindowindex].name == 'contact_us') { Recaptcha.create("6LfTrcESAAAAAIGDJv9p9a3OBXGZHew2DgIdC_Vo", "recaptcha_refresh", { theme : 'custom', custom_theme_widget: 'recaptcha_widget' } ); } } else { if(windowArray[currentwindowindex].name == 'upload' && !memberloggedin) { $('window_container').style.top = (($('test').offsetHeight - 200) / 2)+'px'; $('window_background').style.display = 'block'; $('window_loading').style.display = 'block'; $('window_container').style.width = '370px'; $('window_container').style.height = '70px'; $('window').style.width = '350px'; $('window').style.height = '50px'; } else { $('window_container').style.top = (($('test').offsetHeight - (windowArray[currentwindowindex].height + 20)) / 2)+'px'; $('window_background').style.display = 'block'; $('window_loading').style.display = 'block'; $('window_container').style.width = (windowArray[currentwindowindex].width + 20)+'px'; $('window_container').style.height = '70px'; $('window').style.width = windowArray[currentwindowindex].width+'px'; $('window').style.height = '50px'; } } } function GetXmlHttpObject() { if (window.XMLHttpRequest) { return new XMLHttpRequest(); } if (window.ActiveXObject) { return new ActiveXObject("Microsoft.XMLHTTP"); } return null; } function addscript() { var jsEl = document.createElement('script'); jsEl.type = 'text/javascript'; var currenttabsplit = currenttab.split("-"); if(currenttabsplit[0] == 'jamlist') { jsEl.src = "/scripts/sortabletwelve.js"; } else { jsEl.src = "/scripts/fiftyeighttest.js"; } document.body.appendChild(jsEl); } function resizeAll() { $('container').style.width = ($('test').offsetWidth - 160)+'px'; $('window_background').style.width = ($('test').offsetWidth - 160)+'px'; if($('window_background').style.display == 'block') { $('window_container').style.top = (($('test').offsetHeight - $('window_container').offsetHeight) / 2)+'px'; } $('ad_space').style.left = ($('test').offsetWidth - 160)+'px'; $('border').style.height = ($('test').offsetHeight - 65)+'px'; $('content').style.width = ($('border').offsetWidth - 5)+'px'; $('content').style.height = ($('border').offsetHeight - 9)+'px'; $('browse').style.left = ($('margin').offsetWidth + 3)+'px'; $('browse').style.width = ($('content').offsetWidth - ($('margin').offsetWidth + 8))+'px'; $('footer').style.width = ($('test').offsetWidth - 160)+'px'; $('tabs_for_picks_completed').style.width = ($('test').offsetWidth - 160)+'px'; if(currenttab == 'browse') { $('content_height_1').style.height = ($('content').offsetHeight - 77)+'px'; $('content_height_2').style.height = ($('content').offsetHeight - 77)+'px'; $('content_height_3').style.height = ($('content').offsetHeight - 77)+'px'; } else if(currenttab != 'home') { $('content_height').style.height = ($('content').offsetHeight - 77)+'px'; } var tempcontainer = containerMap.retrieve(currenttab); if(tempcontainer.file != '') { $('whole_tab').style.height = (getBrowseHeight() - 25)+'px'; $('tab_cycle').style.left = -($('current_cycling_index').className * (getBrowseWidth()-20))+'px'; for(var i=0; i < $('size_of_cyclingarray').className; i++) { $('cycle_container_'+i+'').style.width = (getBrowseWidth() - 20)+'px'; } if(tempcontainer.ytstate == 'closed') { $('tab_contents').style.height = (getBrowseHeight() - 33)+'px'; $('tab_overflow').style.height = (getBrowseHeight() - 97)+'px'; $('left_arrow_container').style.height = (getBrowseHeight() - 115)+'px'; $('right_arrow_container').style.height = (getBrowseHeight() - 115)+'px'; } else if(tempcontainer.ytstate == 'search') { $('tab_contents').style.height = (getBrowseHeight() - 95)+'px'; $('tab_overflow').style.height = (getBrowseHeight() - 160)+'px'; $('left_arrow_container').style.height = (getBrowseHeight() - 155)+'px'; $('right_arrow_container').style.height = (getBrowseHeight() - 155)+'px'; } else if(tempcontainer.ytstate == 'initial' || tempcontainer.ytstate == 'results') { $('tab_contents').style.height = (getBrowseHeight() - 193)+'px'; $('tab_overflow').style.height = (getBrowseHeight() - 268)+'px'; $('left_arrow_container').style.height = (getBrowseHeight() - 275)+'px'; $('right_arrow_container').style.height = (getBrowseHeight() - 275)+'px'; } else if(tempcontainer.ytstate == 'video') { $('tab_contents').style.height = (getBrowseHeight() - 302)+'px'; $('tab_overflow').style.height = (getBrowseHeight() - 400)+'px'; $('left_arrow_container').style.height = (getBrowseHeight() - 405)+'px'; $('right_arrow_container').style.height = (getBrowseHeight() - 405)+'px'; } } } function onFocusResultsSearch(input) { if(input.value == "Search these results") { input.value = ""; } } function onBlurResultsSearch(input) { if(input.value == "") { input.value = "Search these results"; } } function onFocusAllSearch(input) { if(input.value == "Search for a tab") { input.value = ""; } } function onBlurAllSearch(input) { if(input.value == "") { input.value = "Search for a tab"; } } function onFocusBrowseSearch(input) { if(input.value == "Search for an artist or song") { input.value = ""; } } function onBlurBrowseSearch(input) { if(input.value == "") { input.value = "Search for an artist or song"; } } function onFocusUsername(input) { if(input.value == "Username") { input.className = "black_input"; input.value = ""; } } function onBlurUsername(input) { if(input.value == "") { input.className = "grey_input"; input.value = "Username"; } } function onFocusPassword(input) { input.style.display = 'none'; $('login_password').style.display = 'block'; setTimeout("$('login_password').focus()", 25); } function onBlurPassword(input) { if(input.value == "") { input.style.display = 'none'; $('grey_password_input').style.display = 'block'; } } function onFocusJamlist(input) { if(input.value == "Enter your jamlist name") { input.value = ""; input.className = "black_input"; } } function onBlurJamlist(input) { if(input.value == '') { input.value = "Enter your jamlist name"; input.className = "grey_input"; } } function onFocusArtist(input) { if(input.value == 'Artist') { input.value = ''; input.className = 'black_input'; } else { input.style.backgroundColor = '#ffffff'; } } function onBlurArtist(input) { if(input.value == '') { input.value = 'Artist'; input.className = 'grey_input'; } } function onFocusSong(input) { if(input.value == 'Song') { input.value = ''; input.className = 'black_input'; } else { input.style.backgroundColor = '#ffffff'; } } function onBlurSong(input) { if(input.value == '') { input.value = 'Song'; input.className = 'grey_input'; } } function onFocusTab(input) { input.style.backgroundColor = '#ffffff'; } function onFocusSignUpUsername(input) { if(input.value == 'Desired Username') { input.className = 'black_input'; input.value = ''; } } function onBlurSignUpUsername(input) { if(input.value == '') { input.className = 'grey_input'; input.value = 'Desired Username'; } } function onFocusSignUpPassword() { $('signup_password_block').style.display = 'none'; $('signup_password_none').style.display = 'block'; setTimeout("$('signup_password_none').focus()", 25); } function onBlurSignUpPassword(input) { if(input.value == '') { $('signup_password_none').style.display = 'none'; $('signup_password_block').style.display = 'block'; } } function onFocusSignUpConfirm() { $('signup_confirm_block').style.display = 'none'; $('signup_confirm_none').style.display = 'block'; setTimeout("$('signup_confirm_none').focus()", 25); } function onBlurSignUpConfirm(input) { if(input.value == '') { $('signup_confirm_none').style.display = 'none'; $('signup_confirm_block').style.display = 'block'; } } function onFocusEmail(input) { if(input.value == 'Your email') { input.className = 'black_input'; input.value = ''; } } function onBlurEmail(input) { if(input.value == '') { input.className = 'grey_input'; input.value = 'Your email'; } } function onFocusAnswer(input) { if(input.value == 'Security question answer') { input.className = 'black_input'; input.value = ''; } } function onBlurAnswer(input) { if(input.value == '') { input.className = 'grey_input'; input.value = 'Security question answer'; } } function onFocusResetEmail(input) { if(input.value == 'Your email') { input.className = 'black_input'; input.value = ''; } } function onBlurResetEmail(input) { if(input.value == '') { input.className = 'grey_input'; input.value = 'Your email'; } } function onFocusYouTubeSearch(input) { if(input.value == 'Search YouTube') { input.className = 'black_input'; input.value = ''; } } function onBlurYouTubeSearch(input) { if(input.value == '') { input.className = 'grey_input'; input.value = 'Search YouTube'; } } function onFocusAdvancedArtist(input) { if(input.value == 'Enter in an artist') { input.value = ''; input.className = 'black_input'; } } function onBlurAdvancedArtist(input) { if(input.value == '') { input.value = 'Enter in an artist'; input.className = 'grey_input'; } } function onFocusAdvancedSong(input) { if(input.value == 'Enter a song or leave it blank to search all songs') { input.value = ''; input.className = 'black_input'; } } function onBlurAdvancedSong(input) { if(input.value == '') { input.value = 'Enter a song or leave it blank to search all songs'; input.className = 'grey_input'; } } function onFocusAdvancedUsername(input) { if(input.value == 'Username') { input.value = ''; input.className = 'black_input'; } } function onBlurAdvancedUsername(input) { if(input.value == '') { input.value = 'Username'; input.className = 'grey_input'; } } function onFocusSearch(obj) { $('fake_search_table').style.display = 'block'; if(obj.value == 'Search for a tab') { obj.value = ''; $('input_clear_style').appear(); new Effect.Morph('input_style', { style: 'padding-left: 30px', duration: 0.5 }); new Effect.Morph('input_search_style', { style: 'left: 236px', duration: 0.5 }); new Effect.Morph('advanced_search', { style: 'left: 275px;', duration: 0.5 }); } if($('auto_complete').innerHTML != '') { $('auto_complete').style.display = 'block'; } } function onBlurSearch(obj) { if(obj.value == '' && !overinputs) { $('fake_search_table').style.display = 'none'; obj.value = 'Search for a tab'; Effect.Fade('input_clear_style', { duration: 0.5 }); new Effect.Morph('input_style', { style: 'padding-left: 5px', duration: 0.5 }); new Effect.Morph('input_search_style', { style: 'left: 210px', duration: 0.5 }); new Effect.Morph('advanced_search', { style: 'left: 250px;', duration: 0.5 }); } if(!autocompleteover) { $('auto_complete').style.display = 'none'; } } function onFocusHomePage(obj) { if(obj.value == 'Search for an artist or song') { obj.value = ''; } } function onBlurHomePage(obj) { if(obj.value == '') { obj.value = 'Search for an artist or song'; } } function onKeyPressSearch(obj, e) { if(Browser.Version() <= 7) { return; } var ASCIIKeyID = allEve(e).key; if(KeyPressed(NonASCIIKeyID, 'NonASCII') != '') { $('current_search').innerHTML = obj.value + KeyPressed(ASCIIKeyID, 'ASCII'); xmlhttp=GetXmlHttpObject(); if (xmlhttp==null) { alert ("Your browser does not support XMLHTTP!"); return; } var url="/auto_complete.php?auto_complete_search="+$('current_search').innerHTML+"!"; xmlhttp.onreadystatechange=autoCompleteStateChanged; xmlhttp.open("GET",url,true); xmlhttp.send(null); jQuery.ajax({ type: 'GET', url: 'auto_complete.php', data: "input_auto_complete=1&auto_complete_search="+$('current_search').innerHTML+"!", beforeSend: function() { $('search_completion').style.visibility = 'hidden'; }, success: function(data) { if(data != '0') { $('search_completion').innerHTML = data; currentautocomplete = data; $('search_completion').style.visibility = 'visible'; } } }); } } function onKeyDownSearch(obj, e) { if(Browser.Version() <= 7) { return; } NonASCIIKeyID = (window.event) ? event.keyCode : e.keyCode; if(NonASCIIKeyID == 39) { var caretposition = 0; if (obj.createTextRange) { var r = document.selection.createRange().duplicate(); r.moveStart("character", -obj.value.length); caretposition = r.text.length; } else { caretposition = obj.selectionEnd; } if(caretposition != 0 && caretposition == obj.value.length && $('search_completion').innerHTML != '') { obj.value = obj.value + currentautocomplete; $('current_search').innerHTML = obj.value; $('search_completion').innerHTML = ''; $('search_completion').style.visibility = 'hidden'; $('auto_complete').style.display = 'none'; } } else if(NonASCIIKeyID == 8) { $('search_completion').style.visibility = 'hidden'; if(obj.value.length > 1) { var caretposition = 0; if (obj.createTextRange) { var r = document.selection.createRange().duplicate(); r.moveStart("character", -obj.value.length); caretposition = r.text.length; } else { caretposition = obj.selectionEnd; } $('current_search').innerHTML = obj.value.slice(0, (caretposition-1)) + obj.value.slice(caretposition, obj.value.length); xmlhttp=GetXmlHttpObject(); if (xmlhttp==null) { alert ("Your browser does not support XMLHTTP!"); return; } var url="/auto_complete.php?auto_complete_search="+$('current_search').innerHTML+"!"; xmlhttp.onreadystatechange=autoCompleteStateChanged; xmlhttp.open("GET",url,true); xmlhttp.send(null); jQuery.ajax({ type: 'GET', url: 'auto_complete.php', data: "input_auto_complete=1&auto_complete_search="+$('current_search').innerHTML+"!", beforeSend: function() { $('search_completion').style.visibility = 'hidden'; }, success: function(data) { if(data != '0') { $('search_completion').innerHTML = data; currentautocomplete = data; $('search_completion').style.visibility = 'visible'; } } }); } else { $('auto_complete').style.height = '0px'; $('auto_complete').innerHTML = ''; $('auto_complete').style.display = 'none'; } } } function clearSearch() { $('input_style').value = ''; $('search_completion').style.visibility = 'hidden'; $('search_completion').innerHTML = ''; $('current_search').innerHTML = ''; $('auto_complete').style.display = 'none'; $('auto_complete').innerHTML = ''; $('input_style').focus(); overinputs = false; } function choseBrowse() { $('browse_vs_search').fade(); decided = true; } function getContentHeight() { return ($('content').offsetHeight - 77)+'px'; } function getBrowseHeight() { return $('browse').offsetHeight; } function getBrowseWidth() { return $('browse').offsetWidth; } function closeTab() { $('tab_display_container').fade(); setTimeout("$('tab_display_container').style.display='none'", 850); var tempcontainer = containerMap.retrieve(currenttab); if(tempcontainer != null) { var currenttabsplit = currenttab.split("-"); if(currenttabsplit[0] == "jamlist" && currenttabsplit.length > 1) { tempcontainer.artist = '-'; tempcontainer.song = '-'; tempcontainer.file = ''; tempcontainer.ytstate='initial'; tempcontainer.previousytstate='initial'; tempcontainer.ytsearch=''; tempcontainer.ytvideoid=''; tempcontainer.ytvideotime=0; tempcontainer.ytvideostate=1; changinghash = true; currenthash = '#!/jamlist/'+currenttabsplit[1]+'/'; window.location.hash = currenthash; changinghash = false; } else if(currenttab == 'browse') { tempcontainer.file = ''; tempcontainer.ytstate='initial'; tempcontainer.previousytstate='initial'; tempcontainer.ytsearch=''; tempcontainer.ytvideoid=''; tempcontainer.ytvideotime=0; tempcontainer.ytvideostate=1; changinghash = true; currenthash = '#!/'+currenttab+'/'+tempcontainer.artist+'/'+tempcontainer.song+'/'; window.location.hash = currenthash; changinghash = false; } else if(currenttab == 'search') { tempcontainer.file = ''; tempcontainer.ytstate='initial'; tempcontainer.previousytstate='initial'; tempcontainer.ytsearch=''; tempcontainer.ytvideoid=''; tempcontainer.ytvideotime=0; tempcontainer.ytvideostate=1; changinghash = true; currenthash = '#!/'+currenttab+'/advanced/'+advancedartist+'/'+advancedsong+'/'+advancedtuning+'/'+advancedportion+'/'+advancedrating+'/'+advancedusername+'/'; window.location.hash = currenthash; changinghash = false; } else { tempcontainer.artist = '-'; tempcontainer.song = '-'; tempcontainer.file = ''; tempcontainer.ytstate='initial'; tempcontainer.previousytstate='initial'; tempcontainer.ytsearch=''; tempcontainer.ytvideoid=''; tempcontainer.ytvideotime=0; tempcontainer.ytvideostate=1; changinghash = true; currenthash = '#!/'+currenttab+'/'; window.location.hash = currenthash; changinghash = false; } if($(currenttab+'_navigation')) { $(currenttab+'_navigation').setAttribute("onClick", "newHash('"+currenthash+"')"); } changeTitle(); } } function openPrintWindow(resourceid) { w = open('/print/?rid='+resourceid+'','Print Tab','width=1000,height=500,location=1,directories=1,status=1,menubar=1,scrollbars=1,resizable=1'); } function CloseUserVideoUpload() { Effect.Fade('user_video_upload', { duration: 0.5 }); setTimeout("$('user_video_upload').style.display = 'none'", 550); } function toggleYouTubeType() { var tempcontainer = containerMap.retrieve(currenttab); var hashsplit = window.location.hash.split("/"); var hash = ''; if(hashsplit.length > 5 && hashsplit[1] == "jamlist") { for(var i=0; i < 6; i++) { hash += hashsplit[i]+'/'; } } else if(hashsplit.length > 11 && hashsplit[1] == "search" && hashsplit[2] == "advanced") { for(var i=0; i < 12; i++) { hash += hashsplit[i]+'/'; } } else if(hashsplit.length > 4) { for(var i=0; i < 5; i++) { hash += hashsplit[i]+'/'; } } if(tempcontainer.overallvideostate == 'initial') { tempcontainer.overallvideostate = 'user'; if(tempcontainer.uservideostate == 'search') { hash += 'search/'; } else if(tempcontainer.uservideostate == 'results') { hash += 'results/'+tempcontainer.uservideoinput+'/'; } else if(tempcontainer.uservideostate == 'video') { hash += 'video/'+tempcontainer.uservideoinput+'/'; } } else if(tempcontainer.overallvideostate == 'user') { tempcontainer.overallvideostate = 'initial'; if(tempcontainer.initialvideostate == 'video') { hash += 'video/'+tempcontainer.initialvideoinput+'/'; } } newHash(hash); } function collapseYouTube() { var tempcontainer = containerMap.retrieve(currenttab); var hashsplit = window.location.hash.split("/"); if(ytplayer != null && hashsplit[1] != window) { tempcontainer.ytvideostate = ytplayer.getPlayerState(); ytplayer.pauseVideo(); tempcontainer.ytvideotime = ytplayer.getCurrentTime(); ytplayer = null; } var hash = ''; if(hashsplit.length > 5 && (hashsplit[1] == "jamlist" || hashsplit[1] == "user_tabs")) { for(var i=0; i < 6; i++) { hash += hashsplit[i]+'/'; } } else if(hashsplit.length > 11 && hashsplit[1] == "search" && hashsplit[2] == "advanced") { for(var i=0; i < 12; i++) { hash += hashsplit[i]+'/'; } } else if(hashsplit.length > 4) { for(var i=0; i < 5; i++) { hash += hashsplit[i]+'/'; } } var data = {}; data.current_hash = hash; data.ytsearch = tempcontainer.ytsearch; data.ytvideoid = tempcontainer.ytvideoid; data.youtube_state = 'closed'; jQuery.ajax({ type: 'POST', url: 'youtube_functionality.php', data: data, beforeSend: function() { $('delayed_youtube_loading').style.display = 'block'; }, success: function(data) { $('delayed_youtube_loading').style.display = 'none'; tempcontainer.ytstate = 'closed'; $('youtube_container').innerHTML = ''; new Effect.Morph('tab_contents', { duration: 0.5, style: 'top: 25px; height: '+(getBrowseHeight()-25)+'px;' }); new Effect.Morph('tab_overflow', { duration: 0.5, style: 'height: '+(getBrowseHeight()-97)+'px;' }); new Effect.Morph('left_arrow_container', { duration: 0.5, style: 'top: 75px; height: '+(getBrowseHeight()-115)+'px;' }); new Effect.Morph('right_arrow_container', { duration: 0.5, style: 'top: 75px; height: '+(getBrowseHeight()-115)+'px;' }); new Effect.Morph('tab_rating_container', { duration: 0.5, style: 'top: 25px;' }); $('collapsed_youtube_navigation').innerHTML = data; setTimeout(function() { $('collapsed_youtube_navigation').style.display = 'block'; }, 550); } }); } function toggleYouTubeDescription() { if($('toggle_youtube_description').innerHTML == 'More') { $('toggle_youtube_description').innerHTML = 'Less'; if($('youtube_description_height').offsetHeight > 120) { $('youtube_description').style.overflow = 'auto'; new Effect.Morph('youtube_description', { duration: 0.5, style: 'height: 120px' }); new Effect.Morph('toggle_youtube_description', { duration: 0.5, style: 'top: 120px' }); new Effect.Morph('youtube_video_information', { duration: 0.5, style: 'top: 155px' }); } else if($('youtube_description_height').offsetHeight > 20) { new Effect.Morph('youtube_description', { duration: 0.5, style: 'height: '+$('youtube_description_height').offsetHeight+'px' }); new Effect.Morph('toggle_youtube_description', { duration: 0.5, style: 'top: '+$('youtube_description_height').offsetHeight+'px' }); new Effect.Morph('youtube_video_information', { duration: 0.5, style: 'top: '+($('youtube_description_height').offsetHeight + 35)+'px' }); } } else if($('toggle_youtube_description').innerHTML == 'Less') { $('toggle_youtube_description').innerHTML = 'More'; $('youtube_description').scrollTop = '0'; $('youtube_description').style.overflow = 'hidden'; new Effect.Morph('youtube_description', { duration: 0.5, style: 'height: 16px' }); new Effect.Morph('toggle_youtube_description', { duration: 0.5, style: 'top: 16px' }); new Effect.Morph('youtube_video_information', { duration: 0.5, style: 'top: 56px' }); } } function forgotPassword() { $('member_login').fade(); setTimeout("$('member_login').style.display = 'none'", 850); setTimeout("$('invalid_login').style.display = 'none'", 850); setTimeout("$('forgot_password').appear()", 850); setTimeout("$('forgot_password').style.display = 'block'", 1700); new Effect.Morph('window_container', { duration: 0.5, style: 'height: 250px;' }); new Effect.Morph('window', { duration: 0.5, style: 'height: 230px;' }); } function cancelPasswordReset() { $('forgot_password').fade(); setTimeout("$('forgot_password').style.display = 'none'", 850); setTimeout("$('reset_username').value = ''", 850); setTimeout("$('reset_email').value = ''", 850); setTimeout("$('reset_failed').style.display = 'none'", 850); setTimeout("$('reset_error').style.display = 'none'", 850); setTimeout("$('member_login').appear()", 850); setTimeout("$('member_login').style.display = 'block'", 1700); new Effect.Morph('window_container', { duration: 0.5, style: 'height: 220px;' }); new Effect.Morph('window', { duration: 0.5, style: 'height: 200px;' }); } function displayJamlistError(error) { if(jamlisterror) { if(error == 'large') { $('jamlist_duplicate').fade(); $('jamlist_nonascii').fade(); setTimeout("$('jamlist_large').appear()", 900); jamlisterror = true; } else if(error == 'duplicate') { $('jamlist_large').fade(); $('jamlist_nonascii').fade(); setTimeout("$('jamlist_duplicate').appear()", 900); jamlisterror = true; } else if(error == 'nonascii') { $('jamlist_large').fade(); $('jamlist_duplicate').fade(); setTimeout("$('jamlist_nonascii').appear()", 900); jamlisterror = true; } else if(error == '') { $('jamlist_large').fade(); $('jamlist_duplicate').fade(); $('jamlist_nonascii').fade(); jamlisterror = false; } } else { if(error == 'large') { $('jamlist_large').appear(); jamlisterror = true; } else if(error == 'duplicate') { $('jamlist_duplicate').appear(); jamlisterror = true; } else if(error == 'nonascii') { $('jamlist_nonascii').appear(); jamlisterror = true; } } } function getCurrentJamlistIndex() { for(var i=0; i < jamlistarray.length; i++) { if(jamlistarray[i][0] == currentjamlist) { return i; } } } function getCurrentWindowIndex() { var hashsplit = currenthash.split("/"); if(hashsplit.length > 2) { for(var i=0; i<windowArray.length; i++) { if(windowArray[i].name == hashsplit[2]) { return i; } } } } function disableBrowsing() { disablebrowsing = true; } function enableBrowsing() { setTimeout("disablebrowsing=false", 50); } function changeTitle() { var tempcontainer = containerMap.retrieve(currenttab); if(tempcontainer != null) { var currenttabsplit = currenttab.split("-"); if(currenttabsplit[0] == "jamlist") { if(tempcontainer.file != "") { var tempartist = tempcontainer.artist; var realartist = ''; tempartist = tempartist.split('_'); for(var i=0; i < tempartist.length; i++) { realartist += tempartist[i].substring(0,1).toUpperCase() + tempartist[i].substring(1,tempartist[i].length) + ' '; } var tempsong = tempcontainer.song; var realsong = ''; tempsong = tempsong.split('_'); for(var i=0; i < tempsong.length; i++) { realsong += tempsong[i].substring(0,1).toUpperCase() + tempsong[i].substring(1,tempsong[i].length) + ' '; } document.title = 'Tab For '+realsong+' by '+realartist+' - Zojam.com'; } else if(currenttabsplit.length > 1) { document.title = (currenttabsplit[1].split("_").join(" "))+' Jamlist - Zojam.com'; } } else if(currenttab == 'home') { document.title = 'Zojam.com - Online Tablature Perfected'; } else if(currenttab == 'popular') { if(tempcontainer.file != "") { var tempartist = tempcontainer.artist; var realartist = ''; tempartist = tempartist.split('_'); for(var i=0; i < tempartist.length; i++) { realartist += tempartist[i].substring(0,1).toUpperCase() + tempartist[i].substring(1,tempartist[i].length) + ' '; } var tempsong = tempcontainer.song; var realsong = ''; tempsong = tempsong.split('_'); for(var i=0; i < tempsong.length; i++) { realsong += tempsong[i].substring(0,1).toUpperCase() + tempsong[i].substring(1,tempsong[i].length) + ' '; } document.title = 'Tab For '+realsong+' by '+realartist+' - Zojam.com'; } else { document.title = '100 Most Popular Tabs - Zojam.com'; } } else if(currenttab == 'recent') { if(tempcontainer.file != "") { var tempartist = tempcontainer.artist; var realartist = ''; tempartist = tempartist.split('_'); for(var i=0; i < tempartist.length; i++) { realartist += tempartist[i].substring(0,1).toUpperCase() + tempartist[i].substring(1,tempartist[i].length) + ' '; } var tempsong = tempcontainer.song; var realsong = ''; tempsong = tempsong.split('_'); for(var i=0; i < tempsong.length; i++) { realsong += tempsong[i].substring(0,1).toUpperCase() + tempsong[i].substring(1,tempsong[i].length) + ' '; } document.title = 'Tab For '+realsong+' by '+realartist+' - Zojam.com'; } else { document.title = 'Most Recently Viewed Tabs - Zojam.com'; } } else if(currenttab == 'browse') { var tempartist = tempcontainer.artist; var realartist = ''; tempartist = tempartist.split('_'); for(var i=0; i < tempartist.length; i++) { realartist += tempartist[i].substring(0,1).toUpperCase() + tempartist[i].substring(1,tempartist[i].length) + ' '; } var tempsong = tempcontainer.song; var realsong = ''; tempsong = tempsong.split('_'); for(var i=0; i < tempsong.length; i++) { realsong += tempsong[i].substring(0,1).toUpperCase() + tempsong[i].substring(1,tempsong[i].length) + ' '; } if(tempcontainer.artist == "-" && tempcontainer.song == "-") { document.title = 'All Artists - Zojam.com'; } else if(tempcontainer.artist != "-" && tempcontainer.song == "-") { document.title = 'Songs by '+realartist+' - Zojam.com'; } else if(tempcontainer.artist != "-" && tempcontainer.song != "-" && tempcontainer.file == "") { document.title = 'Tabs For '+realsong+' by '+realartist+' - Zojam.com'; } else if(tempcontainer.artist != "-" && tempcontainer.song != "-" && tempcontainer.file != "") { document.title = 'Tab For '+realsong+' by '+realartist+' - Zojam.com'; } } else if(currenttab == 'search') { if(searchstate == 'regular') { if(pastsearch == '-') { document.title = 'Search Results For (Nothing Searched) - Zojam.com'; } else { document.title = 'Search Results For '+pastsearch+' - Zojam.com'; } } else { if(advancedsong == '-') { document.title = 'Advanced Search Results for '+advancedartist+' Tabs - Zojam.com'; } else { document.title = 'Advanced Search Results for '+advancedsong+' by '+advancedartist+' Tabs - Zojam.com'; } } } else if(currenttab == 'user_tabs') { if(usertabs != '') { document.title = "User "+usertabs+"'s Tabs"; } } } } function customTuning() { $('default_tunings').fade(); $('choose_custom').fade(); setTimeout("$('default_tunings').style.display='none'", 900); setTimeout("$('choose_custom').style.display='none'", 900); setTimeout("$('custom_tuning').appear()", 900); setTimeout("$('choose_default').appear()", 900); } function defaultTunings() { $('custom_tuning').fade(); $('choose_default').fade(); setTimeout("$('custom_tuning').style.display='none'", 900); setTimeout("$('choose_default').style.display='none'", 900); setTimeout("$('default_tunings').appear()", 900); setTimeout("$('choose_custom').appear()", 900); } function uploadContainer(type) { if(type == 'tab') { if($('tab_upload_container').style.display == 'none') { if($('file_upload_container').style.display == 'block') { Effect.BlindUp('file_upload_container'); setTimeout("$('file_upload_container').style.display='none'", 850); } Effect.BlindDown('tab_upload_container'); setTimeout("$('tab_upload_container').style.display='block'", 850); } else { Effect.BlindUp('tab_upload_container'); setTimeout("$('tab_upload_container').style.display='none'", 850); } } else if(type == 'file') { if($('file_upload_container').style.display == 'none') { if($('tab_upload_container').style.display == 'block') { Effect.BlindUp('tab_upload_container'); setTimeout("$('tab_upload_container').style.display='none'", 850); } Effect.BlindDown('file_upload_container'); setTimeout("$('file_upload_container').style.display='block'", 850); } else { Effect.BlindUp('file_upload_container'); setTimeout("$('file_upload_container').style.display='none'", 850); } } } function addTabLine() { if($('tab_upload').value == "" || $('tab_upload').value == "\n") { $('tab_upload').value = "|------------------------------------------------------------------------------|"; } else { $('tab_upload').value += "\n\n|------------------------------------------------------------------------------|"; } $('tab_upload').value += "\n|------------------------------------------------------------------------------|"; $('tab_upload').value += "\n|------------------------------------------------------------------------------|"; $('tab_upload').value += "\n|------------------------------------------------------------------------------|"; $('tab_upload').value += "\n|------------------------------------------------------------------------------|"; $('tab_upload').value += "\n|------------------------------------------------------------------------------|"; } function startUpload() { $('upload_loading').style.display = 'block'; return true; } function stopUpload(success) { $('upload_loading').style.display = 'none'; if (success == 1) { $('upload_success').appear(); } else if(success == 2) { $('upload_result').innerHTML = '<span class="emsg">You can only upload guitar pro and power tab files<\/span><br/><br/>'; $('file_upload_name').value = ''; } else { $('upload_result').innerHTML = '<span class="emsg">There was an error during file upload!<\/span><br/><br/>'; $('file_upload_name').value = ''; } return true; } function uploadAnotherTab() { $('artist_upload').value = ''; $('song_upload').value = ''; $('instrument_upload').selectedIndex = 0; $('tuning_upload').selectedIndex = 0; $('portion_upload').selectedIndex = 0; $('tab_upload').value = ''; $('tab_save_id').value = ''; $('tab_video_id').value = ''; $('youtube_video_successfully_linked').style.display = 'none'; $('youtube_user_video_choice').style.display = 'block'; Effect.Fade('upload_success', { duration: 0.8 }); Effect.Appear('user_upload', { delay: 0.8, duration: 0.8 }); new Effect.Morph('window_container', { delay: 0.8, duration: 0.5, style: 'width: 720px; height: 580px; top: '+(($('test').offsetHeight - 580) / 2)+'px' }); new Effect.Morph('window', { delay: 0.8, duration: 0.5, style: 'width: 700px; height: 560px;' }); } function starOver(stars) { if($('actual_star_rating').style.display == 'block') { $('actual_star_rating').style.display = 'none'; } else if($('one_star_rating').style.display == 'block') { $('one_star_rating').style.display = 'none'; } else if($('two_star_rating').style.display == 'block') { $('two_star_rating').style.display = 'none'; } else if($('three_star_rating').style.display == 'block') { $('three_star_rating').style.display = 'none'; } else if($('four_star_rating').style.display == 'block') { $('four_star_rating').style.display = 'none'; } else if($('five_star_rating').style.display == 'block') { $('five_star_rating').style.display = 'none'; } $(stars+'_star_rating').style.display = 'block'; } function starOut() { if($('one_star_rating').style.display == 'block') { $('one_star_rating').style.display = 'none'; } else if($('two_star_rating').style.display == 'block') { $('two_star_rating').style.display = 'none'; } else if($('three_star_rating').style.display == 'block') { $('three_star_rating').style.display = 'none'; } else if($('four_star_rating').style.display == 'block') { $('four_star_rating').style.display = 'none'; } else if($('five_star_rating').style.display == 'block') { $('five_star_rating').style.display = 'none'; } $('actual_star_rating').style.display = 'block'; } function DisplayTabInformation(e, div) { $('tab_information').innerHTML = $('tab_information_'+div+'').innerHTML; $('tab_information').style.display = 'block'; var posx = 0; var posy = 0; 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; } $('tab_information').style.left = (posx+10)+'px'; $('tab_information').style.top = (posy-35)+'px'; } function HideTabInformation() { $('tab_information').style.display = 'none'; } function KeyPressed(code, type) { var keypressed = ''; if(type == 'ASCII') { switch(code) { case 32: keypressed=' '; break; case 33: keypressed='!'; break; case 34: keypressed='"'; break; case 35: keypressed='#'; break; case 36: keypressed='$'; break; case 37: keypressed='%'; break; case 38: keypressed='&'; break; case 39: keypressed="'"; break; case 40: keypressed='('; break; case 41: keypressed=')'; break; case 42: keypressed='*'; break; case 43: keypressed='+'; break; case 44: keypressed=','; break; case 45: keypressed='-'; break; case 46: keypressed='.'; break; case 47: keypressed='/'; break; case 48: keypressed='0'; break; case 49: keypressed='1'; break; case 50: keypressed='2'; break; case 51: keypressed='3'; break; case 52: keypressed='4'; break; case 53: keypressed='5'; break; case 54: keypressed='6'; break; case 55: keypressed='7'; break; case 56: keypressed='8'; break; case 57: keypressed='9'; break; case 58: keypressed=':'; break; case 59: keypressed=';'; break; case 60: keypressed='<'; break; case 61: keypressed='='; break; case 62: keypressed='>'; break; case 63: keypressed='?'; break; case 64: keypressed='@'; break; case 65: keypressed='A'; break; case 66: keypressed='B'; break; case 67: keypressed='C'; break; case 68: keypressed='D'; break; case 69: keypressed='E'; break; case 70: keypressed='F'; break; case 71: keypressed='G'; break; case 72: keypressed='H'; break; case 73: keypressed='I'; break; case 74: keypressed='J'; break; case 75: keypressed='K'; break; case 76: keypressed='L'; break; case 77: keypressed='M'; break; case 78: keypressed='N'; break; case 79: keypressed='O'; break; case 80: keypressed='P'; break; case 81: keypressed='Q'; break; case 82: keypressed='R'; break; case 83: keypressed='S'; break; case 84: keypressed='T'; break; case 85: keypressed='U'; break; case 86: keypressed='V'; break; case 87: keypressed='W'; break; case 88: keypressed='X'; break; case 89: keypressed='Y'; break; case 90: keypressed='Z'; break; case 91: keypressed='['; break; case 92: keypressed='\\'; break; case 93: keypressed=']'; break; case 94: keypressed='^'; break; case 95: keypressed='_'; break; case 96: keypressed='`'; break; case 97: keypressed='a'; break; case 98: keypressed='b'; break; case 99: keypressed='c'; break; case 100: keypressed='d'; break; case 101: keypressed='e'; break; case 102: keypressed='f'; break; case 103: keypressed='g'; break; case 104: keypressed='h'; break; case 105: keypressed='i'; break; case 106: keypressed='j'; break; case 107: keypressed='k'; break; case 108: keypressed='l'; break; case 109: keypressed='m'; break; case 110: keypressed='n'; break; case 111: keypressed='o'; break; case 112: keypressed='p'; break; case 113: keypressed='q'; break; case 114: keypressed='r'; break; case 115: keypressed='s'; break; case 116: keypressed='t'; break; case 117: keypressed='u'; break; case 118: keypressed='v'; break; case 119: keypressed='w'; break; case 120: keypressed='x'; break; case 121: keypressed='y'; break; case 122: keypressed='z'; break; case 123: keypressed='{'; break; case 124: keypressed='|'; break; case 125: keypressed='}'; break; case 126: keypressed='~'; break; } } else { if((code > 46 && code < 91) || (code > 93 && code < 112) || code > 145 || code == 32) { keypressed = 'character'; } } return keypressed; } function allEve(e){ var ev= (window.event)? window.event: e; if(!ev || !ev.type) return false; var ME= ev; if(ME.type.indexOf('key')!= -1){ if(window.event || ME.type.indexOf('keypress')!= -1){ ME.key= (ev.keyCode)? ev.keyCode: ((ev.charCode)? ev.charCode: ev.which); } else ME.key= ev.charCode; if(ME.key) ME.letter= String.fromCharCode(ME.key); } return ME; }function RenderAds(){	var currentTimeout = 0;	var currentadrotate = 1; var esarotate = 0;	function TriggerAds()	{ currentTimeout = setTimeout(RotateAd, 10000); $('ad_rotate_1').appear(); setTimeout("$('ad_rotate_1').style.display = 'block'", 850);	}	function RotateAd()	{ if(currentadrotate == 1) { if(!esarotate) { clearTimeout(currentTimeout); currentTimeout = setTimeout(RotateAd, 30000); esarotate = 1; $('esa_text_1').fade(); setTimeout("$('esa_text_1').style.display = 'none'", 850); setTimeout("$('esa_text_2').appear()", 900); setTimeout("$('esa_text_2').style.display = 'block'", 1750); } else { clearTimeout(currentTimeout); currentTimeout = setTimeout(RotateAd, 10000); esarotate = 0; $('esa_text_2').fade(); setTimeout("$('esa_text_2').style.display = 'none'", 850); $('esa_text_1').onclick = RotateAd; setTimeout("$('esa_text_1').appear()", 900); setTimeout("$('esa_text_1').style.display = 'block'", 1750); } } else { currentadrotate = 1; $('ad_rotate_2').fade(); setTimeout("$('ad_rotate_2').style.display = 'none'", 850); $('ad_rotate_1').onclick = RotateAd; setTimeout("$('ad_rotate_1').appear()", 900); setTimeout("$('ad_rotate_1').style.display = 'block'", 1750); }	} TriggerAds();} function CloseWindow(type) { if(type == 'parent' && overwindow) { return; } var currenthashsplit = currenthash.split("/"); if(currenthash.length >= 2 && currenthashsplit[1] == 'window') { Effect.Fade('window_background', { duration: 0.7 }); setTimeout("$('window_background').style.display = 'none'", 750); setTimeout("$('window').innerHTML = ''", 750); setTimeout("$('window_container').style.width = '0px'", 750); setTimeout("$('window_container').style.height = '0px'", 750); setTimeout("$('window').style.width = '0px'", 750); setTimeout("$('window').style.height = '0px'", 750); if(type == 'manual' || type == 'parent') { changinghash = true; currenthash = pasthash; window.location.hash = currenthash; changinghash = false; } } } function GlobalOnMouseMove(event) { var ev = event || window.event; var posx = 0; var posy = 0; if (ev.pageX || ev.pageY) { posx = ev.pageX; posy = ev.pageY; } else if (ev.clientX || ev.clientY) { posx = ev.clientX + document.body.scrollLeft + document.documentElement.scrollLeft; posy = ev.clientY + document.body.scrollTop + document.documentElement.scrollTop; } $('ajax_loading').style.top = (posy - 10)+'px'; $('ajax_loading').style.left = (posx + 10)+'px'; if(ajaxloading) { $('ajax_loading').style.display = 'block'; } } function addEvent(obj, evt, fn) { if (obj.addEventListener) { obj.addEventListener(evt, fn, false); } else if (obj.attachEvent) { obj.attachEvent("on" + evt, fn); } } addEvent(window,"load",function(e) { addEvent(document, "mouseout", function(e) { e = e ? e : window.event; var from = e.relatedTarget || e.toElement; if (!from || from.nodeName == "HTML") { $('ajax_loading').style.display = 'none'; } }); }); function GlobalOnMouseDown(event) { if(!mouseovernotification) { $('notifications').style.display = 'none'; $('notification_container').innerHTML = '<div id="notifications_loading" style="display: none;"><table cellspacing="0" cellpadding="0" border="0" width="100%" height="100%"><tr valign="top"><td align="center"><div id="notifications_loading_container"><table cellspacing="0" cellpadding="0" border="0" width="100%" height="100%"><tr valign="middle"><td align="center">Loading...</td></tr></table></div></td></tr></table></div>'; } } function trackAnalytics() { var urlsplit = document.location.href.split("/"); return (urlsplit[2] == "localhost") ? false : true; } function OpenAdvancedSearch() { new Effect.BlindDown('advanced_search_container'); $('header_search_form').fade(); } function contentContainer(url, artist, song, file, filter, sortcolumn, orderby, ytstate, previousytstate, ytsearch, ytvideoid, ytvideotime, ytvideostate) { this.url=url; this.artist=artist; this.song=song; this.file=file; this.filter=filter; this.sortcolumn=sortcolumn; this.orderby=orderby; this.ytstate=ytstate; this.previousytstate=previousytstate; this.ytsearch=ytsearch; this.ytvideoid=ytvideoid; this.ytvideotime=ytvideotime; this.ytvideostate=ytvideostate; } function windowContainer(url, width, height) { this.url=url; this.width=width; this.height=height; } Effect.Scroll = Class.create(); Object.extend(Object.extend(Effect.Scroll.prototype, Effect.Base.prototype), { initialize: function(element) { this.element = $(element); var options = Object.extend({ x: 0, y: 0, mode: 'absolute' } , arguments[1] || {} ); this.start(options); }, setup: function() { if (this.options.continuous && !this.element._ext ) { this.element.cleanWhitespace(); this.element._ext=true; this.element.appendChild(this.element.firstChild); } this.originalLeft=this.element.scrollLeft; this.originalTop=this.element.scrollTop; if(this.options.mode == 'absolute') { this.options.x -= this.originalLeft; this.options.y -= this.originalTop; } else { } }, update: function(position) { this.element.scrollLeft = this.options.x * position + this.originalLeft; this.element.scrollTop = this.options.y * position + this.originalTop; } }); var BrowserDetect = { init: function () { this.browser = this.searchString(this.dataBrowser) || "An unknown browser"; this.version = this.searchVersion(navigator.userAgent) || this.searchVersion(navigator.appVersion) || "an unknown version"; this.OS = this.searchString(this.dataOS) || "an unknown OS"; }, searchString: function (data) { for (var i=0;i<data.length;i++)	{ var dataString = data[i].string; var dataProp = data[i].prop; this.versionSearchString = data[i].versionSearch || data[i].identity; if (dataString) { if (dataString.indexOf(data[i].subString) != -1) return data[i].identity; } else if (dataProp) return data[i].identity; } }, searchVersion: function (dataString) { var index = dataString.indexOf(this.versionSearchString); if (index == -1) return; return parseFloat(dataString.substring(index+this.versionSearchString.length+1)); }, dataBrowser: [ { string: navigator.userAgent, subString: "Chrome", identity: "Chrome" }, { string: navigator.userAgent, subString: "OmniWeb", versionSearch: "OmniWeb/", identity: "OmniWeb" }, { string: navigator.vendor, subString: "Apple", identity: "Safari", versionSearch: "Version" }, { prop: window.opera, identity: "Opera" }, { string: navigator.vendor, subString: "iCab", identity: "iCab" }, { string: navigator.vendor, subString: "KDE", identity: "Konqueror" }, { string: navigator.userAgent, subString: "Firefox", identity: "Firefox" }, { string: navigator.vendor, subString: "Camino", identity: "Camino" }, { string: navigator.userAgent, subString: "Netscape", identity: "Netscape" }, { string: navigator.userAgent, subString: "MSIE", identity: "Explorer", versionSearch: "MSIE" }, { string: navigator.userAgent, subString: "Gecko", identity: "Mozilla", versionSearch: "rv" }, { string: navigator.userAgent, subString: "Mozilla", identity: "Netscape", versionSearch: "Mozilla" } ], dataOS : [ { string: navigator.platform, subString: "Win", identity: "Windows" }, { string: navigator.platform, subString: "Mac", identity: "Mac" }, { string: navigator.userAgent, subString: "iPhone", identity: "iPhone/iPod" }, { string: navigator.platform, subString: "Linux", identity: "Linux" } ] }; BrowserDetect.init(); var Browser = { Version: function() { var version = 999; if (navigator.appVersion.indexOf("MSIE") != -1) version = parseFloat(navigator.appVersion.split("MSIE")[1]); return version; } }
