// Collapse & Expand Panel for Reminder and Alert starts
	function CE(){
		document.getElementById('CEFunction').style.display="none";
		document.getElementById('CEContainer').style.width="940px";
		document.getElementById('CEIcon').innerHTML="<img  onclick='javascript:EC();' alt='Expand Panel' title='Expand Panel' src='/images/icons/Expand.jpg' />"
	}

	function EC(){
		document.getElementById('CEFunction').style.display="block";
		document.getElementById('CEContainer').style.width="630px"
		document.getElementById('CEIcon').innerHTML="<img  onclick='javascript:CE();' alt='Collapse Panel' title='Collapse Panel' src='/images/icons/Collapse.jpg' />"
	}
// Collapse & Expand Panel for Reminder and Alert ends

//Pop up Window Generation starts
	function MakePop(url,width,height) {
		
		x = (width)/2, y = (height)/2;
		if (screen) {
			y = (screen.availHeight - height)/2;
			x = (screen.availWidth - width)/2;
		}
		window.open(url,'newWin', 'scrollbars=yes, width='+width+',height='+height+',screenX='+x+',screenY='+y+',top='+y+',left='+x);
	}
//Pop up Window Generation ends

//Delete Pop up Window Generation starts
	function MakeDeletePop(url,width,height) {
	
		x = (width)/2, y = (height)/2;
		if (screen) {
		
			y = (screen.availHeight - height)/2;
			x = (screen.availWidth - width)/2;
		}//fi
		window.open(url,'newWin1', 'status=no,scrollbars=no, width='+width+',height='+height+',screenX='+x+',screenY='+y+',top='+y+',left='+x);
	}//nf	
//Delete Pop up Window Generation ends

//Update Pop up Window Generation starts
	function MakeUpdatePopup(url,width,height) {
	
		x = (width)/2, y = (height)/2;
		if (screen) {
		
			y = (screen.availHeight - height)/2;
			x = (screen.availWidth - width)/2;
		}//fi
		window.open(url,'newWin2', 'status=no,scrollbars=no, width='+width+',height='+height+',screenX='+x+',screenY='+y+',top='+y+',left='+x);
	}//nf	
//Update Pop up Window Generation ends


//Move Pop up Window Starts
function MoveFilePop(url,width,height) {
		x = (width)/2, y = (height)/2;
		if (screen) {
		
			y = (screen.availHeight - height)/2;
			x = (screen.availWidth - width)/2;
		}//fi
		window.open(url,'newWin3', 'status=no,scrollbars=no, width='+width+',height='+height+',screenX='+x+',screenY='+y+',top='+y+',left='+x);
		
	}//nf
//Move Pop up Window Ends

	function splitAndReplace(responseText,tagName,id) {
                
            //var responseText  = document.body.innerHTML;              
            //split document into tag
            splittedElements = responseText.split("</"+tagName+">");
 			   
            //Process each element
            for(var i=0;i < splittedElements.length;i++) {
    
                //check that this begins with <tagName id=
                //leave other-tag that having no attribute named id
                if((tagPos = splittedElements[i].indexOf("<"+tagName +" id=")) >-1 ){
    
                    //remove everything before <tagName id=
                    if(tagPos > 0) {
                        subString = splittedElements[i].substring(tagPos);
                        splittedElements[i] = subString;
                    }//end if
    
                    //get the id of tag
                    //get the name - between the 1st and 2nd quote mark
                    startNamePos=splittedElements[i].indexOf('"')+1;
                    endNamePos=splittedElements[i].indexOf('"',startNamePos);
                    name=splittedElements[i].substring(startNamePos,endNamePos);
    
                    //get the content - everything after the first > mark
                    startContentPos=splittedElements[i].indexOf('>')+1;
                    content=splittedElements[i].substring(startContentPos);
                    
                    //alert("div name : "+name);
                    //Now update the existing Document with this element
                    //check that this element exists in the document
                    if(document.getElementById(name) && name == id){
                        //alert(name);
                        //alert(content);
                        document.getElementById(name).innerHTML = content;
                    } else {
                        //alert("Element:"+name+"not found in existing document");
                    }//end if-else
                }//end if
    
            }//end for
     }//end of splitAndReplace function
     
        
     
