function IntvalMsg(id,text){
	var id;
	var text ;
	document.getElementById(id).value=text;
	document.getElementById(id).disabled = true ;
	
}

function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=450,height=300,left = 490,top = 175');");
}

function confirmation($message,$url) {
	var answer = confirm($message)
	if (answer){
		parent.window.location = $url;
	}
	
}


function VisibleNotes ($id,$tr,$val){
	
	var $id ;
	var $tr ;
	document.getElementById($id).style.display = 'block';
	document.getElementById($id).style.visibility = 'visible';
	//document.getElementById($tr).bgColor='#D94600';
	document.getElementById('note_book_id').value = $val ;
	document.getElementById('notes').value = '' ;
	
	}

function CloseNotes ($id){
	
	var $id ;
	var $tr ;
	document.getElementById($id).style.display = 'none';
	document.getElementById($id).style.visibility = 'hidden';
	//document.getElementById($tr).bgColor='#D94600';
	
	}
	
	function ViewNotes($note,$id,$val){
	var $id ;
	var $tr ;
	
	document.getElementById($id).style.display = 'block';
	document.getElementById($id).style.visibility = 'visible';
	document.getElementById('notes').value = $note ;
	document.getElementById('note_book_id').value = $val ;
	}
	
	function delete_doc(holder){
		document.getElementById(holder).style.display = 'block';
		document.getElementById(holder).style.visibility = 'visible';
		
	}
	
		function delete_doc_Hide(holder){
			
		document.getElementById(holder).style.display = 'none';
		document.getElementById(holder).style.visibility = 'hidden';
		
	}
	
var valid_extensions = /(.jpg|.jpeg|.rtf|.RTF|.DOC|.doc|.DOCX|.docx|.xls|.XLS|.xlsx|.XLSX|.pdf|.PDF|.PNG|.png|.rar|.RAR|.zip|.ZIP)$/i;
function ValidateFileTypes(fld)
{
if (valid_extensions.test(fld.value)) return true;
alert('You have selected invalid file type.');
fld.value = '';
fld.select();
fld.focus();
return false;
}



var arrayOfRolloverClasses = new Array();
	var arrayOfClickClasses = new Array();
	var activeRow = false;
	var activeRowClickArray = new Array();
	
	function highlightTableRow()
	{
		var tableObj = this.parentNode;
		if(tableObj.tagName!='TABLE')tableObj = tableObj.parentNode;

		if(this!=activeRow){
			this.setAttribute('origCl',this.className);
			this.origCl = this.className;
		}
		this.className = arrayOfRolloverClasses[tableObj.id];
		
		activeRow = this;
		
	}
	
	function clickOnTableRow()
	{
		var tableObj = this.parentNode;
		if(tableObj.tagName!='TABLE')tableObj = tableObj.parentNode;		
		
		if(activeRowClickArray[tableObj.id] && this!=activeRowClickArray[tableObj.id]){
			activeRowClickArray[tableObj.id].className='';
		}
		this.className = arrayOfClickClasses[tableObj.id];
		
		activeRowClickArray[tableObj.id] = this;
				
	}
	
	function resetRowStyle()
	{
		var tableObj = this.parentNode;
		if(tableObj.tagName!='TABLE')tableObj = tableObj.parentNode;

		if(activeRowClickArray[tableObj.id] && this==activeRowClickArray[tableObj.id]){
			this.className = arrayOfClickClasses[tableObj.id];
			return;	
		}
		
		var origCl = this.getAttribute('origCl');
		if(!origCl)origCl = this.origCl;
		this.className=origCl;
		
	}
		
	function addTableRolloverEffect(tableId,whichClass,whichClassOnClick)
	{
		arrayOfRolloverClasses[tableId] = whichClass;
		arrayOfClickClasses[tableId] = whichClassOnClick;
		
		var tableObj = document.getElementById(tableId);
		var tBody = tableObj.getElementsByTagName('TBODY');
		if(tBody){
			var rows = tBody[0].getElementsByTagName('TR');
		}else{
			var rows = tableObj.getElementsByTagName('TR');
		}
		for(var no=0;no<rows.length;no++){
			rows[no].onmouseover = highlightTableRow;
			rows[no].onmouseout = resetRowStyle;
			
			if(whichClassOnClick){
				rows[no].onclick = clickOnTableRow;	
			}
		}
		
	}
