var g_allImages  = new Array();


/**
 * url always defined from the root.
 */
function _newWebImage(displayText_in, docUid_in, 
						url_in, blurb_in) {
	this.displayText = displayText_in;
	this.uuid = docUid_in;
	this.url = url_in;
	this.blurb = blurb_in;
	return this;
}
function newWebImage(displayText_in, docUid_in, 
						url_in, blurb_in) {
	var img =  new _newWebImage(displayText_in, docUid_in, 
						url_in, blurb_in);
	g_allImages[docUid_in] = img;
	return img;
}
	function fnImgThumb(img, showBlurb) {	
		var url = getContextUrl(img.url);
		var imgUrl = url;
		var s = '<center><b>' + img.displayText + '</b><br/><br/>' 
		+ '<a href="javascript:fnPopImg(\'' + imgUrl + '\');">' 
		  + '<img width="100"  src="' + url + '" /></a>'
	     + '</center>';
	     if (showBlurb) {
	        s += '<br/>' + img.blurb ;
	     }
	     return s;
	}
	
	function fnImage(imgUuid, showBlurb) {
		var img = fnGetImage(imgUuid);
		var s= fnImgThumb(img, showBlurb);
		return s;
	}	
	
	function fnGallery(arrImgUuid) {
		var s = "<table border=0><tr>";
		
		for (var i = 0; i < arrImgUuid.length; i++) {
		   var imgUuid = arrImgUuid[i];
		   var img = fnGetImage(imgUuid);
		   var x = fnImgThumb(img, true);
		   var z = "<td>" + x + "</td>";
		   s+= z;
		}
		s += "</tr></table>";
		return s;
	}
	
	function fnPopImg(url) {
		var u = getContextUrl(url);
		openPop(u, 600, 1000);
	}
	
function fnGetImage(imgUuid) {
   var img = g_allImages[imgUuid];
   	if (img == null) {
//			alert('missing ' + imgUuid);
			img = newWebImage(imgUuid, imgUuid, '/images/home/easter_island.jpg',''); 
	        
		   }
	return img;
}

newWebImage('Sales Rep Quote Dashboard', 'q_salesdash', '/images/quote/q_salesdash.jpg',
	        'The dashboard for the Sales Rep displays quote totals, goal totals, in numeric '
	        + ' and tachometer format.'); 
newWebImage('Sales Manager Quote Dashboard', 'q_salesmgrdash', '/images/quote/q_salesmgrdash.jpg',
	        'The dashboard for the Sales Rep displays quote totals, goal totals, in numeric '
	        + ' and tachometer format.'); 
newWebImage('Select Contact for Quote', 'q_selectcontact', '/images/quote/q_selectcontact.jpg',
	        'Create a new quote for customer by searching and selecting a quote, or select the '
	        + 'contact in ECS and click on "New Quote" button'); 

newWebImage('Customer Information', 'q_contact', '/images/quote/contact_detail.jpg',
	        'The customer contact in ECS provides a central location for operations for a Contact, '
	        + 'from sending e-mail to creating a quote, to editing phone numbers and e-mail addresses.');
newWebImage('Create Quote', 'q_newquote_tmpl', '/images/quote/newquote_choosetemplate.jpg',
	        'Select various quote attributes during quote creation.  Especially important is the  '
	        + ' quote template.'); 
newWebImage('Add  Quote Items', 'q_newquote_items', '/images/quote/quote_additems.jpg',
	        'Adding items to the quote. '); 
newWebImage('Edit Propoosal Section', 'q_edithtml', '/images/quote/quote_edithtml.jpg',
	        'Edit a proposal section using the inline editor. '); 
newWebImage('Edit Propoosal ', 'q_editprop', '/images/quote/quote_editprop.jpg',
	        'Edit the proposal. '); 
newWebImage('Organize Quote Items', 'q_newquote_orgitems', '/images/quote/quote_orgitems.jpg',
	        'Move the items to the correct "section" of the proposal. '); 
newWebImage('Send Proposal', 'q_newquote_send', '/images/quote/quote_send.jpg',
	        'Use the "Quote Status" page to send the proposal to the Customer out. '); 
newWebImage('Quote Proposal', 'q_proppdf', '/images/quote/quote_proppdf.jpg',
	        'The quote proposal sent to the customer is a PDF document that is stored '
	        + ' in the customer history.'); 

			