function pgNav(pagenum,contentID){
	ColdFusion.navigate('productBestAvailable.cfm?pageno='+ pagenum +'&contentID='+ contentID,'results');
}

function pgNav2(pagenum,itemTypeID){
	ColdFusion.navigate('/CustomerItemList.cfm?pageno='+ pagenum + '&ItemListTypeID=' + itemTypeID ,'showCustomerItems' + itemTypeID);
}

function pgSort(sortCol,sortDir,contentID){
	ColdFusion.navigate('productBestAvailable.cfm?sortCol='+ sortCol +'&sortDirection=' + sortDir +'&contentID='+ contentID,'results');
}	

function delItem(custitemID,contentID,itemTypeID) {
	ColdFusion.navigate('/CustomerItemList.cfm?action=removeItem&CustomerItemListID=' + custitemID + '&ContentID='+ contentID + '&ItemListTypeID=' + itemTypeID,'showCustomerItems' + itemTypeID)
}

function popimage2(TheRequestObject)
{
	myRef = window.open(TheRequestObject,'mywin','left=20,top=20,width=400,height=350,scrollbars=1, toolbar=0,resizable=1');
}

showWin = function(f){
    //show the window

    //i'm not really sure why this is necessary

    //but it is

    //there doesn't appear to be any flicker or

    //negative side effects, so we'll go with it

    ColdFusion.Window.show('results')
    
    //get the window object

    var winOb = ColdFusion.Window.getWindowObject('results');    
    
    //get the window 'element'

    var el = winOb.getEl();

    //need to get the windows shadow object separately

    var s = winOb.shadow.el;

    //remove the existing closeclick listener

    winOb.close.un("click", winOb.closeClick, winOb);
    
    //set up a new close listener

    winOb.closeClick = hideWin;
    
    //apply the new close listener

    winOb.close.on("click", winOb.closeClick, winOb);

    //if the window is modal show the modal mask

    if(winOb.modal){
        winOb.mask.dom.style.visibility = 'visible';
    }
    //fade in the shadow

    //s.fadeIn({duration: .5});    

    //fade in the window

    el.fadeIn({duration: .5});    
}

hideWin = function(){
    //get the window object

var winOb = ColdFusion.Window.getWindowObject('results');    

    //get the winodws 'element' object

    var el = winOb.getEl();
    
    //get the shadow element

    //if we don't get this separately

    //wacky things happen

    var s = winOb.shadow.el;
    
    //is the window modal?

    //if so hide the modal mask

    if(winOb.modal){
        winOb.mask.dom.style.visibility = 'hidden';
    }

    //fade out the shadow     
    s.fadeOut({duration: .5});

    //fade out the window itself

    el.fadeOut({duration: .5});
}
   
showItemListWin = function(f){

	//if(!isNaN(f)) {
	    if(f==1)
	    	winName = 'showCustomerItems1';
	    else
	    	winName = 'showCustomerItems2';
	    
	    ColdFusion.Window.show(winName);
	
	    var winOb = ColdFusion.Window.getWindowObject(winName);    
	    var el = winOb.getEl();
	    var s = winOb.shadow.el;
	
	    winOb.close.un("click", winOb.closeClick, winOb);
	    winOb.closeClick = hideWin2;
	    winOb.close.on("click", winOb.closeClick, winOb);
	
	    if(winOb.modal){
	        winOb.mask.dom.style.visibility = 'visible';
	    }
	    
	    el.fadeIn({duration: .5});    
		//}
    }	
    
	hideWin2 = function(){
		
		var winOb = ColdFusion.Window.getWindowObject(winName);    
	    var el = winOb.getEl();
	    var s = winOb.shadow.el;
	
	    if(winOb.modal){
	        winOb.mask.dom.style.visibility = 'hidden';
	    }
	    
	    s.fadeOut({duration: .5});
	    el.fadeOut({duration: .5});

}