function $(id)		{return document.getElementById(id);}
function N(name)	{return document.getElementsByName(name);}


function calcul_acompte_apparte(prix_aeroport,prix_gare)
{
	if($('t2').checked)
	{
		prix_aeroport = 0;
		prix_gare = 0;	
	}
	
	if($('cgare').checked)
		$('acompte_final').innerHTML = parseInt($('tarif_appart').innerHTML) + parseInt(prix_gare);
	else
		$('acompte_final').innerHTML = parseInt($('tarif_appart').innerHTML) + parseInt(prix_aeroport);
}


function Resa(){};

function hop()
{
	alert('test');	
}

Resa.nPerson = function(n)
{
	if(n == 1)
	{
		$('n_person').innerHTML = 1;
		$('2_v').className = 'hide';	
		$('3_v').className = 'hide';	
		$('4_v').className = 'hide';
	}
	else if(n == 2)
	{	
		$('n_person').innerHTML = 2;
		$('2_v').className = 'view';	
		$('3_v').className = 'hide';	
		$('4_v').className = 'hide';	
	}
	else if(n == 3)
	{	
		$('n_person').innerHTML = 3;
		$('2_v').className = 'view';	
		$('3_v').className = 'view';	
		$('4_v').className = 'hide';	
	}
	else if(n == 4)
	{	
		$('n_person').innerHTML = 4;
		$('2_v').className = 'view';	
		$('3_v').className = 'view';	
		$('4_v').className = 'view';	
	}
	
	Resa.calculPrixForm();
}

Resa.checkInputReserve = function(id,target,mini_nuit)
{
	if(target == 'n_nuit')
	{
		if(isNaN(id.value) && id.value != '')
		{
			var MonReg = new RegExp("[^0-9]");
			var Chaine = id.value;
			var result = Chaine.replace(MonReg, "");
			if(result >= mini_nuit) $('mini_nuit').className = 'hide';
			else if(result < mini_nuit)	$('mini_nuit').className = 'view';
			if(result > 30) result = 30;
			id.value = result; 
			$('n_nuit').value=result;
			$('n_nuit2').innerHTML=result;
		}
		else if(id.value != '')
		{
			if($('n_nuit').value >= mini_nuit) $('mini_nuit').className = 'hide';
			else if($('n_nuit').value < mini_nuit)	$('mini_nuit').className = 'view';
			if(id.value > 30)id.value = 30;
			$('n_nuit').value=id.value;
			$('n_nuit2').innerHTML=id.value;
		}
		
		if($('day_arrival').value != '')
		{
		//alert($('day_arrival').value);
			var chaine = $('day_arrival').value;
			var reg=new RegExp("[/]+", "g");
			var tableau=chaine.split(reg);
			var my_time = new Array();
			for (var i=0; i<tableau.length; i++) 
				my_time[i] = tableau[i];			
			var n_nuit = $('n_nuit').value;
			if(n_nuit == '')
			{
				n_nuit = mini_nuit;
			}
			n_nuit = parseInt(n_nuit);
			
			var Date_1 = new Date(my_time[2],my_time[1],my_time[0]);
		
			time_1 = Date_1.getTime();
			time_2 = time_1 + n_nuit*24*60*60*1000;
			//$('trace_form').innerHTML = time_1+' '+time_2+' '+my_time[2]+','+my_time[1]+','+my_time[0];
			Date_1.setTime(time_2);
			
			var jour_arrive = Date_1.getDate();
			if(jour_arrive < 10) jour_arrive = '0'+jour_arrive;
			var mois_arrive = Date_1.getMonth();
			if(mois_arrive < 10) mois_arrive = '0'+mois_arrive;
			
			
			var Date_result = jour_arrive+"/"+mois_arrive+"/"+Date_1.getFullYear()
			
			$('jour_depart').innerHTML = Date_result;
			
		}
	}
}


