﻿/*
 * ====================================
 *   Florida Physicians Medical Group
 * ------------------------------------
 *   Base Javascript
 * ====================================
 */

$(function() {
	// Fix IE6 Flicker Bug
	try { document.execCommand('BackgroundImageCache', false, true); } catch (e) { }
	// Pager
	$(".pager a[disabled=disabled]").addClass("disabled");
	$(".pager .pager-command:last").addClass("pager-next");
	//show/hide job details
	$(".showlink").click(function(e) { $(this).parents(".listrow").children(".showhidepanel").slideToggle("fast"); });
	// Open Print Window
	$('#printForm').attr("target", "_blank");
	
	
	$('#header .site-search input').val('Search');
	$('#header .site-search input').focus(function() {
		$(this).filter(function() {
			return $(this).val() == '' || $(this).val() == 'Search';
		}).val('').addClass('focus');
	}).blur(function() {
		$(this).filter(function() {
			return $(this).val() == '';
		}).val('Search').removeClass('focus');
	});
	if($('#footer .central-florida-locations .locations ul li').length > 36){
		$('#footer .central-florida-locations .locations').before('<a href="javascript:void(0);" class="button btn-prevlocations" title="Browse Previous Locations">Previous locations</a><a href="javascript:void(0);" class="button btn-nextlocations" title="Browse Next Locations">Next locations</a>');
		$('#footer .central-florida-locations .locations').scrollable({
			clickable: false,
			items: 'ul',
			prevPage: '#footer .central-florida-locations .btn-prevlocations',
			nextPage: '#footer .central-florida-locations .btn-nextlocations',
			size: 36,
			speed: 200,
			vertical: true
		});
	}
});

// Font Resizer
function fontResize(size) { var litContent = document.getElementById("litContent"); switch (size) { case "normal": litContent.style.fontSize = "1.4em"; break; case "medium": litContent.style.fontSize = "1.8em"; break; case "large": litContent.style.fontSize = "2em"; break; } }
// Print
function printpage() { document.getElementById("hdn_Title").value = document.title; document.getElementById("hdn_Content").value = document.getElementById("main_content").innerHTML; document.forms[1].submit(); }
// Bookmark
function bookmarkpage(bookmarkUrl) { var bookmarkTitle = document.title; if (window.sidebar) { window.sidebar.addPanel(bookmarkTitle, bookmarkUrl, ""); } else if (window.external) { window.external.AddFavorite(bookmarkUrl, bookmarkTitle); } else if (window.opera && window.print) { var elem = document.getElementById('menu_bookmark'); elem.setAttribute('href', bookmarkUrl); elem.setAttribute('title', bookmarkTitle); elem.setAttribute('rel', 'sidebar'); elem.click(); } }
// Textbox Char count
function CheckFieldLength(fn, rn, mc) { var len = fn.value.length; if (len > mc) { fn.value = fn.value.substring(0, mc); len = mc; } document.getElementById(rn).innerHTML = mc - len; }


$(window).bind("mousemove",function(){
	$('a[title*="block"]').remove();
});
