// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults
var futura = new Font("futurabook.swf");
var futuraBold = new Font("futurabold.swf")

function applySifr(){

	var futura = new Font("futurabook.swf");
	var futuraBold = new Font("futurabold.swf")

	/*
	var menus = $$('.tab_names.headerMenu a');
	menus.each(function (menu){
		futura.replaceElement(menu);
	});
	for(i=0; i< menus.length-1; i++){
		var ele = new Element('span', {'class':'header_item_border'});
		ele.innerHTML = "|";
		menus[i].insert({'after': ele});
	}
	
	var tab_clicked = $$('.tab_names.headerMenu .tab_true')[0]
	futura.replaceElement(tab_clicked);
	tab_clicked.setStyle({marginTop: "4px"})
	
	futuraBold.replaceElements($$('.image_readmore_text'));
	*/

	futura.replaceElements($$('.chef_name'));
	futura.replaceElements($$('.page_title')); 	
	var names = $$('.pod_name');
	futura.replaceElements(names);
}

function potato_facts_sifr(name){
	//futura.replaceElements($$('.fact_no')); 
}

function homeSifr(){
	//futuraBold.replaceElements($$('.applySifr'));
}

function changeImage(e){
	var no = e.target.innerHTML.split(/\D{1,2}/)[0];
}

function calculate_amount(e){
	if (e) 
		$("total_amount").innerHTML = "£"+15*parseInt(e)
	else
		$("total_amount").innerHTML = "£0"
}

function calculate_amount_2(e){
	if (e) 
		$("total_amount_2").innerHTML = "£"+15*parseInt(e)
	else
		$("total_amount_2").innerHTML = "£0"
}
function printPage(){ 
	window.print();
}

function specialInstructionBlur(){
    if ($('order_short_message').value == ''){
        $('order_short_message').value='If you would like your potatoes to be delivered to an alternative address, please enter it here.';
    }; 
    if ($('order_short_message').value =='If you would like your potatoes to be delivered to an alternative address, please enter it here.') {
        $('order_short_message').style.color='#999999';
    };
}

function specialInstructionClick(){
    if ($('order_short_message').value == 'If you would like your potatoes to be delivered to an alternative address, please enter it here.'){
        $('order_short_message').value='';
    };
    $('order_short_message').select();
    $('order_short_message').style.color='#000000';
}


