function buttons(){
//script to load radio text value to delivery tab divs
            var elements = document.getElementsByName ("shipping_id");

            for (var i=0; i < elements.length; i++) {
                if (elements[i].checked) {
					method=elements[i].onclick();
					//document.getElementById("del_text").innerHTML=document.getElementsByName("lab")[i].innerHTML;
                }

            }
}
function show_delivery(day) {


//if (day==6||day==1)
	if (day==6)
	{
			hideit('normal_deliv');
			hideit('spec_deliv');
			hideit('sameday_deliv');
			showit('sat_deliv');
		 document.getElementById("sat1").checked=true;

	}
	else if (day==9)
	{
			showit('normal_deliv');
			hideit('sat_deliv');
			showit('spec_deliv');

	}

	else if (day=='today')
	{
			hideit('normal_deliv');
			hideit('sat_deliv');
			showit('sameday_deliv');

			document.getElementById("sad1").checked=true;
	}
	else
	{
		hideit('sat_deliv');
		hideit('sameday_deliv');
		showit('normal_deliv');
		showit('spec_deliv');

		document.getElementById("nd1").checked=true;
	}
	buttons();
//catch(err) {alert(err)}
}

function hidewarning(){
try {
  var del_x = document.getElementById("del_warning");
  del_x.innerHTML = "";
  obj = document.getElementById("post_note");
  obj.style.display = "none";

} catch(err) {}
}

function showwarning(){
try {
  obj = document.getElementById("post_note");
  obj.style.display = "";
 // var del_x = document.getElementById("del_warning");
//  del_x.innerHTML = "* Please note: With this delivery method This item will be delivered by post and the delivery date cannot be guaranteed."; 
} catch(err) {}
}

function deliveryText(i,j,type,service){
hidewarning() ;
var del_y = document.getElementById("del_text");
var del_sel = "Delivery Method Selected : "+j;

del_y.innerHTML = "Delivery Method Selected : "+j ;
if (service=="SD101")
del_sel=del_sel+" Guaranteed Delivery";

//can customize below by nd1..nd2..nd3..sd1..etc.. for each id name , change i==ndN1 to correct id	
	if (type=="2") {
		showwarning();
		del_y.innerHTML = del_sel + " <p>Flowers from the postal range are dispatched by post and therefore can take 1-2 Days to reach their destination. You are able to upgrade this to a <b>Next Day Guaranteed</b> service by selecting the appropriate delivery method on the product. We also now offer a  <a href='/same-day-flowers.html'>same day flower range</a>  for those customers requiring a delivery today. </p>";
 }
	else if (type=="3"){
    	del_y.innerHTML = del_sel + "<p>Flowers from our same day delivery range can be delivered on the day of ordering if the order is received by 2.30pm. If this time has passed then a next day delivery service is offered.</P>";
    } else {
    	del_y.innerHTML = del_sel + "<p>Good News ! We offer FREE Guaranteed delivery on all our flowers in thiis range, we also provide a tracking code which will provide the current status of your order, and you can also have the option for a FREE text alert on delivery.<br> <br>Please be aware that a signature is required for all of our guaranteed delivery products. If a recipient is not in, a card will be left informing the recipient that the flowers will be at a local delivery office.<br><br> We also now offer a  <a href='/same-day-flowers.html'>same day flower range</a>  for those customers requiring a delivery today.  </P>";
	}

}

function fnPaging(){

}
 
function increase() {
// hidUnitPrice
document.frmMain.hidUnitPrice.value=0;
if (!isNaN(document.frmMain.psize.value)) {
var total =0;
total= parseFloat(document.frmMain.OrigPrice.value)+parseFloat(document.frmMain.psize.value);
document.getElementById("hidUnitPrice").value=total.toFixed(2);
//var format = document.frmMain.hidUnitPrice.value;
//format = (format).toFixed(2);
//document.getElementById("priceshown").value=format;
document.getElementById("priceshown").value=document.frmMain.hidUnitPrice.value;
}
}

function Upgrade(deluxe,amnt, price){
              
	document.getElementById("hidUnitPrice").value=0;
	var total =0;     

 //document.frmMain.prodUpgrade.value; //parseFloat(document.frmMain.OrigPrice.value)+parseFloat(document.frmMain..value);
 if(document.getElementById("prodUpgrade").checked == true){
 
    document.getElementById("hidUnitPrice").value=amnt+price;
  	document.getElementById("priceshown").value= (parseFloat(document.getElementById("hidUnitPrice").value)).toFixed(2);
  	document.getElementById("priceshown_text").innerHTML = (parseFloat(document.getElementById("hidUnitPrice").value)).toFixed(2);
  	document.getElementById("deluxe").value=1;
  	
 }else{
                    
    document.getElementById("hidUnitPrice").value=parseFloat(price).toFixed(2);
  	document.getElementById("priceshown").value=parseFloat(price).toFixed(2);
  	document.getElementById("priceshown_text").innerHTML = parseFloat(price).toFixed(2);
  	document.getElementById("deluxe").value=0;
  	
 }
	
}

function fnChangeMonth(y,m) {
	document.frmMain.action="/product_details.php?month="+m+"&year="+y+"&org_date="+document.frmMain.org_date.value;
	document.frmMain.submit();
}

function showButtons(action){
if(action == 'show'){
  document.getElementById("carouselTr").style.height = "160px";
  //document.getElementById("infiniteCarousel2").style.top = "-75px";  
  document.getElementById("navLinks").style.display = "inline";
}else{
  document.getElementById("carouselTr").style.height = "120px";
 // document.getElementById("infiniteCarousel2").style.top = "-55px";
  document.getElementById("navLinks").style.display = "none";
}
  
}

