$(function() {

	$.preloadCssImages();	

    $(".wrap label").inFieldLabels({
        fadeOpacity: 0,
        fadeDuration: 100
    });

    $('input.date').DatePicker({
        format: 'A, B d, Y',
        date: $('input.date').val(),
        current: $('input.date').val(),
        starts: 1,
        position: 'bottom',
        onBeforeShow: function() {
            $('input.date').DatePickerSetDate($('input.date').val(), true);
        },
        onChange: function(formated, dates) {
            $('input.date').val(formated);
            $('input.date').DatePickerHide();
            __doPostBack($('input.date').attr("id"), 'ChangeDate|'+$('input.date').val());
        }
    });
	
	$("#location_search .change_locaiton").keypress(function(e) {
        if (e.keyCode == 13 || e.keyCode == 10) {
            var getBtnId = $("#location_search .go").attr("id");
            __doPostBack(getBtnId, 'ChangeLocation|'+$("#location_search .change_locaiton").val());
            return false;
        }
    });

    $("#find_location .change_locaiton").keypress(function(e) {
        if (e.keyCode == 13 || e.keyCode == 10) {
            var getBtnId = $("#find_location .go").attr("id");
            __doPostBack(getBtnId, 'ChangeLocation|'+$("#find_location .change_locaiton").val());
            return false;
        }
    });

    $("#your_showtimes .movie:first,#home #coming_attractions .attraction:first").css("border-top", "1px dotted #434343");
    $("#footer ul li:last").css("background", "none");
    $(".movie dl").each(function() {
        $("dd:last", this).css("background", "none");
    });
	
	$(".calendar").click(function(){
	    $(".date").click();
	});
	
	$('a[rel="external"]').click( function() {
        window.open( $(this).attr("href") );
        return false;
    });
	
    if ($(".change_theater").length) {
        var theater_id = $("#theater_id").attr("value");
        var current_date = $("#currentdate").attr("value").split(" ");
        //var current_date = $(".showtime_dates option:selected").attr("value").split(" ");
        current_date = current_date[0].replace("/", "-").replace("/", "-");

        $("#home a.change_theater").click(function() {
            var h = $("#find_theater").outerHeight() + 40;
            $("#left .inner").animate({ height: h }, 800);
            $("#location_set").fadeOut(function() {
                $("#find_theater").fadeIn();
            });
            return false;
        });

        $("#tickets_and_showtimes .change_theater").click(function() {
            $("#theater_showtimes").animate({ height: 0, opacity: 0 }, 800, function() {
                $(this).css("display", "none");
            });
            $("#location_set").animate({ height: 108, opacity: 0 }, 800, function() {
                $(this).css("display", "none");
                $("#find_theater").fadeIn();
            });
            return false;
        });
    }
    $("a.show_on_map").click(function() {
        $("#basic-modal-content").modal({
            minHeight: 450,
            overlayClose: true, onShow: function() {
                $("#simplemodal-container").addClass("map");
                var theaterId = $("#theater_id").attr("value");
                $.ajax({
                    type: "GET",
                    url: "/api/theater.svc/gettheater/" + theater_id + "",
                    dataType: "json",
                    success: function(theater) {
                        $(".loading").remove();
                        $("#basic-modal-content").append("<div id=\"map\"></div>");
                        function initialize() {
                            var myLatlng = new google.maps.LatLng(theater.Latitude, theater.Longitude);
                            var myOptions = {
                                zoom: 14,
                                center: myLatlng,
                                mapTypeId: google.maps.MapTypeId.ROADMAP,
                                mapTypeControlOptions: { style: google.maps.MapTypeControlStyle.DROPDOWN_MENU },
                                backgroundColor: "#000000"
                            }
                            var map = new google.maps.Map(document.getElementById("map"), myOptions);
                            var contentString = '<div id="map_content">' +
					'<div class="left_col">' +
	                '<img src="' + theater.ImageUrl + '" alt="' + theater.Name + '" class="theater" />' +
					'</div>' +
					'<div class="right_col">' +
	                '<h1>' + theater.Name + '</h1>' +
	                '<p>' + theater.Address + '<br/>' + theater.Phone + '</p>' +
	                '<p><a href="/tickets/' + theater.Permalink + '">Showtimes</a>' +
	                '<form action="http://maps.google.com/maps" method="get" target="_blank">' +
	                '<p>Start address: <input type="text" size=30 maxlength=40 name="saddr" id="saddr" value="" /><br>' +
	                '<INPUT value="Get Directions" TYPE="SUBMIT">' +
	                '<input type="hidden" name="daddr" value="' + +'"/>' +
	                '</p>' +
					'</div>' +
	                '</div>';
                            var infowindow = new google.maps.InfoWindow({
                                content: contentString
                            });
                            var marker = new google.maps.Marker({
                                position: myLatlng,
                                map: map,
                                title: 'Uluru (Ayers Rock)'
                            });
                            google.maps.event.addListener(marker, 'click', function() {
                                infowindow.open(map, marker);
                            });
                        }
                        initialize();
                    }
                });
            }
        });
        return false;
    });

    $("a.tickets").click(function() {
        var movie_data = $(this).parent().find("dl:eq(0)").html();
        $("#basic-modal-content").modal({
            maxWidth: 640,
            maxHeight: 120,
            overlayClose: true,
            onShow: function() {
                $("#simplemodal-container").addClass("movie");
                var html = "<div id=\"movie_showtimes\" class=\"clearfix\">" +
			"<div class=\"inner clearfix\">" +
			"<h1 id=\"click_showtimes\" class=\"title\">Click Showtimes for Tickets</h1>" +
			"<div class=\"section clearfix\">" +
			"<dl>" + movie_data + "</dl>" +
			"</div>" +
			"</div>" +
			"</div>";
                $("#basic-modal-content").append(html);
            }
        });
        return false;
    });

    $("a.print_showtimes").click(function() {
        var getHref = $(this).attr("href");
        window.open(getHref, 'print', 'width=700,height=600,screenX=100,screenY=200,top=100,left=200,scrollbars=yes,toolbar=no,location=no');
        return false;
    });

    $("a.movie_title").click(function() {
        var movie_id = $(this).attr("rel");
		var trailerPath = $(this).attr("href");
        $("#basic-modal-content").modal({
            overlayClose: true,
            onShow: function() {
                $("#simplemodal-container").append("<div class=\"loading\"></div>");
                $(".simplemodal-close").hide();
                var contentHeight = $("#basic-modal-content").outerHeight();
                var theater_id = $("#theater_id").attr("value");
                var current_date = $("#currentdate").attr("value").split(" ");
                current_date = current_date[0].replace("/", "-").replace("/", "-");
				var videoPlayer = "";
				if (trailerPath!="#") {
					videoPlayer = "<div id=\"video_player\">" +
					"<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\"640\" height=\"302\" id=\"myFlashContent\">" +
						"<param name=\"movie\" value=\"/swf/video-player.swf\" />" +
						"<param value=\"noscale\" name=\"scale\">" +
						"<param value=\"true\" name=\"allowfullscreen\">" +
						"<param value=\"tl\" name=\"salign\">" +
						"<param value=\"000000\" name=\"bgcolor\">" +
						"<param value=\"imagePath=&amp;videoPath="+trailerPath+"&amp;title=&amp;description=&amp;viewInfoButton=false&amp;viewFullscreenButton=false&amp;viewScaleButton=false&amp;viewVolumeControls=true&amp;viewTime=false&amp;viewBigPlayButton=true&amp;viewRightClickMenu=true&amp;mouseHide=true&amp;mouseHideTime=3&amp;doubleClick=false&amp;oneClick=true&amp;spaceKey=true&amp;videoLoop=false&amp;videoAutoPlay=false&amp;videoBufferTime=0.1&amp;tlInterval=100000&amp;soundVolume=0.8&amp;fullSizeView=2&amp;spacing=10&amp;controlHeight=25&amp;volumeLengthW=50&amp;color1=0x2e2e2e&amp;color2=0x000000&amp;alpha1=1&amp;alpha2=1&amp;borderColor=0x555555&amp;borderAlpha=1&amp;timeColor1=0x333333&amp;timeColor2=0x111111&amp;timeAlpha1=1&amp;timeAlpha2=1&amp;timeTextColor1=0xffffff&amp;timeTextColor2=0x888888&amp;scrubberHeight=3&amp;scrubberColor1=0x333333&amp;scrubberAlpha1=1&amp;scrubberColor2=0x88acc4&amp;scrubberAlpha2=1&amp;filterColor=0x0066ff&amp;filterAlpha=1&amp;titleColor=0x88acc4&amp;descriptionColor=0xD3D3D3&amp;infoBackgroundColor=0x000000&amp;infoBackgroundAlpha=0.5\" name=\"flashvars\">" +
						"<!--[if !IE]>-->" +
						"<object type=\"application/x-shockwave-flash\" data=\"/swf/video-player.swf\" width=\"640\" height=\"302\">" +
						"<param value=\"noscale\" name=\"scale\">" +
						"<param value=\"true\" name=\"allowfullscreen\">" +
						"<param value=\"tl\" name=\"salign\">" +
						"<param value=\"000000\" name=\"bgcolor\">" +
						"<param value=\"imagePath=&amp;videoPath="+trailerPath+"&amp;title=&amp;description=&amp;viewInfoButton=false&amp;viewFullscreenButton=false&amp;viewScaleButton=false&amp;viewVolumeControls=true&amp;viewTime=false&amp;viewBigPlayButton=true&amp;viewRightClickMenu=true&amp;mouseHide=true&amp;mouseHideTime=3&amp;doubleClick=false&amp;oneClick=true&amp;spaceKey=true&amp;videoLoop=false&amp;videoAutoPlay=false&amp;videoBufferTime=0.1&amp;tlInterval=100000&amp;soundVolume=0.8&amp;fullSizeView=2&amp;spacing=10&amp;controlHeight=25&amp;volumeLengthW=50&amp;color1=0x2e2e2e&amp;color2=0x000000&amp;alpha1=1&amp;alpha2=1&amp;borderColor=0x555555&amp;borderAlpha=1&amp;timeColor1=0x333333&amp;timeColor2=0x111111&amp;timeAlpha1=1&amp;timeAlpha2=1&amp;timeTextColor1=0xffffff&amp;timeTextColor2=0x888888&amp;scrubberHeight=3&amp;scrubberColor1=0x333333&amp;scrubberAlpha1=1&amp;scrubberColor2=0x88acc4&amp;scrubberAlpha2=1&amp;filterColor=0x0066ff&amp;filterAlpha=1&amp;titleColor=0x88acc4&amp;descriptionColor=0xD3D3D3&amp;infoBackgroundColor=0x000000&amp;infoBackgroundAlpha=0.5\" name=\"flashvars\">" +
						"<!--<![endif]-->" +
							"<a href=\"http://www.adobe.com/go/getflashplayer\">" +
								"<img src=\"http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif\" alt=\"Get Adobe Flash player\" />" +
							"</a>" +
						"<!--[if !IE]>-->" +
						"</object>" +
						"<!--<![endif]-->" +
					"</object>" +
					"</div>"
				}
                $.ajax({
                    type: "GET",
                    url: "/api/theater.svc/gettheaterwithmovie/" + theater_id + "/" + movie_id + "/" + current_date + "",
                    dataType: "json",
                    success: function(theater) {
                        var getShowTimes = $("#your_showtimes").find("a[rel=" + movie_id + "]").parents("dl").html();
                        var html = videoPlayer +
						"<h2>" + theater.Movies[0].Movie.Title + " <em>(" + theater.Movies[0].Movie.Rating + ")</em></h2>" +
						"<p>" + theater.Movies[0].Movie.SynopsisLong + "</p>" +
						"<div id=\"movie_showtimes\" class=\"movie clearfix\">" +
						"<div class=\"inner clearfix\">" +
						"<h1 id=\"click_showtimes\" class=\"title\">Click Showtimes for Tickets</h1>" +
						"<div class=\"section clearfix\">" +
						"<dl>" +
						getShowTimes +
						"</dl>" +
						"</div>" +
						"</div>" +
						"</div>";
                        $("#basic-modal-content").css("display", "none").append(html);
                        $("#movie_showtimes dl dt").html(theater.Name);
                        var contentHeight = $("#basic-modal-content").outerHeight();
                        $("#simplemodal-container").animate({ height: contentHeight }, 300, function() {
                            $(".simplemodal-close").show();
                            $(".loading").remove();
                            $("#basic-modal-content").css("display", "block");
                        });
                    }
                });
            },
            minHeight: 500
        });
        return false;
    });

    $("a.view_trailer_only").click(function() {
		var trailerPath = $(this).attr("href");
        $("#basic-modal-content").modal({
            overlayClose: true,
            onShow: function() {
                $("#simplemodal-container").append("<div class=\"loading\"></div>");
                $(".simplemodal-close").hide();
				var html = "<div id=\"video_player\">" +
					"<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\"640\" height=\"302\" id=\"myFlashContent\">" +
						"<param name=\"movie\" value=\"/swf/video-player.swf\" />" +
						"<param value=\"noscale\" name=\"scale\">" +
						"<param value=\"true\" name=\"allowfullscreen\">" +
						"<param value=\"tl\" name=\"salign\">" +
						"<param value=\"000000\" name=\"bgcolor\">" +
						"<param value=\"imagePath=&amp;videoPath="+trailerPath+"&amp;title=&amp;description=&amp;viewInfoButton=false&amp;viewFullscreenButton=false&amp;viewScaleButton=false&amp;viewVolumeControls=true&amp;viewTime=false&amp;viewBigPlayButton=true&amp;viewRightClickMenu=true&amp;mouseHide=true&amp;mouseHideTime=3&amp;doubleClick=false&amp;oneClick=true&amp;spaceKey=true&amp;videoLoop=false&amp;videoAutoPlay=false&amp;videoBufferTime=0.1&amp;tlInterval=100000&amp;soundVolume=0.8&amp;fullSizeView=2&amp;spacing=10&amp;controlHeight=25&amp;volumeLengthW=50&amp;color1=0x2e2e2e&amp;color2=0x000000&amp;alpha1=1&amp;alpha2=1&amp;borderColor=0x555555&amp;borderAlpha=1&amp;timeColor1=0x333333&amp;timeColor2=0x111111&amp;timeAlpha1=1&amp;timeAlpha2=1&amp;timeTextColor1=0xffffff&amp;timeTextColor2=0x888888&amp;scrubberHeight=3&amp;scrubberColor1=0x333333&amp;scrubberAlpha1=1&amp;scrubberColor2=0x88acc4&amp;scrubberAlpha2=1&amp;filterColor=0x0066ff&amp;filterAlpha=1&amp;titleColor=0x88acc4&amp;descriptionColor=0xD3D3D3&amp;infoBackgroundColor=0x000000&amp;infoBackgroundAlpha=0.5\" name=\"flashvars\">" +
						"<!--[if !IE]>-->" +
						"<object type=\"application/x-shockwave-flash\" data=\"/swf/video-player.swf\" width=\"640\" height=\"302\">" +
						"<param value=\"noscale\" name=\"scale\">" +
						"<param value=\"true\" name=\"allowfullscreen\">" +
						"<param value=\"tl\" name=\"salign\">" +
						"<param value=\"000000\" name=\"bgcolor\">" +
						"<param value=\"imagePath=&amp;videoPath="+trailerPath+"&amp;title=&amp;description=&amp;viewInfoButton=false&amp;viewFullscreenButton=false&amp;viewScaleButton=false&amp;viewVolumeControls=true&amp;viewTime=false&amp;viewBigPlayButton=true&amp;viewRightClickMenu=true&amp;mouseHide=true&amp;mouseHideTime=3&amp;doubleClick=false&amp;oneClick=true&amp;spaceKey=true&amp;videoLoop=false&amp;videoAutoPlay=false&amp;videoBufferTime=0.1&amp;tlInterval=100000&amp;soundVolume=0.8&amp;fullSizeView=2&amp;spacing=10&amp;controlHeight=25&amp;volumeLengthW=50&amp;color1=0x2e2e2e&amp;color2=0x000000&amp;alpha1=1&amp;alpha2=1&amp;borderColor=0x555555&amp;borderAlpha=1&amp;timeColor1=0x333333&amp;timeColor2=0x111111&amp;timeAlpha1=1&amp;timeAlpha2=1&amp;timeTextColor1=0xffffff&amp;timeTextColor2=0x888888&amp;scrubberHeight=3&amp;scrubberColor1=0x333333&amp;scrubberAlpha1=1&amp;scrubberColor2=0x88acc4&amp;scrubberAlpha2=1&amp;filterColor=0x0066ff&amp;filterAlpha=1&amp;titleColor=0x88acc4&amp;descriptionColor=0xD3D3D3&amp;infoBackgroundColor=0x000000&amp;infoBackgroundAlpha=0.5\" name=\"flashvars\">" +
						"<!--<![endif]-->" +
							"<a href=\"http://www.adobe.com/go/getflashplayer\">" +
								"<img src=\"http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif\" alt=\"Get Adobe Flash player\" />" +
							"</a>" +
						"<!--[if !IE]>-->" +
						"</object>" +
						"<!--<![endif]-->" +
					"</object>" +
					"</div>";
					$("#basic-modal-content").css("display", "none").append(html);
                    var contentHeight = $("#basic-modal-content").outerHeight();
                    $("#simplemodal-container").animate({ height: contentHeight }, 300, function() {
                        $(".simplemodal-close").show();
                        $(".loading").remove();
                        $("#basic-modal-content").css("display", "block");
                    });
            },
            minHeight: 500
        });
        return false;
    });

    $("a.view_trailer,a.view_synopsis,.movie_poster").click(function() {
        $(this).parents(".movie").find(".movie_title").click();
        return false;
    });

    $("a.tickets").click(function() {
        var movie_data = $(this).parent().find("dl:eq(0)").html();
        $("#basic-modal-content").modal({
            maxWidth: 640,
            minHeight: 130,
            overlayClose: true,
            onShow: function() {
                $("#simplemodal-container").addClass("movie");
                var html = "<div id=\"movie_showtimes\" class=\"clearfix\">" +
			"<div class=\"inner clearfix\">" +
			"<h1 id=\"click_showtimes\" class=\"title\">Click Showtimes for Tickets</h1>" +
			"<div class=\"section clearfix\">" +
			"<dl>" + movie_data + "</dl>" +
			"</div>" +
			"</div>" +
			"</div>";
                $("#basic-modal-content").append(html);
            }
        });
        return false;
    });

	$('.PrintAtHome').qtip({
	   content: 'Print Tickets At Home',
	   show: 'mouseover',
	   hide: 'mouseout',
	   position: {
	      corner: {
	         target: 'topMiddle',
	         tooltip: 'bottomMiddle'
	      }
	   },
	style: { 
		padding: 2,
		background: '#121212',
		color: '#fff',
		textAlign: 'center',
		border: {
		width: 0,
		radius: 3,
		color: '#121212'
		},
	tip: true
	}
	});
	$('.Kiosk').qtip({
	   content: 'Ticket Kiosk',
	   show: 'mouseover',
	   hide: 'mouseout',
	   position: {
	      corner: {
	         target: 'topMiddle',
	         tooltip: 'bottomMiddle'
	      }
	   },
	style: { 
		padding: 2,
		background: '#121212',
		color: '#fff',
		textAlign: 'center',
		border: {
		width: 0,
		radius: 3,
		color: '#121212'
		},
	tip: true
	}
	});
	$('.GameRoom').qtip({
	   content: 'Gaming Room',
	   show: 'mouseover',
	   hide: 'mouseout',
	   position: {
	      corner: {
	         target: 'topMiddle',
	         tooltip: 'bottomMiddle'
	      }
	   },
	style: { 
		padding: 2,
		background: '#121212',
		color: '#fff',
		textAlign: 'center',
		border: {
		width: 0,
		radius: 3,
		color: '#121212'
		},
	tip: true
	}
	});
	$('.WheelChair').qtip({
	   content: 'Wheelchair Accessible',
	   show: 'mouseover',
	   hide: 'mouseout',
	   position: {
	      corner: {
	         target: 'topMiddle',
	         tooltip: 'bottomMiddle'
	      }
	   },
	style: { 
		padding: 2,
		background: '#121212',
		color: '#fff',
		textAlign: 'center',
		border: {
		width: 0,
		radius: 3,
		color: '#121212'
		},
	tip: true
	}
	});
	$('.WheelChair').qtip({
	   content: 'Wheelchair Accessible',
	   show: 'mouseover',
	   hide: 'mouseout',
	   position: {
	      corner: {
	         target: 'topMiddle',
	         tooltip: 'bottomMiddle'
	      }
	   },
	style: { 
		padding: 2,
		background: '#121212',
		color: '#fff',
		textAlign: 'center',
		border: {
		width: 0,
		radius: 3,
		color: '#121212'
		},
	tip: true
	}
	});
	$('.ListeningDevices').qtip({
	   content: 'Listening Devices Available',
	   show: 'mouseover',
	   hide: 'mouseout',
	   position: {
	      corner: {
	         target: 'topMiddle',
	         tooltip: 'bottomMiddle'
	      }
	   },
	style: { 
		padding: 2,
		background: '#121212',
		color: '#fff',
		textAlign: 'center',
		border: {
		width: 0,
		radius: 3,
		color: '#121212'
		},
	tip: true
	}
	});
	$('.PartyRoom').qtip({
	   content: 'Party Room!',
	   show: 'mouseover',
	   hide: 'mouseout',
	   position: {
	      corner: {
	         target: 'topMiddle',
	         tooltip: 'bottomMiddle'
	      }
	   },
	style: { 
		padding: 2,
		background: '#121212',
		color: '#fff',
		textAlign: 'center',
		border: {
		width: 0,
		radius: 3,
		color: '#121212'
		},
	tip: true
	}
	});
	$('.AllStadiumSeating').qtip({
	   content: 'All Stadium Seating',
	   show: 'mouseover',
	   hide: 'mouseout',
	   position: {
	      corner: {
	         target: 'topMiddle',
	         tooltip: 'bottomMiddle'
	      }
	   },
	style: { 
		padding: 2,
		background: '#121212',
		color: '#fff',
		textAlign: 'center',
		border: {
		width: 0,
		radius: 3,
		color: '#121212'
		},
	tip: true
	}
	});
	
	$('.G').qtip({
	   content: 'General Audiences - All ages admitted',
	   show: 'mouseover',
	   hide: 'mouseout',
	   position: {
	      corner: {
	         target: 'topMiddle',
	         tooltip: 'bottomMiddle'
	      }
	   },
	style: { 
		padding: 2,
		background: '#121212',
		color: '#fff',
		textAlign: 'center',
		border: {
		width: 0,
		radius: 3,
		color: '#121212'
		},
	tip: true
	}
	});
	$('.PG').qtip({
	   content: 'Parental Guidance Suggested - Some material may not be suitable for children',
	   show: 'mouseover',
	   hide: 'mouseout',
	   position: {
	      corner: {
	         target: 'topMiddle',
	         tooltip: 'bottomMiddle'
	      }
	   },
	style: { 
		padding: 2,
		background: '#121212',
		color: '#fff',
		textAlign: 'center',
		border: {
		width: 0,
		radius: 3,
		color: '#121212'
		},
	tip: true
	}
	});
	$('.PG-13').qtip({
	   content: 'Parents Strongly Cautioned - Some material may not be suitable for children under 13',
	   show: 'mouseover',
	   hide: 'mouseout',
	   position: {
	      corner: {
	         target: 'topMiddle',
	         tooltip: 'bottomMiddle'
	      }
	   },
	style: { 
		padding: 2,
		background: '#121212',
		color: '#fff',
		textAlign: 'center',
		border: {
		width: 0,
		radius: 3,
		color: '#121212'
		},
	tip: true
	}
	});
	$('.R').qtip({
	   content: 'Restricted - Under 17 requires accompanying parent or adult guardian',
	   show: 'mouseover',
	   hide: 'mouseout',
	   position: {
	      corner: {
	         target: 'topMiddle',
	         tooltip: 'bottomMiddle'
	      }
	   },
	style: { 
		padding: 2,
		background: '#121212',
		color: '#fff',
		textAlign: 'center',
		border: {
		width: 0,
		radius: 3,
		color: '#121212'
		},
	tip: true
	}
	});
});

