// JavaScript Document

 var tipTexte;
 var tipText2;
 function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
/*
dateChanged(calendar)
Berechnen von dem BIS Datum fuer den Kalender
*/



function explodeLayer(id,noSrc,actSrc) {
	//if(id == tipText2 && tipText2 !='') tipText2 ='';
	if(id != tipText2) {
		tipText2 = id;
		if(document.getElementById('hint_'+id))document.getElementById('hint_'+id).style.display = "none";	
//		document.getElementById('layer_'+id).style.display = "block";
		document.getElementById(''+id).src = actSrc;
	} else {
		tipText2 = '';
		if(document.getElementById('hint_'+id))document.getElementById('hint_'+id).style.display = "block";	
//		document.getElementById('layer_'+id).style.display = "none";
		document.getElementById('image_'+id).src = noSrc;
	}		


}
function chgIcon(id,layer,noSrc,actSrc) {
//alert(document.getElementById(''+layer).style.display);
		if(document.getElementById(''+layer).style.display =='none') {
			document.getElementById(''+id).src = actSrc;
		} else {
				document.getElementById(''+id).src = noSrc;
		}

}
function explodeLayer2(id,noSrc,actSrc) {
	if(document.getElementById('layer_'+id).style.display == 'none') {
		if(document.getElementById('hint_'+id))document.getElementById('hint_'+id).style.display = "none";	
		document.getElementById('layer_'+id).style.display = "block";
		document.getElementById('image_'+id).src = actSrc;
	} else {
		if(document.getElementById('hint_'+id))document.getElementById('hint_'+id).style.display = "block";	
		document.getElementById('layer_'+id).style.display = "none";
		document.getElementById('image_'+id).src = noSrc;
	}		

}

function showTipLayer(nr) {
	 tipTexte = new Array();
	tipTexte = getTipTexte();
	//tipTexte[1] = 'Das ist die Nummer eins';
	if(tipTexte[ nr ])		document.getElementById('tipLayer').innerHTML = tipTexte[ nr ];
	else 	document.getElementById('tipLayer').innerHTML = 'Die Nummer ' + nr + ' ist nicht vorhanden!';
        document.getElementById('tipLayer').style.visibility = "visible";
		
}
function hideTipLayer() {
        document.getElementById('tipLayer').style.visibility = "hidden";
}

function sendSubmit(formular)
  {
  document.forms[formular].submit('test');
  }

      function dateactivate(no) {
        document.getElementById('dateinputfld_'+ no).style.visibility = "visible";

      }
function showLayer(name) {
        document.getElementById(name).style.visibility = "visible";
}
function displayLayer(name) {
        document.getElementById(name).style.display = "block";
}
function raiseValue(type,name) {
		var newValue = 0; 
		if(type == 'raice') { newValue = (parseInt(document.getElementById(name).value) + 1);
		} else 	{newValue = (parseInt(document.getElementById(name).value) -1);}
		
		if(newValue < 1) {newValue = 1;}
		
		document.getElementById(name).value = newValue;
}
function checkMinDays(obj,nights) {
        if(obj.value < nights) {
			alert('Die Mindestanzahl der Uebernachtungen fuer diese Unterkunft sind ' +nights+' Tag/e');
			obj.value = nights;
		}
}
      //  obj.visibility = "hidden";  yle.visibility = "visible";
		
function fill(maxP,maxA) {

	for(i=1; i<=maxA; i++) {
		NeuerEintrag = new Option(i, i, false, true);
	  	document.getElementById("adults").options[document.getElementById("adults").length] = NeuerEintrag;
	}

}
function fillKids(maxP,id) {
	emptyKids(id);
	maxK = maxP - document.getElementById("adults"+id).value;
	for(i=0; i<=maxK; i++) {
		NeuerEintrag = new Option(i, i, false, false);
	  	document.getElementById("kids"+id).options[document.getElementById("kids"+id).length] = NeuerEintrag;
	}

}
function emptyKids(id) {
	count = document.getElementById("kids"+id).length;
	for(i=1; i<=count; i++) {
	  document.getElementById("kids"+id).options[document.getElementById("kids"+id).length - 1] = null;
	}
}
function Goto(formName){
	var URL = document.getElementById(formName).options[document.getElementById(formName).selectedIndex].value;
	window.location.href = URL;
}
/*
function Goto222(){
	var URL = document.form.site.options[document.form.site.selectedIndex].value;
	window.location.href = URL;
}
*/
 /*function generateForm(strKid) {
//  		document.getAnzeige.Zeit.value = 'sadf';
	output = '';
valueStr = '';
					knum = document.getElementById("kidsNum").value;
//					knum = 6;
 	for(i=1 ; i <= knum; i++) {
//		output = output + '<option value="2">2</option>';
//		if(!document.getElementById("kidsNum_" + i).value) {
/*	alert(typeof(document.getElementById("kidsNum_" + i))+"sdf");
		if(typeof(document.getElementById("kidsNum_" + i)) == 'object') {
			//valueStr = document.getElementById("kidsNum_" + i).value;
//			valueStr = '';
			//valueStr = document.getElementById("kidsNum_" + i).value;
		} else {
			//valueStr = document.getElementById("kidsNum_" + i).value;
//			valueStr = '';
		}
		output = output +i+'.'+ strKid +' <input name="data[kids]['+i+']" type="text" size="12" class="standard" id="kidsNum_'+i+'" value="'+valueStr+'"> TT.MM.JJJJ<br>';
 	}
//	output = output + '</select>';
	document.getElementById("kidsform").innerHTML =output;

 }*/
 function addKidForm(strKid) {
	i = 5;
	output =	document.getElementById("kidsform").innerHTML; 
	output = output + strKid +' <input name="data[kids]['+i+']" type="text" size="12" class="standard" id="kidsNum_1" value="'+document.getElementById("kidsNum_1").value+'"> TT.MM.JJJJ<br>';
	document.getElementById("kidsform").innerHTML =output;
	 
	 }
  function generateForm2() {
	i = 0;
	/*
	output =	document.getElementById("kidsform").innerHTML; 
	output = output + strKid +' <input name="data[kids]['+i+']" type="text" size="12" class="standard" id="kidsNum_1" value="'+document.getElementById("kidsNum_1").value+'"> TT.MM.JJJJ<br>';
	document.getElementById("kidsform").innerHTML =output;
	*/ 
	knum = document.getElementById("kidsNum").value;
	if(knum > 0) document.getElementById("birthdate").style.visibility = "visible";
	else document.getElementById("birthdate").style.visibility = "hidden";
	
	for(i=1 ; i <= 12; i++) {
		if(i <= knum) 	document.getElementById("kid"+i).style.visibility = "visible";
		else 	document.getElementById("kid"+i).style.visibility = "hidden";
	}
	 
	 }
 

var pageindex;
function updateNbNight(){
	theArrivee = document.getElementById('arrive_date').value;theDepart = document.forms[0].depart.value;
	date_arrivee= new Date (getDateFromFormat(theArrivee,"dd/MM/yy"));
	date_depart= new Date (getDateFromFormat(theDepart,"dd/MM/yy"));
	diff=dateDiff("d",date_arrivee,date_depart); 
	if(diff <= 0 )	diff = 'x';document.forms[0].nbnight.value = diff;if (document.getElementById('tdnuit'))	document.getElementById('tdnuit').innerHTML = tdstrnight;if (document.getElementById('tdsoit'))	document.getElementById('tdsoit').innerHTML = tdstrsoit;if (document.getElementById('shownbnight')){	if(diff == 1)		document.getElementById('shownbnight').innerHTML = tdstrsoit+'&nbsp;'+diff+'&nbsp;'+tdstr1night;	else		document.getElementById('shownbnight').innerHTML = tdstrsoit+'&nbsp;'+diff+'&nbsp;'+tdstrnights;}}function getNameDay(jour){if (pageindex!=null){return dayNameShort[jour];}else {return dayNameLong[jour];}}
	function updatedisplaycalendar(){date_arrivee= new Date (getDateFromFormat(document.getElementById('arrive_date').value,"dd/MM/yy"));date_depart= new Date (getDateFromFormat(document.forms[0].depart.value,"dd/MM/yy"));updateNbNight();}
	function after_select_arrivee(y,m,d){date_arrivee = new Date(y,m-1,d,0,0,0);selected_date=dateAdd('D',1,date_arrivee);document.getElementById('arrive_date').value =formatDate(date_arrivee,'dd/MM/yy');document.forms[0].depart.value =formatDate(selected_date,'dd/MM/yy');updatedisplaycalendar();}
	function after_select_depart(y,m,d){date_depart=new Date(y,m-1,d,0,0,0);document.forms[0].depart.value =formatDate(date_depart,'dd/MM/yy');updatedisplaycalendar();}function selectarrivee(){calarr = new CalendarPopup("divcall");calarr.setCssPrefix("TS");if (document.all) {	calarr.offsetX=0;	calarr.offsetY=18;} else {	calarr.offsetX=-65;	calarr.offsetY=4;}	calarr.addDisabledDates(null,formatDate(dateAdd('D',-1,new Date()),'MM/dd/yyyy'));calarr.setReturnFunction("after_select_arrivee");if (document.getElementById('arrive_date').value != ""){		selected_date=document.getElementById('arrive_date').value ;}else {	selected_date=formatDate(new Date(),'dd/MM/yy');	}calarr.select(document.getElementById('arrive_date'),'arr','dd/MM/yy',selected_date); return false;}function selectdepart() {caldep = new CalendarPopup("divcall");caldep.setCssPrefix("TS");if (document.all) {	caldep.offsetX=0;	caldep.offsetY=18;} else {	caldep.offsetX=-65;	caldep.offsetY=4;}caldep.setReturnFunction("after_select_depart");if (document.getElementById('arrive_date').value != "" )	date_arrivee= new Date (getDateFromFormat(document.getElementById('arrive_date').value,"dd/MM/yy"));else 	date_arrivee= new Date ();	date_arrivee=formatDate(date_arrivee,'MM/dd/yyyy');	caldep.addDisabledDates(null,date_arrivee);	caldep.select(document.forms[0].depart,'dep','dd/MM/yy'); 	return false;}	

