//___________________________________________
function Webkitchen(){
	
	// define document content holder
	var userContentId_str		= 'userContent';
	var filesToIcon				= new Object();
	filesToIcon.xls				= true;
	filesToIcon.doc				= true;
	filesToIcon.ppt				= true;
	filesToIcon.pdf				= true;
	filesToIcon.zip				= true;
	
	
	//---------------------------------------
	function addLinkCSSClasses(){
		
		var content_htm			= document.getElementById('userContent');
		var links_arr			= content_htm.getElementsByTagName('a');
		for(var index_int=0; index_int<links_arr.length; index_int++){
			var link_htm		= links_arr[index_int];
			var rgxMatches_arr	= link_htm.href.match(/.([\w]{3}$)/i);
			if(rgxMatches_arr){
				var ext_str		= rgxMatches_arr[1];
				if(filesToIcon[ext_str]){
					link_htm.className = link_htm.className+' fileLink '+ext_str;
				}
			}
		}
	};
	//---------------------------------------
	function makeSelectOnFocus(elementId_str){
		
		var element_htm			= document.getElementById(elementId_str);
		if(element_htm){
			element_htm.onfocus = function(){this.select();};
		}
	};
	//_______________________________________
	this.processXHTML = function(){
		
		// process maps and video
		IntegrateEmbeds();
		
		// add onFocus events where required
		makeSelectOnFocus('emailSubscribe');
		makeSelectOnFocus('upperSearchInput');
		makeSelectOnFocus('lowerSearchInput');
		
		// setup feedburner popup properties
		var mailForm_htm		= document.getElementById('emailSubscribeForm')
		if(mailForm_htm){
		
			var feedburner				= new Object();
			feedburner.popupProps_str 	= 'scrollbars=yes,width=550,height=520';
//			mailForm_htm.onsubmit= function(){				
//				alert(mailForm_htm.target);
//				window.open('http://www.feedburner.com',mailForm_htm.target,feedburner.popupProps_str);
//			};
		}
		
		// add icons to relevant links
		addLinkCSSClasses();
	};
};	//_______________________________________
//___________________________________________
window.webkitchen	= new Webkitchen();