$(document).ready(function(){
													 
	$('#magazine-goto-btn').click(function(){
		var magazine = $('#magazine-goto-select').val();
		if(magazine == '' || magazine == '#'){
			alert('Please select a site');
			return false;
		}
		window.location = magazine;
	});
	
	$('#btn-advertise-contact').click(function(){
		var site = $('#select-advertise-magazine').val();
		window.location = 'contact_advertise.html?site=' + site;
	});
	
	$('#sidebar-register-btn').click(function(){
		var magazine = $('#sidebar-register-select').val();
		if(magazine == '' || magazine == '#'){
			alert('Please select a site');
			return false;
		}
		window.open(magazine);
	});
	
	$('#btn-contribute-contact').click(function(){
		var site = $('#select-contribute-magazine').val();
		window.location = 'contact_contribute.html?site=' + site;
	});
	
	$('#btn-download-media-kit').click(function(){
		var media_kit = $('#select-download-media-kit').val();
		var url = 'media_kits/';
		switch(media_kit){
			case 'Connected Home Technology':
			url += 'CH_media_kit.pdf';
			break;
			case 'World Plumbing Info':
			url += 'WPI_ONLINE_MEDIA_KIT.pdf';
			break;
			default:
			url = false;
			break;
		}
		if(url){
			window.open(url);
		}else{
			alert('Please select a site');
		}
	});
});

function MM_jumpMenuGo(objId,targ,restore){ //v9.0
  var selObj = null;  with (document) { 
  if (getElementById) selObj = getElementById(objId);
  if (selObj) eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0; }
}

function getParam( name ){
  name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
  var regexS = "[\\?&]"+name+"=([^&#]*)";
  var regex = new RegExp( regexS );
  var results = regex.exec( window.location.href );
  if( results == null )
    return "";
  else
    return results[1];
}