var xmlHttp;
function getUploadDescription(contentid){
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="fileuploadDesc.php"
url=url+"?contentid=" + contentid;
hint="editDescinput";

url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)

}
function loadFilesToReview(){
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="documentShowInReviewAll.php";

hint="reviewprojects";

url=url+"?sid="+Math.random()

xmlHttp.onreadystatechange=stateChanged
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
function loadNotes(count,type,projectid){
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="projectshowNotes.php?projectid=" + projectid + "&type=" + type;
var name="notes" + count;
if(window.document.getElementById(name).style.display=="none"){
window.document.getElementById(name).style.display="block";
window.document.getElementById("notes2").style.display="none";

}
hint=name;

url=url+"&sid="+Math.random()

xmlHttp.onreadystatechange=showNotes
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
function showNotes() 
{ 
if(xmlHttp.readyState == 1){

document.getElementById(hint).innerHTML = "Loading please wait...";
//document.getElementById(hint2).innerHTML = "Loading please wait...";
}

if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
//alert(xmlHttp.responseText);
data = xmlHttp.responseText;
//var projectid=window.document.getElementById("id").value;
document.getElementById(hint).innerHTML = data;
//loadNotes('1','PRN',projectid);
}
}
function selectLaunchFile(choice,filename){

}
function loadChecklist(count,type,projectid){
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="projectshowChecklist.php?projectid=" + projectid + "&type=" + type;
var name="checklist" + count;
if(window.document.getElementById(name).style.display=="none"){
window.document.getElementById(name).style.display="block";
//window.document.getElementById("notes2").style.display="none";
}
hint=name;

url=url+"&sid="+Math.random()

xmlHttp.onreadystatechange=showChecks
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
function showChecks() 
{ 
if(xmlHttp.readyState == 1){

document.getElementById(hint).innerHTML = "Loading please wait...";
//document.getElementById(hint2).innerHTML = "Loading please wait...";
}

if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
//alert(xmlHttp.responseText);
data = xmlHttp.responseText;
var projectid=document.getElementById("id").value;
document.getElementById(hint).innerHTML = data;
loadNotes('1','PRN',projectid);
}
}
function loadProjectViewData(count,type,projectid){
 xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }

if(type=="PMEM" || type=="PRMP"){
if(window.location.href.indexOf("project.php")==-1){
  var showAdd="N";
}else{
  var showAdd="Y";
}
 var url="projectshowMembers.php?projectid=" + projectid + "&type=" + type + "&showAdd=" + showAdd;
 var name="members" + count;
}else if(type=="PRN"){

var url="projectshowNotes.php?projectid=" + projectid + "&type=" + type;
var name="notes" + count;
if(window.document.getElementById(name).style.display=="none"){
window.document.getElementById(name).style.display="block";
window.document.getElementById("notes2").style.display="none";
}
}else if(type=="PRFP"){
var url="projectFolderShow.php?projectid=" + projectid + "&type=" + type;
var name="folders" + count;
if(window.document.getElementById("projectConfirm").style.display=="block"){
  window.document.getElementById("projectConfirm").style.display="none"
}
}else if(type=="PLib"){
var url="projectFolderShowTemplates.php?projectid=" + projectid + "&type=" + type;
var btnid="btnAdd" + projectid;
if(window.document.getElementById(btnid).style.display=="none"){
 window.document.getElementById(btnid).style.display="block";
}else{
 window.document.getElementById(btnid).style.display="none"
}
var name="project" + count;
}else if(type=="Lib"){
var url="projectfolders.php?projectid=" + projectid + "&type=" + type;
var name="contLibP";
}else if(type=="PRewP"){
 var url="projectshowReviewHistory.php?projectid=" + projectid + "&type=" + type;
 var name="projectreview" + count;
 //var url="documentReviewPrepareAll.php?projectid=" + projectid + "&type=" + type;
 //var name="projectreview" + count;
}else if(type=="PRNF"){
 var url="projectshowNotifications.php?projectid=" + projectid + "&type=" + type;
 var name="notes" + count;
}else if(type=="PRECA"){
 var url="projectshowRecent.php?projectid=" + projectid + "&type=" + type;
 var name="recent" + count;
 
}else if(type=="PRCP"){
 var url="projectshowChecklist.php?projectid=" + projectid + "&type=" + type;
 var name="checklist" + count;
if(window.document.getElementById(name).style.display=="none"){
window.document.getElementById(name).style.display="block";
//window.document.getElementById("notes2").style.display="none";
}
}

hint=name;

//window.document.getElementById(folderid).style.display="none";
url=url+"&sid="+Math.random()

xmlHttp.onreadystatechange=stateChanged
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function loadFolders2(count,type,projectid){
 xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }

var url="projectFolderShow.php?projectid=" + projectid + "&type=" + type;
var name="folders" + count;
hint=name;

url=url+"&sid="+Math.random()

xmlHttp.onreadystatechange=stateChanged
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
function loadFolders(count,type,projectid){
 xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
if(window.document.getElementById("projectConfirm").style.display=="block"){
 window.document.getElementById("projectConfirm").style.display="none";
}else{
 window.document.getElementById("projectConfirm").style.display="block";
}
var url="projectFolderShow.php?projectid=" + projectid + "&type=" + type;
var name="folders" + count;
hint=name;

url=url+"&sid="+Math.random()

xmlHttp.onreadystatechange=loadPage
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
function loadPage() 
{ 
if(xmlHttp.readyState == 1){

document.getElementById(hint).innerHTML = "Loading please wait...";
//document.getElementById(hint2).innerHTML = "Loading please wait...";
}

if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
//alert(xmlHttp.responseText);
data = xmlHttp.responseText;
var projectid=document.getElementById("id").value;
document.getElementById(hint).innerHTML = data;
//document.getElementById(hint2).innerHTML = data[1];
loadChecklist('1','PRCP',projectid)
//loadChecklist('1','PRCP',projectid);
}
}
function updateNavigator(divid){
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="catsupdatenav.php?"

hint=divid;
//window.document.getElementById(folderid).style.display="none";
url=url+"sid="+Math.random()

xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)

}
function catSaveChanges(catid,newvalue){
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }

var url="catSaveChanges.php?catid=" + catid + "&newvalue=" + newvalue;
url=url+"&sid="+Math.random()
hint=catid;

xmlHttp.onreadystatechange=stateChanged
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
function editCatName(catid,catname,action){
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }

var url="catEditName.php?catid=" + catid + "&catname=" + catname + "&action=" + action;
url=url+"&sid="+Math.random()
if(action=="edit"){
 hint=catid;
}else{
 hint="cats";
}