Resa.checkInput = function(id,target)
{
	if(target == 'n_nuit')
	{
		if(isNaN(id.value) && id.value != '')
		{
			var MonReg = new RegExp("[^0-9]");
			var Chaine = id.value;
			var result = Chaine.replace(MonReg, "");
			if(result >= 4) $('mini_nuit').className = 'hide';
			else if(result < 4)	$('mini_nuit').className = 'view';
			if(result > 30) result = 30;
			id.value = result; 
			$('n_nuit').value=result;
			$('n_nuit2').innerHTML=result;
			Resa.calculPrixForm();
		}
		else if(id.value != '')
		{
			if($('n_nuit').value >= 4) $('mini_nuit').className = 'hide';
			else if($('n_nuit').value < 4)	$('mini_nuit').className = 'view';
			if(id.value > 30)id.value = 30;
			$('n_nuit').value=id.value;
			$('n_nuit2').innerHTML=id.value;
			Resa.calculPrixForm();
		}
		
		if($('day_arrival').value != '')
		{
		//alert($('day_arrival').value);
			var chaine = $('day_arrival').value;
			var reg=new RegExp("[/]+", "g");
			var tableau=chaine.split(reg);
			var my_time = new Array();
			for (var i=0; i<tableau.length; i++) 
				my_time[i] = tableau[i];			
			var n_nuit = $('n_nuit').value;
			if(n_nuit == '')
			{
				n_nuit = 4;
			}
			n_nuit = parseInt(n_nuit);
			
			var Date_1 = new Date(my_time[2],my_time[1],my_time[0]);
		
			time_1 = Date_1.getTime();
			time_2 = time_1 + n_nuit*24*60*60*1000;
			//$('trace_form').innerHTML = time_1+' '+time_2+' '+my_time[2]+','+my_time[1]+','+my_time[0];
			Date_1.setTime(time_2);
			
			var jour_arrive = Date_1.getDate();
			if(jour_arrive < 10) jour_arrive = '0'+jour_arrive;
			var mois_arrive = Date_1.getMonth();
			if(mois_arrive < 10) mois_arrive = '0'+mois_arrive;
			
			
			var Date_result = jour_arrive+"/"+mois_arrive+"/"+Date_1.getFullYear()
			
			$('jour_depart').innerHTML = Date_result;
			
		}
	}
}

