var iMoveFooter = null;

$(document).ready(function () {

    //Situate the Footer in all browsers and screen sizes
    MoveFooter();
    iMoveFooter = setInterval("MoveFooter()", 1000);
    setTimeout("SizeRight()", 250);
    
    MoveDefault();
	MoveCaseStudy();
	
	HandleDropDownBrowsers();
	
	TweakMenuOnMac();
});

function TweakMenuOnMac()
{
	if (navigator.appVersion.indexOf('Mac OS') != -1)
	{
		$('#SearchText').css('width','252px')
	}
}

function MoveFooter() {
    var h = parseInt($('div.main').height());
	if ($('#CreativeWrapper').attr('class') == "CreativeDefault") {
		newBottom = h + 150;
	} else {
		newBottom = h + 500;
	}
    $('.footer').css('top', newBottom + 'px');
}

function SizeRight() {
    $('div.RightContent').css('height', ($('div.LeftContent').height()-15) + 'px');
}

function MoveDefault() {
    if ($('#CreativeWrapper').attr('class') == "CreativeDefault") {
        $('div.main').css('top', '150px');
    }
}

function MoveCaseStudy() {
    if ($('#CreativeWrapper').attr('class') == "CaseStudiesCreative") {
        $('div.main').css('top', '335px');
    }
}

function HandleDropDownBrowsers() {
	if(navigator.appVersion.indexOf("Safari") == -1) {
		$('select').css('background-image','none');	
		$('select').css('padding','5px 5px 5px 10px');	
	}
}
