var redirURL = '';
$(document).ready(function(){
	$.getScript('js/browser.js');
	$.getScript('js/timer.js');
});
var Functions = {
	breedJump:function(){
		var val = $('#breedjumper option:selected').val();
		if(val && val != ""){
			window.open('http://www.pets4you.com/'+val+'.html', '_self');
		}
	},
	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');
	},
    stripHTML:function(){
		var re= /<\S[^><]*>/g
		for (i=0; i<arguments.length; i++){
			arguments[i].value = arguments[i].value.replace(re, "");
		}
	},
	loadCSS:function(c){
		$("head").append("<link >");
		css = $("head").children(":last");
		css.attr({
			rel:  "stylesheet",
			type: "text/css",
			href: "css/"+c+".css"
		});	
	},
	scrollTo:function(a){
		if($.browser.opera){
			$('html').animate({scrollTop: $(a).offset().top}, 1000);
		} else {
			$('html,body').animate({scrollTop: $(a).offset().top}, 1000);
		}
	}
}
