/*-----------------------------------------------------------------------------------*/
/*	FAQ's
/*-----------------------------------------------------------------------------------*/
function toggle(showHideDiv, switchTextDiv) {
	var ele = document.getElementById(showHideDiv);
	var text = document.getElementById(switchTextDiv);
	if(ele.style.display == "block") {
    		ele.style.display = "none";
  	}
	else {
		ele.style.display = "block";
	}
} 
/*-----------------------------------------------------------------------------------*/
/*	Show/Hide Logins
/*-----------------------------------------------------------------------------------*/
function showonlyone(thechosenone,thechosentitle) {
      var newboxes = document.getElementsByTagName("div");
            for(var x=0; x<newboxes.length; x++) {
                  name = newboxes[x].getAttribute("name");
                  if (name == 'login') {
                        if (newboxes[x].id == thechosenone) {
                        newboxes[x].style.display = 'block';
                  }
                  else {
                        newboxes[x].style.display = 'none';
                  }
				  }
				  if (name == 'login-title') {
                        if (newboxes[x].id == thechosentitle) {
                        newboxes[x].className = 'active';
                  }
                  else {
                        newboxes[x].className = 'inactive';
                  }
            }
      }
}

jQuery(document).ready(function() {
/*-----------------------------------------------------------------------------------*/
/*	Move Nav for Mobile Site
/*-----------------------------------------------------------------------------------*/
	var style = $('#nav_container nav ul li a').css('width');
    if( style == '874.6666px' ) {
        $('#main-content').insertBefore('#top-of-page');
    }
	else{
		$('#top-of-page').insertBefore('#main-content');
	}
/*-----------------------------------------------------------------------------------*/
/*	Clear Default Text
/*-----------------------------------------------------------------------------------*/
    $(".cleardefault").focus(function(srcc)
    {
        if ($(this).val() == $(this)[0].title)
        {
            $(this).removeClass("cleardefaultActive");
            $(this).val("");
        }
    });
    
    $(".cleardefault").blur(function()
    {
        if ($(this).val() == "")
        {
            $(this).addClass("cleardefaultActive");
            $(this).val($(this)[0].title);
        }
    });
    
    $(".cleardefault").blur();        
});

/*-----------------------------------------------------------------------------------*/
/*	Move Nav for Mobile Site
/*-----------------------------------------------------------------------------------*/
$(window).resize( function() {
    var screenWidth = window.innerWidth;
    if( screenWidth <= '479' ) {
        $('#main-content').insertBefore('#top-of-page');
    }
	else{
		$('#top-of-page').insertBefore('#main-content');
	}
	/*-----------------------------------------------------------------------------------*/
	/*	Right Column Height
	/*-----------------------------------------------------------------------------------*/
	var highestCol = $('.right-column .column-content').height();
	$('.right-column .left').height(highestCol);
	$('.right-column .right').height(highestCol);
	var margin = "-" + highestCol + "px";
	$('.right-column .right').css("margin-top", margin);
	/*-----------------------------------------------------------------------------------*/
	/*	Main Column Height
	/*-----------------------------------------------------------------------------------*/
	var mainCol = $('.main-column .main-column-content').height();
	$('.main-column .main-left').height(mainCol);
	$('.main-column .main-right').height(mainCol);
	var Mainmargin = "-" + mainCol + "px";
	$('.main-column .main-right').css("margin-top", Mainmargin);
	/*-----------------------------------------------------------------------------------*/
	/*	Page Title Height
	/*-----------------------------------------------------------------------------------*/
	var titleCol = $('.page-title .page-title-content').height();
	$('.page-title .page-title-left').height(titleCol);
	$('.page-title .page-title-right').height(titleCol);
	var titleMargin = "-" + titleCol + "px";
	$('.page-title .page-title-right').css("margin-top", titleMargin);
});
