
var checkboxHeight = "25";
var radioHeight = "25";
var selectWidth = "155";

/* No need to change anything after this */

document.write('<style type="text/css">input.styled { display: none; } select.styled {font-size:0.99em; position: relative; color:#323232;width: ' + selectWidth + 'px; opacity: 0; filter: alpha(opacity=0); }select.styled1 {font-family:Lucida Sans Unicode;font-size:0.99em; position: relative; color:#323232;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;

				
				inputs[a].parentNode.insertBefore(span[a], inputs[a]);
				inputs[c].parentNode.insertBefore(span[c], inputs[c]);
				
			}
		}
		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;
			}
		}
		for(c = 0; c < inputs.length; c++) {
			if(inputs[c].className == "styled1") {
				option = inputs[c].getElementsByTagName("option");
				active = option[0].childNodes[0].nodeValue;
				textnode = document.createTextNode(active);
				for(d = 0; d < option.length; d++) {
					if(option[d].selected == true) {
						textnode = document.createTextNode(option[d].childNodes[0].nodeValue);
					}
				}
				span[c] = document.createElement("span");
				span[c].className = "select2";
				span[c].id = "select2" + inputs[c].name;
				span[c].appendChild(textnode);
				inputs[c].parentNode.insertBefore(span[c], inputs[c]);
				inputs[c].onchange = Custom.sel;
			}
		}
	},
	
	choose: function() {
		option = this.getElementsByTagName("option");
		for(e = 0; e < option.length; e++) {
			if(option[e].selected == true) {
				document.getElementById("select" + this.name).childNodes[0].nodeValue = option[e].childNodes[0].nodeValue;
			}			
		}		
		if(document.getElementById(this.name).id=="ddlstorename")		
		    loadstoreslocation();
		else
		    loadstoresdetails();
	},
	sel: function() {
		option = this.getElementsByTagName("option");
		for(f = 0; f < option.length; f++) {
			if(option[f].selected == true) {
				document.getElementById("select2" + this.name).childNodes[0].nodeValue = option[f].childNodes[0].nodeValue;
				
			}
		}
		
	}
}
window.onload = Custom.init;
   
