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";
 }
}
window.onload = externalLinks;

function doPopup(URL, WIDTH, HEIGHT) {
	url = URL;
	width = WIDTH;  // width of window in pixels
	height = HEIGHT; // height of window in pixels
	windowprops = "left=50,top=50,width=" + WIDTH + ",height=" + HEIGHT + "toolbar=no," + "location=no," + "directories=no," + "status=no," + "menubar=no," + "scrollbars=no," + "resizable=no,";
	preview = document.open(URL, "_blank", windowprops);
}

function URLEncode(xxx)
{
  var inputString=xxx;  
  var encodedInputString=escape(inputString);
  encodedInputString=encodedInputString.replace(/[+]/g, "%2B");
  encodedInputString=encodedInputString.replace(/[/]/g, "%2F"); 
  return encodedInputString;
}

// opens calendar
function OpenCalendar(formfield,language,type,date,mapdir,startyear,endyear) {

	url = mapdir + '/js/calendar2.cfm?language=' + language + '&type=' + type + '&formfield=' + formfield + '&date=' + URLEncode(date) + '&startyear=' + escape(startyear) + '&endyear=' + escape(endyear);
	win = window.open(url,'calendar','height=200,width=200');
	win.focus();

}

function Profiles06AplicationOpen() {
	window.open('http://www.axnix-pr.at/slsp/main.html','','toolbar=0,location=0,directories=0,menuBar=0,scrollbars=1,resizable=1,width=800,height=500,left=100,top=100');
}

// exchange table
var previousRowClass;

function tableRowClick(link) {
     window.location = link;
}

function tableRowOver(element) {
     previousRowClass = element.className;
     element.className = 'bgcurrency-on';
}

function tableRowOut(element) {
     element.className = previousRowClass;
}


// SITEMAP SWITCHER

function siteMapSwitch(element) {
     temp = element.parentNode.parentNode.className;
     if(temp.indexOf("-off") != -1){
          temp = temp.substr(0,temp.indexOf("-off"));
          element.parentNode.parentNode.className = temp+'-on';
     }
     else {
          temp = temp.substr(0,temp.indexOf("-on"));
          element.parentNode.parentNode.className = temp+'-off';
     }
}

function ShowOtherInfo(ItemID) {
    document.getElementById(ItemID).style.display = 'block';
}
function HideOtherInfo(ItemID) {
    document.getElementById(ItemID).style.display = 'none';
}

function HideShowOtherInfo(ItemID) {

    if (document.getElementById(ItemID).style.display == 'none')
        document.getElementById(ItemID).style.display = 'block';
    else
        document.getElementById(ItemID).style.display = 'none';
}