Resa.calculPrixForm = function()
{
	var a = new Array();
	
	a[1] = new Array();
	a[1]['nuit'] = parseInt($('1_NUIT').value);
	a[1]['clim'] = parseInt($('1_CLIM').value);
	a[1]['tran'] = parseInt($('1_TRANSPORT').value);
	a[1]['assu'] = parseInt($('1_ASSURANCE').value);
	
	a[2] = new Array();
	a[2]['nuit'] = parseInt($('2_NUIT').value);
	a[2]['clim'] = parseInt($('2_CLIM').value);
	a[2]['tran'] = parseInt($('2_TRANSPORT').value);
	a[2]['assu'] = parseInt($('2_ASSURANCE').value);
	
	a[3] = new Array();
	a[3]['nuit'] = parseInt($('3_NUIT').value);
	a[3]['clim'] = parseInt($('3_CLIM').value);
	a[3]['tran'] = parseInt($('3_TRANSPORT').value);
	a[3]['assu'] = parseInt($('3_ASSURANCE').value);
	
	a[4] = new Array();
	a[4]['nuit'] = parseInt($('4_NUIT').value);
	a[4]['clim'] = parseInt($('4_CLIM').value);
	a[4]['tran'] = parseInt($('4_TRANSPORT').value);
	a[4]['assu'] = parseInt($('4_ASSURANCE').value);
		
	var n = parseInt($('n_person').innerHTML);
	
	if($('n_nuit').value == '')
	{
		$('n_nuit').value = 4;
	}
	
		
	$('n_nuit2').innerHTML = $('n_nuit').value;
	
	var tarif = a[n]['nuit'];
	if(parseInt($('clim').value) == 1)	tarif += a[n]['clim'];
	
	//alert($('COEFF').value+' -> '+parseFloat($('COEFF').value));
	tarif = (tarif * parseFloat($('n_nuit').value) + a[n]['tran'] + a[n]['assu'])*parseFloat($('COEFF').value);
	
	
	
	var n_nuit = $('n_nuit').value;
	
	if($('typeroom').value == 1)		tarif = Math.round(tarif*$('SUPERIEURE').value);
	
	//$('acompte_par_personne').innerHTML = parseInt(tarif*30/100);
	
	//alert('tarif base '+tarif);
	
	if(n_nuit == 6)	tarif = Math.round(tarif*0.99);	if(n_nuit == 7)	tarif = Math.round(tarif*0.985);
	if(n_nuit == 8)	tarif = Math.round(tarif*0.98);	if(n_nuit == 9)	tarif = Math.round(tarif*0.975);
	if(n_nuit == 10)tarif = Math.round(tarif*0.97);	if(n_nuit == 11)tarif = Math.round(tarif*0.965);
	if(n_nuit == 12)tarif = Math.round(tarif*0.96);	if(n_nuit == 13)tarif = Math.round(tarif*0.955);
	if(n_nuit == 14)tarif = Math.round(tarif*0.95);	if(n_nuit == 15)tarif = Math.round(tarif*0.945);
	if(n_nuit == 16)tarif = Math.round(tarif*0.94);	if(n_nuit == 17)tarif = Math.round(tarif*0.935);
	if(n_nuit == 18)tarif = Math.round(tarif*0.93);	if(n_nuit == 19)tarif = Math.round(tarif*0.925);
	if(n_nuit == 20)tarif = Math.round(tarif*0.92);	if(n_nuit == 21)tarif = Math.round(tarif*0.915);
	if(n_nuit == 22)tarif = Math.round(tarif*0.91);	if(n_nuit == 23)tarif = Math.round(tarif*0.905);
	if(n_nuit == 24)tarif = Math.round(tarif*0.90);	if(n_nuit == 25)tarif = Math.round(tarif*0.995);
	if(n_nuit == 26)tarif = Math.round(tarif*0.89);	if(n_nuit == 27)tarif = Math.round(tarif*0.885);
	if(n_nuit == 28)tarif = Math.round(tarif*0.88);	if(n_nuit == 29)tarif = Math.round(tarif*0.875);
	if(n_nuit == 30)tarif = Math.round(tarif*0.87);	
	
	//alert('tarif reduc '+tarif);
	
	
	if($('visa').value == 1)		tarif += parseFloat($('PRIX_PASSVISA').value);
	if($('demip').value == 1) 		tarif += parseFloat($('PRIX_DEMIPENSION').value) * parseFloat($('n_nuit').value);
	
	if($('temp_pack').value == 1)	tarif += parseFloat($('PRIX_PACK1').value) * parseFloat($('n_nuit').value);	 
	if($('temp_pack').value == 2)	tarif += parseFloat($('PRIX_PACK2').value) * parseFloat($('n_nuit').value);	
	
	
	tarif 		= Math.round(tarif*$('AUGM').value);
	
	
	
	$('tarif_par_personne').innerHTML = tarif;
	
	var total 	= tarif*n;
	
	
	var acompte	= parseInt(total*30/100);
	$('tarif').innerHTML 			= total;
	//$('acompte').innerHTML			= acompte;
	$('acompte_final').innerHTML 	= Math.round(total*3/parseInt($('n_nuit').value));
	//$('solde').innerHTML 			= total - acompte;
	//$('solde_personne').innerHTML 	= parseInt((total - acompte)/n);
}

function nPersonForm(id)
{
	if(isNaN(id.value))
	{
		var MonReg = new RegExp("[^0-9]");
		var Chaine = id.value;
		var result = Chaine.replace(MonReg, "");
		id.value = result; 
		$('nperson').value=result;
	}
	else
		$('nperson').value=id.value;
}

function nNuitForm(id)
{
	if(isNaN(id.value))
	{
		var MonReg = new RegExp("[^0-9]");
		var Chaine = id.value;
		var result = Chaine.replace(MonReg, "");
		id.value = result; 
		$('nnuit').value=result;
	}
	else
		$('nnuit').value=id.value;
}






function click(e) 
{
  if (navigator.appName == 'Netscape'
           && e.which == 3) {
      	alert("no right click please")
      return false;
      }
   else {
      if (navigator.appName == 'Microsoft Internet Explorer'
          && event.button==2)
         alert("no right click please")
         return false;
         }
   return true;
 }

function hide_message()
{
	$('cadre_message').className = 'hide';
}

function h_or_v(id)
{
	if($(id).className == 'hide')	$(id).className = 'view';
	else							$(id).className = 'hide';
}

