function preload(arrayOfImages) {
    $(arrayOfImages).each(function(){
        $('<img/>')[0].src = this;
        // Alternatively you could use:
        // (new Image()).src = this;
    });
}

function init() {
	if ($('vidplayerholder')) { $('#vidplayerholder').css("display","block"); }


	if ($(".homepagemainvideo")) {
		$(".homepagemainvideo").hover(
			function(e){
				e.preventDefault();
				$(this).css("background", "#ffffff");
				$(this).children("div.video").css("background", "#ffffff");
				$(this).children("div.video").css("cursor","pointer");		
				$(this).children("div.text").css("color","#000");
				$(this).children("div.hovvideo").css("visibility","visible");
			},
			function(e){
				e.preventDefault();
				$(this).css("background", "#000000");
				$(this).children("div.video").css("background", "#333333");
				$(this).children("div.video").css("cursor","normal");
				$(this).children("div.text").css("color","#bbb");
				$(this).children("div.hovvideo").css("visibility","hidden");
			}
		);
	}
	
	if ($(".lpVidHolder.search")) {
		$(".lpVidHolder.search").hover(
			function(e){
				e.preventDefault();
				$(this).css("background", "#ffffff");
				$(this).children("div.lpvhimage").css("background", "#ffffff");
				$(this).children("div.lpvhimage").css("cursor","pointer");		
				$(this).children("div.lpvhtext").css("color","#000");
				$(this).children("div.lpvhtitle").css("display","none");
				$(this).children("div.lpvhtext").css("display","block");
				$(this).children("div.lpvhhovvideo").css("visibility","visible");
			},
			function(e){
				e.preventDefault();
				$(this).css("background", "transparent");
				$(this).children("div.lpvhimage").css("background", "#333333");
				$(this).children("div.lpvhimage").css("cursor","normal");
				$(this).children("div.lpvhtext").css("color","#bbb");
				$(this).children("div.lpvhtitle").css("display","block");
				$(this).children("div.lpvhtext").css("display","none");
				$(this).children("div.lpvhhovvideo").css("visibility","visible");
			}
		);	
	}
	
	if ($(".lpVidHolder")) {
		$(".lpVidHolder").hover(
			function(e){
				e.preventDefault();
				$(this).css("background", "#ffffff");
				$(this).children("div.lpvhimage").css("background", "#ffffff");
				$(this).children("div.lpvhimage").css("cursor","pointer");
				$(this).children("div.lpvhtext").css("display","block");
				$(this).children("div.lpvhtext").css("color","#000");
				$(this).children("div.lpvhhovvideo").css("visibility","visible");
			},
			function(e){
				e.preventDefault();
				$(this).css("background", "transparent");
				$(this).children("div.lpvhimage").css("background", "#333333");
				$(this).children("div.lpvhimage").css("cursor","normal");
				$(this).children("div.lpvhtext").css("display","none");
				$(this).children("div.lpvhtext").css("color","#bbb");
				$(this).children("div.lpvhhovvideo").css("visibility","hidden");
			}
		);	
	}

	if ($(".catpagemainvideo")) {
		$(".catpagemainvideo").hover(
			function(e){
				e.preventDefault(); 
				//$(this).css("background", "#ffffff");
				$(this).children("div.video").css("cursor","pointer");		
				$(this).children("div.hovvideo").css("visibility","visible");
			},
			function(e){
				e.preventDefault();
				//$(this).css("background", "transparent");
				$(this).children("div.video").css("cursor","normal");
				$(this).children("div.hovvideo").css("visibility","hidden");
			}
		);
	}

	if ($(".vidpagemainvideo")) {
			$(".vidpagemainvideo").hover(
				function(e){
					if ($('#vidplayerholder').css("display")=="block")  {
						e.preventDefault(); 
						$(this).children("div.video").css("cursor","pointer");	
						$(this).children("div.hovvideo").css("visibility","visible");
					}
				},
				function(e){
					if ($('#vidplayerholder').css("display")=="block")  {
						e.preventDefault();
						$(this).children("div.video").css("cursor","normal");
						$(this).children("div.hovvideo").css("visibility","hidden");
					}
				}
			);
		
	}	
	
}
	
function showVideoPlayer() {
	$('#vidplayerholder').css("display","none");
	$('#brightcovevideo').css("display","block");
	$("div.hovvideo").css("visibility","hidden");
}
