var webroot = "http://www.musikalchairs.net/"; /* Lyrek::MusikalChairs::Handling Scripts ****************************************************************/ function login() { document.getElementById('loginForm').submit(); } function logout() { window.location = webroot + "account/?logout=true"; } function sh(id) { if(div=document.getElementById(id)) { if(div.style.display == "block" || div.style.display != "none") { div.style.display = "none"; return; } else { div.style.display = "block"; return; } } else { return false; } } function vi(id) { if(div=document.getElementById(id)) { if(div.style.visibility == "visible" || div.style.visibility != "hidden") { div.style.visibility = "hidden"; return; } else { div.style.visibility = "visible"; return; } } else { return false; } } function togglePage(id,len){ // Function to toggle visibility on multi-page pages (ie. Privacy Policy, Terms of Service) for (i=1; i<=len; i++){ document.getElementById("page"+i).style.display="none"; } document.getElementById("page"+id).style.display="block"; } function swap(id){ // Function to toggle up and down sorts (ie. sort_u_grn, sort_d_grn, sort_u_gry, sort_d_gry, etc.) var i = document.getElementById(id); var arr = i.className.split("_"); arr[1] = (arr[1] == "u"?"d":"u"); var n = arr[0]+"_"+arr[1]+"_"+arr[2]; i.className = n; } function proceed(form) { document.getElementById(form).submit(); } function cancel(page) { document.location=webroot + page; } function initss(show) { for(var i=0;i<10;i++) { if(document.getElementById("ss_"+i)) { var ss = document.getElementById('ss_'+i); if (document.all) { ss.style.left = ((document.body.clientWidth - 450)/2)+"px"; } else { ss.style.left = ((window.innerWidth - 450)/2)+"px"; } ss.style.top = "250px"; new Draggable('ss_'+i,{starteffect:false,endeffect:false}); //no fade, please } } if(show != ""){ if(document.getElementById(show)) ssopen(show); } } function ssopen(ss) { document.getElementById(ss).style.display = "block"; } function ssclose(ss) { document.getElementById(ss).style.display = "none"; } function edit(vars) { document.location = webroot+vars; } function rem(item,path) { if (confirm('Are you sure you want to permanently delete this '+item+'?\nIf you proceed, there is no way to recover any of this information.')) { document.location.href = webroot + path; } } function setVal(fd,val) { var field = document.getElementById(fd); if(field && val) field.value = val; return; } function sort(dir) { var url = window.location.toString(); //url += (url.indexOf('?') > 0 ? "&" : "?") + "s="+dir; url = url.split('?'); url = url[0]; url += "?s="+dir; window.location = url; return; } function collapseAll() { if(!dds) return; for(var i=0; i < dds.length; i++) document.getElementById(dds[i]).style.display = "none"; } function invite(id) { if(uncb) uncb(); if(tc) tc("cid",id,0); if(document.getElementById('selE0')) { if(document.getElementById('selE0').checked == false) document.getElementById('selE0').checked = true; } if(document.getElementById('dd_event').style.display == "none") setLyr(document.getElementById('event'),'dd_event','',1,20); } /* Lyrek::MusikalChairs::Checkboxes and Radios ************************************************************/ function tc(field,id,ico) { var check_field = document.getElementById(field+id); var chk = document.getElementById(field+"_chk"+id); var icon = (ico == 0 ? "chk" : "rad"); if(check_field.checked == true) { check_field.checked = false; chk.src = webroot+"_img/_btn/"+icon+"_d.gif"; } else { check_field.checked = true; chk.src = webroot+"_img/_btn/"+icon+"_a.gif"; } } function tac(field,id,ico) { var check_field = document.getElementById(field+id); var chk = document.getElementById(field+"_chk"+id); var icon = (ico == 0 ? "chk" : "rad"); for(var i=0; i<20; i++) { var check_field = document.getElementById(field+i); var chk = document.getElementById(field+"_chk"+i); if(check_field) { if(id == i) { check_field.checked = true; if(chk) chk.src = webroot+"_img/_btn/"+icon+"_a.gif"; } else { check_field.checked = false; if(chk) chk.src = webroot+"_img/_btn/"+icon+"_d.gif"; } } else { break; } } } /* Lyrek::MusikalChairs::AJAX Scripts ********************************************************************/ /* Lyrek::MusikalChairs::Flash Scripts *******************************************************************/ function buildVenue(vid, n) { alert("VID: "+vid+" NAME: "+n); if (!vid) { return false; } else { n = escape(n); openWin(webroot+'seating/?vid='+vid+'&oldvid='+vid+'&n='+n, 'opt', 800, 600, 0); } } function openWin(url, winname, width, height, scroll) { if (!width) width = 720; if (!height) height = 600; if (!scroll) scroll = 0; window.open(url, winname, 'toolbar=0,scrollbars='+scroll+',location=0,statusbar=0,menubar=0,resizable=0,width='+width+',height='+height); } //sample usage: javascript:openWin('{$wwwroot}mypage.html','wname',720,600,0); /* Lyrek::MusikalChairs:: Promo Links (on dashboard and other pages) *******************************************************************/ function promos(service) { //URL of this document if(!service) service='delicious'; var loc="http://www.musikalchairs.net/"; //Get Title and encode var title = "Free Venues, Seating, Reports and Floorplans"; var url=''; //Redirect to service if(service=='digg') url='http://www.digg.com/submit?phase=2&url=' + loc + '&title=' + title; else if(service=='newsvine') url='http://www.newsvine.com/_tools/seed&save?u=' + loc + '&h=' + title; else if(service=='furl') url='http://www.furl.net/storeIt.jsp?p=1&u='+ loc +'&t=' + title; else if(service=='blinklist') url='http://www.blinklist.com/index.php?Action=Blink/addblink.php&Description=&Url=' + loc + '&Title=' + title; else if(service=='technorati') url='http://technorati.com/faves?add=' + loc; else if(service=='facebook') url='http://www.facebook.com/sharer.php?u=' + loc; else if(service=='yahoo') url='http://myweb2.search.yahoo.com/myresults/bookmarklet?t=' + loc; else if(service=='stumble') url='http://www.stumbleupon.com/submit?url=' + loc; else if(service=='google') url='http://www.google.com/bookmarks/mark?op=add&bkmk=' + loc; else if(service=='reddit') url='http://www.reddit.com/submit?url=' + loc; else if(service=='aol') url='http://favorites.my.aol.com/ffclient/AddFeed?url=' + loc; else url='http://del.icio.us/post?v=2&url=' + loc + '&title=' + title; location.href = url; return false; } /************************************************************************* * MusikalChairs: Dropdown Handlers *************************************************************************/ function initDivCloser(){ setTimeout("document.onclick=check",100); } function endDivCloser(){ document.onclick = null; } function check(e){ var target = (e && e.target) || (event && event.srcElement); var arr = drops; for (i= 0; i"; return; }