//refresh script
function refresh()
{
      window.location.reload( false );
}

// Insert Controls variables

// General Inaert permissions
var insertStatus

// insertText
var insertTextWhere = "insertText"
var insertTextWhereBt = "insertTextBt"

// adddoclink
var addDocLinkWhere = "insertDocLink"

// addimage
var addImageWhere = "insertImage"

// addlink
var addlinkwhere = "addlink"

// addUserlist
var addUserlistwhere = "insertUserList"

// addBulletlist
var addBulletlistwhere ="insertBulletList"
var addBulletlistBtwhere ="insertBulletBtList"

// addNumlist
var addNumlistwhere ="numberUserList"

// addmedia
var addMediawhere = "insertMedia"
var addMediaBtwhere = "insertMediaBt"

// headpara
var headParaWhere = "insertPara"

// headparaBt
var headParaBtWhere = "insertParaBt"

// realView
var realViewWhere = "insertRealview"

// realViewBt
var realViewBtWhere = "insertRealviewBt"

// textLink
var textLinkWhere = "textLink"
var textLinkBtWhere = "textLinkBt"

// End of insert controls
//


// start action calls
function fileAction (call, where)

{

if (call == "adddoclink")

        {

        if (adddoclink == "no"){

             alert ("Can not perform this action now!");

                                        }

        else if (adddoclink == "nosupport"){

             alert ("This page does not support document linking!");

                                        }

        else if (adddoclink == "yes"){

            editWin('../edit_insert_doc.html');

                                        }

                }


if (call == "addimage")

        {

        if (addimage == "no"){

             alert ("Can not perform this action now!");

                                }

        else if (addimage == "nosupport"){

             alert ("This page does not allow image insertion!");

                                        }

        else if (addimage == "yes"){

            editWin('../imageedit.html');

                                        }
        }


if (call == "addlink")

        {

        if (addlink == "no"){

             alert ("Can not perform this action now!");

                                        }

        else if (addlink == "nosupport"){

             alert ("This page does not allow this operation!");

                                        }

        else if (addlink == "yes") {
        messWin();
        DoSubmit(addlinkwhere);

                }


        }



 if (call == "addUserlist")

        {

        if (addUserlist == "no"){

             alert ("Can not perform this action now!");

                                        }

        else if (addUserlist == "nosupport"){

             alert ("This page does not allow lists insertion!");

                                        }

        else if (addUserlist == "yes"){

            editWin(addUserlistwhere);

                                }

                }


if (call == "addMedia")

        {

        if (addMedia == "no"){

             alert ("Can not perform this action now!");

                                        }

		// General insertStatus					
        if (insertStatus == "nosupport"){

             alert ("This page does not allow media insertion!");

                            }	
																	
        else if (addMedia == "nosupport"){

             alert ("This page does not allow media insertion!");

                                        }

        else if (addMedia == "inprogress"){

             alert ("This page currently in Edit Mode!");

                                        }

        else if (addMedia == "yes"){

        messWin();
        DoSubmit(addMediawhere);

                        }

        }


if (call == "addMediaBt")

        {

        if (addMediaBt == "no"){

             alert ("Can not perform this action now!");

                                        }
										
		// General insertStatus					
        if (insertStatus == "nosupport"){

             alert ("This page does not allow media insertion!");

                            }											

        else if (addMediaBt == "nosupport"){

             alert ("This page does not allow media insertion!");

                                        }

        else if (addMediaBt == "inprogress"){

             alert ("This page currently in Edit Mode!");

                                        }

        else if (addMediaBt == "yes"){

        messWin();
        DoSubmit(addMediaBtwhere);

                        }

        }



 if (call == "addBulletlist")

        {

        if (addBulletlist == "no"){

             alert ("Can not perform this action now!");

                                        }

        else if (addBulletlist == "nosupport"){

             alert ("This page does not allow lists insertion!");

                                        }



        else if (addBulletlist == "yes") {
        messWin();
        DoSubmit(addBulletlistwhere);

                }

        }

 if (call == "addBulletBtlist")

        {

        if (addBulletBtlist == "no"){

             alert ("Can not perform this action now!");

                                        }

        else if (addBulletBtlist == "nosupport"){

             alert ("This page does not allow lists insertion!");

                                        }



        else if (addBulletBtlist == "yes") {
        messWin();
        DoSubmit(addBulletlistBtwhere);

                }

        }




if (call == "addNumlist")

        {

        if (addNumlist == "no"){

             alert ("Can not perform this action now!");

                                        }

        else if (addNumlist == "nosupport"){

             alert ("This page does not allow lists insertion!");

                                        }

        else if (addNumlist == "yes"){

            editWin(addNumlistwhere);

                        }

                }


if (call == "createpage")

        {

        if (createpage == "no"){

             alert ("This action is not allowed at this time.");

                                        }

        else if (createpage == "samepage"){

             alert ("This is the current control!");

                                        }

        else if (createpage == "inprogress"){

             alert ("This action is not allowed while editing is in progress. \n Click \"Preview Page\" and try again!");

                                        }

        else if (createpage == "sitesection"){

             alert ("Please go to the site section to create a new page!");

                                        }

        else if (createpage == "yes"){

              window.location.href=('file_add_page.html');

                                }

                }

// Not used at this time
if (call == "createsection")

        {

        if (createsection == "no"){

             var fileName = prompt("Enter a file name:");

                                }

        else if (createsection == "inprogress"){

             alert ("This action is not allowed while editing is in progress. \n Click \"Preview Page\" and try again!");

                                        }

        else if (createsection == "yes"){

              window.location.href=('file_add_section.html');

                                        }

        }



if (call == "edit")

        {

        if (edit == "no"){

             alert ("No editing allowed at this time!");

                                        }

        else if (edit == "nosupport"){

             alert ("This page can not be edited!");

        }


        else if (edit == "inprogress"){
             alert ("Edit in Progress!");

                        }

        else if (edit == "yes"){

              window.location.href=(local);

                                        }

                        }


if (call == "headpara")

        {

        if (headpara == "no"){

             alert ("Can not add new items now!");

                            }

        else if (headpara == "nosupport"){

             alert ("This page does not support text insertion!");

                               }
        else if (headpara == "frames"){

             alert ("You have loaded the frame pages. To do insertion you must have only the page\n you wish to insert an element to, in the editing window!\n\n Click \"Edit/Insert.\" at the top of the page you wish to insert to.\n If the page does not have this, it may not support insertion.");

                               }

        else if (headpara == "yes") {
        messWin();
        DoSubmit(headParaWhere);

                }

        }

if (call == "headparaBt")

        {

        if (headparaBt == "no"){

             alert ("Can not add new items now!");

                            }

        else if (headparaBt == "nosupport"){

             alert ("This page does not support text insertion!");

                               }
        else if (headparaBt == "frames"){

             alert ("You have loaded the frame pages. To do insertion you must have only the page\n you wish to insert an element to, in the editing window!\n\n Click \"Edit/Insert.\" at the top of the page you wish to insert to.\n If the page does not have this, it may not support insertion.");

                               }

        else if (headparaBt == "yes") {
        messWin();
        DoSubmit(headParaBtWhere);

                }

        }


if (call == "insertText")

        {

        if (insertText == "no"){

             alert ("Can not add new items now!");

                            }
							
		// General insertStatus					
        if (insertStatus == "nosupport"){

             alert ("This page does not support text insertion!");

                            }								

        if (insertText == "nosupport"){

             alert ("This page does not support text insertion!");
                                 }

        else if (insertText == "yes") {
        messWin();
        DoSubmit(insertTextWhere);
                }


        }


if (call == "insertTextBt")

        {

        if (insertTextBt == "no"){

             alert ("Can not add new items now!");

                            }

		// General insertStatus					
        if (insertStatus == "nosupport"){

             alert ("This page does not support text insertion!");

                            }	
														
        if (insertTextBt == "nosupport"){

             alert ("This page does not support text insertion!");

                                        }

        else if (insertTextBt == "yes") {
        messWin();
        DoSubmit(insertTextWhereBt);
                }


        }


if (call == "notes")

        {

        if (notes == "no"){

             alert ("Can not add notes here!");

                                        }


                else if (notes == "nosupport"){

             alert ("This page does not support notes!");

                                       }

             else if (notes == "yes"){

             editWin(noteswhere);
                        }

             }



if (call == "notesSection")

        {

        if (notesSection == "no"){

             alert ("Can not add notes here!");

                                        }


        else if (notesSection == "notsection"){

             alert ("Can not add section notes here. \nYou must first go to a site section!");

                                        }

        else if (notesSection == "nosupport"){

             alert ("This page does not support notes!");

                                         }

        else if (notesSection == "yes"){

             editWin(notesSectionwhere);

                                }

                }


if (call == "notesPage")

        {

        if (notesPage == "no"){
             alert ("Can not add notes here!");

                                        }

        else if (notesPage == "nosupport"){

             alert ("This page does not support notes!");

                                         }


        else if (notesPage == "yes"){

             editWin(notesPagewhere);

                                        }

                        }



if (call == "notesPreview")

        {

        if (notesPreview == "no"){

             alert ("Sorry, can not preview notes now!");

                                }

        else if (notesPreview == "nosupport"){

             alert ("This page does not support notes!");

                                         }

        else if (notesPreview == "yes"){

             editWin(notesPreviewwhere);

                        }

                }



if (call == "notesSectionPreview")

        {

        if (notesSectionPreview == "no"){

             alert ("Sorry, can not preview notes now!");

                                        }

        else if (notesSectionPreview == "notsection"){

             alert ("Can not view section notes here. \nYou must first go to a site section!");

                                        }

                else if (notesSectionPreview == "nosupport"){

             alert ("This page does not support notes!");

                                         }


             else if (notesSectionPreview == "yes"){

             editWin(notesSectionPreviewwhere);

                                        }

                        }



if (call == "notesPagePreview")

        {

        if (notesPagePreview == "no"){

             alert ("Sorry, can not preview notes now!");

                                        }

                else if (notesPagePreview == "nosupport"){

             alert ("This page does not support notes!");

                                         }

             else if (notesPagePreview == "yes"){

             editWin(notesPagePreviewwhere);

                                        }

                        }



if (call == "preview")

        {

        if (preview == "no"){

             alert ("Preview is not allowed at this time!");

                        }

        else if (preview == "frames"){

               if(confirm ("Preview is not allowed in Frames Mode. To view the individual pages, click Cancel and;\n Go to; File --> Site Section --> and select the section for this content, or\n Click OK to Preview the Web Site in it's entierty."))
            window.location.href=(local);
             else {}
                }

        else if (preview == "nosupport"){
             alert ("Nothing to preview!");

                        }

        else if (preview == "inprogress"){
             alert ("Preview in Progress!");

                        }

        else if (preview == "yes"){

             window.location.href=(local);

                        }


             }


 if (call == "realView")

        {

        if (headpara == "no"){

             alert ("Can not add new items now!");

                            }
							
		// General insertStatus					
        if (insertStatus == "nosupport"){

             alert ("CThis page does not support text insertion!");

                            }								

        else if (realView == "nosupport"){

             alert ("This page does not support text insertion!");

                               }
        else if (realView == "frames"){

             alert ("You have loaded the frame pages. To do insertion you must have only the page\n you wish to insert an element to, in the editing window!\n\n Click \"Edit/Insert.\" at the top of the page you wish to insert to.\n If the page does not have this, it may not support insertion.");

                               }

        else if (realView == "yes") {
        messWin();
        DoSubmit(realViewWhere);

                }

        }



if (call == "realViewBt")

        {

        if (realViewBt == "no"){

             alert ("Can not add new items now!");

                            }
		// General insertStatus					
        if (insertStatus == "nosupport"){

             alert ("This page does not support text insertion!");

                            }								

        else if (realViewBt == "nosupport"){

             alert ("This page does not support text insertion!");

                               }
        else if (realViewBt == "frames"){

             alert ("You have loaded the frame pages. To do insertion you must have only the page\n you wish to insert an element to, in the editing window!\n\n Click \"Edit/Insert.\" at the top of the page you wish to insert to.\n If the page does not have this, it may not support insertion.");

                               }

        else if (realViewBt == "yes") {
        messWin();
        DoSubmit(realViewBtWhere);

                }

        }


if (call == "save")

        {

        if (save == "no"){

            alert ("Can not Save at this time!");
                        }

        if (save == "nosupport"){

           alert ("This page can not be saved in this manner!");
                        }

        else if (save == "yes")
                {

             if(confirm ("Saving File..."))
             DoSubmit(saveWhere);
             else {}
                }

        }



if (call == "saveas")

        {

        if (saveas == "no"){

             alert ("Can not Save at this time!");

                                        }
        if (saveas == "nosupport"){

           alert ("This page can not be saved in this manner!");
                        }


        else if (saveas == "yes"){

           var fileName = prompt("Enter the new file name:");

                        }

        }



if (call == "style")

        {

        if (style == "no"){

             alert ("No styles to edit now!");

                                }

        else if (style == "yes"){

              window.location.href=('edit_style.html');

                                }


        }


if (call == "textLink")

        {

        if (textLink == "no"){

             alert ("Can not add new items now!");

                            }

        else if (textLink == "nosupport"){

             alert ("This page does not support insertion of this item!");

                               }
        else if (textLink == "frames"){

             alert ("You have loaded the frame pages. To do insertion you must have only the page\n you wish to insert an element to, in the editing window!\n\n Click \"Edit/Insert.\" at the top of the page you wish to insert to.\n If the page does not have this, it may not support insertion.");

                               }

        else if (textLink == "yes") {
        messWin();
        DoSubmit(textLinkWhere);

                }

        }

 if (call == "textLinkBt")

        {

        if (textLinkBt == "no"){

             alert ("Can not add new items now!");

                            }

        else if (textLinkBt == "nosupport"){

             alert ("This page does not support insertion of this item!");

                               }
        else if (textLinkBt == "frames"){

             alert ("You have loaded the frame pages. To do insertion you must have only the page\n you wish to insert an element to, in the editing window!\n\n Click \"Edit/Insert.\" at the top of the page you wish to insert to.\n If the page does not have this, it may not support insertion.");

                               }

        else if (textLinkBt == "yes") {
        messWin();
        DoSubmit(textLinkBtWhere);

                }

        }


if (call == "upload")

        {

        if (upload == "no"){

             alert ("Can not upload images now!");

                                        }

        else if (upload == "yes"){

              window.location.href=('upload_image.html');

                                }

        }


}// end program