﻿// JScript File

function format_sel_3(v) {
            var str = document.selection.createRange().text;
            document.getElementById("ctl00_cphMain_UC_Add_New_Event1_TextBox2").focus();
            var sel = document.selection.createRange();
            sel.text = "<" + v + ">" + str + "</" + v + ">";
            return;
        }
        
        function insert_link3() {
          var str = document.selection.createRange().text;
            document.getElementById("ctl00_cphMain_UC_Add_New_Event1_TextBox2").focus();
            var my_link = prompt("Enter URL:","http://");
        if (my_link != null) {
            var sel = document.selection.createRange();
	        sel.text = "<a href=\"" + my_link + "\">" + str + "</a>";
        }
          return;
        }         
	
	    function format_sel_2(v) {
            var str = document.selection.createRange().text;
            document.getElementById("ctl00$cphMain$UC_SecondaryParagraphList1$ctl00$LoginView1$tbParagraph").focus();
            var sel = document.selection.createRange();
            sel.text = "<" + v + ">" + str + "</" + v + ">";
            return;
        }
        
        function insert_link2() {
          var str = document.selection.createRange().text;
            document.getElementById("ctl00$cphMain$UC_SecondaryParagraphList1$ctl00$LoginView1$tbParagraph").focus();
            var my_link = prompt("Enter URL:","http://");
        if (my_link != null) {
            var sel = document.selection.createRange();
	        sel.text = "<a href=\"" + my_link + "\">" + str + "</a>";
        }
          return;
        }         
	
	
        function format_sel(v) {
            var str = document.selection.createRange().text;
            document.getElementById("ctl00_cphMain_UC_Enter_New_Posting1_TextBox2").focus();
            var sel = document.selection.createRange();
            sel.text = "<" + v + ">" + str + "</" + v + ">";
            return;
        }
        
        function insert_link() {
          var str = document.selection.createRange().text;
            document.getElementById("ctl00_cphMain_UC_Enter_New_Posting1_TextBox2").focus();
            var my_link = prompt("Enter URL:","http://");
        if (my_link != null) {
            var sel = document.selection.createRange();
	        sel.text = "<a href=\"" + my_link + "\">" + str + "</a>";
        }
          return;
        }         
        function Hide_UpdateSuccessful() {
            document.getElementById("ctl00_divTag").style.display='none';
            //document.getElementById("UC_Enter_New_Posting1$TextBox1").value='';
            //document.getElementById("UC_Enter_New_Posting1$TextBox2").value='';
            document.location.replace("http://dchsalumni.townmvideo.com/default.aspx");
            
            //document.location.replace("http://localhost:1527/DCHS_2010/Site_Default.aspx");
            //document.location.replace("http://dchsalumni.townmvideo.com/Site_Default.aspx");
        }       
        
        function Display_UpdateCancelled() {
            var x = (window.innerWidth / 2) - (document.getElementByID("ct100_divTag2").offsetWidth / 2);
            var y = (window.offsetHeight / 2) - (document.getElementByID("ct100_divTag2").offsetHeight / 2);              
            document.getElementByID("ct100_divTag2").style.top = y;
            document.getElementByID("ct100_divTag2").style.left = x;
            document.getElementById("ctl00_divTag2").style.display='block';
        }       
         
        function Hide_UpdateCancelled() {
            
            document.getElementById("ctl00_divTag2").style.display  ='none';
        }       
        
        function Hide_Error() {
            document.getElementById("ctl00_divTag3").style.display  ='none';
            document.location.replace("http://dchsalumni.townmvideo.com/Default.aspx");
            //document.getElementById("ctl00_cphMain_UC_Enter_New_Posting1_TextBox1").value='';
            //document.getElementById("ctl00_cphMain_UC_Enter_New_Posting1_TextBox2").value='';
            //document.getElementById("ctl00_cphMain_UC_Enter_New_Posting1_dtParagraphExpires_dateInput_TextBox").value='';
            //document.location.replace("http://localhost:3788/DCHS_2030/Site_DefaultMain.aspx");
            //execscript(AddAnother(),"javascript");
        }
        
       function AddAnother() {
           var answer = confirm("Do you want to add another post?", 2, 2);    

            /* Question icon, Yes/No button. */
            /* 0 = error, 1 = OK, 2 = Cancel, 3 = No, 4 = Yes */

            if (answer == 4)
            {
                
            }
            else
            {
                document.location.replace("http://dchsalumni.townmvideo.com/Default.aspx");
            }
        }

       


        function CloseAddParagraph() {
            //document.location.replace("http://localhost:1527/DCHS_2010/Site_Default.aspx");
            document.location.replace("http://dchsalumni.townmvideo.com/Default.aspx");
        }
                
        function Change_Error_Text(msg) {
            var obj = document.getElementById("P2");
            obj.innerhtml = msg;
        }
        


        // PopUp Maker 5.0 by CodeBrain.com
        // PopUp Window Script
        // Place this script in the <head> of your page.

        var ShowDraftsX = (screen.width/2)-150;
        var ShowDraftsY = (screen.height/2)-200;
        var pos = "left="+ShowDraftsX+",top="+ShowDraftsY;

        function ShowDrafts(){
        ShowDraftsWindow = window.open("pop_ShowDrafts.aspx","pop_Drafts","width=500,height=650,"+pos);
        }

        
