document.write(
	'<style type="text/css">' +
		'body { background:#fff; }' +
	'</style>'
);

document.write('<script type="text/javascript" src="http://www.salzburg.info/static/js/lib/xpath.js"></script>');

document.write(
	'<script type="text/javascript">' +
	'var _gaq = _gaq || [];' + 
	"_gaq.push(['_setAccount', 'UA-217410-19']);" +
	"_gaq.push(['_trackPageview']);" +
	'(function() {' +
	"var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;" +
	"ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';" +
	"var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);" +
	'})();' +
	'</script>'
);


var initGoogleAnalytics = window.setInterval("setupGoogleAnalytics()", 2500);

function setupGoogleAnalytics () {

	clearInterval(initGoogleAnalytics);

	// resize image at package detail
	try {
		if(location.href.indexOf("book_packagestep3") >= 0) {
			var images = document.getElementsByTagName("img");
			for(var i=0; i<images.length; i++) {
				if(images[i].getAttribute("src").indexOf("ImageID") >= 0) {
					images[i].setAttribute("width", 1);
					
					var imageUrl = images[i].getAttribute("src");
					
					// remove node
					var imageTable = images[i].parentNode.parentNode.parentNode.parentNode.parentNode.parentNode;
					var containerTable = imageTable.parentNode;
					containerTable.removeChild(imageTable);
					
					var newImage = document.createElement("img");
					newImage.src = imageUrl;
					newImage.width = 340;
					
					
					containerTable.getElementsByTagName("td")[1].appendChild(newImage);
					
					break;
				}
			}
		}
	}
	catch(err) { }
	
	var title = document.evaluate('/html/body/table/tbody/tr/td/table/tbody/tr[5]/td/table/tbody/tr/td/table/tbody/tr/td/strong', document, null, 7, null);
	if (title != null) {
		var h_title = title.snapshotItem(0);
	}
	
	var inr = document.evaluate('/html/body/table/tbody/tr/td/table/tbody/tr[3]/td/table/tbody/tr/td', document, null, 7, null);
	if (inr != null) {
		var h_inr = inr.snapshotItem(0);
		var identnr = h_inr.innerHTML.match(/(\d+)/)[0];
	}
	
	var price = document.evaluate('/html/body/table/tbody/tr/td/table/tbody/tr[10]/td/table/tbody/tr/td/table/tbody/tr/td[2]/strong[2]', document, null, 7, null);
	if (price != null) {
		var h_price = price.snapshotItem(0);	
	}
	
	try {
		if (identnr != null) {			
			_gaq.push(['_addTrans',
				identnr,
				'Salzburg.info Feratel',
				h_price.innerHTML,
				'',
				'',
				'',
				'',
				''
			]);
			_gaq.push(['_addItem',
				identnr,
				identnr,
				h_title.innerHTML,
				'Hotel',
				h_price.innerHTML,
				'1'
			]);
			_gaq.push(['_trackTrans']);
		}
	}
	catch(err) { }
	
}

//window.onload = onWindowLoad;




