/* 1b test template
 * requires:
 * jquery.js
 * player_test_template.js
 * iliustraData.js
 */

console.log('> template1b.js is iniciated;');

function template1bscript() {
	console.log("function template1bscript(); sectionName=" +sectionName + "; slideName=" +slideName);
	
	tObj = getObject();
    
        var mainVars = initMainVars(tObj,sectionName,slideName);
	var tO = mainVars.tO;     
        
       tO = randomizeAnswers(tO);        
       var items = tO['items'];       
        
       var check_type = 0;          
        
	// count items
	var itemsCount = tO['items_count']; 	console.log('items count: ' +itemsCount);
	       
        if (tO['background']) {
		loadSlideBackground();
	}
        
	var p = {	// properties
		step : 160,		// it is a step for each text, radio, checkbox, check items
		check :{
			top  : 184,
			unchecked		: 'img/check.png',
			checked			: 'img/check_true.png',
			checked_false	: 'img/check_false.png',
			unchecked_false	: 'img/check_false_2.png',
			css  : {
				"position":"absolute",
				'width':'28px',
				'height':'28px',
				'left' : '595px',
				"cursor": "pointer",
				"z-index": "10",
				"background":"url(img/check.png) no-repeat 0px 0px"
			}
		},
		radio :{
			top  : 184,
			unchecked		: 'img/radio.png',
			checked			: 'img/radio_true.png',
			checked_false	: 'img/radio_false.png',
			unchecked_false	: 'img/radio_false_2.png',
			css :{
				"position":"absolute",
				'width':'35px',
				'height':'35px',
				'left' : '595px',
				"cursor": "pointer",
				"z-index": "10",
				"background":"url(img/radio.png) no-repeat 0px 0px"
			}
		},
		photo:{
			css	:{
				"position":"absolute",
				'width'	:'505px',
				'height':'500px',
				'top'	: '187px',
				'left' 	: '60px',
				"z-index": "7"
			}
		},
		text:{
			top  : 185,
			css	:{
				"position":"absolute",
				'width':'476px',
				'height':'133px',
				'left' : '655px',
				"z-index": "7",
				'text-indent':'0px',
				'font-family':'Arial',
				'font-size': '24px',
				'text-align':'left',
				'line-height': '33px'
			}
		}
	}	
	
	p.step = 490/itemsCount;
	
	var zIndexChange=20;
	
	var text_top = 185;
	
	//  get true - correct ; or falls - incorrect
	this.checkAnswer = checkTestAnswer;
	// check buttton and function to check
	checkTestButton(this.checkAnswer,tO,p);

	appendQuestion(ssId, ss, tO);
	
	check_type = check_check_or_radio(tO,p,check_type);
	
	append_photo(tO.photo,p);
	
	append_items(items,p,1,ss,ssId,check_type);
}

