// JavaScript Document

$(document).ready(function() {
	//var total = 0;	
	//var total = $('input[name=sizeprice]:checked').attr('value');
	var fo="";
	$("input[name$='sizeprice']").click(function() {
		$("input[name$='mediaoption']").attr("checked", false);
		$("#optionFramed").hide();
        var size = $('input[name=sizeprice]:checked').val();
		var fsize = size.split("-");
		var psize = fsize[2];
		var prise = parseFloat(fsize[3]);

		if (psize == 'Framed'){
			$("#optionFramed").show();
		}
		else{
			$('#os3').val("None");
			$("input[name$='mediaoption']").attr("checked", false);
			$("#optionFramed").hide();
			}
		/*if (psize == '36x48' || psize == '40x60' || psize == '60x72'){
			psize = 'BG';
		}
        $("div.desc").hide();
        $("#option"+psize).show();
		$('#item_name').val(fsize[0] + " - " + fsize[1]);*/
		
		$('#item_name').val(size);
		$('#amount').val(prise);
    });	
	
	$("input[name$='tone']").click(function() {
	  	$('#os1').val($('input[name=tone]:checked').val())
	});	
	$("input[name$='bg']").click(function() {
		$('#os2').val($('input[name=bg]:checked').val());												   
	});
	
	$("input[name$='mediaoption']").click(function() {
		var frame = $('input[name=mediaoption]:checked').val();
		var getframe = frame.split("-");
		fo = getframe[0];
		$('#os3').val(fo);												   
	});
	  
});
$(document).ready(function(){
    $("#orderform").submit(function(){
     $('#os4').val($('#message').val());
	 var projectname = $('input[name=photoname]').val() + ' by ' + $('input[name=firstname]').val() + '  ' + $('input[name=lastname]').val();
	 $('#os5').val(projectname);
    });
});

function getContinueShoppingURL(form){   
 form.shopping_url.value = window.location.href;  
}  


