/*
CUSTOM FORM ELEMENTS

Created by Ryan Fait
www.ryanfait.com

The only thing you need to change in this file is the following
variables: checkboxHeight, radioHeight and selectWidth.

Replace the first two numbers with the height of the checkbox and
radio button. The actual height of both the checkbox and radio
images should be 4 times the height of these two variables. The
selectWidth value should be the width of your select list image.

You may need to adjust your images a bit if there is a slight
vertical movement during the different stages of the button
activation.

Visit http://ryanfait.com/ for more information.

*/

var checkboxHeight = "25";
var radioHeight = "25";
var selectWidth = "167";

/* No need to change anything after this */

document.write('<style type="text/css">input.styled { display: none; } select.styled { position: relative; width: ' + selectWidth + 'px; opacity: 0; filter: alpha(opacity=0); z-index: 5; }</style>');

var Custom = {
	init: function() {
		var inputs = document.getElementsByTagName("input"), span = Array(), textnode, option, active;
		for(a = 0; a < inputs.length; a++) {
			if((inputs[a].type == "checkbox" || inputs[a].type == "radio") && inputs[a].className == "styled") {
				span[a] = document.createElement("span");
				span[a].className = inputs[a].type;

				if(inputs[a].checked == true) {
					if(inputs[a].type == "checkbox") {
						position = "0 -" + (checkboxHeight*2) + "px";
						span[a].style.backgroundPosition = position;
					} else {
						position = "0 -" + (radioHeight*2) + "px";
						span[a].style.backgroundPosition = position;
					}
				}
				inputs[a].parentNode.insertBefore(span[a], inputs[a]);
				inputs[a].onchange = Custom.clear;
				span[a].onmousedown = Custom.pushed;
				span[a].onmouseup = Custom.check;
				document.onmouseup = Custom.clear;
			}
		}
		inputs = document.getElementsByTagName("select");
		for(a = 0; a < inputs.length; a++) {
			if(inputs[a].className == "styled") {
				option = inputs[a].getElementsByTagName("option");
				active = option[0].childNodes[0].nodeValue;
				textnode = document.createTextNode(active);
				for(b = 0; b < option.length; b++) {
					if(option[b].selected == true) {
						textnode = document.createTextNode(option[b].childNodes[0].nodeValue);
					}
				}
				span[a] = document.createElement("span");
				span[a].className = "select";
				span[a].id = "select" + inputs[a].name;
				span[a].appendChild(textnode);
				inputs[a].parentNode.insertBefore(span[a], inputs[a]);
				inputs[a].onchange = Custom.choose;
			}
		}
	},
	pushed: function() {
		element = this.nextSibling;
		if(element.checked == true && element.type == "checkbox") {
			this.style.backgroundPosition = "0 -" + checkboxHeight*3 + "px";
		} else if(element.checked == true && element.type == "radio") {
			this.style.backgroundPosition = "0 -" + radioHeight*3 + "px";
		} else if(element.checked != true && element.type == "checkbox") {
			this.style.backgroundPosition = "0 -" + checkboxHeight + "px";
		} else {
			this.style.backgroundPosition = "0 -" + radioHeight + "px";
		}
	},
	check: function() {
		element = this.nextSibling;
		if(element.checked == true && element.type == "checkbox") {
			this.style.backgroundPosition = "0 0";
			element.checked = false;
		} else {
			if(element.type == "checkbox") {
				this.style.backgroundPosition = "0 -" + checkboxHeight*2 + "px";
			} else {
				this.style.backgroundPosition = "0 -" + radioHeight*2 + "px";
				group = this.nextSibling.name;
				inputs = document.getElementsByTagName("input");
				for(a = 0; a < inputs.length; a++) {
					if(inputs[a].name == group && inputs[a] != this.nextSibling) {
						inputs[a].previousSibling.style.backgroundPosition = "0 0";
					}
				}
			}
			element.checked = true;
		}
	if (element.type == "radio") {
			//fuelChange();
			//function fuelChange(){
			
	// hello sir, we are calling this function straight in the custom form elements instead of separate declaration
	var fuelchecked = $("input[name='fuel']:checked").val();
	//alert(fuelchecked);
	//alert("current cell data is: " + $("#fuelselectcell").html());
	$.ajax({
		type: "GET",
		url: "scripts/showFuelTypes.php",
		cache: false,
		data: "fuelType=" + fuelchecked,
		success: function(html){
			//alert("ajax call has returned this: " + html);
			/*$("#fuelselectcell").empty();
			$("#fuelselectcell").html(html);*/
			
			$('#fuelselect').find('option').remove().end().append(html);
			$("#fuelselectcell").highlightFade({color: 'rgb(117, 69, 150)',speed: 1500,iterator: 'sinusoidal'});

			
			function fuelSchmool() {
				var newselect = document.getElementById("fuelselect");
				var fuelspanbox = document.getElementById("selectfuelselect");
				newoption = newselect.getElementsByTagName("option");
				//alert("a! "+newoption.length);
				/*for(d = 0; d < newoption.length; d++) {
				if(newoption[d].selected == true) {
				//alert("achtung! "+newoption[d].childNodes[0].nodeValue);
				//fuelspanbox.childNodes[0].nodeValue = newoption[d].childNodes[0].nodeValue;
				fuelspanbox.childNodes[0].nodeValue = newoption[d].childNodes[0].nodeValue;
				}
				}*/
				var newopt = newselect.options[newselect.selectedIndex].text;
				//alert(newopt);
				//newselect.onchange = fuelSchmool();
				//initBinding();
				}
			
			
			var inputs = document.getElementsByTagName("input"), span = Array(), textnode, option, active;
			var newselect = document.getElementById("fuelselect");
			var fuelspanbox = document.getElementById("selectfuelselect");
			//options = newselect.getElementsByTagName("option");
			//alert(options.length);
			//for(a = 0; a < options.length; a++) {
			
			option = newselect.getElementsByTagName("option");
				//active = option[0].childNodes[0].nodeValue;
				active = "[none selected]";
				textnode = document.createTextNode(active);
				fuelspanbox.childNodes[0].nodeValue = active;
				/*for(b = 0; b < option.length; b++) {
					if(option[b].selected == true) {
						textnode = document.createTextNode(option[b].childNodes[0].nodeValue);
					}
				}*/
				
				
				//span[a] = document.createElement("span");
				//span[a].className = "select";
				//span[a].id = "selectfuelselect";
				//span[a].appendChild(textnode);
				//newselect.parentNode.insertBefore(span[a], newselect);
				//$("#fuelselectcell").show();
				/*goSelector = Array();
				goSelector = newselect.getElementsByTagName("select");*/
				//var fuelspanbox = document.getElementById("selectfuelselect");
				newselect.onchange = function () {
					var newselect = document.getElementById("fuelselect");
					var fuelspanbox = document.getElementById("selectfuelselect");
					newoption = newselect.getElementsByTagName("option");
					for(d = 0; d < newoption.length; d++) {
						if(newoption[d].selected == true) {
						fuelspanbox.childNodes[0].nodeValue = newoption[d].childNodes[0].nodeValue;
						}
					}
				/*---dig it, burry---*/
var productid = $("#product_id_value").text();
var price = $("#productprice").text();
price = price.replace(/,/, "");
var productprice = parseFloat(price.replace(/£/, ""));
var base = $("#baseprice").text();
base = base.replace(/,/, "");
var baseprice = parseFloat(base.replace(/£/, ""));
var finishdrop = document.getElementById("finishselect");
var selectedfinish = finishdrop.options[finishdrop.selectedIndex].value;
if (document.getElementById("insetfinishselect")) {
var insetfinishdrop = document.getElementById("insetfinishselect");
var selectedinsetfinish = insetfinishdrop.options[insetfinishdrop.selectedIndex].value;
} else {
var selectedinsetfinish = 219;
}
var fueldrop = document.getElementById("fuelselect");
var selectedfuel = fueldrop.options[fueldrop.selectedIndex].value;
//alert("selectedfuel: "+selectedfuel);
//alert("product:" + productid + "\nproductprice:" + productprice + "\n finish:" + selectedfinish + "\n insetfinish:" + selectedinsetfinish + "\n insetfuel:" + selectedfuel + "\n");
$.ajax({
type: "GET",
url: "scripts/CRcalculateProductPrice.php",
cache: false,
data: "productid=" + productid + "&productprice=" + productprice + "&baseprice=" + baseprice + "&finishid=" + selectedfinish + "&insetfinishid=" + selectedinsetfinish + "&fuelid=" + selectedfuel,
success: function(html){
//alert(html);
$('#calculatedpricebox').show();
var prices = html.split(':');
$("#calculatedpricebox p").html(prices[2]+" total");
$("#basefinalprice").html(prices[0]);
$("#finalprice").html(prices[1]);
if((selectedfinish!="" && selectedfinish!=0)) {
$.scrollTo("#calculatedpricebox");
$("#calculatedpricebox").highlightFade({color:'rgb(105, 207, 136)',speed:1500,iterator:'sinusoidal'});
//$('#customernotes').show();
//$('#addtocart').show();
} /*else {
$.scrollTo("#calculatedpricebox");
$("#calculatedpricebox").highlightFade({color:'rgb(255, 207, 136)',speed:1000,iterator:'sinusoidal'});
alert("error: you need to select a finish for this product");
}*/
}
});
/*---ende bodge---*/
				//initBinding();
				}
				
// Comrades, now we march to Gdansk!
			
			
			
		}
	});
//}
		}
	},
	clear: function() {
		inputs = document.getElementsByTagName("input");
		for(var b = 0; b < inputs.length; b++) {
			if(inputs[b].type == "checkbox" && inputs[b].checked == true && inputs[b].className == "styled") {
				inputs[b].previousSibling.style.backgroundPosition = "0 -" + checkboxHeight*2 + "px";
			} else if(inputs[b].type == "checkbox" && inputs[b].className == "styled") {
				inputs[b].previousSibling.style.backgroundPosition = "0 0";
			} else if(inputs[b].type == "radio" && inputs[b].checked == true && inputs[b].className == "styled") {
				inputs[b].previousSibling.style.backgroundPosition = "0 -" + radioHeight*2 + "px";
			} else if(inputs[b].type == "radio" && inputs[b].className == "styled") {
				inputs[b].previousSibling.style.backgroundPosition = "0 0";
			}
		}
	},
	choose: function() {
		option = this.getElementsByTagName("option");
		for(d = 0; d < option.length; d++) {
			if(option[d].selected == true) {
				document.getElementById("select" + this.name).childNodes[0].nodeValue = option[d].childNodes[0].nodeValue;
				//alert("selected: "+option[d].childNodes[0].nodeValue);
			}
		}
/*---dig it, burry---*/
var productid = $("#product_id_value").text();
var price = $("#productprice").text();
price = price.replace(/,/, "");
var productprice = parseFloat(price.replace(/£/, ""));
var base = $("#baseprice").text();
base = base.replace(/,/, "");
var baseprice = parseFloat(base.replace(/£/, ""));
var finishdrop = document.getElementById("finishselect");
var selectedfinish = finishdrop.options[finishdrop.selectedIndex].value;
// changes 041109
//var insetfinishdrop = document.getElementById("insetfinishselect");
//var selectedinsetfinish = insetfinishdrop.options[insetfinishdrop.selectedIndex].value;
// changed to allow inset to go through as 219 or "n/a" eaier than editing php files
if (document.getElementById("insetfinishselect")) {
var insetfinishdrop = document.getElementById("insetfinishselect");
var selectedinsetfinish = insetfinishdrop.options[insetfinishdrop.selectedIndex].value;
} else {
var selectedinsetfinish = 219;
}
// end changes 041109
var fueldrop = document.getElementById("fuelselect");
var selectedfuel = fueldrop.options[fueldrop.selectedIndex].value;
//alert("selectedfuel: "+selectedfuel);
//alert("product:" + productid + "\nproductprice:" + productprice + "\n finish:" + selectedfinish + "\n insetfinish:" + selectedinsetfinish + "\n insetfuel:" + selectedfuel + "\n");
$.ajax({
type: "GET",
url: "scripts/CRcalculateProductPrice.php",
cache: false,
data: "productid=" + productid + "&productprice=" + productprice + "&baseprice=" + baseprice + "&finishid=" + selectedfinish + "&insetfinishid=" + selectedinsetfinish + "&fuelid=" + selectedfuel,
success: function(html){
//alert(html);
$('#calculatedpricebox').show();
var prices = html.split(':');
$("#calculatedpricebox p").html(prices[2]+" total");
$("#basefinalprice").html(prices[0]);
$("#finalprice").html(prices[1]);
if((selectedfinish!="" && selectedfinish!=0)) {
$.scrollTo("#calculatedpricebox");
$("#calculatedpricebox").highlightFade({color:'rgb(105, 207, 136)',speed:1500,iterator:'sinusoidal'});
//$('#customernotes').show();
//$('#addtocart').show();
} /*else {
$.scrollTo("#calculatedpricebox");
$("#calculatedpricebox").highlightFade({color:'rgb(255, 207, 136)',speed:1000,iterator:'sinusoidal'});
alert("error: you need to select a finish for this product");
}*/
}
});
/*---ende bodge---*/
	}
}
window.onload = Custom.init;


