//DOM Image Rollover II- Available at Dynamic Drive (http://www.dynamicdrive.com)

	// Make Variables----------------------
	var imgMouseOverHolder = new Array();
	var imgMouseDownHolder = new Array();
	//-------------------------------------

function preloader(imgTags){

	// Create Variables------------------
	var newmouseover, newmouseout, newmouseup, newmousedown, oldmouseover, oldmouseout, oldmouseup, oldmousedown
	//-----------------------------------
	
	// Get array length--------------
	var AL = imgMouseOverHolder.length + 1;
	//-------------------------------

	for (var i = 0; i < imgTags.length; i++) {

		if (imgTags[i].getAttribute('srcdown')||imgTags[i].getAttribute('srcover')) {
	
		newmouseover = null; newmouseout = null; newmouseup = null;	newmousedown = null; oldmouseover = null; oldmouseout = null; oldmouseup = null; oldmousedown = null

			// Store src Images------------------
			if (imgTags[i].getAttribute('srcover')) {imgMouseOverHolder[AL] = new Image(); imgMouseOverHolder[AL].src = imgTags[i].getAttribute('srcover');}
			if (imgTags[i].getAttribute('srcdown')) {imgMouseDownHolder[AL] = new Image(); imgMouseDownHolder[AL].src = imgTags[i].getAttribute('srcdown');}
			//-----------------------------------
			
			// Make backups----------------------
			if (imgTags[i].src) {imgTags[i].setAttribute("oldsrc", imgTags[i].src);}
			//-----------------------------------
				
			if (imgTags[i].getAttribute('srcover')) {
			
				// Make Mouse over--------------------
				if (imgTags[i].onmouseover) {imgTags[i].oldmouseover = imgTags[i].onmouseover; newmouseover = function (){this.src=this.getAttribute("srcover"); this.oldmouseover();}}
				else {newmouseover = function (){this.src=this.getAttribute("srcover");}}
				imgTags[i].onmouseover = newmouseover;
				//------------------------------------
			
				// Make Mouse out--------------------
				if (imgTags[i].onmouseout){imgTags[i].oldmouseout = imgTags[i].onmouseout; newmouseout = function (){this.src=this.getAttribute("oldsrc"); this.oldmouseout();}}
				else {newmouseout = function (){this.src=this.getAttribute("oldsrc");}}
				imgTags[i].onmouseout = newmouseout;
				//-----------------------------------
			}
			
			if (imgTags[i].getAttribute('srcdown')) {	
			
			// Make Mouse Down---------------------
			if (imgTags[i].onmousedown) {imgTags[i].oldmousedown = imgTags[i].onmousedown; newmousedown = function (){this.src=this.getAttribute("srcdown"); this.oldmousedown();}}
			else {newmousedown = function (){this.src=this.getAttribute("srcdown");}}
			imgTags[i].onmousedown = newmousedown;
			//-------------------------------------
			
				if (imgTags[i].getAttribute('srcover')) {
						
					// Make Mouse up-----------------------
					if (imgTags[i].onmouseup) {imgTags[i].oldmouseup = imgTags[i].onmouseup; newmouseup = function (){this.src=this.getAttribute("srcover"); this.oldmouseup();}}
					else {newmouseup = function (){this.src=this.getAttribute("srcover");}}
					imgTags[i].onmouseup = newmouseup;
					//-------------------------------------
				
				} else {
								
					//Make Mouse up-------------------------
					if (imgTags[i].onmouseup) {imgTags[i].oldmouseup = imgTags[i].onmouseup; newmouseup = function (){this.src=this.getAttribute("oldsrc"); this.oldmouseup();}}
					else {newmouseup = function (){this.src=this.getAttribute("oldsrc");}}
					imgTags[i].onmouseup = newmouseup;
					//-------------------------------------
					
					// Make Mouse out--------------------
					if (imgTags[i].onmouseout) {imgTags[i].oldmouseout = imgTags[i].onmouseout; newmouseout = function (){this.src=this.getAttribute("oldsrc"); this.oldmouseout();}}
					else {newmouseout = function (){this.src=this.getAttribute("oldsrc");}}
					imgTags[i].onmouseout = newmouseout;
					//-----------------------------------
				
				}
				
			}
		}
	}
}

function preloadimgsrc() {

	// Check to see if document element----
	if (!document.getElementById) return;
	//-------------------------------------
	
	// Declare variables--------------------
	var imgTags = document.getElementsByTagName('IMG'); 
	var imgTags2 = document.getElementsByTagName('INPUT');   // For image type submit buttons 
	//--------------------------------------
	
	// Preload Images-----------------------
	preloader(imgTags);
	preloader(imgTags2);  // For image type submit buttons 
	//--------------------------------------
}

