if(typeof sIFR == "function") {
    sIFR.replaceElement("#cities li", named({
    	sFlashSrc: "/sifr/univers3.swf",
    	sColor: "#dddddd",
    	sBgColor: "#000000",
    	sCase: "upper",
    	sWmode: "transparent"
    }));
    
    sIFR.replaceElement("#offers .right .use-code .code", named({
    	sFlashSrc: "/sifr/univers3.swf",
    	sColor: "#dddddd",
    	sBgColor: "#000000",
    	sCase: "upper",
    	sWmode: "transparent"
    }));
}

$(document).ready(function() {
	var so = new SWFObject("/flash/enhanced-video.swf", "sizzle", "285", "185", "8", "#000000");
	so.write("topVideo");
	
	if(jQuery("#citySelect").val().match(/las_vegas|new_york|orlando|chicago|boston|berlin|zurich|tokyo/)) {
		var c = jQuery("#citySelect").val();
		jQuery("#ticketsLink").attr("href", options[c]['tickets_link']);
		jQuery("#theaterText").html(options[c]['theater_text']);
		jQuery("#phoneText").html(options[c]['int_phone']);
		jQuery("#offers .right").css({ opacity: 0.0, visibility: "visible" }).fadeTo(300, 1.0);
	}
	
	jQuery("#citySelect").change(function() {
		var $div = jQuery("#offers .right");
		var city = jQuery(this).val();

		if($div.css("visibility") == "hidden") {
			$div.css({ opacity: 0.0, visibility: "visible" });
			$div.fadeTo(300, 1.0);
		} else {
			if(!city.length || city.match("Choose a City")) {
				$div.fadeTo(300, 0.0, function() {
					jQuery(this).css({ visibility: "hidden" });
				});
				return false;
			}
		}
		
		jQuery("#phoneText").html(options[city]['int_phone']);
		jQuery("#ticketsLink").attr("href", options[city]['tickets_link']);
		if(!(/berlin|zurich|tokyo/.test(city))) {
			jQuery("#theaterText").html(options[city]['theater_text']).parent().children().fadeTo(300, 1.0);
		} else {
			jQuery("#theaterText").parent().children().fadeTo(300, 0.0);
		}
	});
});