﻿function HandleError() {
    return true;
}        
window.error = HandleError;

/*
if (self != top) 
    top.location.replace(self.location);

if(window.location.hostname != 'www.loantin.com' 
       && window.location.hostname != 'loantin.com'
       && window.location.hostname != 'localhost')
          window.location = 'http://www.loantin.com';           
*/        

var refeshPageTimer = null;

function RefeshPage()
{
    if(typeof(isPost) == 'undefined')
    {
        window.location.reload();
    }
}

//refeshPageTimer = setTimeout("RefeshPage()", 1200000);

function setHomePage()
{
    var isIE= navigator.userAgent.indexOf('MSIE') != -1;
    
    if(isIE)
    {
        var url = 'http://www.loantin.com';
        
        var homePage = document.body;
        
        homePage.style.behavior = 'url(#default#homepage)';
        homePage.setHomePage(url);
    }
    else
    {
        alert('Nhấn tổ hợp phím [Ctrl+D] để đặt www.loantin.com làm trang chủ!');
    }
}

function addFavorite()
{
    var url = window.location.href;
    var title = document.title;
    
    if(document.all)
    {
        window.external.AddFavorite(url, 'loantin.com | ' + title);
    }
    else if(window.sidebar)
    {
        window.sidebar.addPanel('loantin.com | ' + title, url, '');
    }
}

//
window.addEvent('domready', function() {
     $$('#page-menu li').each(function(item){
        item.addEvents(
        {               
		    'mouseover': function(){
		        item.set('class','nav-hover');
		    }.bind(this), 
		    'mouseout': function(){
		        item.set('class','nav');
		    }.bind(this)
        });        
    });
}); 
