$(document).ready(function() 
		{  		if(document.getElementById('prod_list') != null)
				{						   
					$('#prod_list').dialog({ autoOpen: false,
				   	width: 500,
				   	buttons: { "Cancel": function() { $(this).dialog("close"); }   
							}
					});
				}
		});
function prodList(prod,s_id)
{
	prod=prod.replace(/ /g,"|");
	prod=prod.replace("&","*");
	$.ajax({ url: 'http://www.habcotest.com/lib/itemQuery.php?item='+ prod +'&id=' + s_id,
				cache: false,
				success: function(msg) 
						{ 	
								var content=msg.split("<|>")
				
									if(content[1]==="1")
									{
										
										//$(document).ready(function() 
										//{
										$("#prod_list").dialog("open");		
										//});
										//item_list("prod_list");
										document.getElementById("prod_display").innerHTML=content[0];
									
									}
									else
									{ 
										parent.window.location = content[0];
										
									}
									
					 	}
				 });

}

function prodList2(prod,s_id)
{
	prod=prod.replace(/ /g,"|");
	prod=prod.replace("&","*");
	$.ajax({ url: 'http://www.habcotest.com/lib/itemQuery.php?item='+ prod +'&id=' + s_id,
				cache: false,
				success: function(msg) 
						{ 	
								var content=msg.split("<|>")
				
									if(content[1]==="1")
									{
										//$(document).ready(function() 
										//{
										//alert("test");
										parent.$("#prod_list").dialog("open");
										//$("#prod_list").parent().appendTo($("form:first"));

										//});
										//item_list("prod_list");
										parent.document.getElementById("prod_display").innerHTML=content[0];
										
									}
									else
									{ 
										//window.location = content[0];
										//var newWindow = window.open(content[0], '_blank'); 
										parent.location.href = content[0];
										
										//newWindow.focus();
									}
									
					 	}
				 });

}


	


