
// -------------------- HK General functions: START:  -------------------- 

function clearText(field){
    if (field.defaultValue == field.value) field.value = '';
    else if (field.value == '') field.value = field.defaultValue;
}
// -------------------- HK General functions: END  -------------------- 



// -------------------- HK Google Analytics START:  -------------------- 
  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-17247634-1']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();
// -------------------- HK Google Analytics END  -------------------- 



// -------------------- HK Fancybox viewer START:  -------------------- 
$(document).ready(function() {
$("a[rel=gallerygroup]").fancybox({
'transitionIn'	: 'elastic',
'transitionOut'	: 'elastic',
'titlePosition' 	: 'inside',
'titleFormat'	: function(title, currentArray, currentIndex, currentOpts) {
return '<span>Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
}});});
// -------------------- HK Fancybox viewer END -------------------- 


// -------------------- HK FreeForm validation START -------------------- 
$().ready(function() {

 // validate signup form on keyup and submit
 $("#freeform").validate({
  rules: {
   name1: "required",
   HK_phone: "required",
   email: {
    required: true,
    email: true
   },
   question: "required"
  },
  errorContainer: $("#warning")
 });
});

// -------------------- HK FreeForm validation START -------------------- 





