var redirURL='';var url='http://www.pets4you.com/';var t='';var Functions={finishLoading:function(){$("#loading").fadeOut(function(){$(this).remove();$('body').removeAttr('style');});},breedJump:function(id){var val=$('#breedjumper'+id+' option:selected').val();if(val&&val!=""){window.open(url+val+'.html','_top');}},feedback:function(){$.getScript('js/jquery.validate.js',function(){$("#form-feedback").validate({submitHandler:function(form){var values=$("#form-feedback").serialize();$("#feedback_loader").show();$("#form-feedback").hide();$.getJSON('ajax.php?action=feedback'+values,function(){$("#feedback_loader").hide();$("#feedback_response").html(d.msg),show();});},rules:{f_name:{required:true},f_email:{required:true,email:true},feedback:{required:true}},messages:{f_name:{required:' '},f_email:{required:' ',email:' '},feedback:{required:' '}}});});},translate:function(){$("#translate").html('<div id="translate-this"><a href="http://translateth.is/" class="translate-this-button">&nbsp;</a></div>');TranslateThis({'GA':false,'scope':false,'undoLength':100,'busyText':'Translating...','cancelText':'CANCEL','fromLang':'en','panelText':'Select Language:','ddLangs':['en','es','da','cs','ru','fr','de','it','ja','ko','zh-CN','zh-TW'],'noBtn':true,'btnImg':'','btnWidth':146,'btnHeight':31,'reparse':true});$(".translate-this-button").html('Translate');},breeder_name:function(label){$("#courtesy").html("Photo Courtesy of<br />"+label);},view_breeder:function(id){$.getJSON('ajax.php?action=view_breeder&id='+id,function(d){$("#middle-alt").append('<div id="view_breeder" title="'+d.title+'">'+d.data+'</div>');$("#view_breeder").dialog({width:600,modal:true,close:function(){$("#view_breeder").remove();}});});},error:function(msg){$.prompt('<div class="error">ERROR:</div>'+msg);},success:function(msg){$.prompt('<div class="success">SUCCESS:</div>'+msg);},error_response:function(d){$('#loader').hide();this.error(d);Timer.resetTimeout();},states_conv:function(d){$.getScript('js/characters.js',function(){TextCheck.char_convert(d);$(d).blur(function(){TextCheck.char_convert(d);});});},load:function(d){Timer.resetTimeout();Timer.initTimeout();$('#'+response_div).html('');$('html, body').animate({scrollTop:$('#site').offset().top},function(){$('#'+content_div).animate({height:'hide'},function(){$('#'+loader_div).fadeIn(function(){$('#'+response_div).html('');$('#'+content_div).animate({height:'hide'},function(){$.get(cf+'.php?action='+d,function(p){$('#'+loader_div).fadeOut(function(){Timer.resetTimeout();$('#'+content_div).html(p).animate({height:'show'});});},'script');});});});});},form_send:function(){Timer.resetTimeout();Timer.initTimeout();var values=$("#fcbform").serialize();$('#'+response_div).html('');$('#'+content_div).animate({height:'hide'},function(){$('#'+loader_div).fadeIn(function(){$('#'+content_div).animate({height:'hide'},function(){$.getJSON(cf+'.php?'+values,function(d){$('#'+loader_div).fadeOut(function(){Timer.resetTimeout();$('#'+response_div).html(d.msg);$('#'+response_div).animate({height:'show'});t=setTimeout("Functions.load('"+d.call+"');",1000);});});});});});},frame_send:function(values){Timer.resetTimeout();Timer.initTimeout();$('html, body').animate({scrollTop:$('#site').offset().top},function(){$('#'+content_div).animate({height:'hide'},function(){$('#'+loader_div).fadeIn(function(){Functions.goto(cf+'.php?'+values,'iframe');});});});},framed_response:function(d){Timer.resetTimeout();$('#'+response_div).hide();$('#'+loader_div).fadeOut(function(){$('#'+response_div).html(d.msg).animate({height:'show'});if(d.call){var t1=setTimeout("Functions.load('"+d.call+"');",1000);var t2=setTimeout("$('#"+response_div+"').fadeOut();",1000);}});},goto:function(_url,_target){window.open(_url,_target);},redirect:function(){this.goto(redirURL,'_self');},reload_it:function(){document.location.reload();},rateit:function(p){$('#vote').html('Sending...');$.getJSON('ajax.php?action='+p.action+'&id='+p.id+'&vote='+p.vote,function(d){$('#vote').html(d.msg);if(d.status==0){$('#rating').html(d.rating);$('#votes').html(d.votes);}},'script');},scrollTo:function(selector){var targetOffset=$(selector).offset().top;if($.browser.opera){$('html').animate({scrollTop:targetOffset},500);}else{$('html,body').animate({scrollTop:targetOffset},500);}},loadCSS:function(c){$("head").append("<link >");css=$("head").children(":last");css.attr({rel:"stylesheet",type:"text/css",href:"css/"+c+".css"});},loadVideo:function(vidname,w,h,div){$("#"+div).click(function(){$.get(url+'ajax.php?action=video_log&name='+vidname,function(d){var vh=(d==0)?h:h+20;var ih=(d==0)?h:h+40;$("#video_dialog").html('<iframe src="'+url+'player/breeds_player.php?name='+vidname+'&w=320&h=240&count='+d+'" name="video_frame" id="video_frame" frameborder="0" width="100%" height="'+ih+'"></iframe>');$("#video_dialog").dialog({width:400,modal:true,close:function(event,ui){current_vid=0;$("#video_frame").remove();}});});});}}
var Messages={framed_response:function(d){Timer.resetTimeout();Messages.doMsg(d.status,d.msg,response_div,false,false);var t3=setTimeout("AC._close();",6000);if(d.call){var t1=setTimeout("Functions.load('"+d.call+"');",4000);}},doMsg:function(a,b,c,d,e){var type=(a==0)?'success':((a==2)?'warning':'error');var title=(a==0)?'Success':((a==2)?'System Notice':'Error');Functions.loadCSS('msgbar');if(e){$(e).animate({scrollTop:0},800);}
$.getScript('js/msgbar.js',function(){$.msgBar({type:type,title:title,text:b,lifetime:6000}).appendTo('#'+c);if(d){var t=setTimeout("window.location.href=window.location.href",1000);}});},doAlert:function(a,b,c,d){Functions.loadCSS('msgalerts');$.getScript('js/msgalerts.js',function(){$.msgAlert({type:a,title:b,text:c,callback:d});});},doGrowl:function(a,b,c){Functions.loadCSS('msggrowl');$.getScript('js/msggrowl.js',function(){$.msgGrowl({type:a,title:b,text:c,lifetime:8000});});}}
$(document).ready(function(){fixBoxShadowBlur($('*'));$.getScript('js/jquery.cookie.js');$.getScript('js/navigation.js');$.getScript('js/timer.js');$.getScript('js/alerts.js');$.getScript('js/jquery.simplemodal.js');if($('#translate').length){var trans=setTimeout("Functions.translate();",100);}
$('#clickme').toggle(function(){$(this).parent().animate({'left':'0px','opacity':100},{'queue':false,'duration':500});Functions.feedback();},function(){$(this).parent().animate({'left':'-285px','opacity':0.50},{'queue':false,'duration':500});});$("#back-top").hide();$(function(){$(window).scroll(function(){if($(this).scrollTop()>100){$('#back-top').fadeIn();}else{$('#back-top').fadeOut();}});$('#back-top a').click(function(){$('body,html').animate({scrollTop:0},800);return false;});});});function fixBoxShadowBlur(jQueryObject){if($.browser.msie&&$.browser.version.substr(0,1)=='9'){jQueryObject.each(function(){boxShadow=$(this).css('boxShadow');if(boxShadow!='none'){var bsArr=boxShadow.split(' ');bsBlur=parseInt(bsArr[2])||0;bsBlurMeasureType=bsArr[2].substr((""+bsBlur).length);bsArr[2]=(bsBlur*2)+bsBlurMeasureType;$(this).css('boxShadow',bsArr.join(' '));}});}}
function pageClosed(){var targetOffset=$("#site").offset().top;if($.browser.opera){$('html').animate({scrollTop:targetOffset},500);}else{$('html,body').animate({scrollTop:targetOffset},500);}}
function pageOpened(){var fl=setTimeout("Functions.finishLoading();",1000);}
function silentErrorHandler(){return true;}
window.onerror=silentErrorHandler;window.addEventListener('beforeunload',pageClosed,false);window.addEventListener('load',pageOpened,false);
