function DESemail(emailname,emailserver) {
	document.write("<a href='mailto:" + emailname + "@" + emailserver +"'>");
	document.write(emailname + "@" + emailserver); 
	document.write("</a>"); 
}
// --------------------------------
// jQuery
// --------------------------------


function openLogin_init() {
	$("#openlogin").toggle(function(){
     $("#vlogin").load("/incs/snippets/vlogin.php",null
	  ,function(){
			$("#vlogin").slideDown("normal");
			return false;
		});
	  //$("#signInForm").slideDown("normal");
     
	  },function(){
	  $("#vlogin").slideUp("fast");
     return false;
   });
	
	$("#archive_date").change(function(){
	  	theDate = $(this).val();
	  	theHref = '/news/archives/'+theDate+'/';
	  	document.location.href = theHref;
  	});
}

function socratesInfo_init() {
	$("a.more_info").toggle(function(){
	  var helpID = $(this).get(0).rel;
	  $(this).html("hide help");
	  $("#"+helpID+"").load("/incs/snippets/help.php?q="+helpID+"", function() {
	  		$("#"+helpID+"").slideDown("fast");
		})
	  return false;
	  },function(){
	  		var helpID = $(this).get(0).rel;
	  		$(this).html("show help");
	  		$("#"+helpID+"").slideUp("fast");
   });
}
function socratesMore_init() {
	$("#toggle_intro").toggle(function(){
	  	$(this).html("Show Introduction");
	  	$("#soc_intro").slideUp("fast");
	  	return false;
  	},function(){
  		$(this).html("Hide Introduction");
	  	$("#soc_intro").slideDown("fast");
	  	return false;
  	});
}

function constructorMore_init() {
	$("#toggle_con_intro").toggle(function(){
	  	$(this).html("Show Introduction");
	  	$("#con_intro").slideUp("fast");
	  	return false;
  	},function(){
  		$(this).html("Hide Introduction");
	  	$("#con_intro").slideDown("fast");
	  	return false;
  	});
}

function print_link_init() {
	$("#print_link").click(function(){
		window.print();
		return false;
	});
	
}
$(document).ready(function(){
	openLogin_init();
	socratesMore_init() ;
	constructorMore_init();
	socratesInfo_init();
	print_link_init();
});