/*Hide/Display Terms & Conditions on galacasinos*/


var hideTC = new function() {
	this.itemsByClass = new Array;
	this.contentObj = null;
	this.state = 0;
	var this_ = this;
	
	this.triggerState = function(evt) {
		if (evt == 0) {
			this_.state = 1;
		}
		if (this_.state == 1) {
			this_.itemsByClass['arrow'].style.backgroundPosition = 'left top';
			this_.itemsByClass['tcHeader'].innerHTML = 'Show Terms and Conditions';
			this_.contentObj.style.display = 'none';
			this_.state = 0;
		}
		else {
			this_.itemsByClass['arrow'].style.backgroundPosition = 'left bottom';
			this_.itemsByClass['tcHeader'].innerHTML = 'Hide Terms and Conditions';
			this_.contentObj.style.display = 'block';
			this_.state = 1;
		}
	}
	
	this.init = function() {
		this_.contentObj = document.getElementById('termsCondContent');
		var tcButton = document.getElementById('tcButton');
		if (tcButton) {
			tcButton.style.cursor = 'pointer';
			tcButton.onclick = this_.triggerState;
			var buttonItems = tcButton.getElementsByTagName("span");
			for (var i=0; i<buttonItems.length; i++) {
				this_.itemsByClass[buttonItems[i].className] = buttonItems[i];
			}
			this_.triggerState(0);
		}
	}

	this.addEventSimple = function(obj, type, fn) {
		if (obj.addEventListener)
			obj.addEventListener( type, fn, false );
		else if (obj.attachEvent) {
			obj['e'+type+fn] = fn;
			obj[type+fn] = function() {
						obj['e'+type+fn]( window.event );
							 }
			obj.attachEvent( 'on'+type, obj[type+fn] );
		}
	}
	
	this.addEventSimple(window,"load",this.init);
}