function showCountry(id)
{
	
	c = "countryUrl"+ id;
	document.getElementById(c).style.display = "block";
	
}
function hideCountry(id)
{
	c = "countryUrl"+ id;
	document.getElementById(c).style.display = "none";
}

function PopupFenster_small(url) {
	var isSafari3 = false; 
	
	if( window.devicePixelRatio &&  window.getMatchedCSSRules && !window.Opera){
	    isSafari3  =  !!window.getMatchedCSSRules(document.documentElement,'');
		msgWindow=window.open(url,"popup","toolbar=no,width=645,height=445,status=no,scrollbars=no,resizable=no,menubar=no,dependent=no");
	}else{
		msgWindow=window.open(url,"popup","toolbar=no,width=630,height=445,status=no,scrollbars=no,resizable=no,menubar=no,dependent=no");
	}
}

function mailto(url){
        var myUrl = escape(url);
        parent.location.href="mailto:Your%20Contact%20Address?subject=Link-Tip&body=This%20link%20was%20recommended%20to%20you:%20%20" + myUrl +"%20";
}

//Globale Variable welche f�r "printpage" ben�tigt wird
var activeTab;

//Funktion welche tab active inactive setzt udn inhalt anzeigt by juwimm
function showtab(id) 
{   
	
	activeTab = id;	
    //tab aktiv setzen und andere Tabs inaktiv setzen, tabcontainer anzeigen
    for (i = 0; i < tabLables.length; i++) 
    {           
        if ((i+1) == id)//tab activ setzen 
        {
            if (document.getElementById("tab"+(i+1)).className == "tabinactive") 
            {
                document.getElementById("tab"+(i+1)).className = "tabactive";
            }
            document.getElementById("tabcontent"+(i+1)).style.display = "block";
              
        }
        else //Tab inactiv setzen 
        {
            
            document.getElementById("tab"+(i+1)).className = "tabinactive";
            //Tabcontainer inaktiv setzen
            document.getElementById("tabcontent"+(i+1)).style.display = "none";
        }
    }
}

function openWindow(url,width,height,scroll,name)
{
	//default scrollbars=no;
	if(scroll=='')
	{
		scroll = 'no';
	}
	if(activeTab == null)
	{
		activeTab=1;
	}
	url = url+"&actTab="+activeTab;
	popWindow = window.open(url,name,"toolbar=no,width="+width+",height="+height+",status=yes,scrollbars="+scroll+",resizable=no,menubar=no,dependent=no");
	popWindow.blur;
}


// will be called by flash layer
function closeFlashBannerDiv() 
{
	document.getElementById("flashLayer").style.display = "none";
}


var activeSubcontactDiv = undefined;
var activeSubcontactSelect = undefined;

function updateSubcontactField(div, select) {

    var subcontactDiv 		= document.getElementById(div);
    var subcontactSelect 	= document.getElementById(select);
    
    if (activeSubcontactSelect != null) {
    	activeSubcontactSelect.selectedIndex = 0;
    	activeSubcontactDiv.style.display = 'none';
    	
    }
    
    if (subcontactDiv != null &&  subcontactDiv != undefined) {
         subcontactDiv.style.display = 'block';
         activeSubcontactDiv = subcontactDiv;
         activeSubcontactSelect = subcontactSelect;
    }
}



function createXMLHttpRequest() {

	var ua;

	if(window.XMLHttpRequest) {
    	try {
      		ua = new XMLHttpRequest();
    	} catch(e) {
      		ua = false;
    	}
  	} else if(window.ActiveXObject) {
    	try {
      		ua = new ActiveXObject("Microsoft.XMLHTTP");
    	} catch(e) {
      		ua = false;
    	}
  	}
  return ua;
}

function sendRequest(url) {
  var req = createXMLHttpRequest();
  id = document.getElementById("dropdown").value;
  req.open("POST",url,true);
  req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
  req.onreadystatechange = tryit;
  req.send(id);
}

function tryit(){
    document.frm.i_gruppe.value = req.responseText;
}


/* print functions using jQuery and Boxy */
var _currentModalBoxy = {};

if(typeof jQuery != "undefined") {

	jQuery.extend({
		  getUrlVars: function(urlurl){
		    var vars = [], hash;
		    var hashes = urlurl.slice(window.location.href.indexOf('?') + 1).split('&');
		    for(var i = 0; i < hashes.length; i++)
		    {
		
		      hash = hashes[i].split('=');
			  	
		      vars.push(hash[0]);
		      vars[hash[0]] = hash[1];
		    }
		    return vars;
		  }
	});

	
	var closeColorBox = function() {
		$("#modalClose").click(); 	
	};
	

	
	
	$(document).ready(function() {
		$("a.print-link, a.print-all-link").click(function(e) {
			var link = $(this);
			_currentModalBoxy = new Boxy("<iframe src='' frameborder='0' id='modalPrintView'></iframe>", {
				title: link.html(),
				afterHide: function() { this.unload(); },
				modal: true,
				closeText: "<img border=\"0\" src=\"/httpd/img/general/icon_close.gif\" width=\"13\" height=\"13\">"
			});
			
			$("#modalPrintView").parent().css("overflow", "hidden");
			$("#modalPrintView").load(function() { $(this).contents().find("html").css("overflow", "hidden"); });
			$("#modalPrintView").attr("src", link.attr("href"));
			
			return false;
		});
		
		
		$("a.boxy-link").click(function(e) {
			var maxHeight = $(window).height() - 40;
			var maxWidth = $(window).width() - 10;
			var link = $(this);
			var widthOfIframe = $.getUrlVars(link.attr("href"))['width'];
			var heightOfIframe = $.getUrlVars(link.attr("href"))['height'];
			
			widthOfIframe = maxWidth > widthOfIframe ? widthOfIframe : maxWidth;
			heightOfIframe = maxHeight > heightOfIframe ? heightOfIframe : maxHeight;
			
			_currentModalBoxy = new Boxy("<iframe src='' frameborder='0' id='modalFrameView' style='width:" + widthOfIframe + "px;height:" + heightOfIframe + "px;'></iframe>", {
				title: "&#160;",
				afterHide: function() { this.unload(); },
				modal: true,
				closeText: "<img border=\"0\" src=\"/httpd/img/general/icon_close.gif\" width=\"13\" height=\"13\">"
			});
			
			$("#modalFrameView").attr("src", link.attr("href"));
//			$("#modalFrameView").attr("style", "width:" + widthOfIframe + "px;height:" + heightOfIframe + "px;");
			
			return false;
		});		
	});
}

