/*
#################################################
# --------------- ISR Helpers ------------------#
#################################################
#												#
# Javascript Methods based on Prototype			#
# Framework for the								#
# INTERSPORT RENT International 				#
# booking application							#
#											  	#
#################################################
#												#
# Last modified by Bernhard Rusch				#
# Date: 22 - 08 - 2006							#
# Version: 0.1									#
#												#
# (c) 2006 elements.at New Media Solutions GmbH #
#												#
#################################################

*/

var helper = Class.create();
helper.prototype = {
	
	initialize: function()
	{
		//alert("initialize");
		/*if (navigator.appVersion.indexOf('MSIE')>0)
		{
			alert("Try Firefox ;)");
			window.location.href = "http://www.mozilla.com";
		}*/
	},
	
	getByNameOverId: function (id,name)
	{
		//alert(id);
		vars = document.getElementById(id).getElementsByTagName(name);
		return vars;
	},
	
	/*****************************************************
	* adjustContainerHeight is a hack for IE6 to raise the
	* height of the parent container on short pages. This
	* solves a probelm with the autocompletion box
	*/
    adjustContainerHeight: function(container,height)
    {
		if (navigator.appVersion.indexOf('MSIE')>0)
		{
			px = "";
			if(parseInt(height).length >= 1)
			{
				px = "px";
			}
			Element.setStyle(container,{height: height + px});
			// document.getElementById(container).style.height = height + px;
		}
    },
	
	getScrollPosition : function ()
	{
		// Return the actual Scroll Position, needed by Lightbox
		if (self.pageYOffset) // all except Explorer
		{
			x = self.pageXOffset;
			y = self.pageYOffset;
		}
		else if (document.documentElement && document.documentElement.scrollTop)
			// Explorer 6 Strict
		{
			x = document.documentElement.scrollLeft;
			y = document.documentElement.scrollTop;
		}
		else if (document.body) // all other Explorers
		{
			x = document.body.scrollLeft;
			y = document.body.scrollTop;
		}
		
		coordinates = new Array;
		coordinates[0] = x;
		coordinates[1] = y;
		return coordinates;
	},
	
	dontHideLightbox : function ()
	{
		lightboxactive = true; 
	},
	
	allowLightbox : function ()
	{
		lightboxactive = false;
	}
}

var helper = new helper;
