function clearMe(formfield, defaultValue) {
	if ((defaultValue == null) || (defaultValue == undefined))
		defaultValue = formfield.defaultValue;
	if (formfield.value == defaultValue)
		formfield.value = "";
}
function restoreMe(formfield, defaultValue) {
	if ((defaultValue == null) || (defaultValue == undefined))
		defaultValue = formfield.defaultValue;
	if (formfield.value.replace(/^\s+|\s+$/g, "") == "")
		formfield.value = defaultValue;
}

$.browser.chrome = /chrome/.test(navigator.userAgent.toLowerCase());
if ($.browser.chrome) { 
	document.write('<link rel="stylesheet" href="/library/styles/transmenu-chrome-fix.css" type="text/css" media="screen">');
}

$(document).ready(function(){
	$(".swapImage").hover(
		function () {
		    this.src = this.src.replace("-0", "-1");
		},
		function () {
		    this.src = this.src.replace("-1", "-0");
		}
	);


	if ($.browser.browser() == "Safari") {
		if ($.browser.OS() == "Windows") {
			$(".transMenu").css({'margin-top' : '31px', 'margin-left' : '4px'});
		}
		else if ($.browser.OS() == "Mac") {
			if(parseInt($.browser.version.number())>=533){
				$(".transMenu").css({'margin-top' : '32px', 'margin-left' : '4px'});
			}
			else if(parseInt($.browser.version.number())<533){
				$(".transMenu").css({'margin-top' : '0px', 'margin-left' : '4px'});
				
			}
		}
	}
});

$(window).load(function(){
	$('#tweetFeed').jTweetsAnywhere({
		username: ['MissAmerica', 'missamericaorg '],
		count: 4,
		tweetTimestampDecorator: false,
		tweetInReplyToDecorator: false,
		tweetRetweeterDecorator: false,
		showTweetBox: false
	});
});
// START HOME PAGE TABS
$(function() {
	
	function handleTabSelect(event, tab) {
	 if (tab.index == 0) {
		 // tab 1 selected
		 $('img#imgTab1').attr({ src: "/library/images/home-refresh/tabs/twitter-1.gif" });
		 $('img#imgTab2').attr({ src: "/library/images/home-refresh/tabs/facebook-0.gif" });
		 $('img#imgTab3').attr({ src: "/library/images/home-refresh/tabs/youtube-0.gif" });
	 }

	 else if (tab.index == 1) {
		 // tab 2 selected
		 $('img#imgTab2').attr({ src: "/library/images/home-refresh/tabs/facebook-1.gif" });
		 $('img#imgTab1').attr({ src: "/library/images/home-refresh/tabs/twitter-0.gif" });
		 $('img#imgTab3').attr({ src: "/library/images/home-refresh/tabs/youtube-0.gif" });
	 }
	 
	 	 else if (tab.index == 2) {
		 // tab 3 selected
		 $('img#imgTab3').attr({ src: "/library/images/home-refresh/tabs/youtube-1.gif" });
		 $('img#imgTab1').attr({ src: "/library/images/home-refresh/tabs/twitter-0.gif" });
		 $('img#imgTab2').attr({ src: "/library/images/home-refresh/tabs/facebook-0.gif" });
	 }
}

 // Set Tab Constructor values & initialize tabs
$('#tabs').tabs({ selected: '0', 
	select: handleTabSelect });
});




