    
    //open product detail window
	function openProductWindow(productid, nheight, nwidth, sCloseTitle) 
	{       	
		win = new Window({className: "mac_os_x", title: "", width: nwidth, height: nheight, resizable: false, destroyOnClose: true, recenterAuto:false, minimizable: false, maximizable: false, closable: true, draggable: false, closeTitle: sCloseTitle}); 
		win.getContent().update("<div name='productdiv' id='productdiv'></div>"); 
		win.showCenter(true);
		sendGetRequest("product.aspx?productid=" + productid + "&height=" + nheight + "&width=" + nwidth,handleServerResponseProduct);
	}
	
    //open project images window
	function openProjectWindow(projectid, sCloseTitle) 
	{       	
		win = new Window({className: "mac_os_x", title: "", width:749, height:520, resizable: false, destroyOnClose: true, recenterAuto:false, minimizable: false, maximizable: false, closable: true, draggable: false, closeTitle: sCloseTitle}); 
		win.getContent().update("<div name='projectdiv' id='projectdiv'></div>"); 
		win.showCenter(true);
		sendGetRequest("project.aspx?projectid=" + projectid,handleServerResponseProject);
	}

    //popup window
	function popupWindow(url,w,h) {
        w=w+10;
		windowprops = "height="+h+",width="+w+",location=no,scrollbars=no,menubar=no,toolbar=no,resizable=no,titlebar=no,status=no,border=no"
		window.open(url, "Picture" + w + h , windowprops);
	}


    //set object position
    function setPosition(obj, name, menuname, offsetTop, offsetLeft)
    {    
        //declare
        var top = 0;
        var left = 0;
        var anchor, layer, scroll, height, parenttop, space;
    	
	    if (document.getElementById)//N6,IE6
	    {
		    anchor = document.getElementById(menuname);
		    layer = document.getElementById(name).offsetHeight;
	    }
	    else	if (document.all)//IE4,IE5
	    {
		    anchor = document.all(menuname);
		    layer = document.all(name).clientHeight;
	    }
	    while (anchor.offsetParent != null)
	    {
		    top += anchor.offsetTop;
		    left += anchor.offsetLeft;
      	    anchor = anchor.offsetParent;
	    }
	    if (document.all)//IE4+
	    {
		    scroll = document.body.scrollTop;
		    height = document.body.clientHeight;
	    }
	    else//N6
	    {
		    scroll = window.pageYOffset;
		    height = window.innerHeight;
	    }
	    parenttop = top - scroll;
	    space = height - parenttop;
	    if (space > layer){	top = top; } else {	top = top - layer + 21;	}
     
        //set position
        obj.getStyle(name).top = top + offsetTop;
	    obj.getStyle(name).left = left+ offsetLeft;  
     
        //return
        return obj
    } 
  