function submitForm() {
	var validated = true;
	$('#comments-form').find(".mailer-input").each(function(i) {
		if ($(this).val() == '') {
			($(this).closest('li').find('label').addClass('required'))
		}
		else {
			($(this).closest('li').find('label').removeClass('required'))
		}
	});
	
	$('#comments-form').find(".required").filter(function(index) {
		validated = false;
	})
	
	if (validated) {
		$("#validation-message").text('Comments sent!');
		$("#validation-message").css('display', 'inline');
		
		$('#footer').append('<iframe id="emailiframe" />');
		$('#emailiframe').width(1).height(1).attr('src', 'http://poll.turner.com/ViewsFlash/servlet/viewsflash?Name=' + $('#name').val() + '&Email=' + $('#email').val() + '&Comments=' + $('#comments').val() + '&submitsubmit=Submit&cmd=tally&pollid=AdultSwim%21icelandic_ultrablue&vwf_showquestion=&results=AdultSwim%21icelandic_ultrablue.results.html&pagenumber=0&charset=UTF-8&vwf_ShowAndHide_HiddenQuestions=');
		
		$('#comments-form').trigger("submit");
		
		$('#comments-form').find(".mailer-input").each(function(i) {
			$(this).val('');
		})
	}
	else {
		$("#validation-message").text('All fields required');
		$("#validation-message").css('display', 'inline');
	}
}

