function mshow (id, ida) {
	document.getElementById(id).className='show';	
	document.getElementById(ida).className='active';	
}
function mhide (id, ida) {
	document.getElementById(id).className='';	
	document.getElementById(ida).className='';	
}
function ichange (id, path) {
	document.getElementById(id).src=path;	
}
function OpenWindow(URL,windowName) {  
	features='dependent=yes, top=0, left=0, width=800, height=600, scrollbars=1, locationbar=no, menubar=no, resizable=no, status=no'  
  newwin=window.open(URL,windowName,features);
  newwin.focus();
}

function imgrotate1() {	
	var imgsrc = document.getElementById('i1').src;
	imgsrc = imgsrc.substring(0,imgsrc.length-5) + "6.jpg"; 
	document.getElementById('i1').src=imgsrc;
	setTimeout("imgrotate2()",3000);
}
function imgrotate2() {
	var imgsrc = document.getElementById('i1').src;
	imgsrc = imgsrc.substring(0,imgsrc.length-5) + "7.jpg"; 
	document.getElementById('i2').src=imgsrc;
	setTimeout("imgrotate3()",3000);
}
function imgrotate3() {	
	var imgsrc = document.getElementById('i1').src;
	imgsrc = imgsrc.substring(0,imgsrc.length-5) + "8.jpg"; 
	document.getElementById('i3').src=imgsrc;
	setTimeout("imgrotate4()",3000);
}
function imgrotate4() {
	var imgsrc = document.getElementById('i1').src;
	imgsrc = imgsrc.substring(0,imgsrc.length-5) + "9.jpg"; 
	document.getElementById('i4').src=imgsrc;
	setTimeout("imgrotate5()",3000);
}
function imgrotate5() {	
	var imgsrc = document.getElementById('i1').src;
	imgsrc = imgsrc.substring(0,imgsrc.length-5) + "0.jpg"; 
	document.getElementById('i5').src=imgsrc;
	setTimeout("imgrotate6()",3000);
}
function imgrotate6() {
	var imgsrc = document.getElementById('i1').src;
	imgsrc = imgsrc.substring(0,imgsrc.length-5) + "1.jpg"; 
	document.getElementById('i1').src=imgsrc;
	setTimeout("imgrotate7()",3000);
}
function imgrotate7() {	
	var imgsrc = document.getElementById('i1').src;
	imgsrc = imgsrc.substring(0,imgsrc.length-5) + "2.jpg"; 
	document.getElementById('i2').src=imgsrc;
	setTimeout("imgrotate8()",3000);
}
function imgrotate8() {
	var imgsrc = document.getElementById('i1').src;
	imgsrc = imgsrc.substring(0,imgsrc.length-5) + "3.jpg"; 
	document.getElementById('i3').src=imgsrc;
	setTimeout("imgrotate9()",3000);
}
function imgrotate9() {	
	var imgsrc = document.getElementById('i1').src;
	imgsrc = imgsrc.substring(0,imgsrc.length-5) + "4.jpg"; 
	document.getElementById('i4').src=imgsrc;
	setTimeout("imgrotate0()",3000);
}
function imgrotate0() {
	var imgsrc = document.getElementById('i1').src;
	imgsrc = imgsrc.substring(0,imgsrc.length-5) + "5.jpg"; 
	document.getElementById('i5').src=imgsrc;
	setTimeout("imgrotate1()",3000);
}

function CurrencyFormatted(amount)
{
	var i = parseFloat(amount);
	if(isNaN(i)) { i = 0.00; }
	var minus = '';
	if(i < 0) { minus = '-'; }
	i = Math.abs(i);
	i = parseInt((i + .005) * 100);
	i = i / 100;
	s = new String(i);
	if(s.indexOf('.') < 0) { s += '.00'; }
	if(s.indexOf('.') == (s.length - 2)) { s += '0'; }
	s = minus + s;
	return s;
}

function CommaFormatted(amount)
{
	var delimiter = ","; // replace comma if desired
	var a = amount.split('.',2)
	var d = a[1];
	var i = parseInt(a[0]);
	if(isNaN(i)) { return ''; }
	var minus = '';
	if(i < 0) { minus = '-'; }
	i = Math.abs(i);
	var n = new String(i);
	var a = [];
	while(n.length > 3)
	{
		var nn = n.substr(n.length-3);
		a.unshift(nn);
		n = n.substr(0,n.length-3);
	}
	if(n.length > 0) { a.unshift(n); }
	n = a.join(delimiter);
	if(d.length < 1) { amount = n; }
	else { amount = n + '.' + d; }
	amount = minus + amount;
	return amount;
}

