function swap_image(id,file) {
	var im = document.getElementById(id);
	im.src=file;
}

// text - to co pojawia sie w div id="caption"
// text2 - to co pojawia sie w div id="description"
function load_image(url,text,text_d) {
	
	this.cover = document.getElementById("photo_cover");
	this.main_image = document.getElementById("main_image");
	this.loading = document.getElementById("loading_photo");
	this.caption = document.getElementById("caption");
	
        this.text_description = document.getElementById("text_description");
        
        
	this.loading.style.display="block";
	//alert("loading visible");
	var imageHTML = "<img id=\"cover_image\" src=\""+url+"\" alt='' />";
	//alert("imageHTML");
	this.cover.innerHTML = imageHTML;
	//alert("innerHTML");
	this.featImage = this.cover.getElementsByTagName("img")[0]
	//alert("get by tag name");
	
	this.featImage.onload = function() {

		loading.style.display="none";
		caption.innerHTML=text;
                text_description.innerHTML=text_d;
		main_image.src = document.getElementById("cover_image").src;
		
		
	}
	
}

function login_highlight(id,mode) {
	
	var elem = document.getElementById(id);
	
	if(mode == 1)
		elem.style.border="1px solid #fc420a";
	else
		elem.style.border="1px solid #292929";
	

}

function button_highlight(id,mode) {
	var elem = document.getElementById(id);
	
	if(mode == 1) {
		elem.style.color="#ffffff";
	} else {
		elem.style.color="#fc420a";
	}
	
}

function load_image_next(url,text,text_d,coord_id, coord_next_id, clear_next) {
	
	this.cover = document.getElementById("photo_cover");
	this.main_image = document.getElementById("main_image");
	this.loading = document.getElementById("loading_photo");
	this.caption = document.getElementById("caption");
	
        this.text_description = document.getElementById("text_description");
        
     document.getElementById("coord_next_"+coord_id).setAttribute("coords", "0,0,0,0");
    document.getElementById("coord_next_"+clear_next).setAttribute("coords", "0,0,0,0"); 
    document.getElementById("coord_next_"+coord_next_id).setAttribute("coords", "0,0,600,450");
   
        
	this.loading.style.display="block";
	//alert("loading visible");
	var imageHTML = "<img id=\"cover_image\" src=\""+url+"\" alt='' />";
	//alert("imageHTML");
	this.cover.innerHTML = imageHTML;
	//alert("innerHTML");
	this.featImage = this.cover.getElementsByTagName("img")[0]
	//alert("get by tag name");
	
	this.featImage.onload = function() {

		loading.style.display="none";
		caption.innerHTML=text;
                text_description.innerHTML=text_d;
		main_image.src = document.getElementById("cover_image").src;
		
		
	}
	
}

// text - to co pojawia sie w div id="caption"
// text_d - to co pojawia sie w div id="description"
function load_image2(url,text,text_d,coord_id, coord_next_id,coord_previous_id, clear_next, clear_previous) {
	
	this.cover = document.getElementById("photo_cover");
	this.main_image = document.getElementById("main_image");
	this.loading = document.getElementById("loading_photo");
	this.caption = document.getElementById("caption");
	
        this.text_description = document.getElementById("text_description");
     
             document.getElementById("coord_next_"+coord_id).setAttribute("coords", "0,0,0,0");
             document.getElementById("coord_previous_"+coord_id).setAttribute("coords", "0,0,0,0");
             document.getElementById("coord_next_"+clear_next).setAttribute("coords", "0,0,0,0");
             document.getElementById("coord_previous_"+clear_previous).setAttribute("coords", "0,0,0,0");
             document.getElementById("coord_next_"+clear_previous).setAttribute("coords", "0,0,0,0");
             document.getElementById("coord_previous_"+clear_next).setAttribute("coords", "0,0,0,0");

          


            document.getElementById("coord_next_"+coord_next_id).setAttribute("coords", "400,0,600,450");
            document.getElementById("coord_previous_"+coord_previous_id).setAttribute("coords", "0,0,200,450");
     
      
        
	this.loading.style.display="block";
	//alert("loading visible");
	var imageHTML = "<img id=\"cover_image\" src=\""+url+"\" alt='' />";
	//alert("imageHTML");
	this.cover.innerHTML = imageHTML;
	//alert("innerHTML");
	this.featImage = this.cover.getElementsByTagName("img")[0]
	//alert("get by tag name");
	
	this.featImage.onload = function() {

		loading.style.display="none";
		caption.innerHTML=text;
                text_description.innerHTML=text_d;
		main_image.src = document.getElementById("cover_image").src;
	}
	
}

