﻿// JScript File
message = "TownerTech Opening Windows for Business Solutions.";
pos = 0;
maxlength = message.length + 1;
timeamount = 50

function setmsg(text, newtimeamount) {
    message = text;
    pos = 0;
    maxlength = message.length + 1;
    timeamount = newtimeamount
}
function writemsg() {
    if (pos < maxlength) {
        txt = message.substring(pos, 0);
        //document.forms[0].msgfield.value = txt;
        document.getElementById("msg").innerHTML = txt;
        pos++;
        timer = setTimeout("writemsg()", timeamount);
    }
    else {
        pos = 0;
        timer = setTimeout("writemsg()", timeamount);
    }
}

function popUp(targetURL,newWidth,newHeight) {
    var windowWidth = "width=" + newWidth + "px";
    var windowHeight = "height=" + newHeight + "px";

    var options = windowWidth + ","+ windowHeight +",status=1";
    //var options = windowWidth + "," + windowHeight + ",status=1,scrollbars,resizable";
    var popUpWindow = window.open(targetURL, "", options);
    //var popUpWindow = window.open(targetURL, "", "width=559px,height=408px,status,scrollbars,resizable");
}

function popUpTwo(targetURL, newWidth, newHeight) {
    var windowWidth = "width=" + newWidth + "px";
    var windowHeight = "height=" + newHeight + "px";

    //var options = windowWidth + ","+ windowHeight +",status=1";
    var options = windowWidth + "," + windowHeight + ",status=1,scrollbars,resizable";
    var popUpWindow = window.open(targetURL, "", options);
    //var popUpWindow = window.open(targetURL, "", "width=559px,height=408px,status,scrollbars,resizable");
}

function blinking_header(id) {
    if (!document.getElementById(id).style.color) {
        document.getElementById(id).style.color = "red";
    }
    if (document.getElementById(id).style.color == "red") {
        document.getElementById(id).style.color = "black";
    }
    else {
        document.getElementById(id).style.color = "red";
    }
    timer = setTimeout("blinking_header('" + id + "')", 500);
}


function stoptimer() {
    clearTimeout(timer);
}

function writeText(id, txt) {
    document.getElementById(id).innerHTML = txt;
}
function mouseOver(id, tag) {
    document.getElementById(id).src = tag;
}
function mouseOut(id, tag) {
    document.getElementById(id).src = tag;
}
function popUpMail(targetURL, newWidth, newHeight) {
    var windowWidth = "width=" + newWidth + "px";
    var windowHeight = "height=" + newHeight + "px";
    //var options = windowWidth + "," + windowHeight + ",status=1,location=0";
    var options = windowWidth + "," + windowHeight + ",status,resizable,scrollbars";
    //var options = windowWidth + "," + windowHeight;
    var popUpWindow = window.open(targetURL, "", options);
    //var popUpWindow = window.open(targetURL, "", "width=559px,height=408px,status,scrollbars,resizable");
}

function reset() {
    document.forms[0].reset();
}

function valClose() {
    window.opener = self;
    window.close();
}
function valSubmit() {
    var isValid = false;
    if (typeof (Page_ClientValidate) == 'function') {
        isValid = Page_ClientValidate();
    }
    if (isValid) {
        txt = "<div  align='center'>";
        txt += "<b> .... Sending Mail please do not click on Submit Button </b> </div>";
        document.getElementById("msg").innerHTML = txt;
    }
}