xmlHttp.onreadystatechange=stateChanged
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
function addFolderToCat(cat,type,folderid,foldername){
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="catAddtoFolder.php?cat=" + cat + "&type=" + type + "&folderid=" + folderid + "&foldername=" + foldername;
url=url+"&sid="+Math.random()
hint="confirmM";

xmlHttp.onreadystatechange=stateChanged
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
function updateGroceryCats(){
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
name=window.document.getElementById("grocerycats").value; 

var url="directorylistaddCatsSubs.php?name=" + name;
url=url+"&sid="+Math.random()
hint="grocerysubcats";

xmlHttp.onreadystatechange=stateChanged
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
function searchDocuments(){
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
name=window.document.getElementById("search").value; 
var url="viewdocumentslist.php?name=" + name;
url=url+"&sid="+Math.random()
hint="newF";

xmlHttp.onreadystatechange=stateChanged
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
function saveProjectInfo(startDate,endDate,sendDate1,returnDate1,sendDate2,returnDate2,comments,folderid,fname){
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="projectSaveData.php?startDate=" + startDate + "&endDate=" + endDate + "&sendDate1=" + sendDate1 + "&returnDate1=" + returnDate1 + "&sendDate2=" + sendDate2 + "&returnDate2=" + returnDate2 + "&comments=" + comments + "&folderid=" + folderid + "&fname=" + fname;

url=url+"&sid="+Math.random()
hint="projectConfirmSchedule";

xmlHttp.onreadystatechange=stateChanged
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
		
}
function addNewCatItems(cat){
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="catAddNew.php?cat=" + cat;
url=url+"&sid="+Math.random()
hint="cats";

xmlHttp.onreadystatechange=stateChanged
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
	
}
function getCustomItems(){
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="orgcustomNav.php?id=25";
url=url+"&sid="+Math.random()
hint="customnav";

xmlHttp.onreadystatechange=stateChanged
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
	
}
function saveGroupInfo(name,userrole){
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="orgsaveinfo.php?name=" + name + "&userrole=" + userrole;
url=url+"&sid="+Math.random()
hint="groups";

xmlHttp.onreadystatechange=stateChanged
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
	
}
function getUpdates(userid){
 xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return 
 }
var url="projectDisplayAll.php?uid=" + userid + "&type=member";
url=url+"&sid="+Math.random()
hint="projectlist";

xmlHttp.onreadystatechange=stateChanged
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
function getReviews(tovalue,fromvalue,type){
 xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="documentReviewAllProjects.php?tovalue=" + tovalue + "&fromvalue=" + fromvalue + "&type="+type;
url=url+"&sid="+Math.random()
hint="reviews";

xmlHttp.onreadystatechange=stateChanged
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function viewMessage(messid){
 xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="messagepopup.php?messid=" + messid;
url=url+"&sid="+Math.random()

xmlHttp.onreadystatechange=displayTextArea 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function displayTextArea(){
	

if(xmlHttp.readyState == 1){

document.getElementById("wysiwygmessbody").contentWindow.document.body.innerHTML = "Loading please wait...";
//document.getElementById(hint2).innerHTML = "Loading please wait...";
}

if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 

//data = xmlHttp.responseText.split ( "~" );
data = xmlHttp.responseText;
var matchTag = /<(?:.|\s)*?>/g;
var display=data.replace(matchTag, "");
document.getElementById("wysiwygmessbody").contentWindow.document.body.innerHTML=display;
}
}
function loadReviewWorkArea(showid,reviewid,status,type,icount){
 xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
if(type=="RIF"){
   var url="formReviewGetArea.php?reviewid=" + reviewid + "&status=" + status + "&num=" + icount;
 }else{
  var url="documentReviewGetArea.php?reviewid=" + reviewid + "&status=" + status;
 }
url=url+"&sid="+Math.random()
hint=showid;

xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
function loadAllReview(showid){
 xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="documentReviewGetAll.php?id=" + showid;

url=url+"&sid="+Math.random()
hint="reviewfiles";

xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
function loadReview(showid,reviewid){
 xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="documentReviewInfo.php?reviewid=" + reviewid;

url=url+"&sid="+Math.random()
//alert(url);
hint=showid;
//alert(showid);
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
function loadUploadFiles(uploadid,loadid){
 xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="documentReviewAllFiles.php?uploadid=" + uploadid;

url=url+"&sid="+Math.random()

hint=loadid;

xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
function sendMessage(to,subject,emailbody,fullname,action){
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }

if(action=="send"){
var url="addNewMessage.php?sendto=" + to + "&subject=" + subject + "&emailbody=" + emailbody + "&type=message&action=Add";	
hint="showNotified";
window.document.getElementById("contentnav1").style.display="none";
}else if(action=="reply"){
var refid=window.document.getElementById("replyid").value;
var url="addReplyMessage.php?sendto=" + to + "&subject=" + subject + "&emailbody=" + emailbody + "&type=message&fullname=" + fullname +"&refid=" + refid;	
hint="showNotified";
window.document.getElementById("contentnav2").style.display="none";	
}else{
var url="filesendmessLink.php?sendto=" + to + "&subject=" + subject + "&emailbody=" + emailbody + "&type=message&fullname=" + fullname;
hint="confirmM";
}
url=url+"&sid="+Math.random()

xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
function getRecentActivities(action,num,spanid){
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }

var url="viewRecentActivities.php?action=" + action + "&num=" + num;
//alert(url);
hint=spanid;
//alert(spanid);
url=url+"&sid="+Math.random()

xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
function getForm(id,uploadid,icount){
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
	var iframeid="iframe" + id + icount;
   //alert(iframeid);

//alert(window.document.getElementById(iframeid).style.display);
 if(window.document.getElementById(iframeid).style.display=="none"){
   window.document.getElementById(iframeid).style.display="block";
 }else{
    window.document.getElementById(iframeid).style.display="none";
 }
var uploadid="uploadid" + id + icount;
var url="documentupload.php?id=" + id + "&uploadid=" + id;
//alert(url);
hint="uploadid" + id;
url=url+"&sid="+Math.random()

//xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
function uploadAttached(id){
 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }

var url="documentuploadAttached.php?id=" + id;

hint="attachedfiles" + id;
url=url+"&sid="+Math.random()

xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
function getExistingFolders(caseid,divid,pid){
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }

var url="view_filefolders.php?id=" + caseid + "&projectid=" + pid;
window.document.getElementById(divid).style.display="block";
hint=divid;
url=url+"&sid="+Math.random()

xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
function loadContent2(loadid,i,type){

xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }

if(type=="SF"){
  var url="sharedsubfolderfiles.php?id=" + loadid + "&i=" + i + "&type=" + type;
  hint=i + "subcontentnav";

}else if(type=="SFY" ){
   var url="sharedfolderfiles.php?id=" + loadid + "&i=" + i + "&type=" + type;
   hint=i + "Fcontentnav";
}else if(type=="PSFY" ){

  var url="projectfolderfiles.php?id=" + loadid + "&i=" + i + "&type=" + type;
   hint=i + "Fcontentnav";
}else if(type=="SFN"){
   var url="sharedfolderfiles.php?id=" + loadid + "&i=" + i + "&type=" + type;
   hint=i + "contentnav";
}else if(type=="PSFN"){
  var url="projectfolderfiles.php?id=" + loadid + "&i=" + i + "&type=" + type;
   hint=i + "contentnav";
}else{
	type="SFN";
	var url="sharedfolderfiles.php?id=" + loadid + "&i=" + i + "&type=" + type;
	hint=i+ "contentnav";
	
}

url=url+"&sid="+Math.random()
//alert(url);

xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
function loadSharedContent(loadid,i,type){
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
if(type=="SF"){
  var url="sharedsubfolderfiles.php?id=" + loadid + "&i=" + i + "&type=" + type;
   hint=i + "subcontentnav";
   
}else if( type=="SFYR" ){
   var url="sharedfolderfiles.php?id=" + loadid + "&i=" + i + "&type=" + type;
   hint=i + "Fcontentnav";

}else if(type=="SFNR"){
   var url="sharedfolderfiles.php?id=" + loadid + "&i=" + i + "&type=" + type;
   hint=i + "contentnav";
}

url=url+"&sid="+Math.random()

xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function setupReview(uploadid,filename,filetitle){
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
//alert(num);
var url="documentAddToReview.php?uploadid=" + uploadid + "&fn=" + filename + "&ft=" + filetitle;

url=url+"&sid="+Math.random()
hint="fileupdate";

xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
function attachReviewFile(reviewid,uploadid,fileloc,filename){
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
//alert(num);
var url="documentreviewaddfile.php?id=" + reviewid + "&fileloc=" + fileloc + "&uploadid=" + uploadid + "&filename=" + filename;
//alert(url);

url=url+"&sid="+Math.random()
hint="attachedfiles" + reviewid;

xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
function sendForReview(workflownotify,teamcontacts,numreviewers,uploadid,action,subject,comments,multiple){
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
if(action=="all"){
 var url="documentReviewWorkflowAll.php?notify=" + workflownotify + "&contacts="
 + teamcontacts + "&num=" + numreviewers +"&action=" + action +  "&subject=" + subject + 
 "&comments=" + comments + "&multi=" + multiple;
 hint="prepall";
 
}else{

var url="documentreviewworkflow.php?notify=" + workflownotify + "&contacts="
 + teamcontacts + "&num=" + numreviewers +"&action=" + action + "&id=" + uploadid + "&subject=" + subject + 
 "&comments=" + comments + "&multi=" + multiple;
 hint="fileupdate";
}

url=url+"&sid="+Math.random()


xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
function showReviewers(num,count,id){
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }

if((num==1) && (count != id)){
if(id=="all"){
 window.document.getElementById("rsr").style.display="block";
 window.document.getElementById("nmc").style.display="none";
 window.document.getElementById("allsubject").style.display="block";
  window.document.getElementById("actionbuttons").style.display="block";
 window.document.getElementById("allcomments").style.display="block";
}else{
 window.document.getElementById("rsr").style.display="block";
 window.document.getElementById("nmc").style.display="none";
  window.document.getElementById("setupsubject").style.display="block";
  window.document.getElementById("actionbuttons").style.display="block";
 window.document.getElementById("setupcomments").style.display="block";
}
}else if(num>1){

 window.document.getElementById("nmc").style.display="block";
 window.document.getElementById("rsr").style.display="none";
 window.document.getElementById("allsubject").style.display="block";
 window.document.getElementById("actionbuttons").style.display="block";
 window.document.getElementById("allcomments").style.display="block";
// window.document.getElementById("swl").style.display="block";
}
var url="documentreviewers.php?num=" + num + "&id=" + id;

url=url+"&sid="+Math.random()
if(count==id){
hint="displayreviewers";

}else{
hint="reviewers"+count;
}

xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
function addOverallComments(uploadid,comment,action){
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }

var url="fileupdateReviewOverallComment.php?id=" + uploadid + "&comment=" + comment+"&action=" + action;
//alert(url);
url=url+"&sid="+Math.random()
hint="fileupdate";

xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
function updateComment(id,comment,status,reviewnum){
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }

var url="fileupdateReviewComment.php?id=" + id + "&comment=" + comment + "&status=" + status + "&rnum="+reviewnum;

url=url+"&sid="+Math.random()
hint="fileupdate";

xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
function updateReviewTitle(filetitle,id,action,multiple){
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var editaction="edit" + id;
var saveaction="add" + id;
var updateaction="update" + id;
  if(action=="add"){
   window.document.getElementById(editaction).style.display="block";
   window.document.getElementById(saveaction).style.display="none";
   

  }else{
   window.document.getElementById(editaction).style.display="none";
   window.document.getElementById(saveaction).style.display="block";
  }
var url="fileupdateReviewTitle.php?id=" + id + "&filetitle=" + filetitle + "&action=" + action + "&multiple=" +multiple;
//alert(url);
url=url+"&sid="+Math.random()

hint="ReviewCount";

xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
function setTempStatus(value,id,icount){

xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
//alert(value);
var comments="";

if(value=="Reject"){
 //alert(value);
 var show="hidden"+id+icount;
 var text="hiddentext" + id+icount;
 var comments="displaycomments" + id+icount;
 var showreviewers="showreviewers" + id+icount;
 var displaycomment="display"+id+icount;
 var displaycomment2="display2" + id+icount;
 var commentsmsg="commentsmsg" +id+icount;

  if(window.document.getElementById(displaycomment).style.display=="none"){
	  
     //window.document.getElementById(displaycomment2).style.display="none";
     window.document.getElementById(text).style.display="block";
	 window.document.getElementById(commentsmsg).innerHTML="Enter your comments for rejecting this update. (Mandatory)";
	 window.document.getElementById(show).style.display="block";
	// window.document.getElementById("selrev").style.display="none";
  }else{

  window.document.getElementById(text).style.display="block";
  //alert(displaycomment2);
   //window.document.getElementById(displaycomment2).style.display="none";
   //alert("Hre1" + displaycomment);
   window.document.getElementById(displaycomment).style.display="none";
   //alert("here");
   window.document.getElementById(commentsmsg).innerHTML="Enter your comments for rejecting this update. (Mandatory)";
  //window.document.getElementById(commentsmsg).innerHTML="";
  window.document.getElementById(show).style.display="block";
 }
}else if(value=="Download"){
 //var comments="";
 var show="hidden"+id+icount;
 var text="hiddentext" + id+icount;
 var comments="displaycomments" + id+icount;
 var displaycomment="display"+id+icount;
 //var displaycomment2="display2" + id;
 var commentsmsg="commentsmsg" + id+icount;
//alert(window.document.getElementById(displaycomment).style.display);
 if(window.document.getElementById(displaycomment).style.display=="none"){
  window.document.getElementById(text).style.display="block";
  window.document.getElementById(commentsmsg).innerHTML="Enter your comments. (Optional)";
  window.document.getElementById(show).style.display="block";
 }else{
  window.document.getElementById(text).style.display="none";
  window.document.getElementById(commentsmsg).innerHTML="Enter your comments. (Optional)";
  window.document.getElementById(show).style.display="none";
  window.document.getElementById(displaycomment).style.display="block"
 }
     
}else{
  var show="hidden"+id+icount;
 var text="hiddentext" + id+icount;
 var comments="displaycomments" + id+icount;
 var commentsmsg="commentsmsg" +id+icount;
  var displaycomment="display"+id+icount;
 // var displaycomment2="display2"+id;
  
  if(window.document.getElementById(displaycomment).style.display=="none"){
  // window.document.getElementById(displaycomment2).style.display="none";
	  window.document.getElementById(text).style.display="block";
	  window.document.getElementById(commentsmsg).innerHTML="Enter your comments. (Optional)";
	  window.document.getElementById(show).style.display="block";
	  
  }else{
	  window.document.getElementById(text).style.display="none";
	  //window.document.getElementById(commentsmsg).innerHTML="";
	  window.document.getElementById(show).style.display="none";
	 // window.document.getElementById(displaycomment2).style.display="block";
      window.document.getElementById(displaycomment).style.display="block"
 }
  //window.document.getElementById("selrev").style.display="block";
 
}
var url="fileupdateReviewTempStatus.php?value="+ value + "&id=" + id + "&icount=" +icount;
//alert(url);
url=url+"&sid="+Math.random()
hint="TempStatus";
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
//return eval(xmlHttp.responseText);
}
function setTempStatusIndex(value,id){

xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }

var url="fileupdateReviewTempStatus.php?value="+ value + "&id=" + id;

url=url+"&sid="+Math.random()
hint="ReviewCountIndex";
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
//return eval(xmlHttp.responseText);
}
function updateStatus(uploadid){
//alert("this is working");
if (window.XMLHttpRequest) { 
    var xmlHttp=new XMLHttpRequest();
} else {
 xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
var url="documentReviewNum.php?id=" + uploadid;
//url=url+"&sid="+Math.random()
//xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,false)
xmlHttp.send(null)
return eval(xmlHttp.responseText);
}
function deleteReviewFiles(uploadid){
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }

var url="fileupdateDeleteFiles.php?id=" + uploadid;
if(window.location.href.indexOf("project.php")==-1){
  hint="txtFolder";
}else{
  hint="projectConfirm";
}
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
function notifyDocReviewers(uploadid,contacts,subject,action,newreview,finalcomments){
//alert("this is working");
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }

var url="fileupdateReviewNotice.php?upload=" +uploadid + "&contacts=" + contacts + "&sub=" + subject + 
"&action=" + action + "&new=" + newreview + "&finalcomments=" + finalcomments;

url=url+"&sid="+Math.random()
hint="ConfirmMsg";
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
function notifyDocReviewersAll(uploadid,contacts,subject,action,newreview,finalcomments){
//alert("this is working");
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }

var url="fileupdateReviewNotice.php?upload=" +uploadid + "&contacts=" + contacts + "&sub=" + subject + 
"&action=" + action + "&new=" + newreview + "&finalcomments=" + finalcomments;

url=url+"&sid="+Math.random()
hint="ConfirmMsg" + uploadid;
xmlHttp.onreadystatechange=reviewConfirm;
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
function reviewConfirm() 
{ 
if(xmlHttp.readyState == 1){

document.getElementById(hint).innerHTML = "Loading please wait...";

}

if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
//alert(xmlHttp.responseText);

//data = xmlHttp.responseText;

document.getElementById(hint).innerHTML = "Review has been completed. An Email has been sent";
}
}
function getdocReviewCount(uploadid){
//alert("this is working");
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }

var url="documentReviewNum.php?id=" + uploadid;

url=url+"&sid="+Math.random()

hint="ReviewCount";

xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
function setDocumentStatus(value,id,uploadid,action){
//alert("this is working");
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }

var url="documentReviewStatus.php?value=" +value + "&id=" + id + "&uploadid=" + uploadid + "&action=" + action;
//alert(url);
url=url+"&sid="+Math.random()
if(action=="review" || action=="draft"){
hint="preparefiles"+id;
hint2="reviewfiles" + id;
xmlHttp.onreadystatechange=statusChanged 
}
if(action=="download"){
hint="reviewers"+id;
hint2="download" + id;
xmlHttp.onreadystatechange=statusChanged 

}
if(action=="reject"){
 hint="ReviewCount";
 xmlHttp.onreadystatechange=stateChanged 
}
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
function statusChanged() 
{ 
if(xmlHttp.readyState == 1){

document.getElementById(hint).innerHTML = "Loading please wait...";
document.getElementById(hint2).innerHTML = "Loading please wait...";
}

if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
//alert(xmlHttp.responseText);
data = xmlHttp.responseText.split ( "~" );

document.getElementById(hint).innerHTML = data[0];
document.getElementById(hint2).innerHTML = data[1];
var action=document.getElementById("action").value;

if(action=="review"){
var msg="Your file has been moved to the area below and is ready to send to the reviewer.";
}else if(action=="draft"){
var msg="Your file has been removed from the review area";
}else if(action=="download"){
var msg="Your file has been moved to the download area";

}
document.getElementById("ReviewCount").style.display="block";
document.getElementById("ReviewCount").innerHTML = msg;

//document.getElementById(hint).innerHTML="test";
//document.getElementById(hint2).innerHTML=xmlHttp.responseText

 } 
}
function loadFiles(id){
//alert("this is working");
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }

var url="documentreviewloadfiles.php?id=" + id;

url=url+"&sid="+Math.random()
hint="draftfiles";

xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,false)
xmlHttp.send(null)
}

function addNewCategory(name,id){

xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }

var url="documentreviewcat.php?catname=" + name + "&id=" + id;

url=url+"&sid="+Math.random()
hint="cats";
//alert(url);
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function getFolderName(folderid,foldertype){

xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }

var url="getFolderName.php?folderid=" + folderid + "&foldertype=" + foldertype;
//alert(url);
url=url+"&sid="+Math.random()
hint="editfolderinput2";
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function populateContent(folderid,foldertype,i){

xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }

var url="contentlibrary.php?folderid=" + folderid + "&foldertype=" + foldertype;

hint="content" + i;

url=url+"&sid="+Math.random()

xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
function downloadSelected(id){
//alert(fname);
  xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }

var url="downloadSelected.php?id=" + id;

hint="newF";
//alert(hint);
url=url+"&sid="+Math.random()
//alert(url);
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
function populateDetails(id,type){
//alert(fname);
  xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="fileversionsdetails.php?id=" + id + "&type=" + type;
//alert(url);
if(type=="title"){
hint="filetitle";
}else{
hint="filedetails";
}
//alert(hint);
url=url+"&sid="+Math.random()
//alert(url);
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function lockDoc(uploadid,action){
//alert(fname);
  xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }

var url="file_lockdoc.php?uploadid=" + uploadid + "&act=" + action;

hint="lock." + uploadid;
//alert(hint);
url=url+"&sid="+Math.random()
//alert(url);
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
function allVersions(uploadid){
//alert(fname);
  xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }

var url="fileversions.php?uploadid=" + uploadid;

hint="versionHistory";
//alert(url);
url=url+"&sid="+Math.random()
//alert(url);
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
function addToCustom(notify,teamcontacts,category,urllink,doctype){
	
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="postaddsharedfiles.php?fn=" + category +  "&usdt=" + doctype + "&link=" + urllink + "&type=custom";
//var url="postaddcustomfiles.php?category=" + category + "&notify=" + notify + "&tc=" + teamcontacts + "&url=" + urllink + "&doctype=" + doctype;

hint="uploadLib";
hidePopup('upload_popup');
url=url+"&sid="+Math.random()
//alert(url);
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
	
}
function hideDivTag(name){
 if(window.document.getElementById("projectConfirm").style.display=="block"){
  window.document.getElementById("projectConfirm").style.display="none"
}
}
function setupUpdateReview(id,usersid,orgid,versionnum){
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var startf ="";
var x=document.getElementsByName("addToUpload");
for(var i = 0; i < x.length; i++) 
{
 var obj = document.getElementsByName("addToUpload").item(i);
  if(obj.checked){
     if(startf != ""){
       	startf += "," + obj.value ;
     }else{
       	startf = obj.value;
   	}
 
 }
}

hint="showReview";
var url="fileupdateReviewSF.php";
url=url+"?id=" + id + "&fn=" + startf + "&vernum=" + versionnum + "&hint=" + hint;

url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)

}
function addAllFiles(upload_id,user_id,orgid,folderid,sendm,type,foldertype,usdt,tc){
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var projectid="";
if(window.location.href.indexOf("view_files.php")==-1){
   projectid=window.document.getElementById("id").value;
}
var url="fileuploadAllNoSF.php";
url=url+"?id=" + upload_id + "&uid=" + user_id+"&org=" + orgid + "&folderid=" + folderid + "&notify=" + sendm + 
"&type=" + type + "&foldertype=" + foldertype + "&usdt=" + usdt + "&contacts=" + tc + "&addAH=Y" + "&projectid=" + projectid;

hint="divSF";
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)

}
function addStartFile(upload_id,user_id,orgid,folderid,sendm,type,foldertype,usdt,tc){
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var startf ="";
var x=document.getElementsByName("addToUpload");
for(var i = 0; i < x.length; i++) 
{
 var obj = document.getElementsByName("addToUpload").item(i);
  if(obj.checked){
     if(startf != ""){
       	startf += "," + obj.value ;
     }else{
       	startf = obj.value;
   	}
 
 }
}
 var projectid="";
if(window.location.href.indexOf("view_files.php")==-1){
    projectid=window.document.getElementById("id").value;
}
var url="fileuploadSF.php";
url=url+"?id=" + upload_id + "&sf=" + startf +"&uid=" + user_id+"&org=" + orgid + "&folderid=" + folderid + "&notify=" + sendm + 
"&type=" + type + "&foldertype=" + foldertype + "&usdt=" + usdt + "&contacts=" + tc + "&addAH=Y" + "&projectid=" + projectid;

hint="divSF";
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)

}
function updateDoc(uploadid,fut,comments,sendm,contacts,folderid,type){

  xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var view=true;
if(window.location.href.indexOf("view_files.php")==-1){
    var projectid=window.document.getElementById("id").value;
    
    var url="postprojectfileupdate.php?uploadid=" + uploadid + "&fut=" + fut +  "&comments=" + comments + "&sendm=" + sendm
+ "&contacts=" + contacts + "&folderid=" + folderid + "&type=" + type + "&view=" + view + "&projectid=" + projectid;
   hint="projectConfirm";
  if(window.document.getElementById("projectConfirm").style.display=="none"){
    window.document.getElementById("projectConfirm").style.display="block"
  }
}else{
var url="postfileupdate.php?uploadid=" + uploadid + "&fut=" + fut +  "&comments=" + comments + "&sendm=" + sendm
+ "&contacts=" + contacts + "&folderid=" + folderid + "&type=" + type + "&view=" + view;

 hint="newF";
}

url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
function addFilestoFolder(fname,type,foldertype,folderid,subdoctype,urllink,msgReq,tc,spanid,spantype,spannum,subs){

  xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var projectid="";
var doctype=window.document.getElementById('doctype').value;
if(foldertype=="sharedownerR" ||foldertype=="sharedsubfolderR" ||foldertype=="sharedR" || foldertype=="sharedsubownerR"){
hint="newFR";
}else{
hint="newF";
} 
if(window.document.getElementById("projectConfirm").style.display=="none"){
    window.document.getElementById("projectConfirm").style.display="block"
  }
hint="projectConfirm";
if(foldertype=="sharedowner" || foldertype=="sharedownerR" || foldertype=="sharedsubfolder" || foldertype=="sharedsubfolderR" ||foldertype=="sharedR" || foldertype=="shared" || foldertype=="sharedsubowner" || foldertype=="sharedsubownerR"){
if(window.location.href.indexOf("project.php")==-1){
  var form="stf";
}else{
 // alert(window.document.getElementById("id").value);
  projectid=window.document.getElementById("id").value;
  var form="projectcomponents";
}
var url="postaddsharedfiles.php?fn=" + fname +  "&type=" + type + "&foldertype=" + foldertype + 
"&fid=" + folderid + "&usdt=" + subdoctype + "&link=" + urllink + "&notify=" + msgReq + "&tc=" + tc + "&spanid="+spanid + 
"&spantype="+spantype+ "&spannum="+spannum+ "&subs="+subs + "&hint=" + hint + "&form=" + form + "&projectid=" + projectid;

window.document.getElementById("upload_popup").style.display="none";

}else{
var url="postaddfiles.php?fn=" + fname +  "&folderid=" + folderid + "&type=" + type + "&foldertype=" + foldertype + "&usdt=" + subdoctype + "&link=" + urllink +
 "&notify=" + msgReq + "&tc=" + tc + "&spanid="+spanid+ "&spantype="+spantype+ "&spannum="+spannum+ "&subs="+subs;
hint="newF";
}

 /*  window.document.getElementById("upload_popup").style.display="none";
if(window.document.getElementById(spanid).style.display=="none"){
   window.document.getElementById(spanid).style.display="block";
}else if(window.document.getElementById(spanid).style.display=="block"){
	window.document.getElementById(spanid).style.display="none";
    window.document.getElementById(spanid).style.display="block";
}*/
url=url+"&sid="+Math.random()

xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
function runFiles(siteid,id){
  //alert(id);
  xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }

var url="siteupdatexml.php";

url=url+"?siteid=" + siteid + "&orgid=" + id;

hint="sitexml";

url=url+"&sid="+Math.random()
//alert(url);
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
function getImage(id){
//alert(siteid);
 xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }

var url="templateTab2ImageLib.php";

url=url+"?id=" + id;

hint="imageLib";

url=url+"&sid="+Math.random()
//alert(url);
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)

}
function showTemplate(id){
//alert(siteid);
 xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }

var url="view_sitetemplates.php";

url=url+"?id=" + id;

hint="ifrimage";

url=url+"&sid="+Math.random()
//alert(url);
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)

}
function editAjaxFiles(contentid,fname,desc){

xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
}
var url="edit_fileproperties.php";
url=url+"?fname=" + fname + "&id=" + contentid  + "&desc=" + desc;

url=url+"&sid="+Math.random()
hint="files" + contentid;

xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)


}
function editAjaxFolders(fname,id,type,desc,ownerid){
//alert(siteid);
var name = window.document.getElementById("spanid").value;
var i = window.document.getElementById("spannum").value;
var spantype=window.document.getElementById("spantype").value;
var subs=window.document.getElementById("spansubs").value;

 xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
if(type=="editshared" || type=="editsubshared" || type=="shared"){
var url="edit_sharedfolders.php";
hint="folder" + id;
//alert(hint);
}else{
var url="edit_folders.php";
if(spantype=="SFNR"){
hint="newFR";
}else{
 hint="newF";
}
}
url=url+"?fname=" + fname + "&id=" + id + "&type=" + type + "&desc=" + desc + "&ownerid=" + ownerid + "&spanid=" + name
+ "&i=" + i + "&spantype=" + spantype + "&subs=" + subs;

url=url+"&sid="+Math.random()
if(window.document.getElementById("input_popup").style.display=="block"){ 
 
 window.document.getElementById("input_popup").style.display="none";
}

xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)

}
function populateCN(cid){
//alert(cid);
 xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
url="notes_populateCN.php";
url=url+"?cid=" + cid; 
//alert(url);
hint="txtcontentname";

url=url+"&sid="+Math.random()
//alert(url);
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)

}

function populateFolderName(fname){
//alert(siteid);
 xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
url="input_populateFN.php";
url=url+"?fname=" + fname;

hint="txtfoldername";

url=url+"&sid="+Math.random()
//alert(url);
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)

}
function updateMembersNum(folderid){

xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
	var url="team_updateMembersNum.php";
	url=url+"?folderid=" + folderid;

hint="members"+folderid;

url=url+"&sid="+Math.random()
//alert(url);
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)

}
function updateNotesNum(contentid){

xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }

