function viewImage(image,x,y)
{
	new_wnd=window.open('view_image.php?slika='+image,'imageWindow','toolbar=no,screenX=100,screenY=100,resizable=yes, scrollbars=yes,width='+x+',height='+y);
}


function toggleMenu(menu_id)
{
  	
 	var mnu = document.getElementById(menu_id);
	if (mnu.className=='menuItemBg') mnu.className='menuItemBgOff'; else mnu.className='menuItemBg';

	if (lastMenu!='')
	{
		var mnu = document.getElementById(lastMenu);
		if (mnu.className=='menuItemBg') mnu.className='menuItemBgOff'; else mnu.className='menuItemBg';
	}
	lastMenu = menu_id;
	
}

function vI(pid)
{
		wnd=window.open('item.php?pid='+pid,'displayWindow','toolbar=no,screenX=100,screenY=100,resizable=yes, scrollbars=yes,width=450,height=350');
}

function aI(pid)
{
  frame=document.getElementById('bc_frame');
  frame.src = "basket_content.php?pid="+pid;
}

function paI(pid)
{
 	window.opener.bc_frame.location.href = "basket_content.php?pid="+pid;
}

function zK()
{
  	document.location.href="index.php?cent=zavrsi_kupnju";
}

function iK()
{
  	document.location.href="index.php?cent=kosarica&isprazni";
}

function mf(id)
{
  	window.opener.location.href="index.php?cent=favoriti&mfid="+id;
}

function reprice()
{
  frame=document.getElementById('bc_frame');
  frame.src = "basket_content.php?reprice";
}

function ae()
{
  wnd=window.open('http://www2.americanexpress.hr/userinfo/Jamstvo_sigurne_online_kupnje.html','prozor','width=750,height=590');
}

function rt(fld)
{
	var total = 0; 
	var ii=0;
	for (ii=1; ii<=total_products; ii++)
	{
	 	total += document.getElementById('q_'+ii).value * mpc[ii-1];
	}

	document.getElementById('total').value = formatCurrency(total)+' kn';
}

function pP(ponuda_id)
{
  wnd=window.open('ponuda.php?pid='+ponuda_id,'prozor','toolbar=no,screenX=100,screenY=50,resizable=yes, scrollbars=yes,width=650,height=700');
  	
}

<!-- Original:  Cyanide_7 (leo7278@hotmail.com) -->
<!-- Web Site:  http://www7.ewebcity.com/cyanide7 -->

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->
function formatCurrency(num) {
	num = num.toString().replace(/\$|\,/g,'');
	if(isNaN(num))
	num = "0";
	sign = (num == (num = Math.abs(num)));
	num = Math.floor(num*100+0.50000000001);
	cents = num%100;
	num = Math.floor(num/100).toString();
	if(cents<10)
	cents = "0" + cents;
	for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)
	num = num.substring(0,num.length-(4*i+3))+','+
	num.substring(num.length-(4*i+3));
	return (((sign)?'':'-') + num + '.' + cents);
}



