	function nemd(){
		window.open();
		window.setInterval();
		window.setInterval(abc,1000);
	}
	
	//----------------------- highlight Row ------------
	var oldRowColor="#FFFFFF";
	var newRowColor="#EEEEDD";
	var tmpRowClass='TableRowNormal';
	
	function HighlightRow(myRow){
	//	oldRowColor = document.getElementById(myRow).getAttribute('bgcolor');
	//	document.getElementById(myRow).setAttribute('bgcolor',newRowColor,0);
	    tmpRowClass = document.getElementById(myRow).className;
	//	if(tmpRowClass == 'TableRowNormal'){
            document.getElementById(myRow).className = 'TableRowHover';
    //    }else{
    //        document.getElementById(myRow).className = 'TableRowNormal';
    //    }
	}
	function DelightRow(myRow){
	//	document.getElementById(myRow).setAttribute('bgcolor',oldRowColor,0);
	//	document.getElementById(myRow).className = 'TableRowNormal';
	    document.getElementById(myRow).className = tmpRowClass;
	}
	
	function getX(event) {
		x=event.clientX;
	
	  return x;
	}
	function getY(event) {
	  y=event.clientY;
	  r=window.pageYOffset || document.body.scrollTop || document.documentElement.scrollTop;
	  y=y+r;
	  return y;
	}
	
	function SetIndexVisibility(strObjectID){
		if(document.getElementById(strObjectID)){
			if(document.getElementById(strObjectID).style.display == 'none'){
				document.getElementById(strObjectID).style.display = 'block';
				if(document.getElementById('img'+ strObjectID)){
					document.getElementById('img'+ strObjectID).src = '../images/common/book_open.gif';
				}
			}else{
				document.getElementById(strObjectID).style.display = 'none';
				if(document.getElementById('img'+ strObjectID)){
					document.getElementById('img'+ strObjectID).src = '../images/common/book_close.gif';
				}
			}
		}
	}