var url="notes_updateNotesNum.php";
url=url+"?cid=" + contentid;
//alert(url)
hint="notes"+contentid;
//alert(hint);
url=url+"&sid="+Math.random()
//alert(url);
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)

}
function getMembers(folderid,foldername){
//alert(siteid);
 xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }

var url="sharedfoldermembers.php";
url=url+"?id=" + folderid + "&fn=" + foldername;

hint1="txtmembers2";
hint2="teamnames";

url=url+"&sid="+Math.random()
//alert(url);
xmlHttp.onreadystatechange=shareChange 

//xmlHttp.onreadystatechange=stateChanged 
//xmlHttp.open("GET",url,true)
//xmlHttp.send(null)
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
function shareChange() 
{ 
if(xmlHttp.readyState == 1){

document.getElementById(hint1).innerHTML = "Loading please wait...";
document.getElementById(hint2).innerHTML = "Loading please wait...";
}

if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
//alert(xmlHttp.responseText);
data = xmlHttp.responseText.split ( "~" );

document.getElementById(hint1).innerHTML = data[0];
document.getElementById(hint2).innerHTML = data[1];


}
}

function populateNotes(contentid){
//alert(siteid);
 xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }

var url="notes_populateNotes.php";
url=url+"?cid=" + contentid;
//alert(url)
hint="txtnotes";

