$(function(){	if($.browser.msie && $.browser.version<=6){		document.execCommand("BackgroundImageCache",false,true);     }	var $form = $('.wpcf7-form');	$(":input",$form).attr('title',' ').hint();		$(':input',$form).focus(function(){		$(this).closest('span').addClass('focus'); })	.blur(function(){		if($(this).val()=='' || $(this).val()==' ') $(this).closest('span').removeClass('focus');												});			$(".gallery-icon").closest('.gallery').find('.gallery-icon a')		.attr('rel','group'+Math.floor(Math.random()*100)).attr('title','')		.fancybox({				'transitionIn'		: 'elastic',				'transitionOut'		: 'elastic',				'titlePosition' 	: 'inside'	});			$($form).submit(function(){		$('.blur',$form).val('');		var html = '', errors = '';		// validation		if(		   	$('[name=your-email]',$form).val()=='' || $('[name=your-message]',$form).val()=='' || 			!/^[_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*@([0-9A-Za-z](-?[0-9A-Za-z])*\.)+[a-z]{2}([zmuvtg]|fo|me)?$/.test($('[name=your-email]',$form).val())		)		errors += "<p>Please fill all fields and enter a valid email address to submit your request.</p>";						if(errors!=''){			html = '<h1>Uh-oh!</h1>'+ errors;			popupShow(html);			return !1;		}else{			$.post($form.attr('action'),				  $form.serializeObject(),				   function(r){					   if(r==1 || $('.wpcf7-mail-sent-ok',r).size()>0 || r.toString().indexOf('mailSent: 1')!=-1){							html = '<h1>Thank you!</h1><p>Thank you for contacting Spinnaker Studio!</p><p>I will get back to you as soon as possible.</p>';							$(' :input',$form).val('').closest('span').removeClass('focus');						}else if($('.wpcf7-response-output',r).size()>0){							html = '<h1>&nbsp;</h1>'+$('.wpcf7-response-output',r).html();						}else{							html = '<h1>Sorry!</h1><p>Server temporarily unavailable.</p>';						}						popupShow(html);					}			);			}		return !1;	});	$('.btn-send',$form).click(function(){$($form).submit(); return !1;});});/*** functions ***/function popupShow(content){	$('#popup-content').html(content);	$('#popup').css('top','-350px').animate({top:'170px'});	$('#popup .close, #popup .btn-close').click(function(){ popupHide(); return !1;});}function popupHide(){	$("#frm :input[title]").hint();	$('#popup').animate({top: '-350px'});	}/*** plugins *****************************/$.fn.serializeObject = function(){    var o = {};    var a = this.serializeArray();    $.each(a, function() {        if (o[this.name]) {            if (!o[this.name].push) {                o[this.name] = [o[this.name]];            }            o[this.name].push(this.value || '');        } else {            o[this.name] = this.value || '';        }    });    return o;};/*** @author Remy Sharp* @url http://remysharp.com/2007/01/25/jquery-tutorial-text-box-hints/*/(function ($) {$.fn.hint = function (blurClass) {    if (!blurClass) blurClass = 'blur';    return this.each(function () {        // get jQuery instance of 'this'        var $$ = $(this);         // get it once since it won't change        var title = $$.attr('title');         // only apply logic if the element has the attribute        if (title) {             // Note this is a one liner            // on blur, set value to title attr if text is blank            $$.blur(function () {                if ($$.val() == '') {                    $$.val(title).addClass(blurClass);                }            })            // on focus, set value to blank if current value matches title attr            .focus(function () {                if ($$.val() == title && $$.hasClass(blurClass)) {                    $$.val('').removeClass(blurClass);                }            })            // clear the pre-defined text when form is submitted            .parents('form:first').submit(function () {                if ($$.val() == title && $$.hasClass(blurClass)) {                    $$.val('').removeClass(blurClass);                }            }).end()            // now change all inputs to title            .blur();            // counteracts the effect of Firefox's autocomplete stripping the blur effect            if ($.browser.mozilla && !$$.attr('autocomplete')) {                setTimeout(function () {                    if ($$.val() == title) $$.val('');                    $$.blur();                }, 10);            }        }    });};})(jQuery);