//-------TEXT AREA & BB Functions -------
    function insertAtCaret(areaId,textS,textE) {
        var txtarea   = document.getElementById(areaId); 
        var scrollPos = txtarea.scrollTop; 
        var strPos    = 0; 
        var br        = ((txtarea.selectionStart || txtarea.selectionStart == '0') ? "ff" : (document.selection ? "ie" : false ) );
        var seltext; 
            seltext = (txtarea.value).substring(txtarea.selectionStart,txtarea.selectionEnd); 
        
        if (br == "ie") { 
            txtarea.focus(); 
            var range     = document.selection.createRange(); 
            range.moveStart ('character', -txtarea.value.length); 
            strPos        = range.text.length; 
        } 
        else if (br == "ff") strPos = txtarea.selectionStart; 
        
        if (seltext == '') {
            text      = textS + textE;
            var front     = (txtarea.value).substring(0,strPos); 
            var back      = (txtarea.value).substring(strPos,txtarea.value.length); 
            txtarea.value = front  + text + back; 
            strPos        = strPos + text.length;

        }else{ 
            text      = textS + seltext + textE;
            var front     = (txtarea.value).substring(0,strPos); 
            var back      = (txtarea.value).substring((strPos + seltext.length),txtarea.value.length); 
            txtarea.value = front  + text + back; 
            strPos        = strPos + text.length;            
        } 
        
        if (br == "ie") { 
            txtarea.focus(); 
            var range = document.selection.createRange(); 
            range.moveStart ('character', -txtarea.value.length); 
            range.moveStart ('character', strPos); 
            range.moveEnd   ('character', 0); range.select(); 
        }else if (br == "ff") { 
            txtarea.selectionStart = strPos; 
            txtarea.selectionEnd   = strPos; 
            txtarea.focus(); 
        }
        txtarea.scrollTop = scrollPos;

    } 
	
	function showFormatBar(textBoxName){
		document.writeln("<INPUT type=\"button\" style=\"cursor:hand\" value=\"Quote\"   onclick=\"javascript:insertAtCaret(\'"+textBoxName+"\',\'[quote]\',\'[/quote]\');\" >");
		document.writeln("<INPUT type=\"button\" style=\"cursor:hand\" value=\"P\"       onclick=\"javascript:insertAtCaret(\'"+textBoxName+"\',\'[p]\',\'[/p]\');\" >");
		document.writeln("<INPUT type=\"button\" style=\"cursor:hand\" value=\"B\"       onclick=\"javascript:insertAtCaret(\'"+textBoxName+"\',\'[b]\',\'[/b]\');\" >");
		document.writeln("<INPUT type=\"button\" style=\"cursor:hand\" value=\"U\"       onclick=\"javascript:insertAtCaret(\'"+textBoxName+"\',\'[u]\',\'[/u]\');\" >");
		document.writeln("<INPUT type=\"button\" style=\"cursor:hand\" value=\"I\"       onclick=\"javascript:insertAtCaret(\'"+textBoxName+"\',\'[i]\',\'[/i]\');\" >");
		document.writeln("<INPUT type=\"button\" style=\"cursor:hand\" value=\"LI\"       onclick=\"javascript:insertAtCaret(\'"+textBoxName+"\',\'[li]\',\'[/li]\');\" >");
		document.writeln("<INPUT type=\"button\" style=\"cursor:hand\" value=\"OL\"       onclick=\"javascript:insertAtCaret(\'"+textBoxName+"\',\'[ol]\',\'[/ol]\');\" >");
		document.writeln("<INPUT type=\"button\" style=\"cursor:hand\" value=\"UL\"       onclick=\"javascript:insertAtCaret(\'"+textBoxName+"\',\'[ul]\',\'[/ul]\');\" >");
		
		document.writeln("<INPUT type=\"button\" style=\"cursor:hand\" value=\"Line\"    onclick=\"javascript:insertAtCaret(\'"+textBoxName+"\',\'[Line]\',\'\');\" >");
		document.writeln("<INPUT type=\"button\" style=\"cursor:hand\" value=\"DLink\"   onclick=\"javascript:insertAtCaret(\'"+textBoxName+"\',\'[dlink]\',\'[/dlink]\');\" >");
		document.writeln("<INPUT type=\"button\" style=\"cursor:hand\" value=\"Ref\"     onclick=\"javascript:insertAtCaret(\'"+textBoxName+"\',\'[ref]\',\'[/ref]\');\" >");
		document.writeln("<INPUT type=\"button\" style=\"cursor:hand\" value=\"Definition\"   onclick=\"javascript:insertAtCaret(\'"+textBoxName+"\',\'[definition   ]\',\'[/definition]\');\" >");
	    document.writeln("<INPUT type=\"button\" style=\"cursor:hand\" value=\"MM1\"      onclick=\"javascript:insertAtCaret(\'"+textBoxName+"\',\'[mm1]\',\'[/mm1]\');\" >");	
        document.writeln("<INPUT type=\"button\" style=\"cursor:hand\" value=\"MM3\"      onclick=\"javascript:insertAtCaret(\'"+textBoxName+"\',\'[mm3]\',\'[/mm3]\');\" >");	
        document.writeln("<INPUT type=\"button\" style=\"cursor:hand\" value=\"ZW\"      onclick=\"javascript:insertAtCaret(\'"+textBoxName+"\',\'[zw]\',\'[/zw]\');\" >");	
	}
