Common.Object.extend(
	Common.Dom,
	{
		setOpacity : function(oElement, iValue) {
			oElement.style.opacity = iValue;
			oElement.style.filter = 'alpha(opacity=' + Math.round(iValue * 100) + ')';
		}
	}
);


var eBody, eContent, eHeader;

function main(){
	eBody = document.getElementsByTagName( 'body' )[0];
	eBody.className += '';
	eContent = document.getElementById( 'content' );

	var aeInput = document.getElementsByTagName( 'input' );
	for( var i = 0 ; i < aeInput.length ; i++ ){
		if( aeInput[i].getAttribute( 'placeholder' ) ){
			placeholder( aeInput[i], aeInput[i].getAttribute( 'placeholder' ), 'empty' );
		}
	}

	makeTableRowsHiglightableInMSIE();
}

function placeholder( eThis, sText, sClass_on_empty ){
	eThis.onfocus = function(){ if( eThis.value.length && eThis.value == sText ){ eThis.value = ''; } Common.Class.remove( this, sClass_on_empty ); eThis.select(); document.getElementsByTagName( 'body' )[0].className += ''; }
	eThis.onblur = function(){ if( !this.value.length ){ Common.Class.add( this, sClass_on_empty ); this.value = sText; document.getElementsByTagName( 'body' )[0].className += ''; } }
	if( !eThis.value.length ){ eThis.onblur(); }
	if( !eThis.getAttribute( 'placeholder' ) ){ eThis.setAttribute( 'placeholder', sText ); }
}


function makeTableRowsHiglightableInMSIE() {
	if (document.all && !window.opera) {
		var aTables = Common.Dom.getElementsByClassName(document, 'data', 'table');
		if(aTables.length > 0) {
			for(var i = 0, iLength = aTables.length, oTable; i < iLength; i++) {
				oTable = aTables[i];
				var aRows = oTable.getElementsByTagName('tr');
				if(aRows.length > 0) {
					for(var j = 0, jLength = aRows.length, oRow; j < jLength; j++) {
						oRow = aRows[j];
						oRow.onmouseover = function() { Common.Class.add(this, 'hover'); }
						oRow.onmouseout = function() { Common.Class.remove(this, 'hover'); }
					}
				}
			}
		}
	}
}