﻿<!--//
var version = "other"
browserName = navigator.appName;   
browserVer = parseInt(navigator.appVersion);

if (browserName == "Netscape" && browserVer >= 7) version = "n7";
else if (browserName == "Netscape" && browserVer < 7) version = "n6";
else if (browserName == "Microsoft Internet Explorer" && browserVer >= 4) version = "e4";
else if (browserName == "Microsoft Internet Explorer" && browserVer < 4) version = "e3";

function stopError()
{return true;}
window.onerror = stopError;

function wireOpen()
 {
   document.write("<marquee behavior=scroll direction=up width=100%  height=60 scrollamount=1.5 scrolldelay=120     	  onmouseover='this.stop()' onmouseout='this.start()'>")
 }
 function wireOpentop()
 {
   document.write("<marquee behavior=scroll direction=up width=100%  height=160 scrollamount=1.5 scrolldelay=120     	  onmouseover='this.stop()' onmouseout='this.start()'>")
 }
 function wireOpentoplike()
 {
   document.write("<marquee behavior=scroll direction=left width=100%  height=135 scrollamount=2.0 scrolldelay=90     	  onmouseover='this.stop()' onmouseout='this.start()'>")
 }
function wireQuestion()
 {
   document.write("<marquee behavior=scroll direction=down width=100%  height=160 scrollamount=1.0 scrolldelay=120 onmouseover='this.stop()' onmouseout='this.start()'>")
 }
function wireURL()
 {
   document.write("<marquee behavior=scroll direction=down width=100%  height=90 scrollamount=1.0 scrolldelay=120 onmouseover='this.stop()' onmouseout='this.start()'>")
 }

function addCommas(nStr)
  {
   nStr += ''; 
   x = nStr.split('.');	
   x1 = x[0];	
   x2 = ""; 
   x2 = x.length > 1 ? '.' + x[1] : '';	
   var rgx = /(\d+)(\d{3})/;	
   while (rgx.test(x1)) 
	{		
     x1 = x1.replace(rgx, '$1' + ',' + '$2');	
	}	
   return x1 + x2;
  }
function formatCurrency(div_id,str_number){
 /*Convert tu 1000->1.000*/
 /*var mynumber=1000;str_number = str_number.replace(/\./g,"");*/
 document.getElementById(div_id).innerHTML = '<font color=red>' + addCommas(str_number) + '<font>'; 
 document.getElementById(div_id).innerHTML = document.getElementById(div_id).innerHTML + ' <font color=red>' + document.getElementById('currency').options[document.getElementById('currency').selectedIndex].innerHTML + '</font>';
}
function add() {		
		alert("Bạn vừa thêm một sản phẩm vào giỏ hàng ! Kiểm tra giỏ hàng.");
		return;
	}

//-->