function view(id)
{
	$(id).style.visibility = 'visible';
	$(id).style.display = 'block';	
}

function hide(id)
{
	$(id).style.visibility = 'hidden';
	$(id).style.display = 'none';	
}

function incFile_js(my_file,id) 
{
	var Head = document.getElementsByTagName('head')[[0]];
	
	var head_inc = document.createElement('script');
	head_inc.setAttribute('type','text/javascript');
	head_inc.setAttribute('src',my_file+'?id='+id);
	
	Head.appendChild(head_inc);
}
function rotate_weather()
{
	if($('current_cpt').innerHTML)
	{
		i = $('current_cpt').innerHTML;
		$('weather_'+i).className = 'hide';

		if(parseInt($('current_cpt').innerHTML) < cpt)
			$('current_cpt').innerHTML = parseInt($('current_cpt').innerHTML) + 1;
		else
			$('current_cpt').innerHTML = 0;
		
		i = $('current_cpt').innerHTML;
		
		$('weather_'+i).className = 'view';
		
	}

	setTimeout("rotate_weather()",5000);
}

rotate = function(nbImg)
{
	this.nbImg = parseInt(nbImg);
}

rotate.prototype.go = function()
{
	//alert(this.nbImg);
	if($('current_img').innerHTML)
	{
		
		//$('diapo').src = tImg[i];
		
		i 	= parseInt($('current_img').innerHTML);
		
		if(i < this.nbImg)
		{
			$('current_img').innerHTML = parseInt($('current_img').innerHTML) + 1;
			ii 	= parseInt(i) + 1;
		}
		else
		{
			$('current_img').innerHTML = 1;
			ii = 1;
		}
		
		

		$('mainheader_'+i).style.zIndex = 0;
		$('mainheader_text_'+i).style.zIndex = 0;
		$('mainheader_img_'+i).style.zIndex = 0;
		$('mainheader_'+ii).style.zIndex = 1;
		$('mainheader_text_'+ii).style.zIndex = 1;
		$('mainheader_img_'+ii).style.zIndex = 1;
		this.fadeOut(i,100);
		this.fadeIn(ii,0);
		//alert($('mainheader_'+i).style.filter+' '+$('mainheader_'+ii).style.filter);
		var Obj = this;
		setTimeout ( function () { Obj.go(); }, 7500);
		//alert(this+ ' | '+Obj)
		//setTimeout("Obj.go()",500);
	}
}


rotate.prototype.destroy = function()
{
	for (key in this) { this[key]=null; }
}

rotate.prototype.setOpacity = function(obj1,obj2,obj3, opacity) 
{
	//opacity = (opacity == 100)?99.999:opacity;
	  
	if(opacity >= 100)
	{
		obj1.style.filter = "";
		obj2.style.filter = "";
		obj3.style.filter = "";
	}
	else
	{
		// IE/Win
		obj1.style.filter = "alpha(opacity:"+opacity+")";
		obj2.style.filter = "alpha(opacity:"+opacity+")";
		obj3.style.filter = "alpha(opacity:"+opacity+")";
	}
		
	// Safari<1.2, Konqueror
	obj1.style.KHTMLOpacity = opacity/100;
	obj2.style.KHTMLOpacity = opacity/100;
	obj3.style.KHTMLOpacity = opacity/100;
	
	// Older Mozilla and Firefox
	obj1.style.MozOpacity = opacity/100;
	obj2.style.MozOpacity = opacity/100;
	obj3.style.MozOpacity = opacity/100;
	
	// Safari 1.2, newer Firefox and Mozilla, CSS3
	obj1.style.opacity = opacity/100;
	obj2.style.opacity = opacity/100;
	obj3.style.opacity = opacity/100;

}

rotate.prototype.fadeOut = function(objId,opacity) 
{
	if (document.getElementById) 
	{
		obj1 	= $('mainheader_'+objId);
		obj2 	= $('mainheader_text_'+objId);
		obj3 	= $('mainheader_img_'+objId);
		if (opacity >= 0) 
		{
			this.setOpacity(obj1,obj2,obj3, opacity);
			opacity -= 5;
			//window.setTimeout("fadeOut('"+objId+"',"+opacity+")", 50);
			var Obj = this;
			setTimeout ( function () { Obj.fadeOut(objId,opacity); }, 50);
		}
	}
}