url=url+"&sid="+Math.random()
//window.document.getElementById("txtNotes").style.display="block";
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)

}
function teset(){

 xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }

hint="newF";
var url="fileversionsdetails.php";
url=url+"&sid="+Math.random()
//alert(url);
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)

}

function addNotes(subj,note,contentid,contacts,action,noteid,sendmess){
//alert(siteid);
//alert(sendmess);

 xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }

var url="notes_addNotes.php";
url=url+"?subj=" + subj + "&note=" + note + "&cid=" + contentid + "&cont=" + contacts + "&act=" + action + "&noteid=" + noteid + "&messem=" + sendmess;
hint="txtnotes";

url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)

}
function removeSite(id){
//alert(siteid);
 xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="../sitedelete.php";
url=url+"?siteid=" + id;
//alert(url);
hint="txtHint";
//alert(hint);
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)

}
function addSite(){
//alert(siteid);
 xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="../addnewSiteText.php";
//url=url+"?sc=" + value + "&act=" + action + "&siteid=" + siteid + "&catid=" + id;
hint="new";
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)

}
function addSubTextField(catid,siteid,action,i){
//alert(siteid);
//alert(action);
 xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="../siteaddSubCategoryText.php";
url=url+"?catid=" + catid + "&siteid=" + siteid + "&ac=" + action + "&count=" + i;
//alert(url);
//return;
hint="cat";
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)

}

