

var  SetDefaultValue =  function  (id, value) {
    var f = document.getElementById(id);
    var value = value;
    if (f)  {
	if (f.value == '') f.value = value;
	AddEvent (f,
		{
		    focus: function()
			{if (f.value==value)f.value='';
		    },
		    blur: function(){
			if (f.value=='')f.value=value;
		    }
	    });
    }
 }



function AddEvent (node, arEvents) {
    if (node) {
	if (node.addEventListener) {
	    for (x in arEvents) {
		node.addEventListener(x, 
		    arEvents[x],false);
	    }
	}
	else if (node.attachEvent) {
	    for (x in arEvents) {
		node.attachEvent('on' + x, arEvents.x,false);
	    }
	}
    }
}