function loadVideoPlayer(url, flv) {
	var swfwidth = 321;
	var swfheight = 271;
	
	var movieID = "icelandic-vid";
	
	var so = new SWFObject(url, movieID, swfwidth, swfheight, "8", "#ffffff");
			//this is to allow a target to open in a window besides _blank
		so.addParam("allowScriptAccess", "always");
		so.addParam("wmode", "transparent");
		
			//set omniture to true to turn on omniture
		so.addVariable("omniture", "false");
		
		so.addVariable("swfHeight", swfheight);
		so.addVariable("swfWidth", swfwidth);
	   
			//flv loads in a single video file
			//if you use "flv" you have to comment out "xml"
		so.addVariable("flv", flv);
	   
			//flvWidth and flvHeight are required variables - don't comment them out
			//they define the width and height of the videoArea
		so.addVariable("flvWidth", 303);
		so.addVariable("flvHeight", 227);
			//the alignment for the video player in the swf window
			//must be defined: set to left, right or center
		so.addVariable("alignment", "left");
			//to add to the x and y values of the flv set these, comment them out if not needed
		so.addVariable("flvX", 5);
		so.addVariable("flvY", 1);
	   
			//use this to add or subtract to the control area y position
			//set it to 0 to use the default
		so.addVariable("controlsX", 0);
		so.addVariable("controlsY", 0);
	   
			//autoplay is required - it must not be commented out
			//true automatically plays the video, false requires you a click before playing
		so.addVariable("autoplay", "true");
	   
			//loop is required - it must not be commented out
			//true sets the entire video and video list to replay
			//false will play through the video once and the entire playlist once
		so.addVariable("loop", "false");
	   
	   		//buffer variables
			//to have no buffer, comment out bufferingMessage
			//bufferingAlignment can be "insideBottomLeft",
		so.addVariable("bufferingMessage", "Buffering...");
		so.addVariable("bufferingAlignment", "insideBottomLeft")
		so.addVariable("bufferingFont", "Trebuchet MS");
		so.addVariable("bufferingFontSize", 12);
		so.addVariable("bufferingFontColor", 0xFFFFFF);
	   
			//controls is required - it must not be commented out
			//if true, the main controls under the video area is visible
			//if false, there is no main control area
			//if controls == true, make sure to turn off innerControls & vice versa
		so.addVariable("controls", "true");
			//innerControls is required - it must not be commented out
			//if true, the play/pause is visible inside the video area
			//if false, there is no inner controls
			//if innerControls == true, make sure to turn off controls & vice versa 
		so.addVariable("innerControls", "false");
			//playlistControls is required - it must not be commented out
			//if false they are not active
			//if bottom, the prev/next controls are on the very bottom of the swf
			//if insidebottom, the controls are on the bottom of inside the flv area
			//if leftbottom, the controls are on the left of the video area towards the bottom
		so.addVariable("playlistControls", "false");
	   
			//descriptionAreaAlign is required - it must not be commented out
			//describes where the description area can be in relation to the player
			//if bottom, it's under the player
			//if lefttop, it's to the left and towards the top
		so.addVariable("descriptionAreaAlign", "lefttop");
	   
			//stillPlayer is the image that displays the video player if the autoplay is turned off
			//stillVideo is the image that displays in the video area if autoplay is off and when a single flv has stopped playing
			//to have no still image, comment this out
		so.addVariable("stillPlayer", "http://i.cdn.turner.com/adultswim/promos/icelandicultrablue/tools/img/video-player/background.png");
		so.addVariable("stillVideo", "http://i.cdn.turner.com/adultswim/promos/icelandicultrablue/tools/img/video-player/still-video.jpg");
			//playerbg is the background image behind the video area
			//to have no bg, comment this out
		so.addVariable("playerbg", "http://i.cdn.turner.com/adultswim/promos/icelandicultrablue/tools/img/video-player/background.png");
		//so.addVariable("offsetBgX", 20);
		//so.addVariable("offsetBgY", 20);
	   
			//the next six variables can be commented out if you want to use the default icons 
			//controlsbg is the bg for the entire main control area
		so.addVariable("controlsbg", "http://i.cdn.turner.com/adultswim/promos/icelandicultrablue/tools/img/video-player/controls-background.png");
			//set this to true if you want to see the play/pause button
		so.addVariable("playPause", "true");
			//playImage is the image for the play button
		so.addVariable("playImage", "http://i.cdn.turner.com/adultswim/promos/icelandicultrablue/tools/img/video-player/play.png");
			//pauseImage is the image for the pause button
		so.addVariable("pauseImage", "http://i.cdn.turner.com/adultswim/promos/icelandicultrablue/tools/img/video-player/pause.png");
	  
		so.addVariable("playImageRO", "http://i.cdn.turner.com/adultswim/promos/icelandicultrablue/tools/img/video-player/play.png");
		so.addVariable("pauseImageRO", "http://i.cdn.turner.com/adultswim/promos/icelandicultrablue/tools/img/video-player/pause.png");
			//playX is for the X coord of the play/pause area in pixels
		so.addVariable("playX", 10);
	  
			//set this to true if you want to see the scrubber track
		so.addVariable("track", "true");
			//thumbImage is the image for the scrubber thumb
			//if you use one of the next 3, you  have to use them all
		so.addVariable("thumbImage", "http://i.cdn.turner.com/adultswim/promos/icelandicultrablue/tools/img/video-player/scrubber.png");
			//loadedTrackImage is the image for the loaded scrub bar
		so.addVariable("loadedTrackImage", "http://i.cdn.turner.com/adultswim/promos/icelandicultrablue/tools/img/video-player/timeline.png");
			//trackImage is the image for the unloaded scrub bar
		so.addVariable("trackImage", "http://i.cdn.turner.com/adultswim/promos/icelandicultrablue/tools/img/video-player/timeline.png"); 
			//trackX is for the X coord of the track in pixels
		so.addVariable("trackX", 30);
	   
			//the following 6 are required parameters
			//set elapsed and/or to true if you want the elapsed time and false if not
		so.addVariable("elapsed", "false");
		so.addVariable("duration", "false");
			//timeFont is for the font face of the time displays
		so.addVariable("timeFont", "Verdana");
			//timeSize is for the size of the time displays font
		so.addVariable("timeSize", 10);
			//elapsedX is the X coord for the elapsed time
		so.addVariable("elapsedX", 305);
			//durationX is the X coord for the duration time
		so.addVariable("durationX", 275);
	  		//if controls is turned on and no images are set above these must not be commented out
			//these control the color of the default icons on the control areas
		so.addVariable("elapsedColor", 0xFF0F56);
		so.addVariable("durationColor", 0xF0F0FF);
	  
			//set the start volume of the video
			//from 0 to 100  (you can set higher, but the volume becomes distorted)
		so.addVariable("startVolume", 100);
			//if you add a volumeImage, you have to add them all or comment them all out
			//set volumeIcon to true/false to turn it on or off
		so.addVariable("volumeIcon", "true");
			//volumeImage is the image for the speaker icon
		so.addVariable("volumeImage", "http://i.cdn.turner.com/adultswim/promos/icelandicultrablue/tools/img/video-player/volume-icon.png");
			//volumeIconX is for the X coord of the volume Icon in pixels
		so.addVariable("volumeIconX", 245);
			//muteImage is the image for the mute icon
			//if one of these next 3 is commented out, all them have to be
		so.addVariable("muteImage", "http://i.cdn.turner.com/adultswim/promos/icelandicultrablue/tools/img/video-player/mute.png");
			//volumeThumbImage is the image for the thumb on the scrubber bar
		so.addVariable("volumeThumbImage", "http://i.cdn.turner.com/adultswim/promos/icelandicultrablue/tools/img/video-player/scrubber.png");
			//set volumeTrack to true/false to turn it on or off
		so.addVariable("volumeTrack", "true");
			//volumeTrackImage is the image for the scrubber bar
		so.addVariable("volumeTrackImage", "http://i.cdn.turner.com/adultswim/promos/icelandicultrablue/tools/img/video-player/volume-bar.png");
			//volumeTrackX is for the X coord of the volume track in pixels
		so.addVariable("volumeTrackX", 270);

		
		so.write("video-player");
}
