/**** ONLOAD FUNCTION ***/
function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      oldonload();
      func();
    }
  }
}

function addQuoteItem(obj) {

	var quoteItems = $("div[id^=quoteItem-]");
	var numQuoteItems = quoteItems.length;
	var lastQuoteItem = $("div[id^=quoteItem-]:last");
	var i = quoteItems.length + 1;
	var url = "page.php?mode=getQuoteItemHTML&number="+i;
	$("#required").attr("value", $("#required").attr("value")+",partNum-"+i+",qty-"+i+",description-"+i+",date-"+i+"");
	$.ajax({
		url:url,
		type:"GET",
		success:function(html){
			lastQuoteItem.after(html);
		}
	});
}

function popupContent(span){
	var id = span.id;
	var innerhtml = $('#'+id+'Tip').html();
	$('#toolTipContent').html(innerhtml);
}