if( navigator.userAgent.match( /(opera mini|ipod|iphone|android|webOS|up.browser|up.link|mmp|symbian|smartphone|midp|wap|vodafone|o2|pocket|kindle|mobile|hiptop|\bpda|psp|treo|nokia|blackberry)/i ) ) {
	var largeLen = parseInt( screen.width > screen.height ? screen.width : screen.height );
	if( largeLen > 0 && largeLen < 1024 ) {
		location.replace( "http://m.vivid.com/" );
	}
}

$(document).ready(function(){

	celebBanner = celebBanners[ Math.floor( Math.random() * celebBanners.length ) ];

	$('#celebBanner').html("<a href='"+celebBanner[1]+"' target='"+celebBanner[2]+"'><img src='/gfx/public/tour/celeb/banners/rotatingCeleb-"+celebBanner[0]+".jpg' /></a>");

	$('#featuredFLV').videoPlayer({
		playerDiv:		'#player',
		hd:				trailer.hd,
		flv720:			trailer.flv720,
		flv540:			trailer.flv540,
		flv360:			trailer.flv360,
		joinURL:		trailer.joinURL,
		missingTrailer: trailer.missingTrailer,
		btn720:			'#hdBtn720',
		btn540:			'#hdBtn540',
		btn360:			'#hdBtn360',
		css720:			'vidPlayer720',
		css540:			'vidPlayer540',
		css360:			'vidPlayer360',
		hideOnHD:		'#marketing',
		join360:		'/gfx/public/tour/player.jpg',
		join540:		'/gfx/public/tour/player_540hd.jpg',
		join720:		'/gfx/public/tour/player_720hd.jpg'
	});

	$( "#player .section_head h2:first" ).width( 430 );

	$('#description,#catagories').expander({slicePoint: 290,expandEffect:'fadeIn',expandSpeed:200,expandText:' more',userCollapseText:' less'});

	$('#starring'				).expander({slicePoint: 550,expandEffect:'fadeIn',expandSpeed:200,expandText:' more',userCollapseText:' less'});

	var config = {
		 over: function() {
			var thisvNum=$(this).parents("[vnumMenu]").attr("vnumMenu");
			$(this)
				.parents("[vnumMenu]")
				.siblings()
				.css({zIndex:'1'});
			$(this)
				.parents("[vnumMenu]")
				.css({zIndex:'2'});
			$(this)
				.parents("[vnumMenu]")
				.children(".vnumAJAXcontent")
				.css({zIndex:'2'});
			$(this)
				.parents("[vnumMenu]")
				.children(".vnumAJAXmenu")
				.stop(true, true)
				.animate({opacity:'show',width:'220px'},400)
				.load('/inl.videos/'+thisvNum+'/');
		},
		out: function() {
			$(this)
				.parents("[vnumMenu]")
				.children(".vnumAJAXmenu")
				.animate({width:'0'},150,function(){
					$(this)
						.hide()
						.parents("[vnumMenu]")
						.children(".vnumAJAXcontent")
						.css({zIndex:'1'});
				});
		},
		timeout: 100
	};

	$("[vnumMenu] .vnumAJAXcontent").hoverIntent(config);
});
