	function change(el,ext) {
		var fix = '-2';
		el.src = (el.src.indexOf(fix)!=-1) ? el.src.replace(eval('/'+fix+'/'),'') : el.src.replace(eval('/\.'+ext+'$/'),fix+'.'+ext);
	}


	function changeImg(file,link) {
		document.getElementById('mine_img').src = file;
		document.getElementById('mine_a').href = link;
		return false;
	}



	function reQuery(func){setTimeout(func,1000);}
	function refreshPage(){window.location.href=window.location.href;}

	function ajaxQuery(params) {
		if (typeof(params.query)=='undefined') return false;
		$.getJSON('/ajax.php?'+Math.random(),params,function(data){
			if (data.status=='waiting'){reQuery(function(){ajaxQuery(params)}); return false;}
			eval('response_'+params.query+'(data,params);');
		});
	}


	function basket(item_id){ajaxQuery({query:"basket",item_id:item_id});}
	function response_basket(data){
//		document.getElementById('basket').innerHTML = data;
		window.location.href = '/basket/';
	}

/*
	jsHover = function() {
		var hEls = document.getElementById("watch").getElementsByTagName("LI");
		for (var i=0, len=hEls.length; i<len; i++) {
			if (hEls[i].className!='top' && hEls[i].className!='bottom') {
				hEls[i].onmouseover=function() { this.className+=" hover"; }
				hEls[i].onmouseout=function() { this.className=this.className.replace(" hover", ""); }
			}
		}
	}
	if (window.attachEvent && navigator.userAgent.indexOf("Opera")==-1) window.attachEvent("onload", jsHover);
*/