/*
-----------------------------------------------
UBhomeloan
Global Javascript
----------------------------------------------- */

$(function() {

	var global = {
		
		process_scenarios : function() {
				$('.whattodo li').each(function(index) {
				$this = $(this);
				var title = $this.find('.scenario');
				/*var title = $this;*/
				var title_link = $('<a href="#"></a>')
				var content = $this.find('.content');
				content.hide();
				title.innerWrap(title_link);
				title_link.click(function() {
					content.toggle();
					$(this).parent().toggleClass('active');
					return false;
				});
			});
		}
	}
	global.process_scenarios();
	 // add external link and document icons
    jQuery('#main_content').linkHints({
        base : jQuery('link[rel=home]').attr('href'),
        targetClass : ".arrow",
        cb : function(){
            return true
            }}
    );	
});

jQuery.fn.extend({
	minHeight : function(height) {
		if ($.browser.msie && !window.XMLHttpRequest && !document.all) { // IE 6 only
			$(this).height(height);
		}
		else {$(this).css('min-height', height)}
	},
	innerWrap : function(e) {
		this.each(function(index) {
			var content = $(this).html();
			$(this).empty();
			e.html(content).appendTo($(this));
		});
	}
	

});