function addcat(desc,action,siteid,id){
//alert(siteid);
 xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
//loadhint="loading";
//document.getElementById(loadhint).style.display="block";
var url="../siteaddCat.php";
url=url+"?sc=" + desc + "&act=" + action + "&siteid=" + siteid + "&catid=" + id;
//alert(url);
hint="cat";
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)

}
function delCat(id,siteid,type,name){
var cdel; 
if(type=="Category"){
cdel = confirm('Delete ' + name + ' from the Site?');   
}else{
cdel = confirm('Delete this SubCategory from the Site?');   
}
 if ( cdel==1 ){ 
   
   }else{
  
	return;
  }
 xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="../sitedeleteCat.php";
url=url+"?catid=" + id + "&siteid=" + siteid + "&type=" + type;
//alert(url);
hint="cat";
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)

}

function addsubcat(value,action,siteid,id,catid){
//alert(siteid);
 xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="../siteaddSubCat.php";
url=url+"?sc=" + value + "&act=" + action + "&siteid=" + siteid + "&subcatid=" + id + "&catid=" + catid;
//alert(url);
hint="cat";
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)

}
function siteAddContent(nameid,sid){
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="../siteaddcontent.php";
url=url+"?id=" + nameid + "&sid=" + sid;
//alert(url);
hint="txtHint";
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function delSubCat(id,siteid){
var cdel; 
cdel = confirm('Delete this SubCategory from the Site?');   
 if ( cdel==1 ){ 
   
   }else{
  
	return;
  }
 xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="../sitedeletesubCat.php";
url=url+"?id=" + id + "&siteid=" + siteid;
//alert(url);
hint="subcat";
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)

}