rotate.prototype.fadeIn = function(objId,opacity) 
{
	if (document.getElementById) 
	{
		obj1 	= $('mainheader_'+objId);
		obj2 	= $('mainheader_text_'+objId);
		obj3 	= $('mainheader_img_'+objId);
		if (opacity <= 100) 
		{
			this.setOpacity(obj1,obj2,obj3, opacity);
			opacity += 5;
			//window.setTimeout("fadeIn('"+objId+"',"+opacity+")", 50);
			var Obj = this;
			setTimeout ( function () { Obj.fadeIn(objId,opacity); }, 50);
		}
	}
}

function rotate()
{
	//alert(nbImg);
	if($('current_img').innerHTML)
	{
		
		//$('diapo').src = tImg[i];
		
		i 	= parseInt($('current_img').innerHTML);
		
		
		if(i < nbImg)
		{
			$('current_img').innerHTML = parseInt($('current_img').innerHTML) + 1;
			ii 	= parseInt(i) + 1;
		}
		else
		{
			$('current_img').innerHTML = 1;
			ii = 1;
		}
		
		
		fadeOut(i,100);
		fadeIn(ii,0);
		//alert($('mainheader_'+i).style.filter+' '+$('mainheader_'+ii).style.filter);
		if($('isrotate').innerHTML == 0)
			setTimeout("rotate()",7500);
	}
}

function initImage() {
	  imageId = 'thephoto';
	  image = document.getElementById(imageId);
	  setOpacity(image, 0);
	  image.style.visibility = 'visible';
	  fadeIn(imageId,0);
	}

function setOpacity(obj1,obj2,obj3, opacity) 
{
	//opacity = (opacity == 100)?99.999:opacity;
	  
	//alert(opacity);
	// IE/Win
	obj1.style.filter = "alpha(opacity:"+opacity+")";
	obj2.style.filter = "alpha(opacity:"+opacity+")";
	obj3.style.filter = "alpha(opacity:"+opacity+")";
	
	// Safari<1.2, Konqueror
	obj1.style.KHTMLOpacity = opacity/100;
	obj2.style.KHTMLOpacity = opacity/100;
	obj3.style.KHTMLOpacity = opacity/100;
	
	// Older Mozilla and Firefox
	obj1.style.MozOpacity = opacity/100;
	obj2.style.MozOpacity = opacity/100;
	obj3.style.MozOpacity = opacity/100;
	
	// Safari 1.2, newer Firefox and Mozilla, CSS3
	obj1.style.opacity = opacity/100;
	obj2.style.opacity = opacity/100;
	obj3.style.opacity = opacity/100;
}
function fadeIn(objId,opacity) 
{
	if (document.getElementById) 
	{
		obj1 	= $('mainheader_'+objId);
		obj2 	= $('mainheader_text_'+objId);
		obj3 	= $('mainheader_img_'+objId);
		if (opacity <= 100) 
		{
			setOpacity(obj1,obj2,obj3, opacity);
			opacity += 5;
			window.setTimeout("fadeIn('"+objId+"',"+opacity+")", 50);
		}
	}
}
function fadeOut(objId,opacity) 
{
	if (document.getElementById) 
	{
		obj1 	= $('mainheader_'+objId);
		obj2 	= $('mainheader_text_'+objId);
		obj3 	= $('mainheader_img_'+objId);
		if (opacity >= 0) 
		{
			setOpacity(obj1,obj2,obj3, opacity);
			opacity -= 5;
			window.setTimeout("fadeOut('"+objId+"',"+opacity+")", 50);
		}
	}
}

function getDataFromForm(my_form)
{
	var my_data = '';
	var plst =  document.forms[my_form];
	for(i=0;i<=plst.length;i++)
	{
		if(plst[i] && plst[i].value)
		{
			if(plst[i].type == 'radio' && plst[i].checked == 1)
				my_data += '&'+plst[i].name +'='+UTF8eur.encode(plst[i].value);
			else if(plst[i].type == 'select-one')
				my_data += '&'+plst[i].name +'='+plst[i].options[plst[i].options.selectedIndex].value;
				//UTF8eur.encode(plst.elements[plst[i].name].options[plst.elements[plst[i].name].selectedIndex].value);
			else if(plst[i].type == 'text' || plst[i].type == 'hidden' || plst[i].type == 'textarea' || plst[i].type == 'password')
				my_data += '&'+plst[i].name +'='+UTF8eur.encode(plst[i].value);
			//else	
		}

		//alert(plst[i].type +' '+ plst[i].checked + ' '+ plst[i].value);
		//if(plst[i].name && plst[i].selectedIndex > 0)

	}
	
	return(my_data);

}



