﻿function main() {
    //fix irratating IE6 background image flickering problem
	try { document.execCommand("BackgroundImageCache", false, true); } catch(err) {}
        
    //drop-down menus
	$('#exploreButton').hover(function(){showSubMenu('#exploreMenu');},function(){hideSubMenu('#exploreMenu')});
	$('#exploreMenu').hover(function(){showSubMenu('#exploreMenu');},function(){hideSubMenu('#exploreMenu')});
	$('#planButton').hover(function(){showSubMenu('#planMenu');},function(){hideSubMenu('#planMenu')});
	$('#planMenu').hover(function(){showSubMenu('#planMenu');},function(){hideSubMenu('#planMenu')});
	$('#purchaseButton').hover(function(){showSubMenu('#purchaseMenu');},function(){hideSubMenu('#purchaseMenu')});
	$('#purchaseMenu').hover(function() { showSubMenu('#purchaseMenu'); }, function() { hideSubMenu('#purchaseMenu') });
	$('#stayButton').hover(function(){showSubMenu('#stayMenu');},function(){hideSubMenu('#stayMenu')});
	$('#stayMenu').hover(function(){showSubMenu('#stayMenu');},function(){hideSubMenu('#stayMenu')});
	
	//jquery implementation of valign="middle"
    $('.valign').each(function () {
        $(this).css('margin-top',(($(this).parent().height()-$(this).height())/2)+'px');
        $(this).css('display','block');
        });

    // Add water mark effect to search box
    $('#Search input[type="text"]').example(' Search', { className: 'example_text' });
    
    //convert PNGs to GIFs if IE6 
    //if($.browser.msie && $.browser.version.substr(0,3)<"7")
        //$("img[@src$=png]").each(function () {$(this).attr('src', $(this).attr('src').replace(/png/i, 'gif'))}); 
}

function showSubMenu(obj) {
    //$('#exploreButton').attr({src: exploreButtonOn.src});
    $(obj).css({display: "block"});
}

function hideSubMenu(obj){
    //$('#exploreButton').attr({src: exploreButtonOff.src});
    $(obj).css({display: "none"});
}