function updateNote(noteid,note,subj){
//alert(foldername);
 xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="updateNote.php?id=" + noteid + "&note=" + note + "&nsj=" + subj;
//alert(url);
url=url
hint="txtNote";
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)

}
function deleteallRecycleBin(uid){
//alert(foldername);
 xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="delete_allrecycleBin.php?id=" + uid;
//alert(url);
url=url
hint="txtFolder";
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)

}
function moveToRecycleBin(id,type,folderid,uid){
//alert(foldername);
 xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="move_recycleBin.php";
url=url+"?id=" + id + "&type=" + type + "&folderid=" + folderid + "&uid="+uid;

hint="newF";
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)

}
function appendtoMessage(mess,i){
 xmlHttp=GetXmlHttpObject()
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="../addMessage.php";
url=url+"?mess=" + mess + "&i=" + i ;
//alert(url);
hint="txtmessage";
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)

}
function removeFolderfromWorkspace(foldername,type,action,folderid){
//alert(foldername);
 xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="sub_removeFolderfromWorkspace.php";
url=url+"?id=" + foldername + "&type=" + type + "&action=" + action + "&folderid=" + folderid;
if ((type=="sharedownerR") || (type=="sharedR")){
hint="newFR";
}else{
hint="newF";
}
window.document.getElementById("new_popup").style.display="none";
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)

}
function removeFolderandContent(folderid,id,type){

//alert(folderid);
 xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="org_removeFolderandContent.php";
url=url+"?id=" + folderid + "&uid=" + id + "&type=" + type;
//alert(url);
hint="newF";
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)

}
function inviteUsers(type){
 xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="../inviteUsers.php";
url=url+"?type=" + type ;
//alert(url);
hint="txtInvite";
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)

}
function showAction(type){

 xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="../orgsharecontent.php";
url=url+"?type=" + type;
//alert(url);
hint="txtShare";
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)

}

function update_LCBK(fileid,siteid,catid,type){

 xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }


var url="../update_LCbk.php";
url=url+"?fileid=" + fileid + "&q=" + siteid + "&catid=" + catid + "&type=" + type;
//alert(url);
hint="txtHint";

url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)

}

//function update_LC(fileid,siteid){
function update_LC(fileid,siteid,catid,type){
 xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="../update_LC.php";
//url=url+"?fileid=" + fileid + "&q=" + siteid + "&catid=" + catid + "&type=" + type;
//hint="txtHint";
var url="../update_LC.php";
url=url+"?id=" + fileid + "&q=" + siteid;
//alert(url);
hint="ifrlibrary";
//hint="txtHint";
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)

}

function removeUserfromList(id){
//alert(id);
 xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="removeUser.php?id=" +id;
url=url
hint="txtDisplay";
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)

}
function addUsers(cn,ea,type,group,groupid,location){

 xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }

var url="addUser.php";
url=url+"?cn=" + cn + "&cea=" + ea + "&a=" + type+ "&location=" + location;
if(group=="Y"){
url=url + "&groupid=" + groupid 
}
//alert(url);
hint="txtDisplay";
//alert(hint);
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)

}

