$(document).ready(function() {
	$("a.show").click(function(){
		var content_show = $(this).attr("title");
		$("#"+content_show).toggle();
		$("a.hide").toggle();
		$(this).toggle();
	});


	$('table').styleTable(); 

	$('.edit').editable('http://www.example.com/save.php');
});

function insertTab(o, e) {
	var kC = e.keyCode ? e.keyCode : e.charCode ? e.charCode : e.which;
	if (kC == 9 && !e.shiftKey && !e.ctrlKey && !e.altKey) {
		var oS = o.scrollTop;
		if (o.setSelectionRange) {
			var sS = o.selectionStart;
			var sE = o.selectionEnd;
			o.value = o.value.substring(0, sS) + "\t" + o.value.substr(sE);
			o.setSelectionRange(sS + 1, sS + 1);
			o.focus();
		} else if (o.createTextRange) {
			document.selection.createRange().text = "\t";
			e.returnValue = false;
		}
		o.scrollTop = oS;
		if (e.preventDefault) { e.preventDefault(); }
		return false;
	}
	return true;
}

























function chsigns(elem, allowed) {
  n = 0;
  newtext = '';
  while(n != elem.value.length) {
    char = elem.value.charAt(n);
    check = char.toLowerCase();
    if(allowed.indexOf(check) != -1) {
      newtext = newtext+char;
    }
    n++;
  };
  elem.value = newtext;
};


function cnfrm(com, txt, fname) {
  if (fname == null) { fname = 'multi'; }
  if (txt == null) { txt = 'Bist Du sicher?'; }
  if (confirm(txt)) {
    if (com) { document.forms[fname].c.value = com; }
    document.forms[fname].submit();
  } else { return false; }
}


function cnfrmlnk(lnk, txt, tgt) {
  if (txt == null) { txt = 'Bist Du sicher?'; }
  if (confirm(txt)) {
    if (tgt == null) { top.window.location = lnk; }
    else if (tgt == "self") { window.location = lnk; }
    else {
      window.open(lnk);
      setTimeout(top.window.location.reload(true), 3000);
    }
  }
}

function slct_all(fname) {
  if (fname == null) { fname = 'multi'; }
  var mf = document.forms[fname];
  var len = mf.elements.length;
  for (var i = 0; i < len; i++) {
    var e = mf.elements[i];
    if ((e.type == "checkbox") && (e.name != "switcher")) {
      if (e.checked != mf.switcher.checked){
        e.checked = mf.switcher.checked;
        slct(e, fname);
      }
    }
  }
}


function slct(e, fname){
  if (fname == null) { fname = 'multi'; }
  var tr = null;
  if (e.parentNode.parentNode){tr = e.parentNode.parentNode;}
  else if (e.parentElement.parentElement){tr = e.parentElement.parentElement;}
  if (tr){
    if(e.checked){document.forms[fname].num_sel.value++;}
    else {document.forms[fname].num_sel.value--;}
  }
}AudioPlayer.setup("http://www.trancemusik.org/flash/audio-player/player.swf", {  
width:			250,  
initialvolume:		50,  
transparentpagebg:	"yes",  
left:			"000000",  
lefticon:		"FFFFFF",
bg:			"86C04A", // e5e5e5
leftbg:			"86C04A", // cccccc Speaker icon/Volume control background
voltrack:		"FFFFFF", // F2F2f2Volume track
volslider:		"C2151C", // 666666Volume slider
rightbg:		"86C04A", // b4b4b4Play/Pause button background
rightbghover:		"60A63A", // 999999Play/Pause button background (hover state)
righticon:		"FFFFFF", // 333333 Play/Pause icon
righticonhover:		"FFFFFF", // Play/Pause icon (hover state)
loader:			"60A63A", // 009900 Loading bar
track:			"86C04A", // ffffff Loading/Progress bar track backgrounds
tracker:		"60A63A", // 	DDDDDD Progress track A2C179
border:			"86C04A", // cccccc Progress bar border
text:			"FFFFFF" // 	333333 Text

});