$(document).ready(function() {
function initBinding() {
$("#fuelselect").onchange = fuelSchmool();
function fuelSchmool() {
				var newselect = document.getElementById("fuelselect");
				var fuelspanbox = document.getElementById("selectfuelselect");
				newoption = newselect.getElementsByTagName("option");
				//alert("a! "+newoption.length);
				/*for(d = 0; d < newoption.length; d++) {
				if(newoption[d].selected == true) {
				//alert("achtung! "+newoption[d].childNodes[0].nodeValue);
				//fuelspanbox.childNodes[0].nodeValue = newoption[d].childNodes[0].nodeValue;
				fuelspanbox.childNodes[0].nodeValue = newoption[d].childNodes[0].nodeValue;
				}
				}*/
				var newopt = newselect.options[newselect.selectedIndex].text;
				//alert(newopt);
				//initBinding();
				}
}
	
//initBinding();
//chapmanBaxter();
// tooltip on acessories hover
$("img.accessimage").tooltip({ 
    track: false, 
    delay: 0, 
    showURL: false, 
    opacity: 0.9, 
    fixPNG: true, 
    showBody: " - ", 
    top: -205, 
    left: -70 
});

/*function FuelTypecalculateProductPrices() {
	alert("FuelTypecalculateProductPrices");
}*/

/*--- accessory set switching --- */

function switchAccessorySets() {
var productid = $("#product_id_value").text();
//var fuelradio = document.getElementById("fuel");
var selectedfueltype = $("input:radio[@name=fuel]:checked").val();
//alert("fuletype:" + selectedfueltype);
//alert("selectedfuel: "+selectedfuel);
//alert("product:" + productid + "\nproductprice:" + productprice + "\n finish:" + selectedfinish + "\n insetfinish:" + selectedinsetfinish + "\n insetfuel:" + selectedfuel + "\n");
$.ajax({
type: "GET",
url: "scripts/CRShowAccessories.php",
cache: false,
data: "productid=" + productid + "&selectedfueltype=" + selectedfueltype,
success: function(html){
//alert(html);
//$('#products_accessories').empty();
$('#products_accessories').show();
$("#products_accessories").html(html);

$("img.accessimage").tooltip({
    track: false,
    delay: 0,
    showURL: false,
    opacity: 0.9,
    fixPNG: true,
    showBody: " - ",
    top: -205,
    left: -70
});
$("img.accessimage").click(
function()
{
var thisid = this.id;
var acc = thisid.split("acc");
var accid = acc[0];
var accprice = acc[1];
calculateAccessoryPrices(accid, accprice)
});
/*if((selectedfinish!="" && selectedfinish!=0)) {
$.scrollTo("#calculatedpricebox");
$("#calculatedpricebox").highlightFade({color:'rgb(105, 207, 136)',speed:1500,iterator:'sinusoidal'});
} /*else {
$.scrollTo("#calculatedpricebox");
$("#calculatedpricebox").highlightFade({color:'rgb(255, 207, 136)',speed:1000,iterator:'sinusoidal'});
alert("error: you need to select a finish for this product");
$('#addtocart').hide();
}*/
}
});
}


/* -- calculate product prices when options are changed --- */
function calculateProductPrices() {
var productid = $("#product_id_value").text();
var price = $("#productprice").text();
var productprice = parseFloat(price.replace(/£/, ""));
var finishdrop = document.getElementById("finishselect");
var selectedfinish = finishdrop.options[finishdrop.selectedIndex].value;
var insetfinishdrop = document.getElementById("insetfinishselect");
var selectedinsetfinish = insetfinishdrop.options[insetfinishdrop.selectedIndex].value;
var fueldrop = document.getElementById("fuelselect");
var selectedfuel = fueldrop.options[fueldrop.selectedIndex].value;
//alert("selectedfuel: "+selectedfuel);
//alert("product:" + productid + "\nproductprice:" + productprice + "\n finish:" + selectedfinish + "\n insetfinish:" + selectedinsetfinish + "\n insetfuel:" + selectedfuel + "\n");
$.ajax({
type: "GET",
url: "scripts/CRcalculateProductPrice.php",
cache: false,
data: "productid=" + productid + "&productprice=" + productprice + "&finishid=" + selectedfinish + "&insetfinishid=" + selectedinsetfinish + "&fuelid=" + selectedfuel,
success: function(html){
//alert(html);
$('#calculatedpricebox').show();
$("#calculatedpricebox p").html(html+" total");
$("#finalprice").html(html);
//switchAccessorySets();
if((selectedfinish!="" && selectedfinish!=0)) {
$.scrollTo("#calculatedpricebox");
$("#calculatedpricebox").highlightFade({color:'rgb(105, 207, 136)',speed:1500,iterator:'sinusoidal'});
} /*else {
$.scrollTo("#calculatedpricebox");
$("#calculatedpricebox").highlightFade({color:'rgb(255, 207, 136)',speed:1000,iterator:'sinusoidal'});
alert("error: you need to select a finish for this product");
$('#addtocart').hide();
}*/
}
});
}

/*---for accessories addtocart from tooltip---*/

function addAccessory(product) {
var thedata = product.split(",")
var productid = thedata[0];
var productprice = thedata[1];
var finishdrop = document.getElementById("finishselect");
var selectedfinish = finishdrop.options[finishdrop.selectedIndex].value;
$.ajax({
type: "GET",
url: "scripts/addItem.php",
cache: false,
data: "productid=" + productid + "&productprice=" + productprice + "&finishid=" + selectedfinish + "&insetfinishid=219" + "&fuelid=24",
success: function(html){
$.scrollTo('#header', 800);
$('#basket').show(400);
$.ajax({
type: "GET",
url: "cherishedQuickCart.php",
cache: false,
success: function(html){
//alert(html);
$('#quickcartdetails').fadeIn(400);
$('#quickcartdetails').html(html);
initBinding();
}
});
}
});
}

function calculateAccessoryPrices(productid, productprice){
	var finishdrop = document.getElementById("finishselect");
	var selectedfinish = finishdrop.options[finishdrop.selectedIndex].value;
	$.ajax({
		type: "GET",
		url: "scripts/CRcalculateAccessoryPrice.php",
		cache: false,
		data: "productid=" + productid + "&productprice=" + productprice + "&finishid=" + selectedfinish + "&insetfinishid=219" + "&fuelid=24",
		success: function(html) {
			addAccessory(html);
		}
	});
}


$("img.accessimage").click(
function()
{
var thisid = this.id;
var acc = thisid.split("acc");
var accid = acc[0];
var accprice = acc[1];
calculateAccessoryPrices(accid, accprice)
});

/*$("#finishselect").change(function() {
calculateProductPrices();
});
$("#insetfinishselect").change(function() {
calculateProductPrices();
});
$("#fuelselect").change(function() {
calculateProductPrices();
});*/


function addProductToCart() {
var productid = $("#product_id_value").text();
var finish = $("#finishselect").val();
var insetfinish = $("#insetfinishselect").val();
var fuel = $("#fuelselect").val();
//var productprice = $("#finalprice").text();
var price = $("#baseprice").text();
price = price.replace(/,/, "");
var productprice = parseFloat(price);
var productneedsfuel = $("#productneedsfuel").val();
if (fuel == 0 && productneedsfuel == "y") {
var erroralert = "<div id=\"errorModal\">\n<h1>Missing Product Details</h1>\n<p>You must choose the fuel option for this product before you can add it to your cart.<br><br>Please check you've chosen the finish and fuel options you require.</p>\n<a class=\"modalCloseImg modalClose\" title=\"Close\"></a>\n</div>";
$.modal(erroralert, {
overlayId: 'alert-overlay',
closeClass: 'modalClose',
containerId: 'erroralert-container'
});
} else {
$.ajax({
type: "GET",
url: "scripts/addItem.php",
cache: false,
data: "productid=" + productid + "&finishid=" + finish + "&insetfinishid=" + insetfinish + "&fuelid=" + fuel + "&productprice=" + productprice,
success: function(html){
$.scrollTo('#header', 800);
$('#basket').show(400);
$.ajax({
type: "GET",
url: "cherishedQuickCart.php",
cache: false,
success: function(html){
$('#quickcartdetails').fadeIn(800);
$('#quickcartdetails').html(html);
var baselink="<a href=\"https://www.cherishedradiators.co.uk/shoppingcart.htm\" id=\"checkoutlink\">Place Your Order</a>";
$('#basketbase').html(baselink);
initBinding();
}
});
// end quickcart ajax
}
// end success loop
});
// end ajax loop
}
// end else loop
//});
}


/*---setup---*/
$('.scroll-pane').jScrollPane();
$("a[rel^='prettyPhoto']").prettyPhoto();
var $tabs = $('#tabs').tabs();
$("#tabs").tabs();
$("#tabs").bind("tabsselect", function(event, ui) { 
	//alert("tabbed: "+ui.tab.hash);
var currentab = ui.tab.hash;
var tabnumber;
var nexttab;
var proceedlink;
//alert("current: "+currentab);
if (currentab == "#description") {
	proceedlink = "<span>Proceed</span>";
	$("#productproceed").removeClass("cartproceed");
	$("#productproceed").addClass("productproceed");
} 
else if (currentab == "#options") {
	/*$("#productproceed").removeClass("productproceed");
	$("#productproceed").addClass("cartproceed");
	proceedlink = "<span>Add to Cart</span>";*/
	proceedlink = "<span>Proceed</span>";
	$("#productproceed").removeClass("cartproceed");
	$("#productproceed").addClass("productproceed");
}
else if (currentab == "#accessories") {
	$("#productproceed").removeClass("productproceed");
	$("#productproceed").addClass("cartproceed");
	proceedlink = "<span>Add to Cart</span>";
    switchAccessorySets();
}
$("#productproceed").html(proceedlink);
//return false;
})
/*--linking scrolling ---*/
if(document.location.hash){
$.scrollTo("#tabs");
}
$("#tabs ul").localScroll({ 
  target:"#tabs",
  duration:0,
  hash:true
});


/*---click through the tabbed panels---*/
$('.productproceed').click(function() {
var currentab = window.location.hash;
var tabnumber;
var nexttab;
var proceedlink;
//alert("current: "+currentab);
if(currentab != "#accessories") {
if (currentab == "#description" || currentab == "") {
	tabnumber=1;
	nexttab = "#options";
	proceedlink = "<span>Proceed</span>";
	$("#productproceed").removeClass("cartproceed");
	$("#productproceed").addClass("productproceed");
} 
else if (currentab == "#options") {
	tabnumber=2;
	nexttab = "#accessories";
	$("#productproceed").removeClass("productproceed");
	$("#productproceed").addClass("cartproceed");
	proceedlink = "<span>Add to Cart</span>";
}
//alert("tabnumber: "+tabnumber);
$tabs.tabs('select', tabnumber); // switch to next tab
//document.location.hash = "t" + $(ui.panel).attr("id");
//alert("nexttab: "+nexttab);
$("#productproceed").html(proceedlink);
document.location.hash = nexttab;
} else if (currentab == "#accessories") {
	addProductToCart();
}
return false;
});


function fuelChange(){
	var fuelchecked = $("input[name='fuel']:checked").val();
	$.ajax({
		type: "GET",
		url: "scripts/showFuelTypes.php",
		cache: false,
		data: "fuelType=" + fuelchecked,
		success: function(html){
			$("#fuelselectcell").empty();
			$("#fuelselectcell").html(html);
			$("#fuelselectcell").highlightFade({color: 'rgb(117, 69, 150)',speed: 1500,iterator: 'sinusoidal'});
			
			
			
		} // end ajax success
	}); // end ajax
}
/*--end checked fuel trigger---*/

}); // end main document ready

/*---unused bilge here ---*/

/*function simonBogey() {
var fuelselect = $("#fuelselect");
option = fuelselect.getElementsByTagName("option");
alert(option.length);
		for(d = 0; d < option.length; d++) {
			if(option[d].selected == true) {
				fuelselect.childNodes[0].nodeValue = option[d].childNodes[0].nodeValue;
				alert(option[d].childNodes[0].nodeValue);
			}
		}
}*/

			//$("#finishselect").css("border", "10px solid pink");
			//selectfuelselect
			//Custom.init;
			//$("#fuelselectcell").show().css("border", "none");
			//$(".styled").css("opacity", "100");
			//$("#fuelselect").size = $("#fuelselect").options.length;
			//$("#fuelselect").size = 10;

/*$( document ).ready( function() { 
$( "input[name='fuel']" ).bind( "click", radioClicks )
});
function radioClicks() {
alert( $( this ).val() );
}*/

//$('#tabs').bind('tabsshow', function(event, ui) {
//alert(ui.tab+" : "+ui.panel+" : "+ui.index)
//document.location.hash = $(ui.panel).attr("id");
//});
//$("span.radio").click(
//$("#fuel").click(
//$("input:radio").click(