var CS = {};
CS.UploadAjax = function(){}

CS.UploadAjax.callBack = function(message,target){
    alert(message); 
    a(false, 'GET',target, '');
}






rotateh = function(nbImg,mytarget,mybanner)
{
	this.nbImg 		= parseInt(nbImg);
	this.mytarget 	= mytarget;
	this.mybanner 	= mybanner;
}

rotateh.prototype.go = function()
{
	if($(this.mytarget).innerHTML)
	{		
		i 	= parseInt($(this.mytarget).innerHTML);
		
		if(i < this.nbImg)
		{
			$(this.mytarget).innerHTML = parseInt($(this.mytarget).innerHTML) + 1;
			ii 	= parseInt(i) + 1;
		}
		else
		{
			$(this.mytarget).innerHTML = 1;
			ii = 1;
		}
		
		
		$(this.mybanner+'_'+i).style.zIndex = 0;
		$(this.mybanner+'_'+ii).style.zIndex = 1;
		this.fadeOut(i,100);
		this.fadeIn(ii,0);
		var Obj = this;
		setTimeout ( function () { Obj.go(); }, 7500);
	}
}


rotateh.prototype.destroy = function()
{
	for (key in this) { this[key]=null; }
}

rotateh.prototype.setOpacity = function(obj1, opacity) 
{
	if(opacity >= 100)
	{
		obj1.style.filter = "";
	}
	else
	{
		// IE/Win
		obj1.style.filter = "alpha(opacity:"+opacity+")";
	}
		
	// Safari<1.2, Konqueror
	obj1.style.KHTMLOpacity = opacity/100;
	
	// Older Mozilla and Firefox
	obj1.style.MozOpacity = opacity/100;
	
	// Safari 1.2, newer Firefox and Mozilla, CSS3
	obj1.style.opacity = opacity/100;

}

rotateh.prototype.fadeOut = function(objId,opacity) 
{
	if (document.getElementById) 
	{
		obj1 	= $(this.mybanner+'_'+objId);
		if (opacity >= 0) 
		{
			this.setOpacity(obj1, opacity);
			opacity -= 5;
			var Obj = this;
			setTimeout ( function () { Obj.fadeOut(objId,opacity); }, 50);
		}
	}
}

rotateh.prototype.fadeIn = function(objId,opacity) 
{
	if (document.getElementById) 
	{
		obj1 	= $(this.mybanner+'_'+objId);
		if (opacity <= 100) 
		{
			this.setOpacity(obj1, opacity);
			opacity += 5;
			//window.setTimeout("fadeIn('"+objId+"',"+opacity+")", 50);
			var Obj = this;
			setTimeout ( function () { Obj.fadeIn(objId,opacity); }, 50);
		}
	}
}







rotateb = function(nbImg,mytarget,mybanner)
{
	this.nbImg 		= parseInt(nbImg);
	this.mytarget 	= mytarget;
	this.mybanner 	= mybanner;
}

rotateb.prototype.go = function()
{
	//alert(this.nbImg);
	if($(this.mytarget).innerHTML)
	{
		
		//$('diapo').src = tImg[i];
		
		i 	= parseInt($(this.mytarget).innerHTML);
		
		if(i < this.nbImg)
		{
			$(this.mytarget).innerHTML = parseInt($(this.mytarget).innerHTML) + 1;
			ii 	= parseInt(i) + 1;
		}
		else
		{
			$(this.mytarget).innerHTML = 1;
			ii = 1;
		}
		
		
		$(this.mybanner+'_'+i).style.zIndex = 0;
//		$('mainheader_text_'+i).style.zIndex = 0;
//		$('mainheader_img_'+i).style.zIndex = 0;
		$(this.mybanner+'_'+ii).style.zIndex = 1;
//		$('mainheader_text_'+ii).style.zIndex = 1;
//		$('mainheader_img_'+ii).style.zIndex = 1;
		this.fadeOut(i,100);
		this.fadeIn(ii,0);
		//alert($('mainheader_'+i).style.filter+' '+$('mainheader_'+ii).style.filter);
		var Obj = this;
		setTimeout ( function () { Obj.go(); }, 7500);
		//alert(this+ ' | '+Obj)
		//setTimeout("Obj.go()",500);
	}
}


