
function getObjectByID(Objid) {
    var ns4 = document.layers;
    var ns6 = document.getElementById && !document.all;
    var ie4 = document.all;
    if (ns4) {
        return eval('document.' + Objid)
    }
    if (ns6) {
        return document.getElementById(Objid);
    }
    if (ie4) {
        return document.all(Objid);
    }
    return null
}

function SetText(objid, msg, fg, bg) {
    var ns4 = document.layers;
    var ns6 = document.getElementById && !document.all;
    var ie4 = document.all;
    if (!fg) fg = "#ff0000";
    if (!bg) bg = "#FFFFFF";

    var content = msg;
    if (ns4) {
        objItm = eval('document.' + objid)
        objItm.document.write(content);
        objItm.document.close();
        objItm.visibility = "visible";
    }
    if (ns6) {
        document.getElementById(objid).innerHTML = content;
    }
    if (ie4) {
        document.all(objid).innerHTML = content;
    }
}

function checkKey(b1, e) {
    if (e.keyCode == 13) {
        document.getElementById(b1).click();
        return false;
    }
}


function checkKey11(e) {
    if (e.keyCode == 13) {
        txtSearchVal = document.getElementById('ctl00_txtSearch3')
        if (txtSearchVal.value != '') {
            //alert('asdf');
            GetWeatherCast(txtSearchVal.value.toLowerCase());
            //alert('sdfsdf');
            return false;
        }
        return false;
    }
}

function checkKey11img() {
    txtSearchVal = document.getElementById('ctl00_txtSearch3')
    if (txtSearchVal.value != '') {
        GetWeatherCast(txtSearchVal.value.toLowerCase());
        return false;
    }
    return false;
}

function checkKey22img() {
    txtSearchVal = document.getElementById('txtSearch3')
    if (txtSearchVal.value != '') {
        GetWeatherCast(txtSearchVal.value.toLowerCase());
        return false;
    }
    return false;
}

function checkKey22(e) {
    if (e.keyCode == 13) {
        txtSearchVal = document.getElementById('txtSearch3')
        if (txtSearchVal.value != '') {
            //alert('asdf');
            GetWeatherCast(txtSearchVal.value.toLowerCase());
            //alert('sdfsdf');
            return false;
        }
        return false;
    }
}

function birthshow() {
    document.getElementById("ctl00_ContentPlaceHolder1_trbirthday").style.display = '';
    document.getElementById("ctl00_ContentPlaceHolder1_imgarrow1").src = 'images/aero.jpg';
}
function birthhide() {
    document.getElementById("ctl00_ContentPlaceHolder1_trbirthday").style.display = 'none';
    document.getElementById("ctl00_ContentPlaceHolder1_imgarrow1").src = 'images/aero-left.jpg';
}



function deathshow() {
    document.getElementById("ctl00_ContentPlaceHolder1_trdeathday").style.display = '';
    document.getElementById("ctl00_ContentPlaceHolder1_imgarrow2").src = 'images/aero.jpg';
}
function deathhide() {
    document.getElementById("ctl00_ContentPlaceHolder1_trdeathday").style.display = 'none';
    document.getElementById("ctl00_ContentPlaceHolder1_imgarrow2").src = 'images/aero-left.jpg';
}


function calendarshow() 
{
    if (document.getElementById("ctl00_ContentPlaceHolder1_trcalendar").style.display == '') 
    {
        document.getElementById("ctl00_ContentPlaceHolder1_trcalendar").style.display = 'none';
        document.getElementById("ctl00_ContentPlaceHolder1_imgcal").src = 'images/max.gif';
    }
    else 
    {
        document.getElementById("ctl00_ContentPlaceHolder1_trcalendar").style.display = '';
        document.getElementById("ctl00_ContentPlaceHolder1_imgcal").src = 'images/min.gif';
    }
}



function weathershow() 
{
    if (document.getElementById("ctl00_ContentPlaceHolder1_trweather").style.display == '') 
    {
        document.getElementById("ctl00_ContentPlaceHolder1_trweather").style.display = 'none';
        document.getElementById("ctl00_ContentPlaceHolder1_imgweather").src = 'images/max.gif';
    }
    else 
    {
        document.getElementById("ctl00_ContentPlaceHolder1_trweather").style.display = '';
        document.getElementById("ctl00_ContentPlaceHolder1_imgweather").src = 'images/min.gif';
    }
}









