function jumpTo(formEl, prefixUrl) {
	var url = $(formEl).children("select").get(0).options[$(formEl).children("select").get(0).selectedIndex].value;
	if(prefixUrl) {
		url = prefixUrl+url;
	}
	window.location = url;
}

$(document).ready(function(){
  $("ul.accordion a.list").click(function(){
  	//$("iframe").remove();
  	if($(this).hasClass("active") == false && $(this).hasClass("closed") == true){
  		if($(this).attr('class') != 'active' ){

  			$(this).siblings("span").slideDown('slow', function(){

  				//$(this).slideDown('slow');
  				//do sifr
  				sIFR.replace(tradegothicext, {
  					selector: '.accordion.approach li.parent h4'
  					,wmode: 'transparent'
  					,css: [
  						'.sIFR-root { color: #89A8BC; font-size: 14px; font-weight: bold; }'
  					]
  				});
  				sIFR.replace(tradegothicext, {
  					selector: '.accordion.quickstart li.parent h4'
  					,wmode: 'transparent'
  					,css: [
  						'.sIFR-root { color: #9999999; font-size: 14px; font-weight: bold; }'
  					]
  				});					
  				$('.jqModal').click(Modal.show);

  				$(this).siblings('a').addClass('active');

  				$(this).siblings('a').removeClass('closed');
  			})

  			$("ul.accordion li.parent a.active").siblings("span").slideUp('slow', function(){
  				$(this).siblings('a').addClass('closed');
  				$(this).siblings('a').removeClass('active');
  				$(this).siblings("span").remove();//here
  			});
  		}
  		if($(this).parent().is("li.parent") == true) {
  			target = { 'href' : $(this).attr("href") };
  			$(".nav_secondary li a").each(function() {
  				$(this).removeClass('active')
  				if($(this).attr("href") == target.href) {
  					$(this).toggleClass('active');
  				};	
  			});
  			return false;
  		}
  	}
  	if($(this).parent().is("li.parent") == true) {
  		return false;
  	}
  });
  $("ul.accordion a.list").click(function() {
  	if($(this).hasClass("active") == true){
  		return false;
  	}
  });

  $('.tooltip').Tooltip({showURL: false});

	$("#colBuild dl dt").click(function(){
		$("#colBuild dl dd:visible").slideUp(500);
		$(this).next().slideDown(500);
		return false;
	});
	
	$("#colEmerge dl dt").click(function(){
		$("#colEmerge dl dd:visible").slideUp(500);
		//$("#colEmerge dl dd:visible iframe").remove();
		$(this).next().slideDown(500);
		//vid = $(this).next().children("input").val();
		//$(this).next().prepend("<iframe src='"+vid+"' width='195' height='110' frameborder='0' scrolling='no'></iframe>");
		return false;

	});
	if ( typeof( window.jsonTeam ) != "undefined" ){
		window.setInterval(function(){
			chosen = Math.floor(Math.random() * jsonTeam.length);
			$('#teamWdgtRotator a').attr('href', '/team/'+jsonTeam[chosen].slug);
			$('#teamWdgtRotator a:eq(1)').text(jsonTeam[chosen].name);
			$('#teamWdgtRotator img').attr('src', '/images/uploads/team/'+jsonTeam[chosen].image);
		}, 3000);
	}

	if($("ul.accordion li.parent a.list").hasClass("active") == false){
		$("ul.accordion li.parent a:first").click();
	}
	$("#colBuild dl dt:eq("+Math.floor(Math.random() * (($("#colBuild dl dt").length)-1))+")").click()
	$("#colEmerge dl dt:eq("+Math.floor(Math.random() * (($("#colEmerge dl dt").length)-1))+")").click()

	$("a.group").fancybox({
		'hideOnContentClick': false,
		'overlayOpacity': .5,
		'overlayColor': '#000',
		'frameWidth': 655,
		'padding': 10
	});
});


