
function Go(url)	{
	window.top.location.href = url.options[url.selectedIndex].value;
	url.selectedIndex=0;
}


function selectChild(url)	{
	
	window.top.location.href = "case_child_employment.php?childID=" +  url.options[url.selectedIndex].value;
	url.selectedIndex=0;
}

function selectChildEducation(url)	{
	
	window.top.location.href = "case_child_education.php?childID=" +  url.options[url.selectedIndex].value;
	url.selectedIndex=0;
}


function setSelectedIndex(s, valsearch){
	for (i = 0; i< s.options.length; i++){
		if (s.options[i].value == valsearch){
			s.options[i].selected = true;
			break;
		}
	}
	return;
}

function showDiv(divid){
	$("#" + divid).addClass("showDiv");									
}

function troggleDisplayYesNo(divid, selectIndex){		
	if (selectIndex == "2"){
		$("#" + divid).css("display", "block");
	}else{
		$("#" + divid).css("display", "none");
	}
}

//Jquery extention to get URL parameters

$.extend({
	  getUrlVars: function(){
	    var vars = [], hash;
	    var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
	    for(var i = 0; i < hashes.length; i++)
	    {
	      hash = hashes[i].split('=');
	      vars.push(hash[0]);
	      vars[hash[0]] = hash[1];
	    }
	    return vars;
	  },
	  getUrlVar: function(name){
	    return $.getUrlVars()[name];
	  }
});
