/*
#############################################################
# projekt:		YFA s.r.o. - funkce javascriptu
##############################################################
# soubor:		function.js
##############################################################
# vytvoren:		25. 11. 2007 
##############################################################
# obsah:        javascriptove funkce pro web YFA s.r.o.
#
##############################################################
# autor:		tm
##############################################################
*/


function top_anime(imgid, poradi, no_img) {
	//vymenime obrazek
	document.getElementById(imgid).src = rotobr[poradi].src; 
	changeOpac(100, imgid); 
	dalsi = (poradi+1>no_img ? 1 : poradi+1);
	blendimage('projector', imgid, rotobr[dalsi].src, 2500);
	window.setTimeout("top_anime('"+imgid+"', "+dalsi+", "+no_img+")", 6000);
}




function blendimage(divid, imageid, imagefile, millisec) { 
    var speed = Math.round(millisec / 100); 
    var timer = 0; 
    //novy obrazek do pozadi do pozadi div#projector
    document.getElementById(divid).style.background = "url(" + imagefile + ") no-repeat"; 
	//zpruhlednime obrazek
    for(i = 100; i >= 0; i--) { 
        setTimeout("changeOpac(" + i + ",'" + imageid + "')",(timer * speed)); 
        timer++; 
    } 
} 




//change the opacity for different browsers 
function changeOpac(opacity, id) { 
    var object = document.getElementById(id).style; 
    object.opacity = (opacity / 100); 
    object.MozOpacity = (opacity / 100); 
    object.KhtmlOpacity = (opacity / 100); 
    object.filter = "alpha(opacity=" + opacity + ")"; 
} 


function vzornik(bgcolor, color, title, pantone, rgb, cmyk) {
	var newOkno;
	newOkno=window.open("",'Foto','location=no, menubar=no, toolbar=no, status=no, scrollbars=yes, resizable=yes, width=300, height=200');
	newOkno.document.write("<html>\n<head>\n<title>"+title+"</title>\n</head>\n");
	newOkno.document.write("<body text='"+color+"' bgcolor='"+bgcolor+"' onblur='self.close();'>\n<div align=\"center\">\n<b>PANTONE: "+pantone+"<br />\n");
	newOkno.document.write(rgb+"<br />\nCMYK: "+cmyk+"<br /></b>\n</body>\n</html>");
	newOkno.document.close();
	newOkno.focus();
}