function share_LC(folderid){

 xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="../create_LC.php";
url=url+"?id=" + folderid;
//alert(url);
hint="txtFolder";
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)

}
function checkFolderforFiles(fileid){

 xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="../checkFolder.php";
url=url+"?id=" + fileid;
//alert(url);
hint="txtcheckFolder";
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)

}
function changeSF(fileid,sf){
//alert(fileid);
 xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="fileupdateSF.php";
url=url+"?id=" + fileid + "&sf=" + sf;
//alert(url);
hint="txtHint";
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)

}
function updateReviewSF(fileid,fn,uid,org,versionnum){
//alert("add " + fileid);
 xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="fileupdateReviewSF.php";
url=url+"?id=" + fileid + "&fn=" + fn + "&vernum=" + versionnum;

hint="txtFolder";
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)

}
function addSF(fileid,sf,uid,org,folderid,notify,type,foldertype,subdoctype,contacts){
//alert("add " + fileid);
 xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="fileuploadSF.php";
url=url+"?id=" + fileid + "&sf=" + sf +"&uid=" + uid+"&org=" + org + "&folderid=" + folderid + "&notify=" + notify + 
"&type=" + type + "&foldertype=" + foldertype + "&usdt=" + subdoctype + "&contacts=" + contacts;
//alert(url);
hint="txtFolder";
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)

}
function addtofolder(fid,uid,org){

xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="filecreateFolder.php";
url=url+"?fid=" + fid + "&uid=" + uid+ "&org=" + org;
hint="txtFolder";
//hint="newF";
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)

}
function updateSF(fileid,sf){
//alert("update " + fileid);
 xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="fileinsertSF.php";
url=url+"?id=" + fileid + "&sf=" + sf ;
//alert(url);
hint="txtFolder";
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)

}
function removefromShared(fileid,folderid){
//alert(folderid);
 xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="sub_removefromShared.php";
url=url+"?id=" + fileid + "&fid=" + folderid ;
//alert(url);
hint="newF";
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)

}
function removeTeamMember(teamid,folderid){
//alert(folderid);
 xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="sharedfoldermembersRemove.php";
url=url+"?id=" + teamid + "&folderid=" + folderid ;

hint1="txtmembers2";
hint2="teamnames";
xmlHttp.onreadystatechange=shareChange 

xmlHttp.open("GET",url,true)
xmlHttp.send(null)

//alert(url);
//hint="txtFolder";
//url=url+"&sid="+Math.random()
//xmlHttp.onreadystatechange=stateChanged 
//xmlHttp.open("GET",url,true)
//xmlHttp.send(null)

}

function addToFolder(fileid,folderid,action){

//folderid is the name of the folder.
 xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }

if(window.location.href.indexOf("project.php")==-1){
		hint="newF";
}else{
 if(window.document.getElementById("projectConfirm").style.display=="none"){
    window.document.getElementById("projectConfirm").style.display="block"
  }
		hint="projectConfirm";
 
}
var url="addToFolder.php";
url=url+"?id=" + fileid + "&fid=" + folderid + "&type=" + action + "&hint=" + hint;
url=url+"&sid="+Math.random()
//alert(url);
window.document.getElementById("popup").style.display="none";
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)

}
function removeNotePopup(subj,newnote2,fileid,noteid){
var contacts="";

 xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="notes_addnotes.php";
//url=url+"?noteid=" + fileid + "&action=remove";
url=url+"?subj=" + subj + "&note=" + newnote2 + "&cid=" + fileid + "&cont=" + contacts + "&act=remove" + "&noteid=" + noteid;
//alert(url);
hint="txtnotes";
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)

}
function removeNote(fileid){
//alert(fileid);
 xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="removeNote.php";
url=url+"?id=" + fileid;

hint="txtNote";
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)

}
function removeFeedback(fileid){
//alert(fileid);
 xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="removefeedback.php";
url=url+"?id=" + fileid;
//alert(url);
hint="txtNote";
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)

}
function removeMess(messid){
//alert(folderid);
 xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="removeMess.php";
url=url+"?id=" + messid;
//alert(url);
hint="txtMess";
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)

}
function removeFromFolder(fileid,type){
//alert(fileid);
 xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }


if(window.location.href.indexOf("project.php")==-1){
		hint="newF";
var url="removeFromFolder.php";
url=url+"?id=" + fileid + "&type=" + type + "&hint=" + hint;
}else{
 if(window.document.getElementById("projectConfirm").style.display=="none"){
    window.document.getElementById("projectConfirm").style.display="block"
  }
		hint="projectConfirm";
var url="projectremoveFromFolder.php";
url=url+"?id=" + fileid + "&type=" + type + "&hint=" + hint;
 
}

url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)

}
function moveSingleToFolder(id,folderid,type,fname,contentid,foldertype){

 xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="moveSingleToFolder.php";
url=url+"?id=" + id + "&folderid=" + folderid + "&type=" + type + "&fname=" + fname + "&contentid=" + contentid + "&foldertype=" + foldertype;
//alert(url);
hint="newF";
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)

}
function moveToFolder(fileid,folderid){

 xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="moveToFolder.php";
url=url+"?id=" + fileid + "&fin=" + folderid ;

hint="newF";
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)

}
function sendSuggest(value){

 xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="../send_sugg.php";
url=url+"?id=" + value;
//alert(url);
hint="txtSuggest";
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)

}

function getFile(){

 xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="../get_startfile.php"
url=url+"?q=";
//alert(url);
hint="txtHint";
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)

}
function shareContent(id){

 xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="team_shareContent.php"
url=url+"?q="+id;
//alert(url);
hint="txtHint";
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)

}
function removeFiles(reviewid,action,icount){

 xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
window.document.getElementById("action2").value=action;
var url="documentAddToReviewAll.php";
url=url+"?q="+reviewid + "&action="+action + "&icount=" + icount;
alert(url);
url=url+"&sid="+Math.random()

hint="reviewprojects";
xmlHttp.onreadystatechange=reviewChange 

//xmlHttp.onreadystatechange=stateChanged 
//xmlHttp.open("GET",url,true)
//xmlHttp.send(null)
xmlHttp.open("GET",url,true)
xmlHttp.send(null)

}
function addToReview(fid,action){

 xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }

var url="documentaddToReviewAll.php";
url=url+"?q="+fid + "&action=" + action;

url=url+"&sid="+Math.random()

hint="reviewprojects"
xmlHttp.onreadystatechange=reviewChange 

//xmlHttp.onreadystatechange=stateChanged 
//xmlHttp.open("GET",url,true)
//xmlHttp.send(null)
xmlHttp.open("GET",url,true)
xmlHttp.send(null)

}
function reviewChange() 
{ 
if(xmlHttp.readyState == 1){

document.getElementById(hint).innerHTML = "Loading please wait...";
}

if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
var action=window.document.getElementById("action2").value;
if(action=="remove"){
 data = xmlHttp.responseText
 document.getElementById(hint).innerHTML = loadFilesToReview();
}else{
 data = xmlHttp.responseText
 document.getElementById(hint).innerHTML = data;
}
 } 
}

function shareFolders(id,dir,folderid){

 xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }

var url="sharedfoldermembers.php";
//removed orgid form shared folders
url=url+"?q="+id + '&d='+ dir + "&id=" + folderid;
url=url+"&sid="+Math.random()

hint1="txtmembers2";
hint2="teamnames";
xmlHttp.onreadystatechange=shareChange 

//xmlHttp.onreadystatechange=stateChanged 
//xmlHttp.open("GET",url,true)
//xmlHttp.send(null)
xmlHttp.open("GET",url,true)
xmlHttp.send(null)

}
function share(orgid,id,dir,action){

 xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }

var url="add_sharecontent.php";

url=url+"?q="+id + '&org=' + orgid + '&d='+ dir;

hint="txtHint";
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)

}
function share2(orgid,id,dir){
//to share sites
 xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="add_share.php"
url=url+"?q="+id + '&org=' + orgid + '&d='+ dir;
//alert(url);
hint="txtHint";
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)

}
function remove(id,siteid){
 xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="./siteremovecontent.php"
url=url+"?fid="+id + "&siteid=" + siteid;

hint="txtHint";
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)

}
function moveContent(id,siteid,act){
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="files_sortorder.php"
url=url+"?fileid="+id+'&act='+act +'&site='+siteid;
hint="txtHint";
//alert(url);
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)

}

function moveTemplateContent(id,siteid,act,type){
 //alert(id);
// alert(siteid);
//alert(act);
 //alert("string subs" + str);
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
//var url="files_sortorder.php"
var url="siteMoveOrder.php";
url=url+"?q="+id+'&act='+act +'&site='+siteid + "&type=" + type;
//hint="txtHint";
hint="cat";
//alert(url);
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)

}

