// andU.de - Webentwicklung und Eventmarketing - Internet-Agentur Hamburg
// (c) 2008 Philipp Randel

// EMAIL SPAMSCHUTZ
function email(name, domain, tld)
{
	var mail = name + "@" + domain + "." + tld;
	var link = "<a href='mailto:" + name + "@" + domain + "." + tld + "'>" + mail + "</a>";
	var bild = name + "_mail_image";
	document.write(link);
	document.getElementById(bild).style.display = "none";
}
// AJAX
function save_tree(element_tree, db_table) {
	new Ajax.Request('/js/save_order.php',
		{
			method:'post',
			parameters: { 
				data: Sortable.serialize(element_tree),
				table: db_table
			},
			onSuccess: function(transport){
			  var response = transport.responseText || "Keine Antwort vom Script...";
			  new Effect.Highlight("status");
			  document.getElementById("status").innerHTML = response;
			},
			onFailure: function(){ 
				new Effect.Highlight("status");
				document.getElementById("status").innerHTML = 'Fehler bei der Verbindung...'; 
			}
		 }
	);
}
// LINK-FOKUS VERSTECKEN
function init() 
 { 
    var a=document.getElementsByTagName('a'); 
  
    for (var i=0;i<a.length;i++) { /* http://www.tomislav.net/gestrichelte-linie-um-link-verstecken.htm */ 
       a[i].onmousedown = function() 
       { 
          this.onfocus = function() 
          { 
             this.blur(); 
          } 
       } 
       a[i].onmouseup = function() 
       { 
          this.onfocus = function(){} 
       } 
       a[i].onmouseout = a[i].onmouseup; 
    } 
 } 
  
 window.onload = init;
