/* IE Clear type fix */
(function ($) {
    $.fn.customFadeIn = function (speed, callback) {
        $(this).fadeIn(speed, function () {
            if (jQuery.browser.msie) $(this).get(0).style.removeAttribute('filter');
            if (callback != undefined) callback();
        });
    };
    $.fn.customFadeOut = function (speed, callback) {
        $(this).fadeOut(speed, function () {
            if (jQuery.browser.msie) $(this).get(0).style.removeAttribute('filter');
            if (callback != undefined) callback();
        });
    };
    $.fn.customFadeTo = function (speed, callback) {
        $(this).fadeTo(speed, function () {
            if (jQuery.browser.msie) $(this).get(0).style.removeAttribute('filter');
            if (callback != undefined) callback();
        });
    };
    $.fn.customToggle = function (speed, callback) {
        $(this).toggle(speed, function () {
            if (jQuery.browser.msie) $(this).get(0).style.removeAttribute('filter');
            if (callback != undefined) callback();
        });
    };

})(jQuery);

/* Live Search */
function lookup(inputString) {
    if (inputString.length == 0) {
        $('#suggestions').customFadeOut();
    } else if(inputString.length >3) {
        $.post(SITEURL + "/ajax/livesearch.php", {
            liveSearch: "" + inputString + ""
        }, 
		function (data) {
            $('#suggestions').customFadeIn();
            $('#suggestions').html(data);
			 
        });
        $("input").blur(function () {
            $('#suggestions').customFadeOut();
        });
    }
}

/* Disable autocomplete */
var flag = 1;
   function disAutoComplete(obj){
        if(flag){
      	obj.setAttribute("autocomplete","off");
            flag = 0;
      }
       //window.location = "#";
        obj.focus();
   }
   
/* Style Switcher */
$.fn.styleSwitcher = function(){
	$(this).click(function(){
		return false;
	});
}
$('#style-switcher a').styleSwitcher();
