
var selectedLink = "";

function sub_selected(n, i, link) {
	$("#optionsDiv2").attr("class", "optionsDivInvisible");
	$("#mySelectText2").text(i);
	selectedLink = link;
}

$(function(){
	$("#mySelect1, #mySelect2, #mySelect3, #mySelect4, #mySelect5, #mySelect6, #mySelect7, #mySelect8, #mySelect9").val(null);
	$("#select1, #select2, #select3, #select4, #select5, #select6").hide();
	
	if($("#mySelect3").val(null)){
		$("#select").click(function(){
			alert("no");
		});
	}
	
	$("#select").click(function(){
		var n = $("#mySelect2").val();
		
		var _n = parseInt(n) + 3;
		
		var op1 = $("#mySelect"+_n).html();
		var p1 = $("#mySelect"+_n+" option");
			var a = "";
			for(var i=0; i<p1.length; i++) {
				a += '<p><a href="javascript:void(0);" style="cursor: pointer;" onClick="sub_selected('+n+',\''+p1.eq(i).text()+'\', \''+p1.get(i).value+'\')">'+p1.eq(i).text()+'</a></p>';
			}
			$("#optionsDiv2").html(a);
			
			$("#select #mySelect3").html(op1);
	});
	
});

function linkJump(sId) {
	var url = $("#"+sId).val();
	window.location.href = url;
	
	if(sId == "mySelect1") {
		if(url == null) {
			window.location.href = "/shop";
		}
	}
	if(sId == "mySelect2") {
		if(url == null) {
			window.location.href = "/floor";
		}
	}
	return false;
}

function linkJump2() {
	window.location.href = selectedLink;
}