if (window.addEventListener)
window.addEventListener("load", preloadimgsrc, false)
else if (window.attachEvent)
window.attachEvent("onload", preloadimgsrc)
else if (document.getElementById)
window.onload=preloadimgsrc

//BG Change

		function onOver(row) {
            if (row.style.backgroundColor != '#00508F') row.style.backgroundColor = '#00508F';
        }

        function onOut(row) {
            if (row.style.backgroundColor != '#BA141A') row.style.backgroundColor = '#BA141A';
        }

        function onClick(row) {
            var row_cnt = document.getElementById('theTable').rows.length;
            for (var loop=0; loop<row_cnt; loop++) {
                document.getElementById('tr_' + loop).style.backgroundColor = '#BA141A';
            }
            row.style.backgroundColor = '#BA141A';
        }


/*
        This script was written by
        Jeff Hoelker - webmaster@cafejava.com <mailto:webmaster@cafejava.com>
        <http://www.cafejava.com/>
        You may use this script as you see fit
        Just please leave this commit in here
*/
function SelectIt(){
        if (document.Links.Select.options[document.Links.Select.selectedIndex].value != "none"){ 
        	url = document.Links.Select.options[document.Links.Select.selectedIndex].value;
	  	window.location = url;
	  }
}


//** Tab Content script- © Dynamic Drive DHTML code library (http://www.dynamicdrive.com)
//** Last updated: Nov 8th, 06

var enabletabpersistence=1 //enable tab persistence via session only cookies, so selected tab is remembered?

////NO NEED TO EDIT BELOW////////////////////////
var tabcontentIDs=new Object()

function expandcontent(linkobj){
var ulid=linkobj.parentNode.parentNode.id //id of UL element
var ullist=document.getElementById(ulid).getElementsByTagName("li") //get list of LIs corresponding to the tab contents
for (var i=0; i<ullist.length; i++){
ullist[i].className=""  //deselect all tabs
if (typeof tabcontentIDs[ulid][i]!="undefined") //if tab content within this array index exists (exception: More tabs than there are tab contents)
document.getElementById(tabcontentIDs[ulid][i]).style.display="none" //hide all tab contents
}
linkobj.parentNode.className="selected"  //highlight currently clicked on tab
document.getElementById(linkobj.getAttribute("rel")).style.display="block" //expand corresponding tab content
saveselectedtabcontentid(ulid, linkobj.getAttribute("rel"))
}

function expandtab(tabcontentid, tabnumber){ //interface for selecting a tab (plus expand corresponding content)
var thetab=document.getElementById(tabcontentid).getElementsByTagName("a")[tabnumber]
if (thetab.getAttribute("rel"))
expandcontent(thetab)
}

function savetabcontentids(ulid, relattribute){// save ids of tab content divs
if (typeof tabcontentIDs[ulid]=="undefined") //if this array doesn't exist yet
tabcontentIDs[ulid]=new Array()
tabcontentIDs[ulid][tabcontentIDs[ulid].length]=relattribute
}

function saveselectedtabcontentid(ulid, selectedtabid){ //set id of clicked on tab as selected tab id & enter into cookie
if (enabletabpersistence==1) //if persistence feature turned on
setCookie(ulid, selectedtabid)
}

function getullistlinkbyId(ulid, tabcontentid){ //returns a tab link based on the ID of the associated tab content
var ullist=document.getElementById(ulid).getElementsByTagName("li")
for (var i=0; i<ullist.length; i++){
if (ullist[i].getElementsByTagName("a")[0].getAttribute("rel")==tabcontentid){
return ullist[i].getElementsByTagName("a")[0]
break
}
}
}

function initializetabcontent(){
for (var i=0; i<arguments.length; i++){ //loop through passed UL ids
if (enabletabpersistence==0 && getCookie(arguments[i])!="") //clean up cookie if persist=off
setCookie(arguments[i], "")
var clickedontab=getCookie(arguments[i]) //retrieve ID of last clicked on tab from cookie, if any
var ulobj=document.getElementById(arguments[i])
var ulist=ulobj.getElementsByTagName("li") //array containing the LI elements within UL
for (var x=0; x<ulist.length; x++){ //loop through each LI element
var ulistlink=ulist[x].getElementsByTagName("a")[0]
if (ulistlink.getAttribute("rel")){
savetabcontentids(arguments[i], ulistlink.getAttribute("rel")) //save id of each tab content as loop runs
ulistlink.onclick=function(){
expandcontent(this)
return false
}
if (ulist[x].className=="selected" && clickedontab=="") //if a tab is set to be selected by default
expandcontent(ulistlink) //auto load currenly selected tab content
}
} //end inner for loop
if (clickedontab!=""){ //if a tab has been previously clicked on per the cookie value
var culistlink=getullistlinkbyId(arguments[i], clickedontab)
if (typeof culistlink!="undefined") //if match found between tabcontent id and rel attribute value
expandcontent(culistlink) //auto load currenly selected tab content
else //else if no match found between tabcontent id and rel attribute value (cookie mis-association)
expandcontent(ulist[0].getElementsByTagName("a")[0]) //just auto load first tab instead
}
} //end outer for loop
}


