String.prototype.capitalize = function() {
	return this.replace(/\w+/g, function(a) {
		return a.charAt(0).toUpperCase() + a.substr(1).toLowerCase();
	});
};

// function postNewsletter() located in inc/newsletter.php

function get_uri() {
	allowed	= ["home", "about", "media", "cast", "news", "partners", "tickets","kellermans"];
	url			= window.location.href;
	if(!url.match("/#/")) {
		page	= "home";
	} else {
		uri	= url.replace(/[^#]+\/#\//, "");
		for(var i = 0; i < allowed.length; i++) {
			if(allowed[i] == uri) {
				page	= uri;
			}
		}
		if(!page) { page = "404"; }
	}
	document.title	= "Dirty Dancing America - Official Site - " + page.capitalize();
	return page;
}

function link(uri) {
	top.document.location.href	= "/#/" + uri;
	top.document.title					= "Dirty Dancing America - Official Site - " + uri.capitalize();
	//top.window.location.replace	= "/#/" + uri;
}



 function popup(url) {
 newwindow=window.open(url,'name','height=500,width=370');
 if (window.focus) {newwindow.focus()}
 return false;
 }
