/*  jquery functions */
  
  /**
   * jQuery redirect
   * @param url 
  */
  function jqRedirect(url) {
    $(location).attr('href', url);
  }
  
  /**
   * jQuery redirect delay
   * @param url 
   * @param delay
  */
  function jqRedirectDelay(url, delay) {
    setTimeout(function() {
      $(location).attr('href', url);
    }, delay);
  }
  
  /**
   * jQuery Fade with timeout
   * @param id, speed, timeout 
  */
  function jqFadeOut(id, speed, timeout) {
    setTimeout(function() {
      $(id).fadeOut(speed);
    }, timeout);
  }
  
  /**
   * Enable javascript trick
  */
  function jsEnabled() {
    $(document).ready(function() {
      $(function() {
        $('#jsEnabled').hide();
      })
    })
  }
  
  /**
   * Get http or https
  */
  function getHttpHeader() {
    var serverprotocol = (("https:" == document.location.protocol) ? "https://" : "http://");
    return serverprotocol;
  }
  
  /**
   * Get hostname
  */
  function getHostName() {
    return window.location.hostname;
  }
  
  /**
   * Get host url with http only
  */
  function getHostUrlHttp() {
    return 'http://'+ getHostName();
  }
  
  /**
   * Get host url with https only
  */
  function getHostUrlHttps() {
    return 'https://'+ getHostName();
  }
  
  /**
   * Get host url depending on http header
  */
  function getHostUrl() {
    return getHttpHeader() + getHostName();
  }
  
  /**
   * Setting two css div columns have same height
 */
  function sameHeight(group) {
    highest = 0;
    group.each(function() {
        thisHeight = $(this).height();
        if(thisHeight > highest) {
            highest = thisHeight;
        }
    });
    group.height(highest);
    
    /*
     Usage:
     $(document).ready(function() {
       sameHeight($('.col-1'));
       sameHeight($('.col-2'));
     }); 
   */
  }
	
	function isiPhone() {
    return (
			(navigator.platform.indexOf("iPhone") != -1) ||
      (navigator.platform.indexOf("iPod") != -1)
    );
	}
	
	function isiPad() {
    return navigator.platform.indexOf("iPad") != -1;
	}

/* End jquery functions */
