﻿//GLOBAL VARS
var conName = "ct100_cpContent_";
var conNameVid = "ct100_cpWelcomeVid_";

function getBaseURL() {
    var url = location.href;  // entire url including querystring - also: window.location.href;
    var baseURL = url.substring(0, url.indexOf('/', 14));


    if (baseURL.indexOf('http://localhost') != -1) {
        // Base Url for localhost
        var url = location.href;  // window.location.href;
        var pathname = location.pathname;  // window.location.pathname;
        var index1 = url.indexOf(pathname);
        var index2 = url.indexOf("/", index1 + 1);
        var baseLocalUrl = url.substr(0, index2);

        return baseLocalUrl + "/";
    }
    else {
        // Root Url for domain name
        return baseURL + "/";
    }

}
 

function doFocus()
{
    document.getElementById("txtMainTitle").className += "teaseTitleBlack";
}

function doBlur()
{
    document.getElementById("txtMainTitle").className = document.getElementById("txtMainTitle").className.replace(/\bteaseTitleBlack\b/, 'teaseTitleBlackSmll')
}


function doFocusNews() {
    document.getElementById("txtNewsTitle").className += "teaseTitleBlack";
}

function doBlurNews() {
    document.getElementById("txtNewsTitle").className = document.getElementById("txtNewsTitle").className.replace(/\bteaseTitleBlack\b/, 'teaseTitleBlackSmll')
}

function stop_onclick(inVideo) {
    if (welcomeVideo) {
        welcomeVideo.pauseVideo();
    }
}

function callNews(inID) {
    
    window.location.href = getBaseURL() + "News.aspx?id=" + inID
}

function callBlog(inID) {
    window.location.href = getBaseURL() + "Blog.aspx?id=" + inID}

function goToMoreProj() {
    //window.location.href = ("http://www.themoreproject.org/")
}


function goToCall() {
    window.location.href = getBaseURL() + "Call.aspx"
}

function saveRegistration() {
    __doPostBack('', '');
}

function startLogout() {
      __doPostBack('', '');
 }

function confirmRegistration() {
    alert("You have been added to Ruth's email list");
}

function underConst() {
    alert("This button is under construction");
}

function needBlogTitle() {
    alert("Your blog needs a title");
}

function newsPublished() {
    alert("Your news item has been published");
}

function needNewsTitle() {
    alert("Your news item needs a title");
}

function needCallTitle() {
    alert("Your call link needs a title and call link in order to be saved");
}


function goToCall(inLink) {
    alert(inLink)
    //window.open(inLink.toString(),'mywindow','width=400,height=200');
}
