


Screen = function(result, index, width, height){
	
	//dimensione 
	this.screenW = width;
	this.screenH = height;
	
	this.element;
	this.background;
	this.descr;
	this.display;

	this.build = function(){
		
		var winW = document.documentElement.clientWidth;	
		var winH = document.documentElement.clientHeight;
		//coefficiente da modificare per eliminare l'effetto di spostamento verticale
		//degli schermi (se lo scorrimento e' verso il basso aumentare il valore)
		var coeff = -13;
		
		this.element = document.createElement("DIV");	
		this.background = document.createElement("DIV");
		this.descr = new Description(result);
		this.display = new Display(result.url, index, this.screenW, this.screenH);
				
		/*if(browser == "Explorer")	this.element.setAttribute("className","screen"); 
		else*/	
		this.element.setAttribute("class","screen"); 
		
		this.element.setAttribute("id","screen"+index);
		this.element.style.width = this.screenW +"px";
		this.element.style.height = this.screenH - 17 + "px";		
		this.element.style.top = - index * (this.screenH + coeff)  + "px";
		this.element.style.left = - index * winW + "px";
		
		//BACKGROUND
		/*if(browser == "Explorer")	this.background.setAttribute("className","background");	
		else*/ 
		this.background.setAttribute("class","background"); 
		this.background.style.width = this.screenW + "px";
		this.background.style.height = this.screenH + "px";
		
		this.element.appendChild(this.background);	
		
		this.descr.build();
		this.background.appendChild(this.descr.element);	
		this.display.build();

	}
	
	this.turnOn = function(){
		
		this.background.appendChild(this.display.element);
		
		if(!this.display.validate){

		    this.display.iframe.setAttribute("src","http://sbrows.com/info3.html")
		    this.display.turnOn();
		
		}
	    				
	}
	
	this.turnOff = function(){
		//if(this.background != null)
		this.background.removeChild(this.display.element);
	    
	}
		
}