function BirthajaxFunction(month, day) {
    document.getElementById("ctl00_ContentPlaceHolder1_div1").innerHTML = "<img src='images/loader.gif' />";
    var xmlHttp;
    try {
        // Firefox, Opera 8.0+, Safari
        xmlHttp = new XMLHttpRequest();
    }
    catch (e) {
        // Internet Explorer
        try {
            xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
        }
        catch (e) {
            try {
                xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
            }
            catch (e) {
                alert("Your browser does not support AJAX!");
                return false;
            }
        }
    }
    xmlHttp.onreadystatechange = function() {
        if (xmlHttp.readyState == 4) {
            //alert(xmlHttp.responseText);
            document.getElementById("ctl00_ContentPlaceHolder1_div1").innerHTML = xmlHttp.responseText;
        }
    }
    xmlHttp.open("GET", "getbstr.aspx?month=" + month + "&day=" + day, true);
    xmlHttp.send(null);
}



function DeathajaxFunction(month, day) {
    document.getElementById("ctl00_ContentPlaceHolder1_div2").innerHTML = "<img src='images/loader.gif' />";
    var xmlHttp;
    try {
        // Firefox, Opera 8.0+, Safari
        xmlHttp = new XMLHttpRequest();
    }
    catch (e) {
        // Internet Explorer
        try {
            xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
        }
        catch (e) {
            try {
                xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
            }
            catch (e) {
                alert("Your browser does not support AJAX!");
                return false;
            }
        }
    }
    xmlHttp.onreadystatechange = function() {
        if (xmlHttp.readyState == 4) {
            //alert(xmlHttp.responseText);
            document.getElementById("ctl00_ContentPlaceHolder1_div2").innerHTML = xmlHttp.responseText;
        }
    }
    xmlHttp.open("GET", "getdstr.aspx?month=" + month + "&day=" + day, true);
    xmlHttp.send(null);
}


function photoloader() 
{
    document.getElementById("ctl00_ContentPlaceHolder1_imgphoto").src = "images/loader.gif";
}








function homedatetime(flag) 
{

    var currentDate = new Date()
    var strdate;
    var strtime;

    strdate = currentDate.toLocaleDateString().replace(',', '').replace(',', '');
    strtime = currentDate.toLocaleTimeString();

    var arr;
    arr = strdate.split(" ");
    //document.write(arr[0] + ' ' + arr[2] + ' ' + arr[1] + ' ' + arr[3]);

    var arr1;
    arr1 = strtime.split(' ');
    //document.write(arr1[0].substring(0, arr1[0].length - 3) + ' ' + arr1[1]);

    var strfinal;
    strfinal = arr[0] + ' ' + arr[2] + ' ' + arr[1] + ' ' + arr[3] + ', ' + arr1[0].substring(0, arr1[0].length - 3) + ' ' + arr1[1];
    //document.write(strfinal);
    if(flag==1){
        document.getElementById("ctl00_spdatetime").innerHTML = strfinal;
    }else{
        document.getElementById("spdatetime").innerHTML = strfinal;
    }
}

function getCookie(Name){ 
	var re=new RegExp(Name+"=[^;]+", "i"); //construct RE to search for target name/value pair
	if (document.cookie.match(re)) //if cookie found
		return document.cookie.match(re)[0].split("=")[1] //return its value
	return ""
}


function checkAuthor(){
    var rpQuote  = document.getElementById("Quote");
    var inputcount = Quote.getElementsByTagName("input").length;
    for (var i = 1; i < inputcount; i++){
        var input = Quote.getElementsByTagName("input")[i];
        var input1 = Quote.getElementsByTagName("input")[i-1];
        if ((input.getAttribute("type") == "hidden") && (input1.getAttribute("type") == "hidden")){
            if(input.value==input1.value){
                 var tdPhoto = document.getElementById("ctl00_ContentPlaceHolder1_rpQuote_ctl0" + i + "_tdQuote");
                 var tdQuote = document.getElementById("ctl00_ContentPlaceHolder1_rpQuote_ctl0" + i + "_tdPhoto");
                 tdPhoto.style.display="none";
                 tdQuote.style.display="none";
                 
                 
                 var ulQuote1 = document.getElementById("ctl00_ContentPlaceHolder1_rpQuote_ctl0" + i + "_ulQuote");
                 if(document.getElementById("ctl00_ContentPlaceHolder1_rpQuote_ctl0" + (i-1) + "_tdQuote").style.display=="none"){
                    var ulQuote = document.getElementById("ctl00_ContentPlaceHolder1_rpQuote_ctl0" + (i-2) + "_ulQuote");
                    ulQuote.innerHTML = ulQuote.innerHTML + ulQuote1.innerHTML;
                 }
                 else{
                    var ulQuote = document.getElementById("ctl00_ContentPlaceHolder1_rpQuote_ctl0" + (i-1) + "_ulQuote");
                    ulQuote.innerHTML = ulQuote.innerHTML + ulQuote1.innerHTML;
                 }
            }
        }
    }
}

function winpopupimage(imgname){
    window.open("ViewImg.aspx?img=" + imgname ,"mywindow","toolbar=0,directories=0,location=0,resizable=1,width=350,height=350");
}	
	
