function mail(name, domain, style, text) {
if (text == "undefined" || text == null)
	document.write("<a h"+"ref='"+"mai"+ "lto:"+name+"@"+domain+"' style='"+style+"'>"+name+"@"+domain+"</a>");
else
	document.write("<a h"+"ref='"+"mai"+ "lto:"+name+"@"+domain+"' style='"+style+"'>"+text+"</a>");
};
	      
function check(myname,text) {
	if($(myname).attr('value')==text)
	{
		//alert($(myname).val());
		$(myname).val('');
	}else{
		if($(myname).attr('value')==''){
		$(myname).val(text);
		}
	}
};
var item;
var itemm;
item=0;
itemm=9;
$(document).ready(function(){
$(".conteiner").scrollTo( {top:'0px', left:'+=17300px'}, 100);
    var rndNum = Math.floor(Math.random() * 7);
    $("#teazer div.info").addClass('foto'+(rndNum+1));
    $("#scrool-right").click(function() {
		$("#scroll-menu ul li").eq(item).clone(true).appendTo("#scroll-menu ul");
		item++;
		$("#scroll-menu ul li").eq(item).clone(true).appendTo("#scroll-menu ul");
		item++;

			$(".conteiner").scrollTo({top:'0px', left:'+=346px'}, 700);

        return false;
        });
        $("#scrool-left").click(function() {

			$(".conteiner").scrollTo( {top:'0px', left:'-=346px'}, 700);

        return false;
        });

	$("#nameitem").change(function () {
        $(this).parent("div").children("input").eq(0).val($(this).val());
        });

	$("div").click(function() {
		$(".select_ct .r_shad:visible").slideUp(200);
		});

    $(".select_ct a").click(function() {
	$(".select_ct li:not(." + $(this).parent("li").attr("class") + ") .r_shad:visible").slideToggle(200);
    $(this).parent("li").children(".r_shad").slideToggle(200);
        $(".select_ct ul li").hover(function () {
                $(this).addClass("hover");
            }, function() {
                $(this).removeClass("hover");
                });

        $(".select_ct ul li").click(function () {
            $(this).parent("ul").parent("span").parent(".r_shad").slideUp(200);
            $(this).parent("ul").parent("span").parent(".r_shad").parent("li").children("a").text($(this).text());

            if ($(this).text()=="Любой тип" || $(this).text()=="Любой жанр" || $(this).text()=="Любой" || $(this).text()=="Любое") {
                $("#" + $(this).parent("ul").parent("span").parent(".r_shad").parent("li").attr("class")).val("");
                }else{
                $("#" + $(this).parent("ul").parent("span").parent(".r_shad").parent("li").attr("class")).val($(this).text());
                    };
            });
    return false;
    });


$("#contform").click(function () {
	$(this).parent("li").children(".r_shad").slideToggle(200);
	return false;
	});




    });

