function makevisible(cur,which){
if (which==0)
	cur.filters.alpha.opacity=50
else
	cur.filters.alpha.opacity=200
}

function enableDropdownMenuForIE(){   
    if (document.all){
        uls = document.getElementsByTagName('UL');
        for(i = 0; i < uls.length; i++){
            if (uls[i].className == 'dropdown'){
                var lis = uls[i].getElementsByTagName('li');
                for (j = 0; j < lis.length; j++){
				   if(lis[j].lastChild.tagName == 'UL'){                      
                        lis[j].onmouseover =function() { this.lastChild.style.display = 'block';
                        								 this.lastChild.style.borderTopWidth='0.5px';
                        								 this.lastChild.style.borderTopStyle='solid';
                        								 this.lastChild.style.borderTopColor='#999999';
                        								 this.getElementsByTagName('a')[0].style.color='white';
                        								 this.getElementsByTagName('a')[0].style.backgroundColor='#74BADC';  }
                        lis[j].onmouseout = function() { this.lastChild.style.display = 'none';
                         								 this.lastChild.style.borderTopWidth='0.5px';
                        								 this.lastChild.style.borderTopStyle='solid';
                        								 this.lastChild.style.borderTopColor='#999999';
                        								 if (this.getElementsByTagName('a')[0].className!= 'aktuell'){
                        								 	this.getElementsByTagName('a')[0].style.color='white'; 
                        								 	this.getElementsByTagName('a')[0].style.backgroundColor='#2D86B0'; }
                        								  }
                    }
                } 
            }
        }
    } 
    }

function change_view(obj_name){
var aa=document.getElementById(obj_name);
if(aa.style.display=="")
	aa.style.display="none"
else
	aa.style.display=""
}

function MM_swapImgRestore() { 
  var i,x,a=document.MM_sr; 
  for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { 
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { 
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() {
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

Validator = {
	Require : /.+/,
	Email : /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/,
	Phone : /^((\(\d{3}\))|(\d{3}\-))?(\(0\d{2,3}\)|0\d{2,3}-)?[1-9]\d{6,7}$/,
	IsSafe : function(str){return !this.UnSafe.test(str);},
	SafeString : "this.IsSafe(value)",
	LimitB : "this.limit(this.LenB(value), getAttribute('min'), getAttribute('max'))",
	ErrorItem : [document.forms[0]],
	ErrorMessage : ["* Îª±ØÌîÏî£¡ Fields marked with * are required£¡"],
	Validate : function(theForm, mode){
		var obj = theForm || event.srcElement;
		var count = obj.elements.length;
		this.ErrorMessage.length = 1;
		this.ErrorItem.length = 1;
		this.ErrorItem[0] = obj;
		for(var i=0;i<count;i++){
			with(obj.elements[i]){
				var _dataType = getAttribute("dataType");
				if(typeof(_dataType) == "object" || typeof(this[_dataType]) == "undefined")  continue;
				this.ClearState(obj.elements[i]);
				if(getAttribute("require") == "false" && value == "") continue;
				switch(_dataType){
					case "LimitB" :
					case "SafeString" :
						if(!eval(this[_dataType]))	{
							this.AddError(i);
						}
						break;
					default :
						if(!this[_dataType].test(value)){
							this.AddError(i);
						}
						break;
				}
			}
		}
		if(this.ErrorItem.length > 1){
			mode = mode || 1;
			var errCount = this.ErrorItem.length;
			switch(mode){
			case 2 :
				for(var i=1;i<errCount;i++)
					this.ErrorItem[i].style.color = "red";
			case 1 :
				alert(this.ErrorMessage);
				this.ErrorItem[1].select();
				this.ErrorItem[1].focus();
				break;
			}
			return false;
		}
		return true;
	},
	limit : function(len,min, max){
		min = min || 0;
		max = max || Number.MAX_VALUE;
		return min <= len && len <= max;
	},
	LenB : function(str){
		return str.replace(/[^\x00-\xff]/g,"**").length;
	},
	ClearState : function(elem){
		with(elem){
			if(style.color == "red")
				style.color = "";
			var lastNode = parentNode.childNodes[parentNode.childNodes.length-1];
			if(lastNode.id == "__ErrorMessagePanel")
				parentNode.removeChild(lastNode);
		}
	},
	AddError : function(index){
		this.ErrorItem[this.ErrorItem.length] = this.ErrorItem[0].elements[index];
	},
	IsDate : function(op, formatString){
		formatString = formatString || "ymd";
		var m, year, month, day;
		switch(formatString){
			case "ymd" :
				m = op.match(new RegExp("^((\\d{4})|(\\d{2}))([-./])(\\d{1,2})\\4(\\d{1,2})$"));
				if(m == null ) return false;
				day = m[6];
				month = m[5]*1;
				year =  (m[2].length == 4) ? m[2] : GetFullYear(parseInt(m[3], 10));
				break;
			case "dmy" :
				m = op.match(new RegExp("^(\\d{1,2})([-./])(\\d{1,2})\\2((\\d{4})|(\\d{2}))$"));
				if(m == null ) return false;
				day = m[1];
				month = m[3]*1;
				year = (m[5].length == 4) ? m[5] : GetFullYear(parseInt(m[6], 10));
				break;
			default :
				break;
		}
		if(!parseInt(month)) return false;
		month = month==0 ?12:month;
		var date = new Date(year, month-1, day);
        return (typeof(date) == "object" && year == date.getFullYear() && month == (date.getMonth()+1) && day == date.getDate());
		function GetFullYear(y){return ((y<30 ? "20" : "19") + y)|0;}
	}
 }