/*
CSS Browser Selector v0.3.4 (Sep 29, 2009)
Rafael Lima (http://rafael.adm.br)
http://rafael.adm.br/css_browser_selector
License: http://creativecommons.org/licenses/by/2.5/
Contributors: http://rafael.adm.br/css_browser_selector#contributors
*/
function css_browser_selector(u){var ua = u.toLowerCase(),is=function(t){return ua.indexOf(t)>-1;},g='gecko',w='webkit',s='safari',o='opera',h=document.getElementsByTagName('html')[0],b=[(!(/opera|webtv/i.test(ua))&&/msie\s(\d)/.test(ua))?('ie ie'+RegExp.$1):is('firefox/2')?g+' ff2':is('firefox/3.5')?g+' ff3 ff3_5':is('firefox/3')?g+' ff3':is('gecko/')?g:is('opera')?o+(/version\/(\d+)/.test(ua)?' '+o+RegExp.$1:(/opera(\s|\/)(\d+)/.test(ua)?' '+o+RegExp.$2:'')):is('konqueror')?'konqueror':is('chrome')?w+' chrome':is('iron')?w+' iron':is('applewebkit/')?w+' '+s+(/version\/(\d+)/.test(ua)?' '+s+RegExp.$1:''):is('mozilla/')?g:'',is('j2me')?'mobile':is('iphone')?'iphone':is('ipod')?'ipod':is('mac')?'mac':is('darwin')?'mac':is('webtv')?'webtv':is('win')?'win':is('freebsd')?'freebsd':(is('x11')||is('linux'))?'linux':'','js']; c = b.join(' '); h.className += ' '+c; return c;}; css_browser_selector(navigator.userAgent);