function getSubs(str,filename)
{ 
//alert("string subs" + str);
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="getSub.php"
url=url+"?q="+str+'&id='+filename
hint="txtHint";
//alert(url);
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
function addSub(fileid)
{ 
//alert("string " + fileid);
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="addSub.php"
url=url+"?q="+fileid
//alert(url);
hint="txtHint";
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
function addUser(cn, eadd)
{ 
//alert("string " + str);
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="addUser.php"
url=url+"?cn="+cn + "&en=" +eadd
//alert(url);
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
function getSubsA(str)
{ 
//alert("string a" + str);
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="getSub.php"
url=url+"?q="+str
//alert(url);
hint="txtHint";
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
function addFAQ(str,strb){
xmlHttp=GetXmlHttpObject()

if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="faq.php"
url=url+"?q="+str + "&a=" + strb
url=url+"&sid="+Math.random()
//alert(url);
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
function loadFAQ(str)
{ 
//alert("string " + str);
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
// alert ("Browser does not support HTTP Request")
 return
 }
var url="loadFAQ.php"
url=url+"?q="+str
//alert(url);
hint="faqHint";
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
function deletefromRecycle(id){
 
xmlHttp=GetXmlHttpObject()

if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="delete_recycleBin.php";
url=url+"?id="+id;
url=url+"&sid="+Math.random()
hint="txtFolder";
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
function restorefromRecycle(id){
 
xmlHttp=GetXmlHttpObject()

if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="move_fromrecycleBin.php";
url=url+"?id="+id;
url=url+"&sid="+Math.random()
hint="txtFolder";
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
function refreshFolder(str,action,type,pfid){
if (action=="d") {
alert("Folder has been deleted successfully!");
}
if (action=='a') {
alert("Folder has been added!");
}
if (action=='') {
alert("Enter a folder name!");
return;
}

xmlHttp=GetXmlHttpObject()

if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
if (type=="SF"){
//alert(type);
var url="sub_orgRefreshFolder.php"
}
if (type=="F"){
var url="orgRefreshFolder.php";
}
if(type="sharedF"){
var url="sub_RefreshsharedFolder.php";
}
url=url+"?q="+str;
//alert(url);
url=url+"&sid="+Math.random()
hint="refreshFolders";
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
function refreshTeamShare(id,fn,fid){

xmlHttp=GetXmlHttpObject()

if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="sharedfoldermembersRemove.php";
url=url+"?id="+id + "&fn=" + fn + "&fid=" + fid;
url=url+"&sid="+Math.random()
hint="txtTeam";
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
function orgdeleteFolder(str,text){
//alert(text);
xmlHttp=GetXmlHttpObject()

if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="orgdeleteFolder.php"
url=url+"?q="+str + "&txt=" + text;
//alert(url);
url=url+"&sid="+Math.random()
hint="new";
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
function orgaddFolder(str,text,type,pfid,tc,others){

xmlHttp=GetXmlHttpObject()

if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var projectid="";
var foldertype=document.getElementById("menutype").value;
var spanid=document.getElementById("spanid").value;
if(type=="FP"){
projectid=window.document.getElementById("id").value;

var url="projectCreateFolder.php";
url=url+"?foldername=" + text +"&projectid=" + projectid + "&hint=" + hint;
if(window.document.getElementById("projectConfirm").style.display=="none"){
    window.document.getElementById("projectConfirm").style.display="block"
  }
hint="projectConfirm";

}
if (type=="F"){
var url="orgaddFolder.php"
url=url+"?q="+str + "&txt=" + text +"&id=" + pfid + "&tc=" + tc + "&type=" + type + "&others=" + others ;
hint="newF";
}
if (type=="SF"){
var url="sub_orgaddsubFolder.php";
url=url+"?q="+str + "&txt=" + text +"&id=" + pfid + "&tc=" + tc + "&type=" + type + "&others=" + others ;

hint="newF";

}

if (type=="sharedF" || type=="sharedOF"){

hint="newF"
var url="sub_addsharedFolder.php";
url=url+"?q="+str + "&txt=" + text +"&id=" + pfid + "&tc=" + tc + "&type=" + type + "&others=" + others  + "&hint=" + hint;
}
if (type=="sharedSF"){

if(foldertype=="sharedownerR"){
	hint="newFR";
	var url="sub_addsharedFolder.php";
	url=url+"?q="+str + "&txt=" + text +"&id=" + pfid + "&tc=" + tc + "&type=" + type + "&others=" + others  + "&hint=" + hint ;
	
}else{
	if(window.location.href.indexOf("project.php")==-1){
		hint="newF";
	}else{
        if(window.document.getElementById("projectConfirm").style.display=="none"){
			window.document.getElementById("projectConfirm").style.display="block"
		}
		hint="projectConfirm";
        projectid=window.document.getElementById("id").value;
	}
	var url="sub_addsharedFolder.php";
	url=url+"?q="+str + "&txt=" + text +"&id=" + pfid + "&tc=" + tc + "&type=" + type + "&others=" + others + "&hint=" + hint + "&projectid=" + projectid ;
   //alert(url);
}
}

url=url+"&sid="+Math.random()

if(window.document.getElementById("input_popup").style.display=="block"){
 window.document.getElementById("input_popup").style.display="none";
}else if(window.document.getElementById("popup").style.display=="block"){
	window.document.getElementById("popup").style.display="none";
}
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)

}
function newtext(str,type){

xmlHttp=GetXmlHttpObject()

if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }

if (type=="F"){
var url="orgnewfolder.php";
}
if(type=="SF"){

var url="sub_orgnewsubfolder.php";
}
if (type=="sharedF"){
var url="sub_newsharedfolder.php";
}
url=url+"?q="+str;
url=url+"&sid="+Math.random()
hint="new";
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
function updateMessRead(messid){
xmlHttp=GetXmlHttpObject()

if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }

var url="updateMessage.php";
url=url+"?mess=" + messid;

hint="txtMessUpdate";

url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)

}
function getFolder(str){
//alert(str);
xmlHttp=GetXmlHttpObject()
//window.document.getElementById("loaderform").style.display="block";
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="orggetfolders.php"
url=url+"?q="+str
url=url+"&sid="+Math.random()
hint="showfolders";
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
function getProvState(str){
//alert(str);
xmlHttp=GetXmlHttpObject()

if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="getProvState.php"
url=url+"?q="+str
url=url+"&sid="+Math.random()
hint="txtHint";
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
function getProvState2(str){
//alert(str);
xmlHttp=GetXmlHttpObject()

if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="getProvState2.php"
url=url+"?q="+str
url=url+"&sid="+Math.random()
hint="txtHint";
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function stateChanged() 
{ 

if(xmlHttp.readyState == 1){

document.getElementById(hint).innerHTML = "Loading please wait...";
}

if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 {

if(hint=="projectConfirm"){
var projectid=document.getElementById("id").value;
document.getElementById(hint).innerHTML=xmlHttp.responseText
loadFolders2('1','PRFP',projectid);

}else{
document.getElementById(hint).innerHTML=xmlHttp.responseText
}
 } 
}
function GetXmlHttpObject()
{
var xmlHttp=null;
try
 {
 // Firefox, Opera 8.0+, Safari
 xmlHttp=new XMLHttpRequest();
 }
catch (e)
 {
 //Internet Explorer
 try
  {
  xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
  }
 catch (e)
  {
  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
 }
return xmlHttp;
}