rotateb.prototype.destroy = function()
{
	for (key in this) { this[key]=null; }
}

rotateb.prototype.setOpacity = function(obj1, opacity) 
{
	//opacity = (opacity == 100)?99.999:opacity;
	  
	if(opacity >= 100)
	{
		obj1.style.filter = "";
	}
	else
	{
		// IE/Win
		obj1.style.filter = "alpha(opacity:"+opacity+")";
	}
		
	// Safari<1.2, Konqueror
	obj1.style.KHTMLOpacity = opacity/100;
	
	// Older Mozilla and Firefox
	obj1.style.MozOpacity = opacity/100;
	
	// Safari 1.2, newer Firefox and Mozilla, CSS3
	obj1.style.opacity = opacity/100;

}

rotateb.prototype.fadeOut = function(objId,opacity) 
{
	if (document.getElementById) 
	{
		obj1 	= $(this.mybanner+'_'+objId);
		//obj2 	= $('mainheader_text_'+objId);
		//obj3 	= $('mainheader_img_'+objId);
		if (opacity >= 0) 
		{
			this.setOpacity(obj1, opacity);
			opacity -= 5;
			//window.setTimeout("fadeOut('"+objId+"',"+opacity+")", 50);
			var Obj = this;
			setTimeout ( function () { Obj.fadeOut(objId,opacity); }, 50);
		}
	}
}

rotateb.prototype.fadeIn = function(objId,opacity) 
{
	if (document.getElementById) 
	{
		obj1 	= $(this.mybanner+'_'+objId);
		//obj2 	= $('mainheader_text_'+objId);
		//obj3 	= $('mainheader_img_'+objId);
		if (opacity <= 100) 
		{
			this.setOpacity(obj1, opacity);
			opacity += 5;
			//window.setTimeout("fadeIn('"+objId+"',"+opacity+")", 50);
			var Obj = this;
			setTimeout ( function () { Obj.fadeIn(objId,opacity); }, 50);
		}
	}
}




var UTF8eur = {
 
	// public method for url encoding
	encode : function (string) {
		return escape(this._utf8_encode(string));
	},
 
	// public method for url decoding
	decode : function (string) {
		return this._utf8_decode(unescape(string));
	},
 
	// private method for UTF-8 encoding
	_utf8_encode : function (string) {
		string = string.replace(/\r\n/g,"\n");
		var utftext = "";
 
		for (var n = 0; n < string.length; n++) {
 
			var c = string.charCodeAt(n);
 
			if (c < 128) {
				utftext += String.fromCharCode(c);
			}
			else if((c > 127) && (c < 2048)) {
				utftext += String.fromCharCode((c >> 6) | 192);
				utftext += String.fromCharCode((c & 63) | 128);
			}
			else {
				utftext += String.fromCharCode((c >> 12) | 224);
				utftext += String.fromCharCode(((c >> 6) & 63) | 128);
				utftext += String.fromCharCode((c & 63) | 128);
			}
 
		}
 
		return utftext;
	},
 
	// private method for UTF-8 decoding
	_utf8_decode : function (utftext) {
		var string = "";
		var i = 0;
		var c = c1 = c2 = 0;
 
		while ( i < utftext.length ) {
 
			c = utftext.charCodeAt(i);
 
			if (c < 128) {
				string += String.fromCharCode(c);
				i++;
			}
			else if((c > 191) && (c < 224)) {
				c2 = utftext.charCodeAt(i+1);
				string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));
				i += 2;
			}
			else {
				c2 = utftext.charCodeAt(i+1);
				c3 = utftext.charCodeAt(i+2);
				string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));
				i += 3;
			}
 
		}
 
		return string;
	}
 
}
