$(document).ready(function() {

	var text = "I'm looking for...";
	$("#src").attr("value", text);	
	$("#src").focus(function() {
		if($(this).attr("value") == text) $(this).attr("value", "");
	});
	$("#src").blur(function() {
		if($(this).attr("value") == "") $(this).attr("value", text);
	});

	$("#menupoz").change( function() {
		var mpoz = $("#menupoz").val();
		
		hideall();

		if(mpoz=="top") {
			showlink();
		} else if(mpoz=="left") {
			showparent();
		} else if(mpoz=="none") {
			showcont();
		} else {
			hideall();
		}

	});

	$("#pglk").change( function() {
		var npglk = $("#pglk").val();
		
		if(npglk==1) {
			showcont();
		} else if(npglk==2) {
			showextlink();
		} else if(npglk==3) {
			showintlink();
		} else {
			hideall();
		}

	});

	$("#cseo").click(function() {
		var seo = $("#cseo:radio").val();
		if(seo=="yes") {
			$('#meta').show();
		} else {
			$('#meta').hide();
		}
	});

	$("#vendorfee").change(function() {

		var vfsel = $("#vendorfee").val();

		$("#vendorfee1-label").hide();
		$("#vendorfee1-element").hide();
		$("#vendorfee2-label").hide();
		$("#vendorfee2-element").hide();

		if(vfsel=="1") {
			$("#vendorfee1-label").show();
			$("#vendorfee1-element").show();
		} else if(vfsel=="2") {
			$("#vendorfee2-label").show();
			$("#vendorfee2-element").show();
		}

	});

});


function showparent() {

	$('#pmenu').show();
	showpagelink();
	
}


function showlink() {

	$('#linkname').show();
	showpagelink();
	
}

function showpagelink() {

	$('#createorlink').show();

}

function showextlink() {

	$('#createorlink').hide();
	$('#linkto').show();
	$('#ord').show();
	$('#protected').show();
	$('#status').show();
	$('#submit').show();
	
}

function showintlink() {

	$('#createorlink').hide();
	$('#linkint').show();
	$('#ord').show();
	$('#protected').show();
	$('#status').show();
	$('#submit').show();
	
}

function showcont() {

	$('#createorlink').hide();
	$('#linkname').show();
	$('#seo').show();
	$('#head').show();
	$('#color').show();
	$('#cont').show();
	$('#ord').show();
	$('#protected').show();
	$('#status').show();
	$('#submit').show();

}

function hideall() {

	$('#pmenu').hide();
	$('#linkname').hide();
	$('#createorlink').hide();
	$('#linkto').hide();
	$('#seo').hide();
	$('#meta').hide();
	$('#head').hide();
	$('#color').hide();
	$('#cont').hide();
	$('#ord').hide();
	$('#protected').hide();
	$('#status').hide();
	$('#submit').hide();
	
}

