


function stripHTML(strHTML) {
    var re = new RegExp;
    re = /<(.|\n)+?>/gi;
    return strHTML.replace(re, "");
    return strHTML

}

function isEmailValid(str) {

    var at = "@"
    var dot = "."
    var lat = str.indexOf(at)
    var lstr = str.length
    var ldot = str.indexOf(dot)
    if (str.indexOf(at) == -1) {
        return false
    }

    if (str.indexOf(at) == -1 || str.indexOf(at) == 0 || str.indexOf(at) == lstr) {
        return false
    }

    if (str.indexOf(dot) == -1 || str.indexOf(dot) == 0 || str.indexOf(dot) == lstr) {
        return false
    }

    if (str.indexOf(at, (lat + 1)) != -1) {
        return false
    }

    if (str.substring(lat - 1, lat) == dot || str.substring(lat + 1, lat + 2) == dot) {
        return false
    }

    if (str.indexOf(dot, (lat + 2)) == -1) {
        return false
    }

    if (str.indexOf(" ") != -1) {
        return false
    }

    return true
}



function swapImage(img) {
    thisSrc = img.src
    if (thisSrc.indexOf("On.gif") == -1) {	//leave alone if on
        if (thisSrc.indexOf("Over") > 0) {	//over, turn off
            thisSrc = thisSrc.replace("Over.gif", ".gif")
            img.src = thisSrc
        } else {	//turn over
            thisSrc = thisSrc.replace(".gif", "Over.gif")
            img.src = thisSrc
        }
    }

}

//for use with any ajax calls													
var request = false;
var requestPrivate = false
try {
    request = new XMLHttpRequest();
} catch (trymicrosoft) {
    try {
        request = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (othermicrosoft) {
        try {
            request = new ActiveXObject("Microsoft.XMLHTTP");
        } catch (failed) {
            request = false;
        }
    }
}


function swlaunchgraybox(strTitle, url, width, height) {
    //see if this is an external url
    if (url.search("http://") >= 0 || url.search("https://") >= 0) {
        url = url
    } else { //internal grey box
        url = "/assets/1/GreyBoxes/" + url
    }
    GB_show(strTitle, url, height, width);
}

function swapContent(inDiv, outDiv) {

    if (document.getElementById(inDiv) && document.getElementById(outDiv)) {

        document.getElementById(outDiv).innerHTML = document.getElementById(inDiv).innerHTML;
        document.getElementById(inDiv).innerHTML = "";
        document.getElementById(inDiv).style.display = "none";
        document.getElementById(inDiv).style.visibility = "hidden";
    }

}

//-->	
