$(document).ready(function(){
		 	   		
// fix for the jQuery slide effects

function slideToggle(el, bShow){
  var $el = $(el), height = $el.data("originalHeight"), visible = $el.is(":visible");
  
  // if the bShow isn't present, get the current visibility and reverse it
  if( arguments.length == 1 ) bShow = !visible;
  
  // if the current visiblilty is the same as the requested state, cancel
  if( bShow == visible ) return false;
  
  // get the original height
  if( !height ){
    // get original height
    height = $el.show().height();
    // update the height
    $el.data("originalHeight", height);
    // if the element was hidden, hide it again
    if( !visible ) $el.hide().css({height: 0});
  }

  // expand the knowledge (instead of slideDown/Up, use custom animation which applies fix)
  if( bShow ){
    $el.show().animate({height: height}, {duration: 250});
  } else {
    $el.animate({height: 0}, {duration: 250, complete:function (){
        $el.hide();
      }
    });
  }
}

//  REMOVE Single and double quotation values

	    $(':input:not([type="submit"])').each(function() {
	    $(this).focus(function() {
		});	
		$(this).blur(function() {
		this.value = this.value.replace(/[%&*}{>\]\[<|'"\\]/g,'');
		});
		});

		
// Show more benefits on homepage	
		$('#x').click(function() {
		$("#x").hide(0);
		$("#x").fadeIn(1000);
		$("#x").hide();
		$(".x").hide();

	
   });

// Popup Windows

		$('.portal').click(function() {
		window.open('https://aip.eo-insurance.com/Login.aspx','','resizable=yes,menubar=no, location=yes,status=no,scrollbars=yes,toolbar=no,width=980,height=600');	
		return false;
		});


// IE Cleartype fix
	
jQuery.fn.fadeIn = function(speed, callback) {
     return this.animate({
          opacity: 'show' }, speed, function() {
               if (jQuery.browser.msie)
                    this.style.removeAttribute('filter');
               if (typeof callback == 'function')
                    callback();
     });
};

jQuery.fn.fadeOut = function(speed, callback) {
     return this.animate({
           opacity: 'hide' }, speed, function() {
               if (jQuery.browser.msie)
                    this.style.removeAttribute('filter');
               if (typeof callback == 'function') callback();
     });
};

jQuery.fn.fadeTo = function(speed,to,callback) {
     return this.animate({opacity: to }, speed, function() {
          if (to == 1 && jQuery.browser.msie)
               this.style.removeAttribute('filter');
          if (typeof callback == 'function') callback();
     });
}; 
	
// END IE Cleartype fix	
	
// Gray Splash Screen		
$(function(){
var pop = function(){
	$('#grayout_screen').show().css({opacity: 0.7,'width':$(document).width(),'height':$(document).height()});
	$('#eo_plans').fadeIn().click(function(){$(this).fadeOut();$('#grayout_screen').fadeOut();});
}
	$('.eo_options_link').click(pop);
	$(window).resize(function(){
	$('#eo_plans').css("display") == 'block'?pop.call($('.eo_options_link')):"";
});
});
});
		