 
var text;
var value = 1;
var ivalue = 100;
var i;
var newAnzeige;
var slidephp;
var insertreturn;



function swapmenu(id,trigger){
	
	var subul = Ext.get("sub"+id);
	
	if (subul){
		subul.setVisibilityMode(Ext.Element.DISPLAY);
		if (1 === trigger){
			var mainkat = Ext.get("main"+id);
			var width = mainkat.getWidth();
			subul.setWidth(width);
			subul.setVisible(true,false);			
			
		}else{
			subul.setVisible(false,false);		
		}
	}
	
}

//menu_slide

  function menu_on(id,type){
	
	if (id != ""){
		
		Ext.Ajax.request({
		   method:'POST',
		   url: 'includes/data.php',
		    success: function(response, opts){
				document.getElementById(id).innerHTML = response.responseText;	
				document.getElementById(id).style.display="block";
			},
		   params: { value: id }
		});
	}}

  function menu_out(id){
	

	document.getElementById(id).innerHTML = "test";
	document.getElementById(id).style.display="none";

  } 
// ende


function Fadeout(id, geschwindigkeit) {
        var fps = Math.round(geschwindigkeit / 100); 
        var tmp = 0;
    for(i = 1; i <= 50; i++) {
        setTimeout("Fadeout_fade('" + id + "'," + i + ")", (tmp * fps));
        tmp++;
    }
}
function Fadeout_fade(id, pas) {
        var heurix = document.getElementById(id).style;
        if(pas < 50) {
               heurix.opacity = (0.01 * pas);
               heurix.MozOpacity = (0.01 * pas);

if(pas == 1){document.getElementById(id).style.display="block";}

               heurix.KhtmlOpacity = (0.01 * pas);
               heurix.filter = "alpha(opacity=" + (1 * pas) + ")"; 
        } else {
               heurix.display = "block";
        }
}



function Fadein(id, geschwindigkeit) {


               document.getElementById(id).style.opacity = 0.1;
               document.getElementById(id).style.MozOpacity = 0.1;
               document.getElementById(id).style.KhtmlOpacity = 0.1;
               document.getElementById(id).style.filter = "alpha(opacity=1)";

	document.getElementById(id).style.display="block";

        var fps = Math.round(geschwindigkeit / 100); 
        var tmp = 0;
    for(i = 0; i <= 100; i++) {
        setTimeout("Fadein_fade('" + id + "'," + i + ")", (tmp * fps));
        tmp++;
    }
}
function Fadein_fade(id, pas) {
        var heurix = document.getElementById(id).style;
        if(pas < 100) {



               heurix.opacity = (0.01 * pas);
               heurix.MozOpacity = (0.01 * pas);
               heurix.KhtmlOpacity = (0.01 * pas);
               heurix.filter = "alpha(opacity=" + (1 * pas) + ")"; 
        } else {
               heurix.display = "block";
        }
}


function checkmail(s)
  {
  var a = false;
  var res = false;
  if(typeof(RegExp) == 'function')
    {
    var b = new RegExp('abc');
    if(b.test('abc') == true){a = true;}
    }

  if(a == true)
    {
    reg = new RegExp('^([a-zA-Z0-9\\-\\.\\_]+)'+
                     '(\\@)([a-zA-Z0-9\\-\\.]+)'+
                     '(\\.)([a-zA-Z]{2,4})$');
    res = (reg.test(s));
    }
  else
    {
    res = (s.search('@') >= 1 &&
           s.lastIndexOf('.') > s.search('@') &&
           s.lastIndexOf('.') >= s.length-5)
    }
  return(res);
  }




