//
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
  return window.open(theURL,winName,features);
}
//-->

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

<!--
function BB_preloadHeaderImages() {
	MM_preloadImages('/img/menu_products_over.gif','/img/menu_home_over.gif','/img/menu_myaccount_over.gif','/img/menu_support_over.gif','/img/menu_aboutus_over.gif');	
}

function CreatePopupWin(URLStr,name,width,height,top,left){
	popUpWin = open(URLStr, name, 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}

function changeClass(thisobj,classname) {

	if (document.all) {							// IE 4/5
		thisobj.className = classname;
	} else if (document.getElementById) {		// NS6 or Firefox
		thisobj.className = classname;
	}

}
function addCommas(nStr)
{
	nStr += '';
	x = nStr.split('.');
	x1 = x[0];
	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 DeleteCommas(nStr)
{
    var rgx = /,/g;
	x1 = nStr.replace(rgx, '');
	return x1;
}
function number_format(a, b, c, d) {
 a = Math.round(a * Math.pow(10, b)) / Math.pow(10, b);
 e = a + '';
 f = e.split('.');
 if (!f[0]) {
  f[0] = '0';
 }
 if (!f[1]) {
  f[1] = '';
 }
 if (f[1].length < b) {
  g = f[1];
  for (i=f[1].length + 1; i <= b; i++) {
   g += '0';
  }
  f[1] = g;
 }
 if(d != '' && f[0].length > 3) {
  h = f[0];
  f[0] = '';
  for(j = 3; j < h.length; j+=3) {
   i = h.slice(h.length - j, h.length - j + 3);
   f[0] = d + i +  f[0] + '';
  }
  j = h.substr(0, (h.length % 3 == 0) ? 3 : (h.length % 3));
  f[0] = j + f[0];
 }
 c = (b <= 0) ? '' : c;
 return f[0] + c + f[1];
}

function findPos(obj)
{
	var curleft = curtop = 0;
	var width = obj.offsetWidth;
	var height = obj.offsetHeight;
	
	if (obj.offsetParent) {
		curleft = obj.offsetLeft;
		curtop = obj.offsetTop;
		while (obj = obj.offsetParent) {
			curleft += obj.offsetLeft;
			curtop += obj.offsetTop;
		}
	}
	return [curleft,curtop,width,height];
}

function showToolTip(ob,title,description){
		var prefix = 'magic';
		var popup_title;
		var popup_content;
		var popup = MM_findObj(prefix+'_tooltip');

		if (typeof(popup)=='undefined' || popup==null){
			popup = document.createElement('div');
			popup.setAttribute('id',prefix+'_tooltip');
			popup.className = prefix+'_tooltip';

			popup_title = document.createElement('div');
			popup_title.setAttribute('id',prefix+'_tooltip_header');
			popup_title.className = 'header';
			
			popup_content = document.createElement('div');
			popup_content.setAttribute('id',prefix+'_tooltip_content');
			popup_content.className = 'content';
			
			popup.appendChild(popup_title);
			popup.appendChild(popup_content);
			
			document.body.appendChild(popup);
		}else{
		
			popup_title = MM_findObj(prefix+'_tooltip_header');
			popup_content = MM_findObj(prefix+'_tooltip_content');
		}
		/*
			<div id="magic_tooltip" style="display:none; position:absolute; background:#E8EEF7; border:1px solid #608ECE; padding:10px; width:300px;">
				<div id="popup_tag_desc_header" style="font-weight:bold"></div>
				<div id="popup_tag_desc_content"></div>
			</div>
		*/
		var obpos = findPos(ob);
		popup.style.position = 'absolute';
		popup.style.left = (obpos[0]+20)+'px';
		popup.style.top = (obpos[1]+10)+'px';
		
		popup_title.innerHTML = title;
		popup_content.innerHTML = description;
		
		popup.style.visibility = 'visible';
		popup.style.display = 'block';
		
	}
	function hideToolTip(){
		var prefix = 'magic';
		var popupob = MM_findObj(prefix+'_tooltip');
		if (popupob!=null || typeof(popupob)!='undefined'){
			popupob.style.visibility = 'hidden';
			popupob.style.display = 'none';
		}
	}
	function IsNumeric(sText)
{
	var ValidChars = "0123456789";
	var IsNumber=true;
	var Char;
	for (i = 0; i < sText.length && IsNumber == true; i++) 
	{ 
		Char = sText.charAt(i); 
		if (ValidChars.indexOf(Char) == -1) 
		{
			IsNumber = false;
		}
	}
	
	return IsNumber;
}
//-->

