function externalLinks() {
 if (!document.getElementsByTagName) return;
 var anchors = document.getElementsByTagName("a");
 for (var i=0; i<anchors.length; i++) {
   var anchor = anchors[i];
   if (anchor.getAttribute("href") &&
       anchor.getAttribute("rel") == "external")
     anchor.target = "_blank";
 }
setCopyYear(); // updates end year in copyright
}
window.onload = externalLinks;




if (document.images) 
{
   img1 = new Image();
   img2 = new Image();
   img3 = new Image();
   img4 = new Image();
   img5 = new Image();
   img6 = new Image();
   img7 = new Image();
   img8 = new Image();
   img9 = new Image();
   img10 = new Image();
   img11 = new Image();
   img12 = new Image();

   img1.src = "/images/nav_home_on.gif";
   img2.src = "/images/nav_about_on.gif";
   img3.src = "/images/nav_work_on.gif";
   img4.src = "/images/nav_services_on.gif";
   img5.src = "/images/nav_careers_on.gif";
   img6.src = "/images/nav_srpski_on.gif";
   img7.src = "/images/nav_contact_on.gif";
   img8.src = "/images/title_feature_services_on.gif";
   img9.src = "/images/title_feature_work_on.gif";
   img10.src = "/images/title_feature_about_on.gif";
   img11.src = "/images/nav_ref_1_on.gif";
   img12.src = "/images/nav_ref_2_on.gif";
}

// updating year in copyright
function getHTTPObject(){
	if (window.ActiveXObject) 
		return new ActiveXObject("Microsoft.XMLHTTP");
	else 
		if (window.XMLHttpRequest) 
			return new XMLHttpRequest();
		else {
			alert("Your browser does not support AJAX.");
			return null;
			}
	}
	
function setCopyYear(){
	httpObject = getHTTPObject();
	if (httpObject != null) {
		httpObject.open("GET", "/godina.php", true);
		httpObject.send(null);
		httpObject.onreadystatechange = setOutput;
		}
	}

function setOutput(){

	if(httpObject.readyState == 4){
		if (httpObject.responseText!=null  && document.getElementById('endyear')!=null)
			document.getElementById('endyear').innerHTML = httpObject.responseText;
		}
	}
