var j = jQuery.noConflict();
j(
	function(){
		
		var offsetfrommouse=[10,10];
		var pre = j('<div id="pre">Загрузка</div>');
		pre.appendTo("body");
		jQuery().ajaxStart(function() {
			pre.show();
		}).ajaxStop(function() {
			pre.hide();
		});

		j(document).bind("mousemove", function(e) {
			pre.css("left", e.pageX + 12 + "px");
			pre.css("top", e.pageY + 12 + "px");
		});
		pre.hide();
		
		
		j('.toolTip').Tooltip({
		  track: true,
		  delay: 0
		});
		j("#contactRequest").each(function(){
			var t = j(this);
			var te = j("textarea", t);
			var h = j("tr.none", t);
			te.focus(function(){
				if(h.is(".none")){
					te.css({"height": "125px"});
					h.removeClass("none");
				}
			});
		});
		j("#locator").each(function(){
			var t = j(this);
			var l = j("div.bannerLabel", t);
			var s = 300;
			l.click(function(){
				l.toggleClass("on")
				if(l.is(".on")){
					l.animate({top:16}, s);
				}
				else {
					l.animate({top:107}, s);
				}
			});
		});
		j("#locatorsf").each(function(){
			var t = j(this);
			var l = j("div.bannerLabel", t);
			var s = 300;
			l.click(function(){
				l.toggleClass("on")
				if(l.is(".on")){
					l.animate({top:16}, s);
				}
				else {
					l.animate({top:107}, s);
				}
			});
		});
	}
);
function go(u){
	document.location = u;
}

function refresh(){
    return document.location.reload( false );
}
function viewState(i,v){
	if(!i)
		i = 0;
	if(!v)
		v = "#views > div";
	j(j(v).hide()[i]).show();
	j(window).scrollTop(0);
}
String.prototype.get = function() {
	var r = {};
	var s = this;
	var q = s.substring(s.indexOf('?') + 1); // remove everything up to the ?
	q = q.replace(/\&$/, ''); // remove the trailing &
	jQuery.each(q.split('&'), function() {
		var splitted = this.split('=');
		var key = splitted[0];
		if(splitted.length > 1)
			var val = splitted[1];
		else
			var val = "";
		if (/^[0-9.]+$/.test(val)) val = parseFloat(val); 	// convert floats
		if (typeof val == 'number' || val.length > 0) r[key] = val; // ignore empty values
	});
	return r;
};
String.prototype.trim = function() {
	return this.replace(/^\s+|\s+$/g,"");
}
function setCookie(c_name,value,expiredays){
	var exdate=new Date();
	exdate.setDate(exdate.getDate()+expiredays);
	document.cookie=c_name+ "=" +escape(value)+((expiredays==null) ? "" : ";  path=/; expires="+exdate.toGMTString());
}
function getCookie(c_name){
	if (document.cookie.length>0){
	c_start=document.cookie.indexOf(c_name + "=");
		if (c_start!=-1){
			c_start=c_start + c_name.length+1;
			c_end=document.cookie.indexOf(";",c_start);
			if (c_end==-1) c_end=document.cookie.length;
			return unescape(document.cookie.substring(c_start,c_end));
   		}
	}
	return "";
}
function checkCookie(c_name){
	var с = getCookie(c_name);
	if(getCookie(c_name).length)
		return true;
	else
		return false;
}
function openprintwin(l) {
	var win = window.open();
	if(win != null) 
		{
			win.focus();
			win.document.location = l;
		}
	return false;
}
function getTracker(){
    return _gat._getTracker("UA-9344937-1");
}
function trackPageView(uri){
    try {
            var pageTracker = getTracker();
            pageTracker._trackPageview(uri);
    }catch(err){}
}