//-------AJAX Functions -----------   

	var tmpObj;  // DOM object name or ID mostly to receive the AJAX HTTP reply

    function getHTTPObject(){
            if (window.ActiveXObject){
                return new ActiveXObject("Microsoft.XMLHTTP");
            }else if (window.XMLHttpRequest) {
                return new XMLHttpRequest();
            }else {
                alert("Your browser does not support AJAX.");
                return null;
            }
        }
 
    function SendHttpRequest(ReceiveObject,RequestURL,RequestMethod){
        
		tmpObj  = ReceiveObject;
		
        httpObject = getHTTPObject();
        if (httpObject != null) {

            httpObject.open("GET", RequestURL , true);
        //    httpObject.open("GET", "http://www.google.com" , true);
            httpObject.onreadystatechange = getHttpReply;
            httpObject.send(null);
            
        }
        
    }
    function getHttpReply(){
        if(httpObject.readyState == 4){
           document.getElementById(tmpObj).innerHTML = httpObject.responseText;
		}else{
			document.getElementById(tmpObj).innerHTML = '<img src="../images/common/busy.gif" >';
		}
    }
	
	//-------------- DIALOG BOX Funstions ---------------------------
	
	
	function LoadDialogBox(varURL,varTitle,varWidth,varHeight){
    	if(document.getElementById('HostDiv')){
           var HostDiv = document.getElementById('HostDiv');
        }else{
           var HostDiv = document.createElement('div');
           document.body.appendChild(HostDiv);
		   HostDiv.setAttribute('id','HostDiv');
           HostDiv.setAttribute('name','HostDiv');
            
        }
        var DisableBG =  document.createElement('div');
        HostDiv.appendChild(DisableBG);
		DisableBG.setAttribute('id','DisableBG');
        DisableBG.setAttribute('name','DisableBG');
        DisableBG.style.width  = screen.width + 'px';
        DisableBG.style.height = screen.height + 'px';
        
        
		
        var DialogBox =  document.createElement('div');
        DisableBG.appendChild(DialogBox);
		DialogBox.setAttribute('id','DialogBox');
        DialogBox.setAttribute('name','DialogBox');
        DialogBox.style.left = (screen.availwidth - varWidth )/2 + 'px';
		DialogBox.style.top  = (screen.availheight - varHeight )/2 + 'px';
        
        
        var InnerBox =  document.createElement('div');
        DialogBox.appendChild(InnerBox);
		InnerBox.setAttribute('id','InnerBox');
        InnerBox.setAttribute('name','InnerBox');
        
        
        var DialogHeader =  document.createElement('div');
        InnerBox.appendChild(DialogHeader);
		DialogHeader.setAttribute('id','DialogHeader');
        DialogHeader.setAttribute('name','DialogHeader');
        
        
        
        var DialogBody =  document.createElement('div');
        InnerBox.appendChild(DialogBody);
		DialogBody.setAttribute('id','DialogBody');
        DialogBody.setAttribute('name','DialogBody');
		DialogBody.style.width     = varWidth + 'px';
        DialogBody.style.height    = varHeight + 'px';

           
        
        var DialogFooter =  document.createElement('div');
        InnerBox.appendChild(DialogFooter);
		DialogFooter.setAttribute('id','DialogFooter');
        DialogFooter.setAttribute('name','DialogFooter');
           
        
        DialogHeader.innerHTML  = varTitle;
        

        DialogFooter.innerHTML  = '<a href="javascript: KillDialogBox()"  class="BtnA" >OK</a>';
		SendHttpRequest('DialogBody',varURL,'GET');
        

    }

    function LoadMsgBox(varMessage,varTitle){
		var varHeight = 60 ;
		var varWidth  = 300 ;
    	if(document.getElementById('HostDiv')){
           var HostDiv = document.getElementById('HostDiv');
        }else{
           var HostDiv = document.createElement('div');
           document.body.appendChild(HostDiv);
		   HostDiv.setAttribute('id','HostDiv');
           HostDiv.setAttribute('name','HostDiv');
            
        }
        var DisableBG =  document.createElement('div');
        HostDiv.appendChild(DisableBG);
		DisableBG.setAttribute('id','DisableBG');
        DisableBG.setAttribute('name','DisableBG');
        DisableBG.style.width  = screen.width + 'px';
		DisableBG.style.height = screen.height + 'px';
		
        
        
        var DialogBox =  document.createElement('div');
        DisableBG.appendChild(DialogBox);
		DialogBox.setAttribute('id','DialogBox');
        DialogBox.setAttribute('name','DialogBox');
        DialogBox.style.left = (screen.availWidth - 400 )/2 + 'px';
		DialogBox.style.top  = (screen.availheight - varHeight )/2 + 'px';
        
        
        var InnerBox =  document.createElement('div');
        DialogBox.appendChild(InnerBox);
		InnerBox.setAttribute('id','InnerBox');
        InnerBox.setAttribute('name','InnerBox');
        
        var DialogHeader =  document.createElement('div');
        InnerBox.appendChild(DialogHeader);
		DialogHeader.setAttribute('id','DialogHeader');
        DialogHeader.setAttribute('name','DialogHeader');
        
        var DialogBody =  document.createElement('div');
        InnerBox.appendChild(DialogBody);
		DialogBody.setAttribute('id','DialogBody');
        DialogBody.setAttribute('name','DialogBody');
		DialogBody.style.width     = varWidth + 'px';
        DialogBody.style.minimumheight    = varHeight + 'px';
		DialogBody.style.padding   = '20px';
           
        
        var DialogFooter =  document.createElement('div');
        InnerBox.appendChild(DialogFooter);  
		DialogFooter.setAttribute('id','DialogFooter');
        DialogFooter.setAttribute('name','DialogFooter');
         
        
        DialogHeader.innerHTML  = varTitle;
        DialogBody.innerHTML    = varMessage;
		
        DialogFooter.innerHTML  = '<a href="javascript: KillDialogBox()"  class="BtnA" >OK</a>';

    }
    function KillDialogBox(){
    	if(document.getElementById('HostDiv')){
           var HostDiv = document.getElementById('HostDiv');
           var KillDiv = document.getElementById('DisableBG');
           HostDiv.removeChild(KillDiv);
        }

    }
    
    function DestroyObj(varBoxName){
	
        objDialog = document.getElementById(varBoxName);
        objDialog.style.display="none";
        //alert(varBoxName);
        //document.body.removeChild(objDialog);
    }
    function WriteDiagBody(varMessage,varTitle){
     //  alert("sfsdf");
       document.getElementById("DialogBody").innerHTML=varMessage;
       document.getElementById("DialogHeader").innerHTML=varTitle;
    }
    
    function LocateDialogBox(varBoxName){
    //      var msgbox = document.getElementById(varBoxName);
    //      var x = (window.innerWidth / 2) - (msgbox.offsetWidth / 2);
    //      var y = (window.offsetHeight / 2) - (msgbox.offsetHeight / 2);              
    //      msgbox.style.top = y;
    //      msgbox.style.left = x;
    
        objDialog = document.getElementById(varBoxName);
        objDialog.style.display="block";
    }
 //---- Tab Functions -----------------------    
        function getTabPage(){
            if(httpObject.readyState == 4){
               document.getElementById(gTabPane).innerHTML = httpObject.responseText;
    		}else{
    			document.getElementById(gTabPane).innerHTML = '<img src="../images/common/busy.gif" >';
    		}
        }
        
		var gTabPane='';
        var prevTab;
       
        function LoadTabDetail(TabID,TabName,TabLink,TabPane){
            if (document.getElementById(TabID) != null){
                document.getElementById(TabID).className  = 'TabBtnOn';
            }
            if (document.getElementById(prevTab) != null){
                document.getElementById(prevTab).className  = 'TabBtn';
            }

            gTabPane = TabPane;
            prevTab  = TabID;
            
            httpObject = getHTTPObject();
            if (httpObject != null) {
                httpObject.open("GET", TabLink, true);
                httpObject.onreadystatechange = getTabPage;
                httpObject.send(null);
                
            }
            
        }

