/*-- UI elements for cart page --*/

 $(document).ready(function(){
		
		$('p.left a:contains(Continue Shopping)').html('<img src="/static/img/layout/continue_shopping.gif" />');
							
		$(".bg").each(function(){
			$(this).corner("12px;");
		});					
							
		$("input[name='qty']").hide();	
		
	   $("input[name='cpn']").each(function(i){	   
	   		if ($(this).val()!=""){
				$(this).parent().children("a.toggle").html($(this).val() + "<img src='/static/img/layout/quantity.gif' border='0' />");
				$(this).parent().children("a.toggle").addClass("popd");
			}			
			$(this).hide();
	   });
	   
/*
	   $("input[name='p_requested_price']").each(function(i){	   
	   		if ($(this).val()!=""){
				$(this).parent().children("a.toggle").html($(this).val() + "<img src='/static/img/layout/quantity.gif' border='0' />");
				$(this).parent().children("a.toggle").addClass("popd");
			}			
			$(this).hide();
	   });
*/
	
	   $("input[name='reqdate']").each(function(i){	   
	   		if ($(this).val()!=""){
				$(this).parent().children("a.toggle").html($(this).val() + "<img src='/static/img/layout/quantity.gif' border='0' />");
				$(this).parent().children("a.toggle").addClass("popd");
			}			
			$(this).hide();
	   });	
	
  });
 
 function switchIt(x){
	$(x).parent().children(".toggle").toggle();
	//add focus to qty element
}

function switchItDate(x){
	$(x).parent().children(".toggle").toggle();
	$(x).parent().children("input[name='reqdate']").datepicker({showOn: 'button', buttonImage: '/static/img/layout/calendar.jpg', buttonImageOnly: true, dateFormat: userdatemask }); 
}
	
// Popup window code
function newPopup(url) {
	popupWindow = window.parent.open(
		url,'popUpWindow','height=670,width=825,left=150,top=150,resizable=yes,scrollbars=yes,toolbar=no,menubar=yes,location=no,directories=no,status=yes')
	popupWindow.focus();
	return false;
}

