
function stat(txt) {
	    window.status = txt;
	    }
	
	var win = null;
	function NewWindow(mypage,myname,w,h,scroll){
	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
	settings =
	'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable=yes'
	win = window.open(mypage,myname,settings)
	}
	
	var bookmarkurl="http://www.morgana.com"
	var bookmarktitle="Morgana slaapkamers - genieten met je ogen dicht"
	
	function addbookmark(){
	if (document.all)
	window.external.AddFavorite(bookmarkurl,bookmarktitle)
	}
	
		
	 function updateHdr(what,which){
         document.getElementById(which).innerText = what;
		} 


		 
function popitup(url)
{
	newwindow=window.open(url,'name','height=540,width=750');
	if (window.focus) {newwindow.focus()}
	return false;
}


	
// toggle view mode of divs
function toggleBox(szDivID, iState) // 1 visible, 0 hidden
{
	if(document.layers)	   //NN4+
    {
       document.layers[szDivID].visibility = iState ? "show" : "hide";
    }
    else if(document.getElementById)	  //gecko(NN6) + IE 5+
    {
        var obj = document.getElementById(szDivID);
        obj.style.visibility = iState ? "visible" : "hidden";
    }
    else if(document.all)	// IE 4
    {
        document.all[szDivID].style.visibility = iState ? "visible" : "hidden";
    }
}


function showcart(id,movx,movy)	{
	focusDiv('cartdiv',movx,movy);
	// updatePopupHeader(hdr);
	document.shopframe.location.href='cart.cfm?id='+id;
	toggleBox('cartdiv',1);
}	


function focusDiv (id,movx,movy) {
	if (!movx)	movx =  -80;
	if (!movy)	movy =  10;
	
	var posx = 0;
	var posy = 0;
	
	if (!e) var e = window.event;
	// alert(e)
	if (e.pageX || e.pageY)
	{
		var posx = e.pageX;
		var posy = e.pageY;
	}
	else if (e.clientX || e.clientY)
	{
		var posx = e.clientX + document.body.scrollLeft;
		var posy = e.clientY + document.body.scrollTop;
		
	}
	var x = posx+movx;
	var y = posy+movy;
	  	
	if (document.all)	{
		obj = document.all[id].style;
  		obj.left = x;
  		obj.top = y;
		}
	else	{
	//	alert('not doc all');
	}	 
}

	function updatePopupHeader(desc)	{	
		var popobj=document.all? document.all["popupHeader"] : document.getElementById? document.getElementById("popupHeader") : ""
		popobj.innerHTML= desc;
	 }		
	 
	function cent(amount) {
	// returns the amount in the .99 format 
	    amount -= 0;
	    amount = (Math.round(amount*100))/100;
	    return (amount == Math.floor(amount)) ? amount + '.00' : (  (amount*10 == Math.floor(amount*10)) ? amount + '0' : amount);
	}