function getAnchorPosition(anchorname) {var useWindow=false;var coordinates=new Object();var x=0,y=0;var use_gebi=false, use_css=false, use_layers=false;if (document.getElementById) { use_gebi=true; }else if (document.all) { use_css=true; }else if (document.layers) { use_layers=true; } 	if (use_gebi && document.all) {	x=AnchorPosition_getPageOffsetLeft(document.all[anchorname]);	y=AnchorPosition_getPageOffsetTop(document.all[anchorname]);	}else if (use_gebi) {	var o=document.getElementById(anchorname);	x=AnchorPosition_getPageOffsetLeft(o);	y=AnchorPosition_getPageOffsetTop(o);	} 	else if (use_css) {	x=AnchorPosition_getPageOffsetLeft(document.all[anchorname]);	y=AnchorPosition_getPageOffsetTop(document.all[anchorname]);	}else if (use_layers) {	var found=0;	for (var i=0; i<document.anchors.length; i++) {		if (document.anchors[i].name==anchorname) { found=1; break; }		}	if (found==0) {		coordinates.x=0; coordinates.y=0; return coordinates;		}	x=document.anchors[i].x;	y=document.anchors[i].y;	}else {	coordinates.x=0; coordinates.y=0; return coordinates;	}coordinates.x=x;coordinates.y=y;return coordinates;}
function getAnchorWindowPosition(anchorname) {var coordinates=getAnchorPosition(anchorname);var x=0;var y=0;if (document.getElementById) {	if (isNaN(window.screenX)) {		x=coordinates.x-document.body.scrollLeft+window.screenLeft;		y=coordinates.y-document.body.scrollTop+window.screenTop;		}	else {		x=coordinates.x+window.screenX+(window.outerWidth-window.innerWidth)-window.pageXOffset;		y=coordinates.y+window.screenY+(window.outerHeight-24-window.innerHeight)-window.pageYOffset;		}	}else if (document.all) {	x=coordinates.x-document.body.scrollLeft+window.screenLeft;	y=coordinates.y-document.body.scrollTop+window.screenTop;	}else if (document.layers) {	x=coordinates.x+window.screenX+(window.outerWidth-window.innerWidth)-window.pageXOffset;	y=coordinates.y+window.screenY+(window.outerHeight-24-window.innerHeight)-window.pageYOffset;	}coordinates.x=x;coordinates.y=y;return coordinates;}function AnchorPosition_getPageOffsetLeft (el) {var ol=el.offsetLeft;while ((el=el.offsetParent) != null) { ol += el.offsetLeft; }return ol;}
function AnchorPosition_getWindowOffsetLeft (el) {return AnchorPosition_getPageOffsetLeft(el)-document.body.scrollLeft;}	
function AnchorPosition_getPageOffsetTop (el) {var ot=el.offsetTop;while((el=el.offsetParent) != null) { ot += el.offsetTop; }return ot;}function AnchorPosition_getWindowOffsetTop (el) {return AnchorPosition_getPageOffsetTop(el)-document.body.scrollTop;}var MONTH_NAMES=new Array('January','February','March','April','May','June','July','August','September','October','November','December','Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec');var DAY_NAMES=new Array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sun','Mon','Tue','Wed','Thu','Fri','Sat');HEADER_NAME= new Array("S","M","T","W","T","F","S");function LZ(x) {return(x<0||x>9?"":"0")+x}function isDate(val,format) {var date=getDateFromFormat(val,format);if (date==0) { return false; }return true;}function compareDates(date1,dateformat1,date2,dateformat2) {var d1=getDateFromFormat(date1,dateformat1);var d2=getDateFromFormat(date2,dateformat2);if (d1==0 || d2==0) {	return -1;	}else if (d1 > d2) {	return 1;	}return 0;}function formatDate(date,format) {format=format+"";var result="";var i_format=0;var c="";var token="";var y=date.getYear()+"";var M=date.getMonth()+1;var d=date.getDate();var E=date.getDay();var H=date.getHours();var m=date.getMinutes();var s=date.getSeconds();var yyyy,yy,MMM,MM,dd,hh,h,mm,ss,ampm,HH,H,KK,K,kk,k;var value=new Object();if (y.length < 4) {y=""+(y-0+1900);}value["y"]=""+y;value["yyyy"]=y;value["yy"]=y.substring(2,4);value["M"]=M;value["MM"]=LZ(M);value["MMM"]=MONTH_NAMES[M-1];value["NNN"]=MONTH_NAMES[M+11];value["d"]=d;value["dd"]=LZ(d);value["E"]=DAY_NAMES[E+7];value["EE"]=DAY_NAMES[E];value["H"]=H;value["HH"]=LZ(H);if (H==0){value["h"]=12;}else if (H>12){value["h"]=H-12;}else {value["h"]=H;}value["hh"]=LZ(value["h"]);if (H>11){value["K"]=H-12;} else {value["K"]=H;}value["k"]=H+1;value["KK"]=LZ(value["K"]);value["kk"]=LZ(value["k"]);if (H > 11) { value["a"]="PM"; }else { value["a"]="AM"; }value["m"]=m;value["mm"]=LZ(m);value["s"]=s;value["ss"]=LZ(s);while (i_format < format.length) {	c=format.charAt(i_format);	token="";	while ((format.charAt(i_format)==c) && (i_format < format.length)) {		token += format.charAt(i_format++);		}	if (value[token] != null) { result=result + value[token]; }	else { result=result + token; }	}return result;}function _isInteger(val) {var digits="1234567890";for (var i=0; i < val.length; i++) {	if (digits.indexOf(val.charAt(i))==-1) { return false; }	}return true;}function _getInt(str,i,minlength,maxlength) {for (var x=maxlength; x>=minlength; x--) {	var token=str.substring(i,i+x);	if (token.length < minlength) { return null; }	if (_isInteger(token)) { return token; }	}return null;}function getDateFromFormat(val,format) {val=val+"";format=format+"";var i_val=0;var i_format=0;var c="";var token="";var token2="";var x,y;var now=new Date();var year=now.getYear();var month=now.getMonth()+1;var date=1;var hh=now.getHours();var mm=now.getMinutes();var ss=now.getSeconds();var ampm="";while (i_format < format.length) {	c=format.charAt(i_format);	token="";	while ((format.charAt(i_format)==c) && (i_format < format.length)) {		token += format.charAt(i_format++);		}	if (token=="yyyy" || token=="yy" || token=="y") {		if (token=="yyyy") { x=4;y=4; }		if (token=="yy")   { x=2;y=2; }		if (token=="y")    { x=2;y=4; }		year=_getInt(val,i_val,x,y);		if (year==null) { return 0; }		i_val += year.length;		if (year.length==2) {			if (year > 70) { year=1900+(year-0); }			else { year=2000+(year-0); }			}		}	else if (token=="MMM"||token=="NNN"){		month=0;		for (var i=0; i<MONTH_NAMES.length; i++) {			var month_name=MONTH_NAMES[i];			if (val.substring(i_val,i_val+month_name.length).toLowerCase()==month_name.toLowerCase()) {				if (token=="MMM"||(token=="NNN"&&i>11)) {					month=i+1;					if (month>12) { month -= 12; }					i_val += month_name.length;					break;					}				}			}		if ((month < 1)||(month>12)){return 0;}		}	else if (token=="EE"||token=="E"){		for (var i=0; i<DAY_NAMES.length; i++) {			var day_name=DAY_NAMES[i];			if (val.substring(i_val,i_val+day_name.length).toLowerCase()==day_name.toLowerCase()) {				i_val += day_name.length;				break;				}			}		}	else if (token=="MM"||token=="M") {		month=_getInt(val,i_val,token.length,2);		if(month==null||(month<1)||(month>12)){return 0;}		i_val+=month.length;}	else if (token=="dd"||token=="d") {		date=_getInt(val,i_val,token.length,2);		if(date==null||(date<1)||(date>31)){return 0;}		i_val+=date.length;}	else if (token=="hh"||token=="h") {		hh=_getInt(val,i_val,token.length,2);		if(hh==null||(hh<1)||(hh>12)){return 0;}		i_val+=hh.length;}	else if (token=="HH"||token=="H") {		hh=_getInt(val,i_val,token.length,2);		if(hh==null||(hh<0)||(hh>23)){return 0;}		i_val+=hh.length;}	else if (token=="KK"||token=="K") {		hh=_getInt(val,i_val,token.length,2);		if(hh==null||(hh<0)||(hh>11)){return 0;}		i_val+=hh.length;}	else if (token=="kk"||token=="k") {		hh=_getInt(val,i_val,token.length,2);		if(hh==null||(hh<1)||(hh>24)){return 0;}		i_val+=hh.length;hh--;}	else if (token=="mm"||token=="m") {		mm=_getInt(val,i_val,token.length,2);		if(mm==null||(mm<0)||(mm>59)){return 0;}		i_val+=mm.length;}	else if (token=="ss"||token=="s") {		ss=_getInt(val,i_val,token.length,2);		if(ss==null||(ss<0)||(ss>59)){return 0;}		i_val+=ss.length;}	else if (token=="a") {		if (val.substring(i_val,i_val+2).toLowerCase()=="am") {ampm="AM";}		else if (val.substring(i_val,i_val+2).toLowerCase()=="pm") {ampm="PM";}		else {return 0;}		i_val+=2;}	else {		if (val.substring(i_val,i_val+token.length)!=token) {return 0;}		else {i_val+=token.length;}		}	}if (i_val != val.length) { return 0; }if (month==2) {	if ( ( (year%4==0)&&(year%100 != 0) ) || (year%400==0) ) {		if (date > 29){ return 0; }		}	else { if (date > 28) { return 0; } }	}if ((month==4)||(month==6)||(month==9)||(month==11)) {	if (date > 30) { return 0; }	}if (hh<12 && ampm=="PM") { hh=hh-0+12; }else if (hh>11 && ampm=="AM") { hh-=12; }var newdate=new Date(year,month-1,date,hh,mm,ss);return newdate.getTime();}function parseDate(val) {var preferEuro=(arguments.length==2)?arguments[1]:false;generalFormats=new Array('y-M-d','MMM d, y','MMM d,y','y-MMM-d','d-MMM-y','MMM d');monthFirst=new Array('M/d/y','M-d-y','M.d.y','MMM-d','M/d','M-d');dateFirst =new Array('d/M/y','d-M-y','d.M.y','d-MMM','d/M','d-M');var checkList=new Array('generalFormats',preferEuro?'dateFirst':'monthFirst',preferEuro?'monthFirst':'dateFirst');var d=null;for (var i=0; i<checkList.length; i++) {	var l=window[checkList[i]];	for (var j=0; j<l.length; j++) {		d=getDateFromFormat(val,l[j]);		if (d!=0) { return new Date(d); }		}	}return null;}function PopupWindow_getXYPosition(anchorname) {var coordinates;if (this.type == "WINDOW") {	coordinates = getAnchorWindowPosition(anchorname);	}else {	coordinates = getAnchorPosition(anchorname);	}this.x = coordinates.x;this.y = coordinates.y;}function PopupWindow_setSize(width,height) {this.width = width;this.height = height;}function PopupWindow_populate(contents) {this.contents = contents;this.populated = false;}function PopupWindow_setUrl(url) {this.url = url;}function PopupWindow_setWindowProperties(props) {this.windowProperties = props;}
function PopupWindow_refresh() {if (this.divName != null) {	if (this.use_gebi) {		parentDiv=document.getElementById(this.divName);		parentDiv.innerHTML="";		iframeObj = document.createElement('IFRAME');		iframeObj.style.position = 'absolute';		iframeObj.border='0px';		iframeObj.frameBorder = '0px';		iframeObj.style.display = '';		iframeObj.style.height = '140px';		iframeObj.style.zIndex=-1;		iframeObj.style.width = '195px';		parentDiv.appendChild(iframeObj);				calendarDiv = document.createElement('DIV');			calendarDiv.id = 'calendarDiv';		calendarDiv.style.zIndex = 1000;		parentDiv.appendChild(calendarDiv);		calendarDiv.innerHTML =this.contents;		iframeObj.style.width = calendarDiv.offsetWidth + 'px';		iframeObj.style.height = calendarDiv.offsetHeight + 'px' ;			}	else if (this.use_css) { 		document.all[this.divName].innerHTML = this.contents;		}	else if (this.use_layers) { 		var d = document.layers[this.divName]; 		d.document.open();		d.document.writeln(this.contents);		d.document.close();		}	}else {	if (this.popupWindow != null && !this.popupWindow.closed) {		if (this.url!="") {			this.popupWindow.location.href=this.url;			}		else {			this.popupWindow.document.open();			this.popupWindow.document.writeln(this.contents);			this.popupWindow.document.close();		}		this.popupWindow.focus();		}	}}function PopupWindow_showPopup(anchorname) {this.getXYPosition(anchorname);this.x += this.offsetX;this.y += this.offsetY;if (!this.populated && (this.contents != "")) {	this.populated = true;	this.refresh();	}if (this.divName != null) {	if (this.use_gebi) {		document.getElementById(this.divName).style.left = this.x + "px";		document.getElementById(this.divName).style.top = this.y + "px";		document.getElementById(this.divName).style.visibility = "visible";		}	else if (this.use_css) {		document.all[this.divName].style.left = this.x;		document.all[this.divName].style.top = this.y;		document.all[this.divName].style.visibility = "visible";		}	else if (this.use_layers) {		document.layers[this.divName].left = this.x;		document.layers[this.divName].top = this.y;		document.layers[this.divName].visibility = "visible";		}	}else {	if (this.popupWindow == null || this.popupWindow.closed) {		if (this.x<0) { this.x=0; }		if (this.y<0) { this.y=0; }		if (screen && screen.availHeight) {			if ((this.y + this.height) > screen.availHeight) {				this.y = screen.availHeight - this.height;				}			}		if (screen && screen.availWidth) {			if ((this.x + this.width) > screen.availWidth) {				this.x = screen.availWidth - this.width;				}			}		var avoidAboutBlank = window.opera || ( document.layers && !navigator.mimeTypes['*'] ) || navigator.vendor == 'KDE' || ( document.childNodes && !document.all && !navigator.taintEnabled );		this.popupWindow = window.open(avoidAboutBlank?"":"about:blank","window_"+anchorname,this.windowProperties+",width="+this.width+",height="+this.height+",screenX="+this.x+",left="+this.x+",screenY="+this.y+",top="+this.y+"");		}	this.refresh();	}}function PopupWindow_hidePopup() {if (this.divName != null) {	if (this.use_gebi) {		document.getElementById(this.divName).style.visibility = "hidden";		}	else if (this.use_css) {		document.all[this.divName].style.visibility = "hidden";		}	else if (this.use_layers) {		document.layers[this.divName].visibility = "hidden";		}	}else {	if (this.popupWindow && !this.popupWindow.closed) {		this.popupWindow.close();		this.popupWindow = null;		}	}}function PopupWindow_isClicked(e) {if (this.divName != null) {	if (this.use_layers) {		var clickX = e.pageX;		var clickY = e.pageY;		var t = document.layers[this.divName];		if ((clickX > t.left) && (clickX < t.left+t.clip.width) && (clickY > t.top) && (clickY < t.top+t.clip.height)) {			return true;			}		else { return false; }		}	else if (document.all) { 		var t = window.event.srcElement;		while (t.parentElement != null) {			if (t.id==this.divName) {				return true;				}			t = t.parentElement;			}		return false;		}	else if (this.use_gebi && e) {		var t = e.originalTarget;		while (t.parentNode != null) {			if (t.id==this.divName) {				return true;				}			t = t.parentNode;			}		return false;		}	return false;	}return false;}
function PopupWindow_hideIfNotClicked(e) {if (this.autoHideEnabled && !this.isClicked(e)) {	this.hidePopup();	}}
function PopupWindow_autoHide() {this.autoHideEnabled = true;}
function PopupWindow_hidePopupWindows(e) {for (var i=0; i<popupWindowObjects.length; i++) {	if (popupWindowObjects[i] != null) {		var p = popupWindowObjects[i];		p.hideIfNotClicked(e);		}	}}function PopupWindow_attachListener() {if (document.layers) {	document.captureEvents(Event.MOUSEUP);	}window.popupWindowOldEventListener = document.onmouseup;if (window.popupWindowOldEventListener != null) {	document.onmouseup = new Function("window.popupWindowOldEventListener(); PopupWindow_hidePopupWindows();");	}else {	document.onmouseup = PopupWindow_hidePopupWindows;	}}function PopupWindow() {if (!window.popupWindowIndex) { window.popupWindowIndex = 0; }if (!window.popupWindowObjects) { window.popupWindowObjects = new Array(); }if (!window.listenerAttached) {	window.listenerAttached = true;	PopupWindow_attachListener();	}this.index = popupWindowIndex++;popupWindowObjects[this.index] = this;this.divName = null;this.popupWindow = null;this.width=0;this.height=0;this.populated = false;this.visible = false;this.autoHideEnabled = false;this.contents = "";this.url="";this.windowProperties="toolbar=no,location=no,status=no,menubar=no,scrollbars=auto,resizable,alwaysRaised,dependent,titlebar=no";if (arguments.length>0) {	this.type="DIV";	this.divName = arguments[0];	}else {	this.type="WINDOW";	}this.use_gebi = false;this.use_css = false;this.use_layers = false;if (document.getElementById) { this.use_gebi = true; }else if (document.all) { this.use_css = true; }else if (document.layers) { this.use_layers = true; }else { this.type = "WINDOW"; }this.offsetX = 0;this.offsetY = 0;this.getXYPosition = PopupWindow_getXYPosition;this.populate = PopupWindow_populate;this.setUrl = PopupWindow_setUrl;this.setWindowProperties = PopupWindow_setWindowProperties;this.refresh = PopupWindow_refresh;this.showPopup = PopupWindow_showPopup;this.hidePopup = PopupWindow_hidePopup;this.setSize = PopupWindow_setSize;this.isClicked = PopupWindow_isClicked;this.autoHide = PopupWindow_autoHide;this.hideIfNotClicked = PopupWindow_hideIfNotClicked;}
function CalendarPopup() {var c ;if (arguments.length>0) {	c = new PopupWindow(arguments[0]);	}else {	c = new PopupWindow();	c.setSize(150,175);	}c.offsetX = -152;c.offsetY = 25;c.autoHide();if (MONTH_NAMES!=null )	c.monthNames=MONTH_NAMES;else	c.monthNames = new Array("January","February","March","April","May","June","July","August","September","October","November","December");if (MONTH_NAMES!=null )	c.monthAbbreviations=MONTH_NAMES;else	c.monthAbbreviations = new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");if (HEADER_NAME!=null )	c.dayHeaders=HEADER_NAME;else	c.dayHeaders = new Array("S","M","T","W","T","F","S");c.returnFunction = "CP_tmpReturnFunction";c.returnMonthFunction = "CP_tmpReturnMonthFunction";c.returnQuarterFunction = "CP_tmpReturnQuarterFunction";c.returnYearFunction = "CP_tmpReturnYearFunction";c.weekStartDay = 1;c.isShowYearNavigation = false;c.displayType = "date";c.disabledWeekDays = new Object();c.disabledDatesExpression = "";c.yearSelectStartOffset = 2;c.currentDate = null;c.todayText="Today";c.cssPrefix="";c.isShowNavigationDropdowns=false;c.isShowYearNavigationInput=false;window.CP_calendarObject = null;window.CP_targetInput = null;window.CP_dateFormat = "MM/dd/yyyy";c.copyMonthNamesToWindow = CP_copyMonthNamesToWindow;c.setReturnFunction = CP_setReturnFunction;c.setReturnMonthFunction = CP_setReturnMonthFunction;c.setReturnQuarterFunction = CP_setReturnQuarterFunction;c.setReturnYearFunction = CP_setReturnYearFunction;c.setMonthNames = CP_setMonthNames;c.setMonthAbbreviations = CP_setMonthAbbreviations;c.setDayHeaders = CP_setDayHeaders;c.setWeekStartDay = CP_setWeekStartDay;c.setDisplayType = CP_setDisplayType;c.setDisabledWeekDays = CP_setDisabledWeekDays;c.addDisabledDates = CP_addDisabledDates;c.setYearSelectStartOffset = CP_setYearSelectStartOffset;c.setTodayText = CP_setTodayText;c.showYearNavigation = CP_showYearNavigation;c.showCalendar = CP_showCalendar;c.hideCalendar = CP_hideCalendar;c.getStyles = getCalendarStyles;c.refreshCalendar = CP_refreshCalendar;c.getCalendar = CP_getDoubleCalendar;c.select = CP_select;c.setCssPrefix = CP_setCssPrefix;c.showNavigationDropdowns = CP_showNavigationDropdowns;c.showYearNavigationInput = CP_showYearNavigationInput;c.copyMonthNamesToWindow();return c;}function CP_copyMonthNamesToWindow() {if (typeof(window.MONTH_NAMES)!="undefined" && window.MONTH_NAMES!=null) {	window.MONTH_NAMES = new Array();	for (var i=0; i<this.monthNames.length; i++) {		window.MONTH_NAMES[window.MONTH_NAMES.length] = this.monthNames[i];	}	for (var i=0; i<this.monthAbbreviations.length; i++) {		window.MONTH_NAMES[window.MONTH_NAMES.length] = this.monthAbbreviations[i];	}}}function CP_tmpReturnFunction(y,m,d) { if (window.CP_targetInput!=null) {	var dt = new Date(y,m-1,d,0,0,0);	if (window.CP_calendarObject!=null) { window.CP_calendarObject.copyMonthNamesToWindow(); }	window.CP_targetInput.value = formatDate(dt,window.CP_dateFormat);	}else {	alert('Use setReturnFunction() to define which function will get the clicked results!'); 	}}
function CP_tmpReturnMonthFunction(y,m) { alert('Use setReturnMonthFunction() to define which function will get the clicked results!\nYou clicked: year='+y+' , month='+m); }function CP_tmpReturnQuarterFunction(y,q) { alert('Use setReturnQuarterFunction() to define which function will get the clicked results!\nYou clicked: year='+y+' , quarter='+q); }function CP_tmpReturnYearFunction(y) { alert('Use setReturnYearFunction() to define which function will get the clicked results!\nYou clicked: year='+y); }function CP_setReturnFunction(name) { this.returnFunction = name; }function CP_setReturnMonthFunction(name) { this.returnMonthFunction = name; }function CP_setReturnQuarterFunction(name) { this.returnQuarterFunction = name; }function CP_setReturnYearFunction(name) { this.returnYearFunction = name; }function CP_setMonthNames() {for (var i=0; i<arguments.length; i++) { this.monthNames[i] = arguments[i]; }this.copyMonthNamesToWindow();}function CP_setMonthAbbreviations() {for (var i=0; i<arguments.length; i++) { this.monthAbbreviations[i] = arguments[i]; }this.copyMonthNamesToWindow();}
function CP_setDayHeaders() {for (var i=0; i<arguments.length; i++) { this.dayHeaders[i] = arguments[i]; }}
function CP_setWeekStartDay(day) { this.weekStartDay = day; }
function CP_showYearNavigation() { this.isShowYearNavigation = (arguments.length>0)?arguments[0]:true; }
function CP_setDisplayType(type) {if (type!="date"&&type!="week-end"&&type!="month"&&type!="quarter"&&type!="year") { alert("Invalid display type! Must be one of: date,week-end,month,quarter,year"); return false; }this.displayType=type;}function CP_setYearSelectStartOffset(num) { this.yearSelectStartOffset=num; }function CP_setDisabledWeekDays() {this.disabledWeekDays = new Object();for (var i=0; i<arguments.length; i++) { this.disabledWeekDays[arguments[i]] = true; }}function CP_addDisabledDates(start, end) {if (arguments.length==1) { end=start; }if (start==null && end==null) { return; }if (this.disabledDatesExpression!="") { this.disabledDatesExpression+= "||"; }if (start!=null) { start = parseDate(start); start=""+start.getFullYear()+LZ(start.getMonth()+1)+LZ(start.getDate());}if (end!=null) { end=parseDate(end); end=""+end.getFullYear()+LZ(end.getMonth()+1)+LZ(end.getDate());}if (start==null) { this.disabledDatesExpression+="(ds<="+end+")"; }else if (end  ==null) { this.disabledDatesExpression+="(ds>="+start+")"; }else { this.disabledDatesExpression+="(ds>="+start+"&&ds<="+end+")"; }}
function CP_setTodayText(text) {this.todayText = text;}
function CP_setCssPrefix(val) { this.cssPrefix = val; }
function CP_showNavigationDropdowns() { this.isShowNavigationDropdowns = (arguments.length>0)?arguments[0]:true; }function CP_showYearNavigationInput() { this.isShowYearNavigationInput = (arguments.length>0)?arguments[0]:true; }function CP_hideCalendar() {if (arguments.length > 0) { window.popupWindowObjects[arguments[0]].hidePopup(); }else { this.hidePopup(); }}function CP_refreshCalendar(index) {var calObject = window.popupWindowObjects[index];if (arguments.length>1) { 	calObject.populate(calObject.getCalendar(arguments[1],arguments[2],arguments[3],arguments[4],arguments[5]));	}else {	calObject.populate(calObject.getCalendar());	}calObject.refresh();}
function CP_showCalendar(anchorname) {if (arguments.length>1) {	if (arguments[1]==null||arguments[1]=="") {		this.currentDate=new Date();		}	else {		this.currentDate=new Date(parseDate(arguments[1]));		}	}this.populate(this.getCalendar());this.showPopup(anchorname);}function CP_select(inputobj, linkname, format) {var selectedDate=(arguments.length>3)?arguments[3]:null;if (!window.getDateFromFormat) {	alert("calendar.select: To use this method you must also include 'date.js' for date formatting");	return;	}if (this.displayType!="date"&&this.displayType!="week-end") {	alert("calendar.select: This function can only be used with displayType 'date' or 'week-end'");	return;	}if (inputobj.type!="text" && inputobj.type!="hidden" && inputobj.type!="textarea") { 	alert("calendar.select: Input object passed is not a valid form input object"); 	window.CP_targetInput=null;	return;	}if (inputobj.disabled) { return; } window.CP_targetInput = inputobj;window.CP_calendarObject = this;this.currentDate=null;var time=0;if (selectedDate!=null) {	time = getDateFromFormat(selectedDate,format)	}else if (inputobj.value!="") {	time = getDateFromFormat(inputobj.value,format);	}if (selectedDate!=null || inputobj.value!="") {	if (time==0) { this.currentDate=null; }	else { this.currentDate=new Date(time); }	}window.CP_dateFormat = format;this.showCalendar(linkname);}function getCalendarStyles() {var result = "";var p = "";if (this!=null && typeof(this.cssPrefix)!="undefined" && this.cssPrefix!=null && this.cssPrefix!="") { p=this.cssPrefix; }result += "<STYLE>\n";result += "."+p+"cpYearNavigation,."+p+"cpMonthNavigation { background-color:#CCCCCC; text-align:center; vertical-align:center; text-decoration:none; color:#555555; font-weight:bold; height:20px}\n";result += "."+p+"cpDayColumnHeader, ."+p+"cpYearNavigation,."+p+"cpMonthNavigation,."+p+"cpCurrentMonthDate,."+p+"cpCurrentMonthDateDisabled,."+p+"cpOtherMonthDate,."+p+"cpOtherMonthDateDisabled,."+p+"cpCurrentDate,."+p+"cpCurrentDateDisabled,."+p+"cpTodayText,."+p+"cpTodayTextDisabled,."+p+"cpText { font-family:verdana; font-size:10px; }\n";result += "TD."+p+"cpDayColumnHeader { text-align:right; border:solid thin #C0C0C0;border-width:0px 0px 1px 0px; }\n";result += "."+p+"cpCurrentMonthDate, ."+p+"cpOtherMonthDate, ."+p+"cpCurrentDate  { text-align:right; text-decoration:none; }\n";result += "."+p+"cpCurrentMonthDateDisabled, ."+p+"cpOtherMonthDateDisabled, ."+p+"cpCurrentDateDisabled { color:#D0D0D0; text-align:right; text-decoration:line-through; }\n";result += "."+p+"cpCurrentMonthDate, .cpCurrentDate { color:#000000; }\n";result += "."+p+"cpOtherMonthDate { color:#808080; }\n";result += "TD."+p+"cpCurrentDate { color:white; background-color: #CCB45E; border-width:1px; border:solid thin #CCB45E; }\n";result += "TD."+p+"cpCurrentDateDisabled { border-width:1px; border:solid thin #FFAAAA; }\n";result += "TD."+p+"cpTodayText, TD."+p+"cpTodayTextDisabled { border:solid thin #C0C0C0; border-width:1px 0px 0px 0px;}\n";result += "A."+p+"cpTodayText, SPAN."+p+"cpTodayTextDisabled { height:20px; }\n";result += "A."+p+"cpTodayText { color:black; }\n";result += "."+p+"cpTodayTextDisabled { color:#D0D0D0; }\n";result += "."+p+"cpBorder { border:  1px ridge; }\n";result += "</STYLE>\n";return result;}function CP_getDoubleCalendar() {var result ;var windowref = "";var now = new Date();display_date_next_month=0;if (this.type == "WINDOW") { var windowref = "window.opener."; }else { var windowref = ""; }if (this.displayType=="date" || this.displayType=="week-end") {	if (this.currentDate==null) { this.currentDate = now; }	if (arguments.length > 0) { var month = arguments[0]; }		else { var month = this.currentDate.getMonth()+1; }	if (arguments.length > 1 && arguments[1]>0 && arguments[1]-0==arguments[1]) { var year = arguments[1]; }		else { var year = this.currentDate.getFullYear(); }	var daysinmonth= new Array(0,31,28,31,30,31,30,31,31,30,31,30,31);	if ( ( (year%4 == 0)&&(year%100 != 0) ) || (year%400 == 0) ) {		daysinmonth[2] = 29;		}	var current_month = new Date(year,month-1,1);	var display_year = year;	var display_month = month;	var display_date = 1;	var weekday= current_month.getDay();	var offset = 0;		offset = (weekday >= this.weekStartDay) ? weekday-this.weekStartDay : 7-this.weekStartDay+weekday ;	if (offset > 0) {		display_month--;		if (display_month < 1) { display_month = 12; display_year--; }		display_date = daysinmonth[display_month]-offset+1;		}	var next_month = month+1;	var next_month_year = year;	if (next_month > 12) { next_month=1; next_month_year++; }	var last_month = month-1;	var last_month_year = year;	if (last_month < 1) { last_month=12; last_month_year--; }	var date_class;}var refresh = windowref+'CP_refreshCalendar';var refreshLink = 'javascript:' + refresh;	result=""; result += "<TABLE  WIDTH=260 BORDER=0 BORDERWIDTH=0 CELLSPACING=0 CELLPADDING=0 bgcolor='#FFFFFF' style='border:1px solid #CCCCCC' >\n"; result += "<TR>\n"; result += '<td><table border="0"  width="160"  cellspacing="0" ><tr>';result += '<td CLASS="'+this.cssPrefix+'cpMonthNavigation"   align="left" nowrap width="20"  > ';result += '<A CLASS="'+this.cssPrefix+'cpMonthNavigation" HREF="'+refreshLink+'('+this.index+','+last_month+','+	last_month_year+');" align="left" >&lt;&lt;</A>';result += '</td>';result += '<td  align="center" CLASS="'+this.cssPrefix+'cpMonthNavigation" >'+this.monthNames[month-1]+' '+year+'</td>';result += "</tr></table>";result += '</td>\n';result += "<td width='20' >&nbsp;&nbsp;</td>";result += '<td><table border="0"  width="160"  cellspacing="0" ><tr>';result += '<td CLASS="'+this.cssPrefix+'cpMonthNavigation" align="center" nowrap >&nbsp;';result += this.monthNames[month]+' '+year;result +='</td>';result +='<td align="right"   width="20" CLASS="'+this.cssPrefix+'cpMonthNavigation" >';result += '<A  CLASS="'+this.cssPrefix+'cpMonthNavigation" HREF="'+refreshLink+'('+this.index+','+next_month+','+next_month_year+');">&gt;&gt;</A>';result += "</td></tr></table>";result +='</td>\n'; result += "</TR>\n"; result += "<TR>\n"; result += '<td  valign="TOP" >\n'; result += '<TABLE WIDTH=120 BORDER=0 CELLSPACING=0 CELLPADDING=1 ALIGN=CENTER >\n';	result += '<TR>\n';	for (var j=0; j<7; j++) {		result += '<TD CLASS="'+this.cssPrefix+'cpDayColumnHeader" WIDTH="14%" align="center" ><SPAN CLASS="'+this.cssPrefix+'cpDayColumnHeader">'+this.dayHeaders[(this.weekStartDay+j)%7]+'</TD>\n';		}	result += '</TR>\n';	for (var row=1; row<=6; row++) {		result += '<TR>\n';		for (var col=1; col<=7; col++) {			var disabled=false;			if (this.disabledDatesExpression!="") {				var ds=""+display_year+LZ(display_month)+LZ(display_date);				eval("disabled=("+this.disabledDatesExpression+")");				}			var dateClass = "";			if ((display_month == this.currentDate.getMonth()+1) && (display_date==this.currentDate.getDate()) && (display_year==this.currentDate.getFullYear())) {				dateClass = "cpCurrentDate";				}			else if (display_month == month) {				dateClass = "cpCurrentMonthDate";				}			else {				dateClass = "cpOtherMonthDate";						}						if (disabled || this.disabledWeekDays[col-1]) {				if (display_month==month)					result += '	<TD CLASS="'+this.cssPrefix+dateClass+'"><SPAN CLASS="'+this.cssPrefix+dateClass+'Disabled">'+display_date+'</SPAN></TD>\n';				else					result += '	<TD  height="1px"></TD>\n';				}			else {				var selected_date = display_date;				var selected_month = display_month;				var selected_year = display_year;				if (this.displayType=="week-end") {					var d = new Date(selected_year,selected_month-1,selected_date,0,0,0,0);					d.setDate(d.getDate() + (7-col));					selected_year = d.getYear();					if (selected_year < 1000) { selected_year += 1900; }					selected_month = d.getMonth()+1;					selected_date = d.getDate();					}					if (display_month==month)											result += '	<TD CLASS="'+this.cssPrefix+dateClass+'"><A HREF="javascript:'+windowref+this.returnFunction+'('+selected_year+','+selected_month+','+selected_date+');'+windowref+'CP_hideCalendar(\''+this.index+'\');" CLASS="'+this.cssPrefix+dateClass+'">'+display_date+'</A></TD>\n';					else						result += '	<TD  height="1px"></TD>\n';				}			display_date++;			if (display_date > daysinmonth[display_month]) {								display_date=1;							display_month++;				}			if (display_month > 12) {				display_month=1;				display_year++;				}			}		result += '</TR>';		}	var current_weekday = now.getDay() - this.weekStartDay;	if (current_weekday < 0) {		current_weekday += 7;		}			result += '	</TABLE>'; result += '</td>\n';  result += '<td>\n';  result += '&nbsp;\n';  result += '</td>\n';  month=month+1;  if (month>12){	  month=+1;	  year=year+1;  }  current_month = new Date(year,month-1,1);  display_year = year;   display_month = month; display_date = 1; weekday= current_month.getDay(); offset = 0;		offset = (weekday >= this.weekStartDay) ? weekday-this.weekStartDay : 7-this.weekStartDay+weekday ;	if (offset > 0) {		display_month--;		if (display_month < 1) { display_month = 12; display_year--; }		display_date = daysinmonth[display_month]-offset+1;		}	 next_month = month+1;	 next_month_year = year;	if (next_month > 12) { next_month=1; next_month_year++; }	 last_month = month-1;	 last_month_year = year;	if (last_month < 1) { last_month=12; last_month_year--; }    result += '<td   valign="TOP"  >\n'; result += '<TABLE WIDTH=120 BORDER=0 CELLSPACING=0 CELLPADDING=1 ALIGN=CENTER >\n';	result += '<TR>\n';	for (var j=0; j<7; j++) {		result += '<TD CLASS="'+this.cssPrefix+'cpDayColumnHeader" WIDTH="14%" align="center" ><SPAN CLASS="'+this.cssPrefix+'cpDayColumnHeader">'+this.dayHeaders[(this.weekStartDay+j)%7]+'</TD>\n';		}	result += '</TR>\n';	for (var row=1; row<=6; row++) {		result += '<TR>\n';		for (var col=1; col<=7; col++) {			var disabled=false;			if (this.disabledDatesExpression!="") {				var ds=""+display_year+LZ(display_month)+LZ(display_date);				eval("disabled=("+this.disabledDatesExpression+")");				}			var dateClass = "";			if ((display_month == this.currentDate.getMonth()+1) && (display_date==this.currentDate.getDate()) && (display_year==this.currentDate.getFullYear())) {				dateClass = "cpCurrentDate";				}			else if (display_month == month) {				dateClass = "cpCurrentMonthDate";				}			else {				dateClass = "cpOtherMonthDate";						}			if (disabled || this.disabledWeekDays[col-1]) {				if (display_month==month)					result += '	<TD CLASS="'+this.cssPrefix+dateClass+'"><SPAN CLASS="'+this.cssPrefix+dateClass+'Disabled">'+display_date+'</SPAN></TD>\n';				else					result += '	<TD  height="1px"></TD>\n';				}			else {var selected_date = display_date;				var selected_month = display_month;				var selected_year = display_year;				if (this.displayType=="week-end") {					var d = new Date(selected_year,selected_month-1,selected_date,0,0,0,0);					d.setDate(d.getDate() + (7-col));					selected_year = d.getYear();					if (selected_year < 1000) { selected_year += 1900; }					selected_month = d.getMonth()+1;					selected_date = d.getDate();					}					if (display_month==month)											result += '	<TD CLASS="'+this.cssPrefix+dateClass+'"><A HREF="javascript:'+windowref+this.returnFunction+'('+selected_year+','+selected_month+','+selected_date+');'+windowref+'CP_hideCalendar(\''+this.index+'\');" CLASS="'+this.cssPrefix+dateClass+'">'+display_date+'</A></TD>\n';					else						result += '	<TD  height="1px"></TD>\n';				}			display_date++;			if (display_date > daysinmonth[display_month]) {								display_date=1;							display_month++;				}			if (display_month > 12) {				display_month=1;				display_year++;				}			}		result += '</TR>';		}	var current_weekday = now.getDay() - this.weekStartDay;	if (current_weekday < 0) {		current_weekday += 7;	}result += '	</TABLE>'; result += '</td>\n';  result += "</TR>\n"; result += "</TABLE>\n";return result;
}
function CP_getCalendar() {var now = new Date();if (this.type == "WINDOW") { var windowref = "window.opener."; }else { var windowref = ""; }var result = "";if (this.type == "WINDOW") {	result += "<HTML><HEAD><TITLE>Calendar</TITLE>"+this.getStyles()+"</HEAD><BODY MARGINWIDTH=0 MARGINHEIGHT=0 TOPMARGIN=0 RIGHTMARGIN=0 LEFTMARGIN=0>\n";	result += '<CENTER><TABLE WIDTH=100% BORDER=0 BORDERWIDTH=0 CELLSPACING=0 CELLPADDING=0>\n';	}else {	result += '<TABLE CLASS="'+this.cssPrefix+'cpBorder" WIDTH=124 BORDER=0 BORDERWIDTH=0 CELLSPACING=0 CELLPADDING=0  bgcolor="#FFFFFF" >\n';	result += '<TR><TD ALIGN=CENTER>\n';	result += '<CENTER>\n';	}if (this.displayType=="date" || this.displayType=="week-end") {	if (this.currentDate==null) { this.currentDate = now; }	if (arguments.length > 0) { var month = arguments[0]; }		else { var month = this.currentDate.getMonth()+1; }	if (arguments.length > 1 && arguments[1]>0 && arguments[1]-0==arguments[1]) { var year = arguments[1]; }		else { var year = this.currentDate.getFullYear(); }	var daysinmonth= new Array(0,31,28,31,30,31,30,31,31,30,31,30,31);	if ( ( (year%4 == 0)&&(year%100 != 0) ) || (year%400 == 0) ) {		daysinmonth[2] = 29;		}	var current_month = new Date(year,month-1,1);	var display_year = year;	var display_month = month;	var display_date = 1;	var weekday= current_month.getDay();	var offset = 0;		offset = (weekday >= this.weekStartDay) ? weekday-this.weekStartDay : 7-this.weekStartDay+weekday ;	if (offset > 0) {		display_month--;		if (display_month < 1) { display_month = 12; display_year--; }		display_date = daysinmonth[display_month]-offset+1;		}	var next_month = month+1;	var next_month_year = year;	if (next_month > 12) { next_month=1; next_month_year++; }	var last_month = month-1;	var last_month_year = year;	if (last_month < 1) { last_month=12; last_month_year--; }	var date_class;	if (this.type!="WINDOW") {		result += "<TABLE WIDTH='100%' BORDER=0 BORDERWIDTH=0 CELLSPACING=0 CELLPADDING=0 >";		}	result += '<TR>\n';	var refresh = windowref+'CP_refreshCalendar';	var refreshLink = 'javascript:' + refresh;	if (this.isShowNavigationDropdowns) {		result += '<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="78" COLSPAN="3"><select CLASS="'+this.cssPrefix+'cpMonthNavigation" name="cpMonth" onChange="'+refresh+'('+this.index+',this.options[this.selectedIndex].value-0,'+(year-0)+');">';		for( var monthCounter=1; monthCounter<=12; monthCounter++ ) {			var selected = (monthCounter==month) ? 'SELECTED' : '';			result += '<option value="'+monthCounter+'" '+selected+'>'+this.monthNames[monthCounter-1]+'</option>';			}		result += '</select></TD>';		result += '<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="10">&nbsp;</TD>';
		result += '<TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="56" COLSPAN="3"><select CLASS="'+this.cssPrefix+'cpYearNavigation" name="cpYear" onChange="'+refresh+'('+this.index+','+month+',this.options[this.selectedIndex].value-0);">';		for( var yearCounter=year-this.yearSelectStartOffset; yearCounter<=year+this.yearSelectStartOffset; yearCounter++ ) {			var selected = (yearCounter==year) ? 'SELECTED' : '';			result += '<option value="'+yearCounter+'" '+selected+'>'+yearCounter+'</option>';			}		result += '</select></TD>';		}	else {		if (this.isShowYearNavigation) {			result += '<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="10"><A CLASS="'+this.cssPrefix+'cpMonthNavigation" HREF="'+refreshLink+'('+this.index+','+last_month+','+last_month_year+');">&lt;</A></TD>';			result += '<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="58"><SPAN CLASS="'+this.cssPrefix+'cpMonthNavigation">'+this.monthNames[month-1]+'</SPAN></TD>';			result += '<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="10"><A CLASS="'+this.cssPrefix+'cpMonthNavigation" HREF="'+refreshLink+'('+this.index+','+next_month+','+next_month_year+');">&gt;</A></TD>';			result += '<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="10">&nbsp;</TD>';
			result += '<TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="10"><A CLASS="'+this.cssPrefix+'cpYearNavigation" HREF="'+refreshLink+'('+this.index+','+month+','+(year-1)+');">&lt;</A></TD>';			if (this.isShowYearNavigationInput) {				result += '<TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="36"><INPUT NAME="cpYear" CLASS="'+this.cssPrefix+'cpYearNavigation" SIZE="4" MAXLENGTH="4" VALUE="'+year+'" onBlur="'+refresh+'('+this.index+','+month+',this.value-0);"></TD>';				}			else {				result += '<TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="36"><SPAN CLASS="'+this.cssPrefix+'cpYearNavigation">'+year+'</SPAN></TD>';				}			result += '<TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="10"><A CLASS="'+this.cssPrefix+'cpYearNavigation" HREF="'+refreshLink+'('+this.index+','+month+','+(year+1)+');">&gt;</A></TD>';			}		else {			result += '<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="22"><A CLASS="'+this.cssPrefix+'cpMonthNavigation" HREF="'+refreshLink+'('+this.index+','+last_month+','+last_month_year+');">&lt;&lt;</A></TD>\n';			result += '<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="100"><SPAN CLASS="'+this.cssPrefix+'cpMonthNavigation">'+this.monthNames[month-1]+' '+year+'</SPAN></TD>\n';			result += '<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="22"><A CLASS="'+this.cssPrefix+'cpMonthNavigation" HREF="'+refreshLink+'('+this.index+','+next_month+','+next_month_year+');">&gt;&gt;</A></TD>\n';			}		}	result += '</TR></TABLE>\n';	result += '<TABLE WIDTH=120 BORDER=0 CELLSPACING=0 CELLPADDING=1 ALIGN=CENTER >\n';	result += '<TR>\n';	for (var j=0; j<7; j++) {
		result += '<TD CLASS="'+this.cssPrefix+'cpDayColumnHeader" WIDTH="14%" align="center" ><SPAN CLASS="'+this.cssPrefix+'cpDayColumnHeader">'+this.dayHeaders[(this.weekStartDay+j)%7]+'</TD>\n';		}	result += '</TR>\n';	for (var row=1; row<=6; row++) {		result += '<TR>\n';		for (var col=1; col<=7; col++) {			var disabled=false;			if (this.disabledDatesExpression!="") {				var ds=""+display_year+LZ(display_month)+LZ(display_date);				eval("disabled=("+this.disabledDatesExpression+")");				}			var dateClass = "";			if ((display_month == this.currentDate.getMonth()+1) && (display_date==this.currentDate.getDate()) && (display_year==this.currentDate.getFullYear())) {				dateClass = "cpCurrentDate";				}			else if (display_month == month) {				dateClass = "cpCurrentMonthDate";				}			else {				dateClass = "cpOtherMonthDate";				}			if (disabled || this.disabledWeekDays[col-1]) {				if (display_month==month || (month-display_month==1) || (month-display_month==-11))					result += '	<TD CLASS="'+this.cssPrefix+dateClass+'"><SPAN CLASS="'+this.cssPrefix+dateClass+'Disabled">'+display_date+'</SPAN></TD>\n';				else					result += '	<TD  height="1px"></TD>\n';				}			else {				var selected_date = display_date;				var selected_month = display_month;				var selected_year = display_year;				if (this.displayType=="week-end") {					var d = new Date(selected_year,selected_month-1,selected_date,0,0,0,0);					d.setDate(d.getDate() + (7-col));					selected_year = d.getYear();					if (selected_year < 1000) { selected_year += 1900; }					selected_month = d.getMonth()+1;					selected_date = d.getDate();					}					if (display_month==month || (month-display_month==1) || (month-display_month==-11))											result += '	<TD CLASS="'+this.cssPrefix+dateClass+'"><A HREF="javascript:'+windowref+this.returnFunction+'('+selected_year+','+selected_month+','+selected_date+');'+windowref+'CP_hideCalendar(\''+this.index+'\');" CLASS="'+this.cssPrefix+dateClass+'">'+display_date+'</A></TD>\n';					else						result += '	<TD  height="1px"></TD>\n';				}			display_date++;			if (display_date > daysinmonth[display_month]) {				display_date=1;				display_month++;				}			if (display_month > 12) {				display_month=1;				display_year++;				}			}		result += '</TR>';		}	var current_weekday = now.getDay() - this.weekStartDay;	if (current_weekday < 0) {		current_weekday += 7;		}	result += '	</TABLE></CENTER></TD></TR></TABLE>\n';}
if (this.displayType=="month" || this.displayType=="quarter" || this.displayType=="year") {	if (arguments.length > 0) { var year = arguments[0]; }	else { 		if (this.displayType=="year") {	var year = now.getFullYear()-this.yearSelectStartOffset; }		else { var year = now.getFullYear(); }		}	if (this.displayType!="year" && this.isShowYearNavigation) {		result += "<TABLE WIDTH=144 BORDER=0 BORDERWIDTH=0 CELLSPACING=0 CELLPADDING=0>";		result += '<TR>\n';		result += '	<TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="22"><A CLASS="'+this.cssPrefix+'cpYearNavigation" HREF="javascript:'+windowref+'CP_refreshCalendar('+this.index+','+(year-1)+');">&lt;&lt;</A></TD>\n';		result += '	<TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="100">'+year+'</TD>\n';		result += '	<TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="22"><A CLASS="'+this.cssPrefix+'cpYearNavigation" HREF="javascript:'+windowref+'CP_refreshCalendar('+this.index+','+(year+1)+');">&gt;&gt;</A></TD>\n';		result += '</TR></TABLE>\n';		}	}	if (this.displayType=="month") {	result += '<TABLE WIDTH=120 BORDER=0 CELLSPACING=1 CELLPADDING=0 ALIGN=CENTER>\n';	for (var i=0; i<4; i++) {		result += '<TR>';		for (var j=0; j<3; j++) {			var monthindex = ((i*3)+j);			result += '<TD WIDTH=33% ALIGN=CENTER><A CLASS="'+this.cssPrefix+'cpText" HREF="javascript:'+windowref+this.returnMonthFunction+'('+year+','+(monthindex+1)+');'+windowref+'CP_hideCalendar(\''+this.index+'\');" CLASS="'+date_class+'">'+this.monthAbbreviations[monthindex]+'</A></TD>';			}		result += '</TR>';		}	result += '</TABLE></CENTER></TD></TR></TABLE>\n';	}if (this.displayType=="quarter") {	result += '<BR><TABLE WIDTH=120 BORDER=1 CELLSPACING=0 CELLPADDING=0 ALIGN=CENTER>\n';	for (var i=0; i<2; i++) {		result += '<TR>';		for (var j=0; j<2; j++) {			var quarter = ((i*2)+j+1);			result += '<TD WIDTH=50% ALIGN=CENTER><BR><A CLASS="'+this.cssPrefix+'cpText" HREF="javascript:'+windowref+this.returnQuarterFunction+'('+year+','+quarter+');'+windowref+'CP_hideCalendar(\''+this.index+'\');" CLASS="'+date_class+'">Q'+quarter+'</A><BR><BR></TD>';			}		result += '</TR>';		}	result += '</TABLE></CENTER></TD></TR></TABLE>\n';	}if (this.displayType=="year") {	var yearColumnSize = 4;	result += "<TABLE WIDTH=144 BORDER=0 BORDERWIDTH=0 CELLSPACING=0 CELLPADDING=0>";	result += '<TR>\n';	result += '	<TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="50%"><A CLASS="'+this.cssPrefix+'cpYearNavigation" HREF="javascript:'+windowref+'CP_refreshCalendar('+this.index+','+(year-(yearColumnSize*2))+');">&lt;&lt;</A></TD>\n';	result += '	<TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="50%"><A CLASS="'+this.cssPrefix+'cpYearNavigation" HREF="javascript:'+windowref+'CP_refreshCalendar('+this.index+','+(year+(yearColumnSize*2))+');">&gt;&gt;</A></TD>\n';	result += '</TR></TABLE>\n';	result += '<TABLE WIDTH=120 BORDER=0 CELLSPACING=1 CELLPADDING=0 ALIGN=CENTER>\n';	for (var i=0; i<yearColumnSize; i++) {		for (var j=0; j<2; j++) {			var currentyear = year+(j*yearColumnSize)+i;			result += '<TD WIDTH=50% ALIGN=CENTER><A CLASS="'+this.cssPrefix+'cpText" HREF="javascript:'+windowref+this.returnYearFunction+'('+currentyear+');'+windowref+'CP_hideCalendar(\''+this.index+'\');" CLASS="'+date_class+'">'+currentyear+'</A></TD>';			}		result += '</TR>';		}	result += '</TABLE></CENTER></TD></TR></TABLE>\n';	}if (this.type == "WINDOW") {	result += "</BODY></HTML>\n";	}return result;}
function dateAdd(intval, numb, dat){base=new Date(dat);switch(intval){	case "M":		base.setMonth(base.getMonth() + numb);		break;	case "YYYY":		base.setFullYear(base.getFullYear() + numb);		break;	case "D":		base.setDate(base.getDate() + numb);		break;	case "H":		base.setHours(base.getHours() + numb);		break;	case "N":		base.setMinutes(base.getMinutes() + numb);		break;	case "S":		base.setSeconds(base.getSeconds() + numb);		break;	default:}return base
}

function isDate(p_Expression){return !isNaN(new Date(p_Expression));	
}
function dateDiff(p_Interval, p_Date1, p_Date2, p_firstdayofweek, p_firstweekofyear){if(!isDate(p_Date1)){return "invalid date: '" + p_Date1 + "'";}if(!isDate(p_Date2)){return "invalid date: '" + p_Date2 + "'";}var dt1 = new Date(p_Date1);var dt2 = new Date(p_Date2);
var iDiffMS = dt2.valueOf() - dt1.valueOf();var dtDiff = new Date(iDiffMS);
var nYears  = dt2.getUTCFullYear() - dt1.getUTCFullYear();var nMonths = dt2.getUTCMonth() - dt1.getUTCMonth() + (nYears!=0 ? nYears*12 : 0);var nQuarters = parseInt(nMonths/3);	var nMilliseconds = iDiffMS;var nSeconds = parseInt(iDiffMS/1000);var nMinutes = parseInt(nSeconds/60);var nHours = parseInt(nMinutes/60);var nDays  = parseInt(nHours/24);var nWeeks = parseInt(nDays/7);
    if (nDays != nHours/24 )	nDays=nDays+1	
 var iDiff = 0;		switch(p_Interval.toLowerCase()){	case "yyyy": return nYears;	case "q": return nQuarters;	case "m": return nMonths;	case "y": 			case "d": return nDays;	case "w": return nDays;	case "ww":return nWeeks;			case "h": return nHours;	case "n": return nMinutes;	case "s": return nSeconds;	case "ms":return nMilliseconds;		default: return "invalid interval: '" + p_Interval + "'";}
}


/*Exp*/

var flds="air_airclass|air_airline|fromairport|fromdate|todate|destination|fromtime|infs|numadult|numadult1|numadult2|numadult3|numchild|numchild1|numchild2|numchild3|numroom|t_age11|t_age12|t_age13|t_age14|t_age15|t_age16|t_age21|t_age22|t_age23|t_age24|t_age25|t_age26|t_age31|t_age32|t_age33|t_age34|t_age35|t_age36|totime|kategorie|maxprice|preis|zimm|carpickuploc|carclass|carvendor|cardroptime|carequipment|carpickuptime|hotelsearcharea|hotelclass|flexfromdate|flextodate|packagetype|fewo_bad|fewo_cat|fewo_dwh|fewo_kidbed|fewo_meer|fewo_rstuhl|fewo_sauna|fewo_skilift|fewo_tier|fewo_tv|fewo_typ|fewo_wsm|chainname|xfamilie_kinder|xfparks|xgolf|xski|sportangebot|sportmoeglichkeiten|strand|land|region|type|verpflegung|xwandern|xwellness|zimmer|dauer|triptype|wizards|wzdf|wzid|carsearchtype|airtriptype|airdirect|airnopen|ttairport|ttdestination|hotelflexdates|kleinkind|fewoprice|entf_meer|entf_lift|ttselectedwizard|x|x|x|x|x|x|x|x|x|x|x|x".split("|");

var ccn="vscook";
var fldsQ="wiz|wizards|wizortgroup|wzid|".split("|");
var fldsonldt=/(^date[1234]$$)/;
var fwarr=[];
var obHeight = 0;
var wizHeight = 0;

function UpdateRegionen(rec)
{
        //alert('in fkt UpdateRegionen(rec)')
        if(rec){
                TTREGS = rec;
        } else {
                return false;
        }
        TTREGS=rec;

        opt=document.Form1.elements["region"].options;
        opt[0].value=-1;opt[0].text="beliebig";
 
        opt=document.Form1.elements["ziel"].options;
        opt[0].value=-1;opt[0].text="beliebig";

        found=1;
        for(i=0;i<TTREGS.length;i++){
                sr=TTREGS[i].split(":");
                if(sr[1]>=10000){
                        if(found>=opt.length){
                                opt[found++]=new Option(sr[0],sr[1]);
                        } else {
                                opt[found].text=sr[0];
                                opt[found++].value=sr[1];
                        }
                }
        }
        while(opt.length > found){
                opt[opt.length-1]=null;
        }
        FixRSel();
        //swap(1);
}

function RZC(ds)
{

        //alert('in fkt RZC(ds)')
        var opt;
        opt=document.Form1.elements["ziel"].options;
        kenner=opt[opt.selectedIndex].value;
        g_nZiel=kenner;
        if(opt.selectedIndex>0){
                g_strZiel=opt[opt.selectedIndex].text;
        } else g_strZiel="";
        gfilt=kenner!=-1;
        //alert(g_strZiel);
        //var regiondd=document.getElementById('region');
        opt=document.Form1.elements["region"].options;
        found=1;
		        for(i=0;i<Regions.length;i++){
                sr=Regions[i].split(":");
                if(sr[1]<10000 && (kenner<0 || sr[2]==kenner)){
              
                        txt=sr[0];
                        if(found>=opt.length){
                         document.Form1.elements["region"].options[found++]=new Option(txt,sr[1]+":"+sr[2]);
                         } else {
                        //alert('opt2 '+txt)
                                opt[found].text=txt;
                                opt[found++].value=sr[1]+":"+sr[2];
                                
                        }
                        
                }
        }

        while(opt.length > found){
              opt[opt.length-1]=null;
        }

       
        
        if(ds){
                opt.selectedIndex=0;
                g_strRegion="";
                g_nRegion=-1;
        }
 }

function REGC()
{
        //alert('in fkt REGC()')
        ropt=document.getElementById('region').options;
        kenner=ropt[ropt.selectedIndex].value.split(":");
        g_nRegion=kenner[0];

        if(ropt.selectedIndex>0){
                sr=ropt[ropt.selectedIndex].text;
                g_strRegion=sr.substr(0,sr.lastIndexOf("(")-1);
        } else g_strRegion="";

        if(kenner[0]>=0){
                opt=document.getElementById("ziel").options;
                for(i=1;i<opt.length;i++){
                        if(opt[i].value==kenner[1]){
                                opt.selectedIndex=i;
                                g_nZiel=kenner[1];
                                g_strZiel=opt[i].text;
                                break;
                        }
                }
        }
}

function RSRCH()
{
        //alert('in fkt RSRCH()')
        strS=document.bengine.elements["zsuch"].value.toLowerCase();
        var nR=-1,nZ=-1;

        if(strS.length > 0){
                for(i=0;i<TTREGS.length && nR<0;i++){
                        if((nPos=TTREGS[i].toLowerCase().indexOf(strS))>=0){
                                if(nPos==0 || TTREGS[i].charAt(nPos-1)==" "
                                || TTREGS[i].charAt(nPos-1)=="-"){
                                        rL=TTREGS[i].split(":");
                                        if(rL[1]<=10000){
                                                nR=rL[1];
                                                nZ=rL[2];
                                        }else nZ=rL[1];
                                }
                        }
                }
        } else nZ=0;
        if(nZ>=0){
                opt=document.bengine.elements["ziel"].options;
                if(nZ>0)for(i=1;i<opt.length;i++)

                if(opt[i].value==nZ){
                        nZ=i;
                        break;
                }
                if(opt.selectedIndex!=nZ){
                        opt.selectedIndex=nZ;
                        RZC();
                }

                opt=document.bengine.elements["region"].options;
                if(nR>=0){
                        for(i=1;i<opt.length;i++){
                                if(opt[i].value.split(":")[0]==nR){
                                        g_nRegion=nR;
                                        sr=opt[i].text;
                                        g_strRegion=sr.substr(0,sr.lastIndexOf("(")-1);
                                        nR=i;break;
                                }
                        }
                } else {
                        g_nRegion=-1;
                        g_strRegion="";
                        nR=0;
                }
                opt.selectedIndex=nR;
        }
}

function FixRSel()
{
        //alert('in fkt FixRSel()')
        opt=document.getElementById("ziel").options;
        if(opt.selectedIndex<0 || opt[opt.selectedIndex].value!=g_nZiel){
                for(i=0;i<opt.length;i++)
                if(opt[i].value==g_nZiel){
                        opt.selectedIndex=i;break;
                }
                if(i==opt.length){
                        if(g_strZiel!=""){
                                opt[opt.length]=new Option(g_strZiel,g_nZiel,true,true);
                        } else {
                                opt.selectedIndex=0;
                                RZC();return;
                        }
                }
        }
        RZC();

        opt=document.getElementById("region").options;
        if(opt.selectedIndex<0 || opt[opt.selectedIndex].value.split(":")[0]!=g_nRegion){
                for(i=0;i<opt.length;i++)
                if(opt[i].value.split(":")[0]==g_nRegion){
                        opt.selectedIndex=i;break;
                }
                if(i==opt.length){
                        if(g_strRegion!=""){
                                opt[opt.length]=new Option(g_strRegion+" (keine Ang.)",g_nRegion+":"+g_nZiel,true,true);
                        } else {
                                opt.selectedIndex=0;
                                g_nRegion=-1;
                                g_strRegion="";
                        }
                }
        }
}

function _date(plusdays)
{
var exp = new Date(); 
exp.setTime(exp.getTime() + (plusdays*24*60*60*1000));
return exp
} 

function SetDays(plusdays)
{
var exp = new Date(); 
exp.setTime(exp.getTime() + (plusdays*24*60*60*1000));
return formatDate(exp);
//me.value = formatDate(exp); 
} 



function ChangeText(target,text)
{
try{
 var ActiveTE = document.getElementById(target.id);
ActiveTE.innerHTML = text;
}
catch(e) {}

}

function CatchDateString(selDate)
{
Setcal(selDate);
}


function update(element) {


for (var i = 0; i< element.form.length; i++) {  
 if (element.form[i].name == element.name) {
  var ActiveTE = document.getElementById(element.form[i].id+ '_text');
try{  
  if (element.form[i].id == element.id) {

  ActiveTE.className='wizardSelected'; }
  else {
  ActiveTE.className='wizardText';

  }
  }
catch(e) {};
 }  } 

} 



function Expand(panel,checked) {

var ActiveTE = document.getElementById(panel);	

if (checked) {
ActiveTE.style.display='inline';
ActiveTE.style.visibility='visible';
} 
else {
ActiveTE.style.display='none';
ActiveTE.style.visibility='hidden';
} 
} 

function ExpandByValue(panel,name,value) {
var ActiveTE = document.getElementById(panel);	
ActiveTE.style.display='none';
ActiveTE.style.visibility='hidden';

for (var i = 1; i< 9; i++) {

if (document.getElementById(name+i) != null) {

var Brotherelements = document.getElementById(name+i);
if (Brotherelements.value != '-1') {
if (Brotherelements.value < value) {
ActiveTE.style.display='inline';
ActiveTE.style.visibility='visible';
}
			}
		}
	} 
} 

function selectPanel(panels,no) {

i = 0
while (i < 10)
{
try {

var ActiveTE = document.getElementById(panels+i);	
ActiveTE.style.display='none';
ActiveTE.style.visibility='hidden';
}
catch(e) {}
i++
}


try {

var ActiveTE = document.getElementById(panels+no);	
ActiveTE.style.display='inline';
ActiveTE.style.visibility='visible';
}
catch(e) {}

} 

function ExpandPanels(panels,no) {

try {
var ActiveTE = document.getElementById(panels);	
if (no>0) {
ActiveTE.style.display='inline';
ActiveTE.style.visibility='visible';
} 
else {
ActiveTE.style.display='none';
ActiveTE.style.visibility='hidden';
} 
}
catch(e) {}


i = 0
while (i < 10)
{
try {

var ActiveTE = document.getElementById(panels+i);	
ActiveTE.style.display='none';
ActiveTE.style.visibility='hidden';
}
catch(e) {}
i++
}

i = 0
while (i <= no)
{
try {

var ActiveTE = document.getElementById(panels+i);	
ActiveTE.style.display='inline';
ActiveTE.style.visibility='visible';
}
catch(e) {}
i++
}

} 

function ExpandHiddenPanel(element) {

for (var i = 0; i< element.form.length; i++) {  
 if (element.form[i].name == element.name) {
  
try{  
var targetele = element.form[i].getAttribute('target')
var ActiveTE = document.getElementById(targetele);
  if (element.form[i].id == element.id) {

ActiveTE.style.display='inline';
ActiveTE.style.visibility='visible';}
  else {
ActiveTE.style.display='none';
ActiveTE.style.visibility='hidden';

  }
  }
catch(e) {};
 }  } 

}
	
	
	
	
//For use with the childRoombreakout	
function ExpandPanelsClosechildbreakout(panels,no) {

try {
var ActiveTE = document.getElementById('div_'+panels);	
if (no>0) {
ActiveTE.style.display='inline';
ActiveTE.style.visibility='visible';
} 
else {
ActiveTE.style.display='none';
ActiveTE.style.visibility='hidden';


var ActiveTE = document.getElementById(panels);
ActiveTe.SelectedIndex=0;	

} 
}
catch(e) {}



i = 0
while (i < 10)
{
try {

var ActiveTE = document.getElementById(panels+i);	
ActiveTE.style.display='none';
ActiveTE.style.visibility='hidden';

var ActiveTE = document.getElementById(panels);
ActiveTe.SelectedIndex=0;	
}
catch(e) {}
i++
}

i = 0
while (i <= no)
{
try {

var ActiveTE = document.getElementById(panels+i);	
ActiveTE.style.display='inline';
ActiveTE.style.visibility='visible';
}
catch(e) {}
i++
}

i = no
i++ 
while (i < 10)
{
try {
var hiddenChilddropdown = document.getElementById('numchild'+i);
hiddenChilddropdown.selectedIndex = 0;
try {
var thatpanel = document.getElementById('ChildrenInRoom'+i);
thatpanel.style.display='none';
thatpanel.style.visibility='hidden';
}
catch(e) {};
//var ActiveTE = document.getElementById('ChildrenInRoom'+i);	

//ActiveTE.style.display='none';
//ActiveTE.style.visibility='hidden';



}
catch(e) {}
i++
}

var MainPanel = document.getElementById('ChildrenInRoom');	

MainPanel.style.display='none';
MainPanel.style.visibility='hidden';

i = 0
while (i < 10)
{
try {
var checkforopen = document.getElementById('ChildrenInRoom'+i);	
if (checkforopen.style.visibility=='visible' ) {
MainPanel.style.display='inline';
MainPanel.style.visibility='visible';
} else {}
}
catch (e) {}
i++
}


	}
	
	
	
	
	
	


function ExpandSubPanels(panels,no,id,subs,controlgroup) {
//Hide Main Panel
var MainPanel = document.getElementById(panels);	
try{
MainPanel.style.display='none';
MainPanel.style.visibility='hidden';
}
catch(e) {};



try {
var ActiveTE = document.getElementById(panels+id);	
if (no>0) {
ActiveTE.style.display='inline';
ActiveTE.style.visibility='visible';
} 
else {
ActiveTE.style.display='none';
ActiveTE.style.visibility='hidden';
} 
}
catch(e) {}

i = 0
while (i < 10)
{
try {

var ActiveTE = document.getElementById('div_'+subs+id+i);	
ActiveTE.style.display='none';
ActiveTE.style.visibility='hidden';
}
catch(e) {}
i++
}

i = 0
while (i <= no)
{
try {

var ActiveTE = document.getElementById('div_'+subs+id+i);	
ActiveTE.style.display='inline';
ActiveTE.style.visibility='visible';
}
catch(e) {}
i++
}


//Make Panel Visible If Any Control In ControlGroup Selected greater than 0

i = 0
while (i < 10)
{
try {
var checkforopen = document.getElementById(panels+i);	
if (checkforopen.style.visibility=='visible' ) {
MainPanel.style.display='inline';
MainPanel.style.visibility='visible';
} else {}
}
catch (e) {}
i++
}
//var panelcount = 2

//	for(i=0;i=panelcount;i++){
	

//	

//ActiveTE.style.display='none';
//ActiveTE.style.visibility='hidden';


	}
	
	
	
	
	function scal(obj)
{
	//dtValue=chckDate(obj)?obj.value:obj.defaultValue;
	
	var cal=parent.document.getElementById("wizardsiframe");
	if(im.style.visibility=="visible" && calObj==obj)return;
	im.style.top=getAbsPos(obj,"Top")+getAbsPos(cal,"Top")+obj.offsetHeight;
	im.style.left=getAbsPos(obj,"Left")+getAbsPos(cal,"Left");
	im.style.display="";
	im.style.visibility="hidden";
	fade(im,"visible");
	var a=obj.name.match(/2|4/)?[2,3]:[0,1];
	parent.document.imerologio.initCal(obj,dtrange[a[0]],dtrange[a[1]],dtValue);
	obj.onbeforedeactivate=function(){datumMAN(this)};
	calObj=obj;
}

function getAbsPos(o,p){var i=0;while(o!=null){i+=o["offset"+p];o=o.offsetParent;}return i;}

function callcal(obj)
{
var MaxDate = '';
if (obj.getAttribute('maxdate')) {
MaxDate = obj.getAttribute('maxdate');
}

var MinDate = '';
if (obj.getAttribute("mindate")) {
MinDate = obj.getAttribute('mindate');
}

var cal=parent.document.getElementById("calendarFrame");
cal.src='/daily/controls/wizards/calender.aspx?date=' + obj.value + '&Maxdate=' + MaxDate + '&Mindate=' + MinDate;

var im=parent.document.getElementById("calendarDiv");
//if(im.style.visibility=="visible")return;
//im.style.top=0;
//im.style.left=0;
im.style.top=getAbsPos(obj,"Top")+obj.offsetHeight;
im.style.left=getAbsPos(obj,"Left");
	//im.style.display="";
	//im.style.visibility="hidden";
	//fade(im,"visible");
	
im.style.display='';
im.style.visibility='visible';
im.setAttribute("caller", obj.id)
//fade(obj,"visible");
}

function hidecal() {
var im

im=parent.document.getElementById("calendarDiv");
try{
//alert(document.activeElement.parent.id);
switch(document.activeElement.tagName) 
{
case("IFRAME"): 
return;
break
default:
hidecalnow();
break
}
}
catch(e){
//hidecalnow();
};
}






function hidecalnow() {

var im=parent.document.getElementById("calendarDiv");
try{

im.style.display="none";
im.style.visibility="hidden";

}
catch(e){
};
}


function fade(obj,st) 
{
	
	obj.style.filter="blendTrans(duration=0.5)";
	obj.filters.blendTrans.apply();
	obj.style.visibility=st;
    obj.filters.blendTrans.play();
	

}

function Setcal(selDate)
{

var im=parent.document.getElementById("calendarDiv");
var cal=parent.document.getElementById(im.getAttribute('caller'));
cal.value = selDate;
try{
cal.onchange();
}
catch(e) {};
//cal.focus()
}

function getc(name)
{
	var allc=getcb(ccn);
	if(allc==null) return null;
	allcArr=allc.split("^");
	for(var i=0; i<allcArr.length;i++)
	{
		cookieName  = allcArr[i].split("~")[0];
		cookieValue = allcArr[i].split("~")[1];
		if (cookieName == name)
		{
			return unescape(cookieValue);
		}
	}
	return null;
}

function getcb(name){
var rs=null;
var mc=" " + document.cookie + ";";
var sn=" " + name + "=";
var sc=mc.indexOf(sn);
var ec;
if (sc!=-1){sc+=sn.length;ec=mc.indexOf(";",sc);
rs=unescape(mc.substring(sc,ec));}
return rs;}


function setcf(name,value){expires = "Thu, 01-Jan-2222 00:00:01 GMT";document.cookie=name+"="+escape(value)+"; expires=" + expires;}

function EncodeTildeXOR(strValue)
{
try{
	strValue = strValue.replace(/\^/g, ";;XOR;;");
	return strValue.replace(/~/g, ";;TIL;;");
	}
	catch(e) {};
}

function DecodeTildeXOR(strValue)
{
	strValue = strValue.replace(/;;XOR;;/g, "^");
	return strValue.replace(/;;TIL;;/g, "~");
}

function setc(name,value)
{
	document.cookie=ccn+"="+escape(addc(EncodeTildeXOR(name),EncodeTildeXOR(value))) + "; path=/;";
}

function addc(name,value)
{
	var allc=getcb(ccn);
	var allcValueNew="";
	cookieName = name + "~";
	allcValue = unescape(allc);
	allcValueItem = allcValue.split("^");
	if(allcValueItem.length>1)
	{
		if(allcValue.indexOf(cookieName)!=-1)
		{
			for(var i=0; i<allcValueItem.length;i++)
			{
				cookieName  = allcValueItem[i].split("~")[0];
				cookieValue = allcValueItem[i].split("~")[1];
				if (cookieName == name) allcValueItem[i] = cookieName + "~" + value;
			}
		}
		else
		{
			allcValueItem[allcValueItem.length] = name + "~" + value;
		}
	
		for(var i=0;i<allcValueItem.length;i++)
		{
			allcValueNew += (i==0?"":"^") + allcValueItem[i];
		}
	}
	else if(allcValue.indexOf("~")!=-1)
	{
		if(allcValue.indexOf(cookieName)!=-1)
		{
			cookieName  = allcValue.split("~")[0];
			cookieValue = allcValue.split("~")[1];
			if (cookieName == name)
			{
				allcValueNew = cookieName + "~" + value;
			}
		}
		else
		{
			allcValueNew = allcValue + "^" +  name + "~" + value;
		}
	}
	
	else 
	{
		allcValueNew +=  name + "~" + value;
	}

return allcValueNew;

}

function setUserValues()
{
	try{if(doNotGetrmbw)return;}catch(e){}
	var prmArr="CCheck=1&&wzdf=4".split("&");
	for(var i=0;i<prmArr.length;i++)
	{
		var prmName=prmArr[i].split("=")[0];
		var prmVal=prmArr[i].split("=")[1];
		if(document.wizards[prmName] && prmVal!="")
		{
			if(getcpos(prmName)!=-1)
			{
				//document.wizards[prmName].value=prmVal;
			}
		}
	}
	datumMAN();
	countzm();
}

function getcpos(fname) // Get Field Position In Array
{
	for(var i=0;i<flds.length;i++)
	{
		if(flds[i]==fname)
		
		return i;
	}
	return -1;
}

function gwc(nm)//Get Wizard Cookie Value For Field
{
try{
	var wzarr=getc("wz");
	wzarr=wzarr.split("|");
	var retval;
	retval = wzarr[getcpos(nm)];
	return escape(retval)

	}
	catch(e) {
	return ''
	};
}	
function getarrpos(arr, fname) // Get Field Position In Array
{
	for(var i=0;i<arr.length;i++)
	{
		if(arr[i]==fname)
		
		return i;
	}
	return -1;
}
function getsubarrpos(arr, fname) // Get Field Position In Array
{

	for(var i=0;i<arr.length;i++)
	{
	//var arrres = arr[i];
		if(fname==arr[i].split("|")[0]){
		return i;}
	}
	return -1;
}

function getArgs() {
	var args = new Object();
	// Get Query String
	var query = location.search.substring(1); 
	// Split query at the comma
	var pairs = query.split("&"); 
	
	// Begin loop through the querystring
	for(var i = 0; i < pairs.length; i++) {

		// Look for "name=value"
		var pos = pairs[i].indexOf('='); 
		// if not found, skip to next
		if (pos == -1) continue; 
		// Extract the name
		var argname = pairs[i].substring(0,pos); 
		
		// Extract the value
		var value = pairs[i].substring(pos+1); 
		// Store as a propert
		value = value.replace("+"," ");
		args[argname] = unescape(value); 
	}
	return args; // Return the Object
}



function setDefaults(theForm) {

// Get Any arguments which are passed via the QueryString
var elArr = theForm.elements;
var Querystring = getArgs();

// Loop through all controls that are on the form
	for(var i = 0; i < elArr.length; i++) {
		with(elArr[i]) {
      
    		var dvid = -1
			var testobj = defaultvalues

				if (testobj != undefined) {
					dvid = getsubarrpos(defaultvalues,elArr[i].getAttribute('wizdefault'))
				};
	
				if (dvid >= 0 ) {
					var newvalue = defaultvalues[dvid].split("|")[1]
					SetControlValue(elArr[i],newvalue);
				}
				else {
					
					try{
					var AddDays = elArr[i].getAttribute('AddDays');

						if (AddDays != null){
							 elArr[i].setAttribute("value", SetDays(AddDays))
						};
						
					} catch(e){};		
				
					var v = elArr[i].getAttribute('wizdefault');

					if (v == '.') {
						v = elArr[i].id;
					}; 
        		
        			if(!v) continue;
						var newvalue ;
						var value ;
						newvalue = unescape(gwc(v));
						newvalue = newvalue.replace("+"," ");
						
						if (newvalue == undefined) {
							newvalue = '';};
						
						if (Querystring[elArr[i].getAttribute('wizdefault')]) {
							var newvalue = Querystring[elArr[i].getAttribute('wizdefault')];
						}
						
						if (newvalue == undefined || newvalue == "undefined") {
							newvalue = '';};
							
						{
						if (newvalue != "") {	
						//alert(elArr[i].id + newvalue);	
							SetControlValue(elArr[i],newvalue);
						};
							};
						};
           }
        }
    }
    
    function isChecked(name)
{
	return(document.getElementById(name).checked);	
}

function setFontWeight(name, value)
{
	document.getElementById(name).style.fontWeight = value;
}

function setInnerHTML(name, value)
{
	document.getElementById(name).innerHTML = value;
}

function setChecked(name)
{
try{
	document.getElementById(name).checked = true;
}
catch (e) {};
}

function setDisplay(name, value)
{
	document.getElementById(name).style.display = value;
}

function setDisabled(name, value)
{
	document.getElementById(name).disabled = value;
}

function setValue(name, value)
{
	document.getElementById(name).value = value;
}

function getValue(name)
{
	return document.getElementById(name).value;
}

function getFocus(name)
{
	return document.getElementById(name).focus();
}

function getOptions(name)
{
	return document.getElementById(name).options;
}

function getSelIndex(name)
{
	return document.getElementById(name).selectedIndex;
}

function getElt(name)
{
	return document.getElementById(name);
}

function addOption(o, text, value)
{
	o[o.length] = new Option(text)
	o[o.length - 1].value = value;
}

function disableRadioButtons(form, groupName, value)
{
	for(i=0; i<form.elements.length; i++)
	{
		if (form.elements[i].name == groupName)
			form.elements[i].disabled = value;
	}
}

function trim(str)
{
   return str.replace(/^\s*|\s*$/g,"");
}

function getDateInt(inDate)
{
	index1 = inDate.indexOf(".");
	index2 = inDate.lastIndexOf(".");
	if (index1 >= 0 && index2 >= 0)
	{
		var year = inDate.substring(index2 + 1, inDate.length);
		var month;
		if (index1 == index2)
		{
			today = new Date();
			year = today.getYear();
			if (year < 2000)
				year = 1900 + year;
			month = inDate.substring(index1 + 1, inDate.length) - 1;
		}
		else
			month = inDate.substring(index1 + 1, index2) - 1;
		if (year.length == 2)
			year = "20" + year;
		var tempDate = new Date(year, month, inDate.substring(0, index1));
		var retDate = new Date(2000,01,01);
		if (isNaN(tempDate.getTime()))
			return retDate.getTime();
			
		else
			return tempDate.getTime();
	}
	else
		return 0;
}

function getTimeInt(time)
{
	var timeInt = time.options[time.selectedIndex].innerHTML;
	timeInt = parseInt(timeInt.replace(/:00/gi, ''));
	timeInt = timeInt * 60 * 60 * 1000;
	return timeInt;
}

function addDays(date, days)
{
	d = new Date(date.getTime() + 86400000 * days);
	return d;	
}

function formatDate(date)
{
	year = date.getYear()
	if (year < 2000)
		year = 1900 + year;
	return date.getDate() + "." + (date.getMonth() + 1) + "." + year;
}

function getMonthName(i)
{
	months = ['janvier', 'f&eacute;vrier', 'mars', 'avril', 'mai', 'juin', 'juillet', "ao&ucirc;t", 'septembre', 'octobre', 'novembre', 'd&eacute;cembre'];
	return months[i];
}

function selectDDValue(dd,value)
{
var current = 0;
var i = 0;
	for(i=0; i<dd.options.length; i++)
	{
		if (dd.options[i].value == value ) {
			current = i;
			dd.options[current].selected = true;}
		else
		{
			var Innertext = dd.options[i].text.toString();
			var Tempval = value.toString();
			try{
				if (Innertext == Tempval) {
					current = i;
					if (dd.options[current].selected != true) {
					dd.options[current].selected = true;
					return "false";
					}
					else
					{
					return "true";
					}
					}}
			catch(e) {}
		}
	}


}

function formatStringAsDate(string)
{
	temp = new Date(getDateInt(string));
	return temp.getDate() + " " + getMonthName(temp.getMonth());
}

// removes trailing spaces and anything within parentheses from input string
function stripInput(input)
{
	index = input.indexOf("(");
	if (index != -1)
		input = input.substring(0, index - 1);
	return trim(input);
}

// Returns text from within parentheses in inputted string
function getParenthText(input)
{
	rules = "";
	index1 = input.indexOf("(");
	if (index1 != -1)
	{
		index2 = input.indexOf(")");
		if (index2 != -1)
			rules = input.substring(index1 + 1, index2);
	}
	return rules;
}

function TransferValue(source,target)
{
		try
		{
		TransferControlValue(source,target);
		//	target.value=source.value;
		}
		catch(e){}
}

function CompareValue(source,target,type)
{
var sourcedate =  getDateInt(source.value)
var targetdate  =  getDateInt(target.value)
d = new Date();
if( sourcedate<d.getTime() ){source.value = formatDate(d);};
try
{
		
switch(type)
{
case "GreaterThan":

if( sourcedate<targetdate ) {
source.value=target.value;
};

break;

case "LessThan":
if (sourcedate>targetdate) {source.value=target.value;};
break;

case "CanNotBeLessThan":
if( sourcedate>targetdate ) {target.value=source.value;
target.onchange();
};

break;
default:
// Do Nothing
}		
		}
		catch(e){}
}


function SetControlValue(Control,newvalue)
{
var ty = Control.type;


if (newvalue == undefined) {
	newvalue = '';};

if ( newvalue != "" ) { 
switch(ty)
					{
						case "text":

						Control.setAttribute("value", newvalue)
						try {
						//elArr[i].onchange();
						}
						catch (e) {};
						break;
						
						case "hidden":
						Control.setAttribute("value", newvalue)
						try {
						//elArr[i].onchange();
						}
						catch (e) {};
						break;
						
						case "select-one":
							newvalue = unescape(newvalue);
							//alert(newvalue);
											
						selectDDValue(Control,newvalue)
						try {
						
						Control.onchange();
						
						return false;
						}
						catch (e) {};
					
					
						break;
						
					
						case "radio":
						if (newvalue == Control.value) {Control.checked = true;
	
						try {
						Control.onclick();}
						catch (e) {};
						};
						break;
						
						case "checkbox":
						//elArr[i].checked = true;
						//workinghere
						
						var valuearr = newvalue.split(",");
						if (valuearr.length > -1) {
						if (getarrpos(valuearr, Control.getAttribute("value")) > -1) {Control.checked = true;};
						}
						else {Control.checked = true;};
					
						try {
						Control.onchange();
						return false;
						}
						catch (e) {};
						break;
						default:
						// Do Nothing
}		
}
}

function TransferControlValue(Control1,Control2)
{
var ty = Control2.type;
var newvalue = Control1.value;

switch(ty)
					{
						case "text":

						Control2.setAttribute("value", newvalue)
						try {
						//elArr[i].onchange();
						}
						catch (e) {};
						break;
						
						case "hidden":
						Control2.setAttribute("value", newvalue)
						try {
						//elArr[i].onchange();
						}
						catch (e) {};
						break;
						
						case "select-one":
						
					if ( Control1.value == Control2.value ) {
					}else{
					try {

						selectDDValue(Control2,newvalue)
						Control2.onchange();
						
						}
						catch (e) {};
					}
					
						break;
						
					
						case "radio":
						if (newvalue == Control2.value) {Control2.checked = true;
	
						try {
						Control2.onclick();}
						catch (e) {};
						};
						break;
						
						case "checkbox":
						//elArr[i].checked = true;
						//workinghere
						
						var valuearr = newvalue.split(",");
						if (valuearr.length > -1) {
						if (getarrpos(valuearr, Control2.getAttribute("value")) > -1) {Control2.checked = true;};
						}
						else {Control2.checked = true;};
					
						try {
						Control2.onchange();}
						catch (e) {};
						break;
						default:
						// Do Nothing
}		
}

function ClearDDValue(Control)
{
var ty = Control.type;
 if (ty == "select-one") {
 var defaultindex;
defaultindex = 0;
	for (var i=0;i<Control.options.length;i++) { 
		if (Control.options[i].defaultSelected) { 
				defaultindex = i; 
			} 
		else { 
				
			} 
	} 
 Control.selectedIndex = defaultindex;
 try {
	Control.onchange();
	}
catch (e) {};
 };

}

function WizOBOffers(ob, wiz) {
try {
if (obHeight != wiz.clientHeight - 1 || (obHeight) > wiz.clientHeight - 1 )
{
obHeight = wiz.clientHeight - 1;


var _offersheight = 0;

var _boximage = document.getElementById("WizObPic");
if (_boximage != null) {

_offersheight = 74;
};

for(var i = 1; i < 20; i++) {
try{
var offer = document.getElementById("WizObOffer" + i);
var offerdiv = document.getElementById("div_WizObOffer" + i);
 offer.style.display='inline';
 offer.style.visibility='visible';
 

var offerHeight = 0;
if (offer.clientHeight != 0) {
offerHeight = offer.clientHeight
} else {
offerHeight = offerdiv.clientHeight;
};

if ((_offersheight + offerHeight + 10) < obHeight) {
_offersheight += offerHeight;
} else {
offer.style.display='none';
offer.style.visibility='hidden';
};


//try{
		var nextoffer = document.getElementById("WizObOffer" + (i + 1));
		if (nextoffer == null) {

			
			if (((_offersheight) < obHeight) && ((_offersheight + 50) > obHeight)) 
				{
				ob.style.height = obHeight;
//
				}
			else
			{
				ob.style.height = _offersheight;
					obHeight = _offersheight;
		};
	//	
		 } ;


	//} catch (e) {};
}catch(e) {};




};

};
} catch (e) {} ;
}


function transferSearchdata(tarr,loc)
{
var advancedloc = loc + "&";
var Arr = tarr.split("|");
for(var i = 0; i < Arr.length; i++) {
try {
var curcontrol = document.getElementById(Arr[i]);

advancedloc += curcontrol.getAttribute('wizdefault') + "=" + curcontrol.value + "&" ;

} catch(e) {};




}
//alert(advancedloc);
document.location = advancedloc;
}


/*Disable_Box*/


function lsetup_handler(e)
{
	lsetup(this);
	return true;
}

function lsetup(target)
{
	try {
		if (!target)
			target = this;

		var o_set = target.document.getElementById('loaderContainerWH');
		var o_getH = target.document.getElementsByTagName('BODY')[0];

		o_set.style.height = o_getH.scrollHeight;
	} catch (e) {
	}
}

function lon(target)
{
	try {
		if (parent.visibilityToolbar)
			parent.visibilityToolbar.set_display("standbyDisplayNoControls");
	} catch (e) {}

	try {
		if (!target)
			target = this;

		lsetup(target);

		if (!target._lon_disabled_arr)
			target._lon_disabled_arr = new Array();
		else if (target._lon_disabled_arr.length > 0)
			return true;

		target.document.getElementById("loaderContainer").style.display = "";
		var select_arr = target.document.getElementsByTagName("select");

		for (var i = 0; i < select_arr.length; i++) {
			if (select_arr[i].disabled)
				continue;

			select_arr[i].disabled = true;
			_lon_disabled_arr.pop(select_arr[i]);
			var clone = target.document.createElement("input");
			clone.type = "hidden";
			clone.name = select_arr[i].name;
			var values = new Array();
			for (var n = 0; n < select_arr[i].length; n++) {
				if (select_arr[i][n].selected) {
					values[values.length] = select_arr[i][n].value;
				}
			}
			clone.value = values.join(",");
			select_arr[i].parentNode.insertBefore(clone, select_arr[i]);
		}
	} catch (e) {
		return false;
	}
	return true;
}

function loff(target)
{
	try {
		if (parent.visibilityToolbar) {
			parent.visibilityToolbar.set_display(visibilityCount
												 ? "standbyDisplay"
												 : "standbyDisplayNoControls");
		}
	} catch (e) {}

	try {
		if (!target)
			target = this;

		target.document.getElementById("loaderContainer").style.display = "none";

		if (target._lon_disabled_arr) {
			while(_lon_disabled_arr.legth > 0) {
				var select = _lon_disabled_arr.push();
				select.disabled = false;

				var clones_arr = target.document.getElementsByName(select.name);
				for (var n = 0; n < clones_arr.length; n++) {
					if ("hidden" == clones_arr[n].type)
						clones_arr[n].parent.removeChild(clones_arr[n]);
				}
			}
		}
	} catch (e) {
		return false;
	}
	return true;
}

function lsubmit(f)
{
	try {
		if (f.lock.value == "true")
			return false;
		f.lock.value = "true";
	} catch (e) {
	}

	lon();

	try {
		f.submit(f);
	} catch (e) {
		return false;
	}
	return true;
}

//Animated Collapsible DIV- Author: Dynamic Drive (http://www.dynamicdrive.com)
//Last updated Aug 1st, 07'. Fixed bug with "block" parameter not working when persist is enabled
//Updated June 27th, 07'. Added ability for a DIV to be initially expanded.

var uniquepageid=window.location.href.replace("http://"+window.location.hostname, "").replace(/^\//, "") //get current page path and name, used to uniquely identify this page for persistence feature
var lastDiv = '';
function animatedcollapse(divId, animatetime, persistexpand, initstate){
	this.divId=divId
	this.divObj=document.getElementById(divId)
	this.divObj.style.overflow="hidden"
	this.timelength=animatetime
	this.initstate=(typeof initstate!="undefined" && initstate=="block")? "block" : "contract"
	this.isExpanded=animatedcollapse.getCookie(uniquepageid+"-"+divId) //"yes" or "no", based on cookie value
	this.contentheight=parseInt(this.divObj.style.height)
	var thisobj=this
	if (isNaN(this.contentheight)){ //if no CSS "height" attribute explicitly defined, get DIV's height on window.load
		animatedcollapse.dotask(window, function(){thisobj._getheight(persistexpand)}, "load")
		if (!persistexpand && this.initstate=="contract" || persistexpand && this.isExpanded!="yes" && this.isExpanded!="") //Hide DIV (unless div should be expanded by default, OR persistence is enabled and this DIV should be expanded)
			this.divObj.style.visibility="hidden" //hide content (versus collapse) until we can get its height
	}
	else if (!persistexpand && this.initstate=="contract" || persistexpand && this.isExpanded!="yes" && this.isExpanded!="") //Hide DIV (unless div should be expanded by default, OR persistence is enabled and this DIV should be expanded)
		this.divObj.style.height=0 //just collapse content if CSS "height" attribute available
	if (persistexpand)
		animatedcollapse.dotask(window, function(){animatedcollapse.setCookie(uniquepageid+"-"+thisobj.divId, thisobj.isExpanded)}, "unload")
}

animatedcollapse.prototype._getheight=function(persistexpand){
	this.contentheight=this.divObj.offsetHeight
	if (!persistexpand && this.initstate=="contract" || persistexpand && this.isExpanded!="yes"){ //Hide DIV (unless div should be expanded by default, OR persistence is enabled and this DIV should be expanded)
		this.divObj.style.height=0 //collapse content
		this.divObj.style.visibility="visible"
	}
	else //else if persistence is enabled AND this content should be expanded, define its CSS height value so slideup() has something to work with
		this.divObj.style.height=this.contentheight+"px"
}


animatedcollapse.prototype._slideengine=function(direction){
	var elapsed=new Date().getTime()-this.startTime //get time animation has run
	var thisobj=this
	if (elapsed<this.timelength){ //if time run is less than specified length
		var distancepercent=(direction=="down")? animatedcollapse.curveincrement(elapsed/this.timelength) : 1-animatedcollapse.curveincrement(elapsed/this.timelength)
	this.divObj.style.height=distancepercent * this.contentheight +"px"
	this.runtimer=setTimeout(function(){thisobj._slideengine(direction)}, 10)
	}
	else{ //if animation finished
		this.divObj.style.height=(direction=="down")? this.contentheight+"px" : 0
		this.isExpanded=(direction=="down")? "yes" : "no" //remember whether content is expanded or not
		this.runtimer=null
	}
}


animatedcollapse.prototype.slidedown=function(){
	if (typeof this.runtimer=="undefined" || this.runtimer==null){ //if animation isn't already running or has stopped running
		if (isNaN(this.contentheight)) //if content height not available yet (until window.onload)
			alert("Please wait until document has fully loaded then click again")
		else if (parseInt(this.divObj.style.height)==0){ //if content is collapsed
			this.startTime=new Date().getTime() //Set animation start time
			this._slideengine("down")
		}
	}
}

animatedcollapse.prototype.slideup=function(){
	if (typeof this.runtimer=="undefined" || this.runtimer==null){ //if animation isn't already running or has stopped running
		if (isNaN(this.contentheight)) //if content height not available yet (until window.onload)
			alert("Please wait until document has fully loaded then click again")
		else if (parseInt(this.divObj.style.height)==this.contentheight){ //if content is expanded
			this.startTime=new Date().getTime()
			this._slideengine("up")
		}
	}
}

animatedcollapse.prototype.slideit=function(){
	if (isNaN(this.contentheight)) //if content height not available yet (until window.onload)
		alert("Please wait until document has fully loaded then click again")
	else if (parseInt(this.divObj.style.height)==0)
		this.slidedown()
	else if (parseInt(this.divObj.style.height)==this.contentheight)
		this.slideup()
}

// -------------------------------------------------------------------
// A few utility functions below:
// -------------------------------------------------------------------

animatedcollapse.curveincrement=function(percent){
	return (1-Math.cos(percent*Math.PI)) / 2 //return cos curve based value from a percentage input
}


animatedcollapse.dotask=function(target, functionref, tasktype){ //assign a function to execute to an event handler (ie: onunload)
	var tasktype=(window.addEventListener)? tasktype : "on"+tasktype
	if (target.addEventListener)
		target.addEventListener(tasktype, functionref, false)
	else if (target.attachEvent)
		target.attachEvent(tasktype, functionref)
}

animatedcollapse.getCookie=function(Name){ 
	var re=new RegExp(Name+"=[^;]+", "i"); //construct RE to search for target name/value pair
	if (document.cookie.match(re)) //if cookie found
		return document.cookie.match(re)[0].split("=")[1] //return its value
	return ""
}

animatedcollapse.setCookie=function(name, value){
		document.cookie = name+"="+value
}



//function slideOne(div) {
//if (lastDiv != div && lastDiv !='') {
//	collapse2.slideup();
//var name = 'collapse2';
//	if(lastDiv == 'cat1') collapse1.slideup(); collapse2.slideup();collapse3.slideup();
//	if(lastDiv == 'cat2')  collapse1.slideup(); collapse2.slideup();collapse3.slideup();
//	if(lastDiv == 'cat3')  collapse1.slideup(); collapse2.slideup();collapse3.slideup();
//	lastDiv = div;
	//} else {	lastDiv = div;}
//name.slideit();
//if(div == 'cat2') collapse2.slidedown();
//if(div == 'cat3') collapse3.slidedown();

//}
/*------- ENDE----Animated Collapsible DIV----*/
//MM_reloadPage(true);


