(function(){
  // if firefox 3.5+, hide content till load (or 3 seconds) to prevent FOUT
  var d = document, e = d.documentElement, s = d.createElement('style');
  if (e.style.MozTransform === ''){ // gecko 1.9.1 inference
    s.textContent = 'body{visibility:hidden}';
    var r = document.getElementsByTagName('script')[0];
    r.parentNode.insertBefore(s, r);
    function f(){ s.parentNode && s.parentNode.removeChild(s); }
    addEventListener('load',f,false);
    setTimeout(f,3000); 
  }
})();
$.fn.clearForm = function() {
  return this.each(function() {
  var type = this.type, tag = this.tagName.toLowerCase();
  if (tag == 'form')
    return $(':input',this).clearForm();
  if (type == 'text' || type == 'password' || tag == 'textarea')
    this.value = '';
  else if (type == 'checkbox' || type == 'radio')
    this.checked = false;
  else if (tag == 'select')
    this.selectedIndex = -1;
  });
};

$(document).ready(function(){

  //$("body").queryLoader2();
  
	// initialize vertical article scrollable
	$(".scrollable").scrollable({ vertical: true, circular:true, next:'#articleNext',speed:	600}).autoscroll(6000);
	
	
$('.casestudy a, .listing a').filter(function() {
    return this.hostname && this.hostname !== location.hostname;
  }).addClass('externalLink').attr('target','_blank');	
	
});
