$(document).ready(function(){
  $('.header-logo a img, .header-heroes .pic,  .header-heroes .links a img').ifixpng();    
    
  if(function_exists("onready")) onready();
  
  var status = getCookie('div_consultant');
        	
    if (status == 0)
    	$('#div_consultant').toggleClass('oc-hidden');
    //else $('#div_consultant').toggleClass('oc-hidden');
    
        $('#oc-toggler').click(function(){
        	$('#div_consultant').toggleClass('oc-hidden');
			if (status==0) setCookie('div_consultant', '1');
			else setCookie('div_consultant', '0');
			
            return false;
        });
    
});

function is_numeric( mixed_var ) {
  return !isNaN(mixed_var * 1);
}

function is_int(val) {
  return (parseFloat(val) == parseInt(val)) && !isNaN(parseInt(val))
}

function function_exists( function_name ) {    // Return TRUE if the given function has been defined
    if (typeof function_name == 'string'){
        return (typeof window[function_name] == 'function');
    } else{
        return (function_name instanceof Function);
    }
}

function openChat() {
	o=window.open;
	o('https://siteheart.com/webconsultation/37853?s=1', 'siteheart_sitewindow_37853', 'width=550,height=400,top=30,left=30,resizable=yes'); 	return false;
}

function setCookie(key, value) {  
   var expires = new Date();  
   expires.setTime(expires.getTime() + 31536000000); //1 year  
   document.cookie = key + '=' + value + ';expires=' + expires.toUTCString();  
   }  
  
function getCookie(key) {  
   var keyValue = document.cookie.match('(^|;) ?' + key + '=([^;]*)(;|$)');  
   return keyValue ? keyValue[2] : null;  
   }
