//===============================================================================
//
// Ajax functions
//
function qdates(showid){
	new Ajax.Updater('eolts_ajax_dates', 'encore_V3_ajax.php',   
		{     
			method: 'get', 
			parameters: {action:'qdates', showid:showid, qdtype:$F('qdtype')}
		});
}
function lhsdates(arg){
	id=$F('showid');
	id=id.substring(0,1);
	if(id=="-"){
		document.frmSelectTicket.qdtype[0].checked = true;
		document.frmSelectTicket.qdtype[1].disabled = true;
	}else{
		document.frmSelectTicket.qdtype[1].disabled = false;
	}
	new Ajax.Updater('eolts_ajax_lhsdates', 'encore_V3_ajax.php',   
		{     
			method: 'get', 
			parameters: {action:'lhsdates', showid:$F('showid'), qdtype:$F('qdtype')}
		});
}
//===============================================================================
//
// WebCredible functions
//
function eolts_createHover(){
	
	if ($$('div.eolts-box-whatson')){ 

		divShow = $$('div.eolts-box-whatson');  
		$(divShow).each(function(div){ 
				
			div.observe('mouseover', this.eolts_respondToOver);
			div.observe('mouseout', this.eolts_respondToOut);
		});
	} 
}
function eolts_respondToOver(){
	this.addClassName('eolts-over') 
	
}
function eolts_respondToOut(){
	this.removeClassName('eolts-over') 
}
function eolts_createShadow(selectCol){
	$$(selectCol).each(function(img){ 
		var storeMargin = new Array();

		storeMargin[0] = $(img).getStyle('margin-top');
		storeMargin[1] = $(img).getStyle('margin-right');
		storeMargin[2] = $(img).getStyle('margin-bottom');
		storeMargin[3] = $(img).getStyle('margin-left');
		
		$(img).setStyle({margin: '0'});
		$(img).wrap('div', { 'class': 'eolts-shadowContainer', 'style': 'height:' + $(img).getHeight() +'px' + ';min-height:' + $(img).getHeight() +'px' + ';width:' + $(img).getWidth() +'px' + ';margin-top:' + storeMargin[0] + ';margin-right:' + storeMargin[1] + ';margin-bottom:' + storeMargin[2] + ';margin-left:' + storeMargin[3]});
	});
}
function eolts_balanceLeftRightCol(){
	try
	{
		
		// this is the non homepage
		if($$('.eolts-noLHC') != ""){
			if($('eolts-content').getHeight()){
				if($('eolts-content').getHeight() > $('eolts-rhc').getHeight()){
					$('eolts-rhc').setStyle({height: $('eolts-content').getHeight() + 'px'});
				}	
			}	
		}else{
		// every other page
			if($('eolts-lhc').getHeight()){
				if($('eolts-lhc').getHeight() > $('eolts-rhc').getHeight()){
					$('eolts-rhc').setStyle({height: $('eolts-lhc').getHeight() + 'px'});
					$('eolts-lhc').setStyle({height: $('eolts-lhc').getHeight() + 'px'});
				}else{
					$('eolts-lhc').setStyle({height: $('eolts-rhc').getHeight() + 'px'});
					$('eolts-rhc').setStyle({height: $('eolts-rhc').getHeight() + 'px'});
				}
			}
		}
	}
	catch(err)
	{
	
	}
	
	
	
}
eolts_init = function (){ 
	eolts_createHover();
	eolts_createShadow("img.shadow");
	eolts_balanceLeftRightCol();
} 
Event.observe(window, 'load', eolts_init, false); 
