function parse_uri(uri) { var sectionHash = new Hash({"home":"67","services":"70","products":"69","gallery":"68","contact":"78","sidebar":"73","footer":"74","library":"-1"});var pageHash = new Hash({"welcome":"227","welcome":"230","gallery":"228","products":"235","services":"236","sidebar":"238","footer":"239","contact_us":"237","empty":"-1"}); uri = uri.replace("#", ""); var qarr = uri.split('|'); var query = "section="+sectionHash.get(qarr[0]); if(qarr[1] && qarr[1].length > 0) { if(qarr[1].contains("&")) { query = query+qarr[1]; } else { query = query+"&id="+pageHash.get(qarr[1]); } } if(qarr[2] && qarr[2].length > 0) { query = query+qarr[2]; } return query; } function basename(path, suffix) { var b = path.replace(/^.*[\/\\]/g, ''); if (typeof(suffix) == 'string' && b.substr(b.length-suffix.length) == suffix) { b = b.substr(0, b.length-suffix.length); } return b; } function ajax(element, url, transition) { if(transition) { element.tween("opacity", 0); } else { element.set("html", ""); } new Request.HTML({ update: element, evalScripts: true, onComplete: function() { ajax_scan(); if(transition) { element.tween("opacity", 1); } } }).get(url); } function updateAdvertisingViews(adID, url) { var myRequest = new Request({method: 'get', url: url}).send('updateViews=true&adID='+adID); } function supports_canvas() { return !!(document.createElement('canvas').getContext); } function ajax_scan() { var rewriting = REWRITE; var i = 0; $$("a.podcastlink").each(function(el){ el.erase("href"); el.rel = "mySound"+i; el.removeEvents("click"); el.addEvent("click", function(ev) { var id = el.get("id").replace(/podcast_/, ""); ajax($('sidebar'), "http://www.westcoasthometheatres.com/__basic/__interface/podcasts.php?podcast_data=true&podcast_key="+id); }); i++; }); $$("a.inlineAudioLink").each(function(el) { var location = el.href; if(el.href.length > 0) { el.erase("href"); el.removeEvents("click"); el.addEvent("click", function(ev) { soundManager.createSound({ id: "mySound_"+location, url: location }); playTrack("mySound_"+location, el.get("title")); }); } }); $$("a.internal_link, a.mainLink").each(function(el) { if(!el.href.contains("#")) { el.removeEvents("click"); var pos = el.href.search("http://www.westcoasthometheatres.com/")+"http://www.westcoasthometheatres.com/".length; var qstring = el.href.substr(pos).replace(/\//g, "|"); var query = parse_uri(qstring); el.href = "#"+qstring; el.addEvent('click', function(ev){ if($("sidebar")) { ajax($("sidebar"), "http://www.westcoasthometheatres.com/__basic/__base/sidebarAjax.php?"+query); } if($("content")) { ajax($("content"), "http://www.westcoasthometheatres.com/__basic/__base/contentAjax.php?"+query); } }); } }); } window.addEvent('domready', function() { if(ajax_site == true) { var loc = window.location.href; var str = "http://www.westcoasthometheatres.com/"; var pos = loc.search("http://www.westcoasthometheatres.com/")+ str.length; if(loc.substr(pos).length > 0 && !loc.substr(pos).contains("#")) { window.location.href = "http://www.westcoasthometheatres.com/#"+loc.substr(pos).replace(/\//g, "|"); } else { ajax_scan(); } } });