jQuery.noConflict()(function(){

jQuery("#menu67").attr("title","Ответы на часто задаваемые вопросы");

jQuery("input[type='text']").focus(function() {
	jQuery(this).val("");
});

jQuery("input[type='password']").focus(function() {
	jQuery(this).val("");
});

jQuery("textarea").focus(function() {
	jQuery(this).val("");
});

jQuery('#main_login_form').submit(function() {
	login = jQuery('#main_login').val();
	pass = jQuery('#main_pass').val();

	if (login == '' || login == 'Логин' || pass == '' || pass == 'Пароль') {
		return false;
	}
});

var width = 975;
var speed = 1500;
var maxlength = jQuery("#index-slider>li").length-1;
var list = jQuery("#index-slider");
var currentslide = 0;

setTimeout(function() {
	if (currentslide == 1)
	{
		return false;
	}

	currentslide = 1;
	list.animate({marginLeft: 1*width*-1}, speed);

		//setTimeout(function() {
		//	if (currentslide == 2) {return false;}
		//	currentslide = 2;
		//	list.animate({marginLeft: 2*width*-1}, speed);
		//},3000); // 2 slide

},3000); // 1 slide

jQuery("a.slider-ctrl").click(function() {
	switch(jQuery(this).attr("id")) {
		case "slider-next":
			if(currentslide==maxlength) {
				list.find("li:first").clone().appendTo(list);
				currentslide+=1;
				list.animate({marginLeft: currentslide*width*-1}, speed, function() {
					list.css("marginLeft", 0);
					currentslide=0;
					list.find("li:last").remove();
				});
			}
			else {
				currentslide +=1;
				list.animate({marginLeft: currentslide*width*-1}, speed);
			}
		break;
		case "slider-prev":
			if(currentslide==0) {
				list.find("li:last").clone().prependTo(list);
				list.css("marginLeft", width*-1);
				list.animate({marginLeft: 0}, speed, function() {
					currentslide=maxlength;
					list.css("marginLeft", currentslide*width*-1);
					list.find("li:first").remove();
				});
			}
			else {
				currentslide -=1;
				list.animate({marginLeft: currentslide*width*-1}, speed);
			}
		break;
	}
	return false;
});

jQuery("a.script-link-pageup").click(function() {
	if(jQuery.browser.opera) jQuery("html").animate({scrollTop: 0}, 500);
	else jQuery("html,body").animate({scrollTop: 0}, 500);
	return false;
});

});
