/*
#################################################
# --------------- ISR Step One -----------------#
#################################################
#												#
# 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 isrStepTwo = Class.create();
isrStepTwo.prototype = {

	
	initialize: function()
	{
		//alert("initialize");
	},
	
	maintabbing: function (showTab,showLink)
	{
		//alert(test);
		var tabs = new Array();
		tabs[0] = "product_select_by_category";
		tabs[1] = "product_select_by_product";
		
		// Set the Contents in the Tabs display:none
		for(i=0;i<tabs.length;i++)
		{
			Element.setStyle(tabs[i],{display:'none'});
		}
		
		// Set the Tabs display:none
		links = helper.getByNameOverId("iic_tbw_navigation","a");
		
		for(i=0;i<links.length;i++)
		{
			links[i].className = "";
		}
		
		showLink.className = "active";
		Element.setStyle(showTab,{display:'block'});
		
		// set the actual position in the tabs
		stepTwoPosition = showTab;
		
	},
	
	showDetails : function (id)
	{
		if(document.layers) document.captureEvents(Event.MOUSEMOVE);
		document.onmousemove =	isrStepTwo.getMousePosition;
		
		document.getElementById('tooltipp_content').innerHTML = document.getElementById('detail_' + id).innerHTML;
		isrStepTwo.showOverlay();
	}, 
	
	hideDetails : function ()
	{
		isrStepTwo.hideOverlay();
		overlayShown = false;
	},
	
	showOverlay : function ()
	{
		if (overlayShown == false)
		{
			Element.setStyle('tooltipp',{display:'block'});
			Element.setStyle('tooltipp',{position:'absolute'});
			Element.setStyle('tooltipp',{marginLeft:'20px'});
			Element.setStyle('tooltipp',{marginTop:'-10px'});
			Element.setStyle('tooltipp',{zIndex:'99999'});
			overlayShown = true;
		}	
	}, 
	
	hideOverlay : function ()
	{
		Element.setStyle('tooltipp',{display:'none'});
	},
	
	getMousePosition : function (e) 
	{
		// Returns the actual Position of the cursor
		var docEl = (
             typeof document.compatMode != "undefined" && 
             document.compatMode        != "BackCompat"
            )? "documentElement" : "body";
		
		var xPos    =  e? e.pageX : window.event.clientX;
		var yPos    =  e? e.pageY : window.event.clientY;
	
		if (document.all && !document.captureEvents) {
			xPos    += document[docEl].scrollLeft;
			yPos    += document[docEl].scrollTop;
		}
		
		Element.setStyle('tooltipp',{left: xPos+'px'});
		Element.setStyle('tooltipp',{top: yPos+'px'});	
		
		if (document.layers) routeEvent(e);
	},
	
	showPersonNameForm : function ()
	{
		common.showLightbox(false,620,210);
		lightboxactive = true;
	},
	
	hidePersonNameForm : function ()
	{
		lightboxactive = false;
		common.hideLightbox();
	},
	
	showErrorBox : function ()
	{
		// Show errors in the lightbox
		common.showLightbox(false,250,140);
		lightboxactive = true;
		setTimeout("isrStepTwo.hideErrorBox()",5000);
	},
	
	hideErrorBox : function ()
	{
		// Hide the error overlay
		lightboxactive = false;
		common.hideLightbox();
	},
	
	showAlternativeCurrency : function (id)
	{
		//alert(document.getElementById('alternativCurrency_' + id).innerHTML.length);
		contentLength = document.getElementById('alternativCurrency_' + id).innerHTML;
		contentLength = contentLength.indexOf("_alt");
		if(contentLength > 0)
		{
			Element.setStyle('price_' + id,{display:'none'});
			Element.setStyle('alternativCurrency_' + id,{display:'block'});
		}
		
	},
	
	hideAlternativeCurrency : function (id)
	{
		Element.setStyle('price_' + id,{display:'block'});
		Element.setStyle('alternativCurrency_' + id,{display:'none'});
	},
	
	updateShoppingCart : function ()
	{
		/*tds = helper.getByNameOverId('iic_shoppingcart_table','tr');
		for(i=0;i<tds.length;i++)
		{
			Element.setStyle(tds[i],{width:'100%'});
		}*/
		
	},
	
	showChooseRenterForm : function ()
	{
		common.showLightbox(false,330,150);
		lightboxactive = true;
	},
	
	hideChooseRenterForm : function ()
	{
		lightboxactive = false;
		common.hideLightbox();
	}
}


var isrStepTwo = new isrStepTwo;

