// IMAGE REPLACE FUER Landingpages


function URLEncode(s) {
     if (window.encodeURIComponent) {
        return encodeURIComponent(s);
     }
     else if (window.escape) {
        return escape(s); 
     }
     return s;
}

actualHoteltype

function replaceHeading(htmltag) {
	
	return false;
	for(var i = 0; i < document.getElementsByTagName(htmltag).length; i++) 
	{
		doit = false;
		myValue = document.getElementsByTagName(htmltag)[i].innerHTML;
		if (myValue != undefined) 
		{
			positiony = '';
			positionx = '';
			
			myObj = document.getElementsByTagName(htmltag)[i];
			myParent = myObj.parentNode;
			myClassname = "";
			myClassname = myObj.className;
			
			bgcolor = 'e5ecf3';
			
			if(htmltag == "em")
			{
					
					width = 240;
					height = 14;
					color = '00498d';
					font = 'StonedSansITCStd-Medium.ttf';
					//font = 'TheSans-B6SemiBold.ttf';
					size = '10.5';
					doit = true;
					myValue = myValue.toUpperCase();
					bgcolor = 'ffffff';
			}
		
			if(htmltag == "h2")
			{
					
					width = 465;
					height = '';
					font = 'StonedInfITCStd-Medium.ttf';
					size = '8.8';
					doit = true;
					color = '999999';
					
					if(actualHoteltype == "wellness")
					{
						bgcolor = 'd2f1ee';
					}
					else if(actualHoteltype == "family")
					{
						bgcolor = 'fff2e0';
					}
					else if(actualHoteltype == "city")
					{
						bgcolor = 'ffe1e3';
					}
			}
			
			if(htmltag == "h3")
			{
				if(myClassname == "download")
				{
					width = 465;
					height = '';
					font = 'StonedSansITCStd-Medium.ttf';
					size = '9.8';
					doit = true;
					myValue = myValue.toUpperCase();
					
					if(actualHoteltype == "wellness")
					{
						color = '05b1a3';
						bgcolor = 'd2f1ee';
					}
					else if(actualHoteltype == "family")
					{
						color = 'f89200';
						bgcolor = 'fff2e0';
					}
					else if(actualHoteltype == "city")
					{
						color = 'bf000e';
						bgcolor = 'ffe1e3';
					}
				}
			}
			
			if(htmltag == "h1")
			{
				if(myClassname == "img")
				{	
					width = 285;
					height = '';
					font = 'StonedInfITCStd-Medium.ttf';
					size = '12.8';
					color = '00498d';
					bgcolor = 'e5ecf3';
					doit = true;
				}
				else if(myClassname == "hotel")
				{
					width = 465;
					height = '';
					font = 'StonedInfITCStd-Medium.ttf';
					size = '12.8';
					doit = true;
					
					if(actualHoteltype == "wellness")
					{
						color = '05b1a3';
						bgcolor = 'd2f1ee';
					}
					else if(actualHoteltype == "family")
					{
						color = 'f89200';
						bgcolor = 'fff2e0';
					}
					else if(actualHoteltype == "city")
					{
						color = 'bf000e';
						bgcolor = 'ffe1e3';
					}
					
				}
				else if(myClassname == "standard")
				{
					width = 780;
					height = '';
					font = 'StonedInfITCStd-Medium.ttf';
					size = '12.8';
					doit = true;
					
					if(actualHoteltype == "wellness")
					{
						color = '05b1a3';
						bgcolor = 'd2f1ee';
					}
					else if(actualHoteltype == "family")
					{
						color = 'f89200';
						bgcolor = 'fff2e0';
					}
					else if(actualHoteltype == "city")
					{
						color = 'bf000e';
						bgcolor = 'ffe1e3';
					}
					else if(actualHoteltype == "standard")
					{
						color = '00498d';
						bgcolor = 'e5ecf3';
					}
					
				}
			
			}
			
			
			
			if(doit == true)
			{
				//alert("DO IT");
				myValue = URLEncode(myValue);			
				
				replaceDiv = document.createElement('img');
				replaceDiv.src = '/extensions/php_to_img/output.php?text=' + myValue + '&width=' + width + '&height=' + height + '&color=' + color + '&font=' + font + '&size=' + size + '&bgcolor=' + bgcolor + '&positiony=' + positiony + '&positionx=' + positionx;
				replaceDiv.className = htmltag;
				myParent.replaceChild(replaceDiv, myObj);

				i--;
			}			
		}	
	}	
}


/*replaceHeading("em");*/
replaceHeading("h3");
replaceHeading("h2");
replaceHeading("h1");