// CONFIG
var iframecom_cookie_domain = ".urlaubstours.de";

// Cookie-Objekte erzeugen
var Cookie_ScrollTop        = new Cookie("iframecom_scroll_top");
var Cookie_IFrameHeight     = new Cookie("iframecom_height");

// MAIN FUNCTION
function iframecom_main(follow_call)
{
	if ((typeof follow_call == 'undefined') || !follow_call)
	{
		setInterval("iframecom_main(1)", 1000);
	}
	else
	{
		iframecom_scroll_top();
		iframecom_resize();
//		iframecom_urchin_tracking();
	}
}

// USER FUNCTIONS
function iframecom_scroll_top()
{
	var CookieContent = Cookie_ScrollTop.Get();

	if ((CookieContent != null) && (CookieContent == "TRUE"))
	{
		// zur linken oberen Ecke des Anzeigefensters scrollen
		window.scrollTo(0, 0);

		//
		Cookie_ScrollTop.Set("FALSE", 0, "/", iframecom_cookie_domain, 0);
	}
}

function iframecom_resize(PassedHeight)
{
	var IFrameMainDiv = document.getElementById("IFrameMainDiv");
	var IFrameDiv     = document.getElementById("IFrameDiv");

	if (!IFrameMainDiv || !IFrameDiv)
		return false;

	if (PassedHeight)
	{
		IFrameMainDiv.style.height = "" + PassedHeight + "px";
		IFrameDiv.style.height     = IFrameMainDiv.style.height;
	}
	else
	{
		var CookieContent = Cookie_IFrameHeight.Get();

		if (CookieContent == null)
			return false;

		var NewHeight = parseInt(CookieContent);

		if (isNaN(NewHeight))
			return false;

		if (NewHeight < 800)
			NewHeight = 800;

		IFrameMainDiv.style.height = "" + (NewHeight + 50) + "px";
		IFrameDiv.style.height     = IFrameMainDiv.style.height;

//		Cookie_IFrameHeight.Set("", 0, "/", iframecom_cookie_domain, 0);
	}

	return true;
}

/*
function iframecom_urchin_tracking()
{
	var urchin_schritt = iframecom_get_cookie("iframecom_urchin_schritt");
	if (!urchin_schritt)
		return false;

	iframecom_set_cookie("iframecom_urchin_schritt","",0,'/',iframecom_cookie_domain,0);

	if (window.urchinTracker) {
		window.urchinTracker('/vidado_ibe_' + urchin_schritt + '.html');
	}

	if (window.reload_werbebanner_iframe) {
		window.reload_werbebanner_iframe();
	}
}
*/

