var HotORNot = {

	setImage : function(src)
	{
		$('hotornot_preview').src = src;
		$('image').value = src;
	},
	
	showMsg : function(msg)
	{
			 $('msg').setStyle({display : 'block'});
			 $('msg').innerHTML = msg;
	},
	
	updateWidth : function(position)
	{
		var width = $('border' + position + 'Width').value;
		var style = $('border' + position + 'Style').value;
		var color = $('border' + position + 'Color').value;
		var newstyle = width + 'px ' + style + ' ' + color;
		
		switch ( position )
		{
			case 'Top' :
				$('preview').style.borderTop = newstyle;
			break;
			
			case 'Right' :
				$('preview').style.borderRight = newstyle;
			break;
			
			case 'Bottom' :
				$('preview').style.borderBottom = newstyle;
			break;
			
			case 'Left' :
				$('preview').style.borderLeft = newstyle;
			break;
			
		}
				
	},
	
	updateTitle : function(el)
	{

		var title = this.trim($F(el));
		
		if ( title == '' )
			title = 'Title';
		
		$('Title').update(title);
		
	},
	
	updateTitleColor : function(el)
	{
	
		var textcolor = $F(el);
		$('Title', 'score1', 'score2', 'score3', 'score4', 'score5', 'score6', 'score7', 'score8', 'score9', 'score10', 'resultColor').each(function(elId){elId.setStyle({color : textcolor})});		
		
	},
	
	updateTextColor : function(el)
	{
		
		var textcolor = $F(el);
		$(el + 'Preview').setStyle({color : textcolor});
		
	},
	
	updateBGColor : function(el)
	{
	
		var bgcolor = $F(el);
		$('preview').setStyle({backgroundColor : bgcolor});
		
	},
	
	trim : function(stringToTrim) 
	{
		
		return stringToTrim.replace(/^\s+|\s+$/g, "");
		
	}
	
}