/****************************************
|
| Entrepreneur London
| Created by: Kevin Biskaborn
| Copyright 2010 ScriptReaction
| http://www.scriptreaction.com
|
****************************************/

var s0 = {
	count: 3,
	active: 0,
	activated: false,
	ov: function ( id ){
		this.actions.doOver( id );
	},
	ou: function ( id ){
		this.actions.doOut( id );
	},
	ck: function ( id ){
		this.actions.doClick( id );
	},
	get: {
		checkboxFromId: function ( id ){
			return document.getElementById( "ckbx_" + id );
		},
		selectBtnFromId: function ( id ){
			return document.getElementById( "btn_" + id );
		},
		reflectFromId: function ( id ){
			return document.getElementById( "rflt_" + id );
		}
	},
	actions: {
		launch: function ( id ){
			s0.ck( id );
		},
		doOver: function ( id ){
			if(id != s0.active){
				//set checkbox appearance
				s0.get.checkboxFromId( id ).style.backgroundPosition = "0 -41px";
			}			
		},
		doOut: function ( id ){
			if(id != s0.active){
				//set checkbox appearance
				s0.get.checkboxFromId( id ).style.backgroundPosition = "0 0";
				s0.get.checkboxFromId( id ).style.cursor = "";
			}
		},
		doReset: function (){
			s0.active = 0;
			for(i = 1; i <= s0.count; i++){
				this.doOut( i );
				this.doUnclick( i );	
			}
		},
		doUnclick: function ( id ){
			//show the select button (use inline instead of block - IE7)
			s0.get.selectBtnFromId( id ).style.display = "inline";
			//hide the reflection
			s0.get.reflectFromId( id ).style.display = "none";
		},
		doClick: function ( id ){
			if(id != s0.active){
				this.doReset();
				//set checkbox appearance
				s0.get.checkboxFromId( id ).style.backgroundPosition = "0 -82px";
				s0.get.checkboxFromId( id ).style.cursor = "default";
				//hide the select button
				s0.get.selectBtnFromId( id ).style.display = "none";
				//show the reflection
				s0.get.reflectFromId( id ).style.display = "block";
				if(!s0.activated){
					//enable next button
					document.dataForm.btn_next.disabled = false;
					document.getElementById( "btn_next" ).style.color = "#000000";
					//show focus arrows
					document.getElementById( "focus_next" ).style.visibility = "visible";
					s0.activated = true;
				}
				//register the selection
				this.doRegister( id );
				//the active selection
				s0.active = id;
			}
		},
		doRegister: function ( id ){
			//var dataOutput = new Array( "planning", "startup", "growing", "matured" );
			document.dataForm.response.value = id; //dataOutput[ id - 1 ];
		}
	}
}




