    var mySlide = function(indexer)  {
        //using prototype syntax, for more effects
        this.indexer    = indexer;
        this.imgnow     = 1;
        this.theDIV     = "";
        this.theDIV_hei = 0;
        this.theDIV_wid = 0;
        this.animation  = "";
    }

    mySlide.prototype.resetStates=function(x,y) {
    	var last = $('#'+this.theDIV+' img').length;
    	for (i=1;i<=last;i++) {
    		if (i!=x && i!=y) {
    			var item="#sliderimg"+this.indexer +i;
                    
                    if (this.animation=="" || this.animation=="bottomout") $(item).css({top:this.theDIV_hei+"px",left:"0px"});			
                    if (this.animation=="leftout") $(item).css({left:this.theDIV_wid+"px",top:"0px"});			

    		}
    	}
    };
    
    mySlide.prototype.tmrRotate=function() {
    	var last = $('#'+this.theDIV+' img').length;
    	var itemnow  = "#sliderimg"+this.indexer +this.imgnow;
    	var imgold   = this.imgnow;
    	
    	this.imgnow++; if (this.imgnow>last) this.imgnow=1;
    	var imgnext  = this.imgnow;
    	var itemnext = "#sliderimg"+this.indexer +imgnext;
    	
    	this.resetStates(imgold,imgnext);

        if (this.animation=="" || this.animation=="bottomout") this.animate_bottomout(itemnow,itemnext);
        if (this.animation=="leftout")  this.animate_leftout(itemnow,itemnext);
    };
    
    mySlide.prototype.animate_leftout=function(itemnow,itemnext) {
    	$(itemnow).animate({left:-920+"px"}, 500, 'linear')
    	$(itemnext).animate({left:"0px"}, 500, 'linear')
        
    }
    mySlide.prototype.animate_bottomout=function(itemnow,itemnext) {
    	$(itemnow).animate({top:this.theDIV_hei+"px"}, 500, 'linear')
    	$(itemnext).animate({top:"0px"}, 500, 'linear')
    }
    
    
    mySlide.prototype.setSliderImgs=function(imgs) {
    	var cont="";
    	for (i=imgs.length-1;i>=0;i--) {
    		j=i+1; cont+='<div id="sliderimg'+this.indexer +j+'" style="position: absolute; left:0px; width:100%; height:100%"><img src="'+imgs[i]+'" border="0" /></div>';
    	}
    	
    	$('#'+this.theDIV).html(cont);
    };
    
    mySlide.prototype.startSlide=function(tmr,imgs,divID,animation) {
        this.theDIV=divID;
        this.animation=animation;
        this.theDIV_wid=$('#'+this.theDIV).width();
        this.theDIV_hei=$('#'+this.theDIV).height();
        
        this.setSliderImgs(imgs);
        this.resetStates(1, $('#'+this.theDIV+' img').length, this.animation);
        
        var obj=this; setInterval(function () { obj.tmrRotate(); }, tmr*1000);
    };


$(document).ready(function(){

	$('.mainmenu').animate({ opacity: '0.7'}, 1);
	$('.mainmenu').mouseover(function(ev) {
	   $(this).animate({ opacity: '1'}, 200);
	});
	$('.mainmenu').mouseout(function(ev) {
	   $(this).animate({ opacity: '0.7'}, 300);
	});
	
	//$('#thepix').coinslider({ width: 900, height:155, navigation: false, delay: 5000 });
	
	$('#languages').css({position:'absolute', width:'443px', top: ($('#clearer').position().top-25)+'px', left: ($('#clearer').position().left+350)+'px'});
	

	$(".lang").css({
		'z-index' : '0', 
		'marginTop': '2px', 
		'marginLeft': '3px',
		'marginBottom': '2px',
		'marginRight': '3px',
		'width': '30px', 
		'height': '20px'	
	});
	$(".lang").hover(function() {
	$(this).css({'z-index' : '10'});
	$(this).stop()
		.animate({
			marginTop: '0px', 
			marginLeft: '0px', 
			marginBottom: '0px',
			marginRight: '0px',
			width: '36px', 
			height: '24px'		
		}, 100);
	
	} , function() {
	$(this).css({'z-index' : '0'});
	$(this).stop()
		.animate({
			marginTop: '2px', 
			marginLeft: '3px',
			marginBottom: '2px',
			marginRight: '3px',
			width: '30px', 
			height: '20px'		
		}, 200);
	});
	
	var pix   = new Array(
		"http://www.campingniche.hu/camping_style/pic7.jpg",
		"http://www.campingniche.hu/camping_style/pic1.jpg",
		"http://www.campingniche.hu/camping_style/pic3.jpg",
		"http://www.campingniche.hu/camping_style/pic4.jpg"
	);
	var tmr   = 5;
	var divID = "thepix";
	
    var ms1= new mySlide(1);
	ms1.startSlide(tmr,pix,divID,"leftout");
});






