// JavaScript Document
var goto_top_itv = 0;
var goto_top_type = -1;
function goto_top_timer() {
	var y = goto_top_type == 1 ? document.documentElement.scrollTop : document.body.scrollTop;
	var moveby = 15;

	y -= Math.ceil(y * moveby / 100);
	if (y < 0)
		y = 0;

	if (goto_top_type == 1)
		document.documentElement.scrollTop = y;
	else
		document.body.scrollTop = y;

	if (y == 0) {
		clearInterval(goto_top_itv);
		goto_top_itv = 0;
	}
}
function goto_top() {
	if (goto_top_itv == 0) {
		if (document.documentElement && document.documentElement.scrollTop)
			goto_top_type = 1;
		else if (document.body && document.body.scrollTop)
			goto_top_type = 2;
		else
			goto_top_type = 0;

		if (goto_top_type > 0)
			goto_top_itv = setInterval('goto_top_timer()', 20);
	}
}

 function setHomepage() 
 { 
		  if (document.all) 
			 { 
				 document.body.style.behavior='url(#default#homepage)'; 
		   document.body.setHomePage('http://amthuckhachsan.com.vn'); 
		   
			 } 
			 else if (window.sidebar) 
			 { 
			 if(window.netscape) 
			 { 
				  try 
				  {   
					 netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");   
				  }   
				  catch(e)   
				  {   
					 /*alert("this action was aviod by your browser,if you want to enable,please enter about:config in your address line,and change the value of signed.applets.codebase_principal_support to true"); */
					 alert("Bạn không thể đặt làm trang chủ được vì trình duyệt của bạn không cho phép đặt làm trang chủ.\nNếu bạn muốn đặt làm trang chủ hãy truy cập about:config trên thanh địa chỉ -> nhấn vào nút I'll be careful, I promise. Sau đó tìm dòng signed.applets.codebase_principal_support và thiết lập lại giá trị true bằng cách nhấp chuột đôi tại cột value.\nChúc bạn thành công");
				  } 
			 }  
			 var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components. interfaces.nsIPrefBranch); 
			 prefs.setCharPref('browser.startup.homepage','http://amthuckhachsan.com.vn'); 
		  } 
		  
  	
 } 

