/* Declare a namespace for the site */
var Site = window.Site || {};

/* Create a closure to maintain scope of the '$'
   and remain compatible with other frameworks.  */
(function($) {
	
	//same as $(document).ready();
	$(function() {

// Cufon Typography		
Cufon.replace('h1', {hover: true});
Cufon.replace('.menu', {hover: true});
Cufon.replace('nav', {hover: true});
Cufon.replace('h2');
Cufon.replace('h5', {hover:true});
Cufon.replace('h3');


/*
$(document).ready(function(){
	$(".img_holder").each(function(i) {
		id = $(this).attr('id');
		$(this).html('<img src="img_thumb/'+ id +'.jpg" style="display:none;" class="ajaxLoad_'+ i +'" title="View this project" width="245" height="147" />');
		$(".ajaxLoad_"+i+"").load(function () {
			$(".ajaxLoad_"+i+"").delay(200).fadeIn(1000);
		});
	});
});    
*/


//Colorbox
$(document).ready(function(){
	//Examples of how to assign the ColorBox event to elements
	$("a[rel='weddingcakes']").colorbox({slideshow:true});
	$("a[rel='celebrationcakes']").colorbox({slideshow:true});
	$("a[rel='cupcakes']").colorbox({slideshow:true});
	//Example of preserving a JavaScript event for inline calls.
	$("#click").click(function(){ 
		$('#click').css({"background-color":"#f00", "color":"#fff", "cursor":"inherit"}).text("Open this window again and this message will still be here.");
		return false;
	});
});


//Jquery Hints
jQuery.fn.hint = function (blurClass) {
  if (!blurClass) { 
    blurClass = 'blur';
  }

  return this.each(function () {
    // get jQuery version of 'this'
    var $input = jQuery(this),

    // capture the rest of the variable to allow for reuse
      title = $input.attr('title'),
      $form = jQuery(this.form),
      $win = jQuery(window);

    function remove() {
      if ($input.val() === title && $input.hasClass(blurClass)) {
        $input.val('').removeClass(blurClass);
      }
    }

    // only apply logic if the element has the attribute
    if (title) { 
      // on blur, set value to title attr if text is blank
      $input.blur(function () {
        if (this.value === '') {
          $input.val(title).addClass(blurClass);
        }
      }).focus(remove).blur(); // now change all inputs to title

      // clear the pre-defined text when form is submitted
      $form.submit(remove);
      $win.unload(remove); // handles Firefox's autocomplete
    }
  });
};

//Jquery Hints
$(function(){ 
    // find all the input elements with title attributes
	$('input[title!=""]').hint();
	$('textarea[title!=""]').hint();
});
		

	});


	$(window).bind("load", function() {
		
		
	
	});
	
})(jQuery);



