<! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01//en" "HTTP://WWW.W3.ORG/TR/HTML4/STRICT.DTD" >
<title>30 Days of Moo-day 1</title>
<link rel=stylesheet href= "css/main.css" type= "Text/css" media=screen>
<script src= "Js/mootools1.2.js" type= "Text/javascript" ></script>
<script type= "Text/javascript" >
function Editcolor ()
{
var o = new Object ();
O.oldcolor = "";//Save the old color every time
O.curcolor = "#FF0000";//Default color
O.setbackcolor = function (event) {//Set color
O.cobj = Event.target;
O.cstyle = O.cobj.get ("type");
if (o.cstyle!= "checkbox" && o.cstyle!= "Radio" && o.cstyle!= "button") {
O.oldcolor = O.cobj.getstyle ("Background-color");
O.cobj.setstyle ("Background-color", O.curcolor);
}
};
O.backbackcolor = function (event) {//return original color
O.cobj = Event.target;
O.cstyle = O.cobj.get ("type");
if (o.cstyle!= "checkbox" && o.cstyle!= "Radio" && o.cstyle!= "button") {
O.cobj.setstyle ("Background-color", O.oldcolor);
}
};
O.setcurcolor = function (Paramcolor) {//Set new color
O.curcolor = Paramcolor;
};
O.fullobjes = $$ ("input");
O.fullarea = $$ ("textarea");
O.fullobjes.combine (O.fullarea);
O.fullobjes.addevent ("Focus", o.setbackcolor);
O.fullobjes.addevent ("Blur", O.backbackcolor);
return o;
};
Window.addevent (' Domready ', function () {
var col = new Editcolor ();
Col.setcurcolor ("#003990");
});
Window.addevent (' Domready ', function () {
alert ();
});
</script>
<body>
<input type= "Checkbox"/><br>
<input type= "Radio"/><br>
<textarea ></textarea><br>
<input id= "Me" style= "Background:yellow"/><br>
<textarea ></textarea><br>
<input id= "Nettween_set" type= "button" value= "buttons"/>
</body>