function getCookie(Name){ 
var re=new RegExp(Name+"=[^;]+", "i"); //construct RE to search for target name/value pair
if (document.cookie.match(re)) //if cookie found
return document.cookie.match(re)[0].split("=")[1] //return its value
return ""
}

function setCookie(name, value){
document.cookie = name+"="+value //cookie value is domain wide (path=/)
}

// PopUp Window
	// Film 1
	function popupFilm1()
	{
	window.open ('film1.html', '', 'width=480,height=360,top=0,left=0,resizable=yes,scrollbars=yes,toolbar=no,menubar=no');
	}
	
	// Film 2
	function popupFilm2()
	{
	window.open ('film2.html', '', 'width=480,height=360,top=0,left=0,resizable=yes,scrollbars=yes,toolbar=no,menubar=no');
	}	
		
	// Film 3
	function popupFilm3()
	{
	window.open ('film3.html', '', 'width=480,height=360,top=0,left=0,resizable=yes,scrollbars=yes,toolbar=no,menubar=no');
	}
	
	// Film 4
	function popupFilm4()
	{
	window.open ('film4.html', '', 'width=480,height=360,top=0,left=0,resizable=yes,scrollbars=yes,toolbar=no,menubar=no');
	}
	
	// Film 17-20_1
	function popupFilm5()
	{
	window.open ('film5.html', '', 'width=480,height=360,top=0,left=0,resizable=yes,scrollbars=yes,toolbar=no,menubar=no');
	}
	
	// Film 17-20_2
	function popupFilm6()
	{
	window.open ('film6.html', '', 'width=480,height=360,top=0,left=0,resizable=yes,scrollbars=yes,toolbar=no,menubar=no');
	}
	
	// Film 17-20_3
	function popupFilm7()
	{
	window.open ('film7.html', '', 'width=480,height=360,top=0,left=0,resizable=yes,scrollbars=yes,toolbar=no,menubar=no');
	}
	
	// Film 25-28_1
	function popupFilm8()
	{
	window.open ('film8.html', '', 'width=480,height=360,top=0,left=0,resizable=yes,scrollbars=yes,toolbar=no,menubar=no');
	}
	
	// Film 25-28_2
	function popupFilm9()
	{
	window.open ('film9.html', '', 'width=480,height=360,top=0,left=0,resizable=yes,scrollbars=yes,toolbar=no,menubar=no');
	}
	
	// Film 25-28_3
	function popupFilm10()
	{
	window.open ('film10.html', '', 'width=480,height=360,top=0,left=0,resizable=yes,scrollbars=yes,toolbar=no,menubar=no');
	}				
	var ver = navigator.appName;
	var num = parseInt(navigator.appVersion);
	var ie = "Microsoft Internet Explorer";
	if ((ver == ie)&&(num >= 4)){
		scrollBar = "yes";
		}
	else scrollBar = "auto";
	
	function popupSlika(imageName,imageDescription,imageWidth,imageHeight) {
		if (parseInt(imageWidth) > 640) {
			windowWidth = 640;
			scrollIndicator = "za ogled celotne slike premaknite drsnik <b>&raquo;</b>";
			}
		else if ((ver == ie)&&(num >= 4)) {
			windowWidth = parseInt(imageWidth) + 16;
			scrollIndicator = "&nbsp;";
			}
		else {
			windowWidth = parseInt(imageWidth);
			scrollIndicator = "&nbsp;";
			}
		windowHeight = parseInt(imageHeight) + 0;
		window.open("popup_slika.html","image","scrollbars=" +scrollBar+ ",top=0, left=0,width=" +windowWidth+ ", height=" +windowHeight+ ", allowresize=yes");
	}
	
	function popupSlikaNews(imageName,imageDescription,imageWidth,imageHeight) {
		if (parseInt(imageWidth) > 400) {
			windowWidth = 400;
			scrollIndicator = "za ogled celotne slike premaknite drsnik <b>&raquo;</b>";
			}
		else if ((ver == ie)&&(num >= 4)) {
			windowWidth = parseInt(imageWidth) + 16;
			scrollIndicator = "&nbsp;";
			}
		else {
			windowWidth = parseInt(imageWidth);
			scrollIndicator = "&nbsp;";
			}
		windowHeight = parseInt(imageHeight) + 0;
		window.open("popup_slika_news.php","image","scrollbars=" +scrollBar+ ",top=50,width=" +windowWidth+ ", height=" +windowHeight+ "");
	}
	
