﻿var bibScript = 
{

GenerateColors: function(div,theLabel)
{
     var divColors = document.getElementById(div);  
     var strColors;
     var lbl;
     lbl = theLabel;
     
     var arrColors = new Array('00','33','66','99','CC','FF');
     
     strColors = "<table>";
     
     
   for (var set1 = 0; set1 < 6; set1++ ) 
	{
	 
	     strColors = strColors + "<tr>" ;
	  
	    for (var set2 = 0; set2 < 6 ; set2++ ) 
	        {
	
			    for (var set3 = 0 ; set3 < 6; set3++)
			        {
		
		 		strColors = strColors + '<td id="#' + arrColors[set1] + arrColors[set2] + arrColors[set3] + '" onmouseover="bibScript.ChangeColor(this,\'' + lbl + '\')"  onclick="bibScript.ChangeColor(this,\'' + lbl + '\')"  width="20" height="20" bgcolor="#' + arrColors[set1] + arrColors[set2] + arrColors[set3] + '"   > </td>'
		 		    }
	        }
	
        strColors = strColors + '</tr>';
 
 
	}
		
		strColors = strColors + "</table>"
		divColors.innerHTML = strColors;
		
},

copyText: function(textbox,thelbl)
{ 
       var lbl = document.getElementById(thelbl);
        lbl.innerHTML = document.getElementById(textbox).value.replace(/\n/g, '<br>');
        
},

ChangeColor: function(colorID,lbl,h)
{ 
        document.getElementById(h).value = colorID.id;
        document.getElementById(lbl).style.color = colorID.id;
}, 

ChangeFontSize: function(lbl,ddl,h)
{
  
    
    var lbl = document.getElementById(lbl);
    var ddl = document.getElementById(ddl);
    document.getElementById(h).value = ddl.innerHTML + "px";
    var lbl2 = document.getElementById(ddl);
    lbl.style.fontSize = ddl.innerHTML + "px";
   
   
    //lbl.style.fontSize = ddl.options[ddl.selectedIndex].value;
}, 

ChangeFontFamily: function(lbl,ddl)
{
    var lbl = document.getElementById(lbl);
    var ddl = document.getElementById(ddl);
    lbl.style.fontFamily = ddl.options[ddl.selectedIndex].value
},

ChangeFontStyle: function(lbl,ddl)
{
   var lbl = document.getElementById(lbl);
   var ddl = document.getElementById(ddl);
  
  
    
  if (ddl.options[ddl.selectedIndex].value == "bold")
      {
           
       
          lbl.style.fontWeight = "bold";
        
          lbl.style.fontStyle = "normal";
      
      }else if (ddl.options[ddl.selectedIndex].value != "bold"){
          
         
          lbl.style.fontWeight = "normal";
          
         
          lbl.style.fontStyle = ddl.options[ddl.selectedIndex].value;
  
  }
  
  
}



 
};