function setpagenum() {
		// old function	
}

function hide() {
	//$("#projector_text").hide("slow");
}

var num = 0;
var timer1;
var timer2;


//////////////////////////////////////////


function isIE() {
	if (document.all) {
		return true
	}else{
		return false
	}
}



function previous() {
		clearTimeout(timer1);
		clearTimeout(timer2);
		num--;
		num--;
		$("#projector_text").animate({opacity: 0.0},"slow",function(){ $(this).empty(); });
		$(function() { moveimg(num) });
		console.log("prev= "+num);
}

function next() {
		clearTimeout(timer1);
		clearTimeout(timer2);
		//num++;
		$("#projector_text").animate({opacity: 0.0},"slow",function(){ $(this).empty(); });
		$(function() { moveimg(num) });
		console.log("next= "+num);
}

function seek(no) {
		clearTimeout(timer1);
		clearTimeout(timer2);
		num = no;
		$("#projector_text").animate({opacity: 0.0},"slow",function(){ $(this).empty(); });
		$(function() { moveimg(num) });
		console.log("seek= "+num);
}


function moveimg(imgnum){
		clearTimeout(timer1);
		clearTimeout(timer2);
		position = -590*imgnum;
		if(num==16){ 
				num = 0;
				position = 0;
		}
		$("#obryvproject").animate({left: position},"slow",function(){ changedescription(num); timerr(); });
		console.log(num);
}

function timerr(){
		console.log("timerr");
		num++;
		timer1 = setTimeout("moveimg(num)",10000);
}

function hide_description() {
		$("#projector_text").animate({opacity: 0.0},"slow",function(){ $(this).empty() });	
}


function changedescription(i) {
	console.log("changedescription= "+i);
	$("#projector_text").append("<h1>"+ description[i][0] +"</h1><p>"+ description[i][1] +"</p>").animate({opacity: 1.0},"slow",function(){$(this).fixClearType()});
	timer2 = setTimeout("hide_description()",9000);
}


function AjaxDialogErr(){
	
	if($.browser.msie) document.getElementById('content_full').style.zIndex = -1;
	
	$("#messagebackground").removeClass("hidenplace").addClass("placeB").show("fast").animate({opacity: 0.2},"slow").wait(3000,"fx").animate({opacity: 0.0},"slow").hide("slow",function(){document.getElementById('content_full').style.zIndex = 1});
	$("#message").removeClass("hidenplace").removeClass("placeM-green").addClass("placeM-red").show("fast").animate({opacity: 1.0},"slow",function(){$(this).fixClearType()}).wait(2500,"fx").animate({opacity: 0.0},"slow",function(){$(this).fixClearType()}).hide("slow");
	
}

function AjaxDialogSucces(){
	if($.browser.msie) document.getElementById('content_full').style.zIndex = -1;
	
	$("#messagebackground").removeClass("hidenplace").addClass("placeB").show("fast").animate({opacity: 0.2},"slow").wait(3000,"fx").animate({opacity: 0.0},"slow").hide("slow",function(){document.getElementById('content_full').style.zIndex = 1});
	$("#message").removeClass("hidenplace").addClass("placeM-green").show("fast").animate({opacity: 1.0},"slow",function(){$(this).fixClearType()}).wait(2500,"fx").animate({opacity: 0.0},"slow",function(){$(this).fixClearType()}).hide("slow"); 
	
	$(':input').clearForm();
}

//mail

$(document).ready(function() { 
					$(".menu > ul").prepend("<li><a href=\"http://rameno.xf.cz/\" title=\"my work\">my work</a></li>");
					
					$(".second_menu > ul").prepend("<li><a href=\"http://rameno.xf.cz/\" title=\"my work\" class=\"noborder\">my work</a></li>");
					
					
					if(num==0) changedescription(num);
					timerr();
					
					
						
					
$.fn.wait = function(time, type) {
        time = time || 1000;
        type = type || "fx";
        return this.queue(type, function() {
            var self = this;
            setTimeout(function() {
                $(self).dequeue();
            }, time);
        });
    };

$.fn.clearForm = function() {
				  return this.each(function() {
					var type = this.type, tag = this.tagName.toLowerCase();
					if (tag == 'form')
					  return $(':input',this).clearForm();
					if (type == 'text' || type == 'password' || tag == 'textarea')
					  this.value = '';
					else if (type == 'checkbox' || type == 'radio')
					  this.checked = false;
					else if (tag == 'select')
					  this.selectedIndex = -1;
				  });
				};
	

	
$.fn.fixClearType = function(){
	
    return this.each(function(){
							  
		if($.browser.msie) {
			
        	if(!!(typeof this.style.filter  && this.style.removeAttribute)) this.style.removeAttribute("filter");
			
		}
		
    });
}; 

// konec document.ready
});