/**
 * @author paul
 */
function send_msg_to_friend(post){
	if(validate_form('sender_name|sender_email|friends_email|message','send_to_friend_frm',false)){
		
		new Ajax.Request('core/aj_send_mail.cfm?'+post+'&subject=Your friend thought you may like this', 
		{asynchronous:true, 
			onSuccess:function(){
				$('send_to_friend_frm').reset()
				create_timeout(600, "blind('send_to_friend_form')")
				blind('message_sent')
			},
			onFailure: function(){ alert('Something went wrong...') }
						 });
//		window.location ='core/aj_send_mail.cfm?' + post
	}
	
}
function out_of_stock(product_id, child_product_id, customer_id){
	working()
	new Ajax.Request('core/aj_request_product.cfm?product_id='+ product_id +'&child_product_id='+ child_product_id+'&customer_id='+customer_id, 
		{asynchronous:true, 
			onSuccess:request_sent(child_product_id),
			onFailure: function(){ alert('Something went wrong, please try again.') }
						 });
}
function request_sent(child_id){
	create_timeout(700, 'working()')
	if(child_id == -1){
		create_timeout(600, "blind('request_sent_div')")
	}
	else{
		create_timeout(600, "blind('request_sent_div_"+child_id+"')")
	}
}