function alignChips(){
	if($$('div.iMaChip').length > 1){
		new Insertion.Before($$('div.iMaChip')[0],'<div id="holder">holder</div>');
		var t = "<table>";
		var inOne = true;
		$$('div.iMaChip').each(function(el){
			if(inOne){
				t += "<tr><td>";
				t += el.innerHTML;
				el.remove();
			}else{
				t += "</td><td>";
				t += el.innerHTML;
				el.remove();
				t += "</tr>";
			}
			inOne = !inOne;	    
		})
		t += "</table>";
		$('holder').innerHTML = t;
	}
}

function selectForward() {
	jumpLink(document.getElementById('data').value);
}
	
function jumpLink(val) {
	
	urlstr = window.location.toString();
	temp = new Array();
	temp = urlstr.split('#');
	window.location.href = temp[0]+'#'+val;	
 
}

function faqForward() {
	val = document.getElementById('data').value;		
	urlstr = window.location.toString();
	temp = new Array();
	temp = urlstr.split('/');
//	alert("http://"+temp[2]+val);
	window.location = "http://"+temp[2]+val;
}

function genSubPullDown() {
	val = document.getElementById('data').value;		
	urlstr = window.location.toString();
	temp = new Array();
	temp = urlstr.split('?');
	window.location = temp[0]+'?s='+val;
}

function forwardToDescrip(dest) {
	val = document.getElementById('data_b').value;		
	urlstr = window.location.toString();
	temp = new Array();
	temp = urlstr.split('/');
	
	//alert (val);
	if (val != 'select')
		window.location = 'http://'+temp[2]+val;
}

FindYourFit = {
	search: function(){
		var edu= $('education').value;
		var spec= $('specialty').value;
		
		if((edu != "")&&(spec != "")){
			new Ajax.Request('programs.php', {
				parameters: {
					edu_id: edu,
					spec_id: spec,
					action: 'search'
				},
				method:'get',
				onSuccess: function(transport) {
					var html = transport.responseText;
					$('resultSet').update(html);
					$('eduCopy').hide();
					$('fyfSearch').show();
					$('fyfResults').show();
		      	}
			})
		}
	}
}