﻿function ChangeTextDefaultPro_ID(objID, string, color) {
    var obj = document.getElementById(objID);
    ChangeTextDefaultPro(obj, string, color);
}

function ChangeTextDefaultPro(obj, string, color) {
    if (obj.value == '' || obj.value == string) {
        obj.value = string;
        if (color) {
            obj.style.color = color;
        }
        else {
            obj.style.color = 000000;
        }
    }
    else {
        obj.style.color = 000000;
    }
}

function ChangeTextFocusPro(obj, string) {
    if (obj.value == string) {
        obj.value = '';
        obj.style.color = 000000;
    }
}
function doClickSearchTitle(buttonName, e) {//the purpose of this function is to allow the enter key to point to the correct button to click.
    var key;

    if (window.event)
        key = window.event.keyCode;     //IE
    else
        key = e.which;     //firefox

    if (key == 13) {
        //Get the button the user wants to have clicked
        var btn = document.getElementById(buttonName);
        if (btn != null) { //If we find the button click it
            btn.click();
            event.keyCode = 0
        }
    }
}

function DisPlayLogo(strURL) {
    window.open(strURL);
}

function redirectNow(strURL) {
    window.location.href = strURL;
}

function setAsHomePage(i) {
    if (document.all) {
        i.style.behavior = 'url(#default#homepage)';
        i.setHomePage('http://dag.com.vn');
    }
}
