/**
 * @author josephryzanmalabuyoc
 */
var sDivHt = '100px';
var iTimeId = 0;
var iSec = 1000;
var sCalcUrl='http://72.167.224.162/homevaluesofamerica/calc.php';

window.addEvent('domready', function(){
	var status = {
		'true': 'open',
		'false': 'close'
	};
	
	var narmalizeIcons=function(oAnchor){
		$$('.ybox-iconcont a').setStyles({
			'font-weight': 'bold',
			'text-decoration': 'none'
		});
		oAnchor.setStyles({
			'font-weight': 'bold',
			'text-decoration': 'underline'
		});
	}
	
	//==================
	
	var oDivTop = new Fx.Slide('ybox-divtop',{'duration': 200});
	oDivTop.hide();
	
	var showDivTop=function(e, sHtml){
		$('ybox-divtop').set('html', sHtml);
		e.stop();
		hideDivBot(e);
		if(!oDivTop.open)
			oDivTop.slideIn();
	}
	
	var hideDivTop=function(e){
		e.stop();
		if(oDivTop.open)
			oDivTop.slideOut();
	}
	
	$('ybox-lndr').addEvents({
		'mouseover': function(e) {
			var sHtml='<ul>'
				+'<li>Exclusive Real Time Leads</li>'
				+'<li>Private Label Lead Generating Machine</li>'
				+'<li>National Recognition</li>'
				+'<li>Connect with up to 5 appraisers</li>'
				+'<li>Free FNMA Appraisals</li>'
				+'</ul>';
			narmalizeIcons(this);
			showDivTop(e, sHtml);
		},
		'mouseout': function(e) {
			//hideDivTop(e);
		}
	});
	
	$('ybox-appr').addEvents({
		'mouseover': function(e) {
			var sHtml='<ul>'
				+'<li>Instant connection to Mortgage Lenders</li>'
				+'<li>Limit your competition</li>'
				+'<li>National Recognition</li>'
				+'<li>Exclusive area marketing</li>'
				+'</ul>';
			narmalizeIcons(this);
			showDivTop(e, sHtml);
		},
		'mouseout': function(e) {
			//hideDivTop(e);
		}
	});
	
	$('ybox-rltr').addEvents({
		'mouseover': function(e) {
			var sHtml='<ul>'
				+'<li>Exclusive Real Time Leads</li>'
				+'<li>Private Label Lead Generating Machine</li>'
				+'</ul>';
			narmalizeIcons(this);
			showDivTop(e, sHtml);
		},
		'mouseout': function(e) {
			//hideDivTop(e);
		}
	});
	
	//==================
	
	var oDivBot = new Fx.Slide('ybox-divbot',{'duration': 150});
	oDivBot.hide();
	
	var showDivBot=function(e, sHtml){
		$('ybox-divbot').set('html', sHtml);
		e.stop();
		hideDivTop(e);
		if(!oDivBot.open)
			oDivBot.slideIn();
	}
	
	var hideDivBot=function(e){
		e.stop();
		if(oDivBot.open)
			oDivBot.slideOut();
	}
	
	$('ybox-lead').addEvents({
		'mouseover': function(e) {
			var sHtml='<p style="font-size: 1.5em; font-weight: bold;">Exclusive real time leads as low as 35 cents</p>';
			var sHtml='<ul>'
				+'<li>Your Leads are Exclusive and Real Time, Guaranteed! Never pay more than <font color="red"><strong>35 cents</strong></font>...</li>'
				+'</ul>';
			narmalizeIcons(this);
			showDivBot(e, sHtml);
		},
		'mouseout': function(e) {
			//hideDivBot(e);
		}
	});
	
	$('ybox-fweb').addEvents({
		'mouseover': function(e) {
			var sHtml='<p style="font-size: 1.5em; font-weight: bold;">Check out our Free lead generating websites</p>';
			var sHtml='<ul>'
				+'<li>Appraiser, Realtor and Mortgage Brokers</li>'
				+'<li>Maintenance Free</li>'
				+'<li>Private Label Electronic Home Appraiser</li>'
				+'</ul>';
			narmalizeIcons(this);
			showDivBot(e, sHtml);
		},
		'mouseout': function(e) {
			//hideDivBot(e);
		}
	});
	
	$('ybox-home').addEvents({
		'mouseover': function(e) {
			var sHtml='<ul>'
				+'<li>Free Instant Home Appraisal</li>'
				+'<li>Find Local Mortgage Programs</li>'
				+'<li>Connect with Up to 5 Appraisers</li>'
				+'</ul>';
			sHtml+='<form action="'+sCalcUrl+'" method="get">';
			sHtml+='Enter Zip Code <input type="text" name="zip" size="4" maxlength="5" style="font-size: 10px;" />&nbsp;';
			sHtml+='<input type="submit" value="Search" style="font-size: 10px; color: #3B5998" />';
			sHtml+='</form>';
			narmalizeIcons(this);
			showDivBot(e, sHtml);
		},
		'mouseout': function(e) {
			//hideDivBot(e);
		}
	});
});
