function framekiller() {
// wegen Links von FReisen    
 if (top!=self) { top.location=self.location; }   
}

function getInternetExplorerVersion()
// Returns the version of Internet Explorer or a -1

{
  var rv = -1; // Return value assumes failure.
  if (navigator.appName == 'Microsoft Internet Explorer')
  {
    var ua = navigator.userAgent;
    var re  = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
    if (re.exec(ua) != null)
      rv = parseFloat( RegExp.$1 );
  }
  return rv;
}


function BlurLinks(){
 lnks=document.getElementsByTagName('a');
 for(i=0;i<lnks.length;i++){
 lnks[i].onfocus=new Function("if(this.blur)this.blur()");
 }
}
 function scrollToTop(){scroll(0,0);}
function scrollToBottom(){scroll(0,50000);}

  function numerisch(feld)
  {
  if (feld.value.search(/^\d{5}$/)==-1)
  {
  alert("Bitte eine 5-stellige Postleitzahl angeben!");
  feld.value="";
  feld.focus();
  return false;
  };
  return true;
  }

function adv_instantwin(url) {
  var myLeft = (screen.Width -600)/2;
var myTop = (screen.Height -620)/2;
 //specify popup window features
//set 1 to enable a particular feature, 0 to disable
var winfeatures="width=600,height=620,scrollbars=0,resizable=0,toolbar=0,location=0,menubar=0,status=0,directories=0";
winfeatures+=(winfeatures!='')?',':'';
winfeatures+=',left='+myLeft+',top='+myTop;


    if (!window.mywindow || window.mywindow.closed) {
    mywindow = window.open('', 'mypopup2', winfeatures);
    }
   mywindow.focus();
  mywindow.location.href = url;
}

   function neuladen(url) {
location.href=url;
}

function ismaxlength(obj){
var mlength=obj.getAttribute? parseInt(obj.getAttribute("maxlength")) : ""
if (obj.getAttribute && obj.value.length>mlength)
obj.value=obj.value.substring(0,mlength)
}

function charsleft(feld, anzahl){     // z.B. 200
var anz = feld.value.length;
if (anz > anzahl ){
feld.value = feld.value.substring(0,anzahl);
}
}

// if (!typeof jQuery === 'undefined') {
jQuery(document).ready(function() {

	$("a.details").fancybox({
		'width'                         : 700,
'height'                        : 450,
		'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'centerOnScroll': false, 

		'type'				: 'iframe'
	});
// über clas
$("a.schnupper").fancybox({
'width'                         : 490,
'height'                        : 480,
'autoScale'             : false,
'scrolling'           :false,

'transitionIn'          : 'none',
'transitionOut'         : 'none',
'type'                          : 'iframe'
});
// über class
$("a.gratis").fancybox({
'width'                         : 550,
'height'                        : '95%',
'autoScale'             : true,
'scrolling'           :false,
 centerOnScroll        :true,
'transitionIn'          : 'none',
'transitionOut'         : 'none',
'type'                          : 'iframe'
});



$("a.fun1").click(function() {
$.fancybox({
'padding'               : 0,
'autoScale'             : false,
'transitionIn'  : 'none',
'transitionOut' : 'none',

'width'                 : 440,
'height'                : 290,
'href'                  : this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
'type'                  : 'swf',
'swf'                   : {
'wmode'                             : 'transparent',
'allowfullscreen'       : 'false'
}
});

return false;
});

$(".player").fancybox({
'padding': 0, //optional
'width': 440, // or your size
'height': 290,
'wmode'                             : 'transparent',
'type': 'swf',
'swf': {

// your flashvars here
'wmode':'transparent',
'allowfullscreen': false

}
});



});
//}
function show_me(id){var e=document.getElementById(id);if(e.style.display=='none')
e.style.display='block';}


function hide_me(id){var e=document.getElementById(id);if(e.style.display=='block')
e.style.display='none';}


function anzeigen(id,id2){var e=document.getElementById(id);if(e.checked==true){var e2=document.
getElementById(id2);e2.style.display='block';}}

/* function isScrolledIntoView(elem)
{
    var docViewTop = document.body.scrollTop.scrollTop();
    var docViewBottom = docViewTop + document.body.height();

    var elemTop = elem+'.offset().top';
    var elemBottom = elemTop + elem+'.height()';

    return ((elemBottom >= docViewTop) && (elemTop <= docViewBottom));
} */

/* Get the TOP position of a given element. */
function getPositionTop(element){
    var offset = 0;
    while(element) {
        offset += element["offsetTop"];
        element = element.offsetParent;
    }
    return offset;
}

/* Is a given element  visible or not? */
function isElementVisible(eltId) {
    var elt = document.getElementById(eltId);
    if (!elt) {
        // Element not found.
        return false;
    }
    // Get the top and bottom position of the given element.
    var posTop = getPositionTop(elt);
    var posBottom = posTop + elt.offsetHeight;
    // Get the top and bottom position of the *visible* part of the window.
   /*  var visibleTop = document.body.scrollTop; */
  var visibleTop =  (document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop);
    var visibleBottom = visibleTop + document.documentElement.offsetHeight;
    return ((posBottom >= visibleTop) && (posTop <= visibleBottom));
}

    function PopUp(link) {
         var src = link.href;
         var title = link.title;
         var img = new Image();
         img.src = src;
         var size = "width=" + (img.width + 30) + ",height=" + (img.height + 30);
        
         var popup = window.open(src, title, size);  
        
         img.onload = function() {
            popup.innerWidth = img.width + 30;
            popup.innerHeight = img.height + 30;
         }      
         return false;
      }
      
function suchenPopup(url)         //Suchoption auf Wahlheftseite
   {
    var myLeft = (screen.Width -400);
var myTop = 0;
var winfeatures="width=300,height=250,scrollbars=0,resizable=0,toolbar=0,location=0,menubar=0,status=0,directories=0";
winfeatures+=(winfeatures!='')?',':'';
winfeatures+=',left='+myLeft+',top='+myTop;

  if (!window.mywindow || window.mywindow.closed) {
    mywindow = window.open('', 'mypopup2', winfeatures);
    }
  mywindow.focus();
  mywindow.location.href = url;

   }
   
  function anZeigen(URL)                 //Zeitschriften-Details
   {
details = 0;
if(details.closed == false) {
details.close();
}
  details=  window.open(URL,"details","width=500, height=500 ,top=0 ,left=20,scrollbars=yes,resizable=no");
details.focus();
   }


    
/***********************************************
* Required field(s) validation v1.10- By NavSurf
* Visit Nav Surf at http://navsurf.com
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/
function formCheck1(formobj){
        // Enter name of mandatory fields
        var fieldRequired = Array("ename", "evname", "estrasse", "eplz", "eort", "etelefon");
        // Enter field description to appear in the dialog box
        var fieldDescription = Array("Nachname", "Vorname", "Strasse", "PLZ (Postleitzahl)", "Ort", "Telefon");
        // dialog message
        var alertMsg = "Bitte füllen Sie alle Felder aus:\n";

        var l_Msg = alertMsg.length;

        for (var i = 0; i < fieldRequired.length; i++){
                var obj = formobj.elements[fieldRequired[i]];
                if (obj){
                        switch(obj.type){
                        case "select-one":
                                if (obj.selectedIndex == -1 || obj.options[obj.selectedIndex].text == ""){
                                        alertMsg += " - " + fieldDescription[i] + "\n";
                                }
                                break;
                        case "select-multiple":
                                if (obj.selectedIndex == -1){
                                        alertMsg += " - " + fieldDescription[i] + "\n";
                                }
                                break;
                        case "text":
                        case "textarea":
                                if (obj.value == "" || obj.value == null){
                                        alertMsg += " - " + fieldDescription[i] + "\n";
                                }
                                break;
                        default:
                        }
                        if (obj.type == undefined){
                                var blnchecked = false;
                                for (var j = 0; j < obj.length; j++){
                                        if (obj[j].checked){
                                                blnchecked = true;
                                        }
                                }
                                if (!blnchecked){
                                        alertMsg += " - " + fieldDescription[i] + "\n";
                                }
                        }
                }
        }

        if (alertMsg.length == l_Msg){
                return true;
        }else{
                alert(alertMsg);
                return false;
        }
}

function formCheck(formobj){
        // Enter name of mandatory fields
        var fieldRequired = Array("Name", "Email", "Telefon", "PLZ", "Ort", "Nachricht");
        // Enter field description to appear in the dialog box
        var fieldDescription = Array("Name", "Email", "Telefon", "PLZ (Postleitzahl)", "Ort", "Nachricht");
        // dialog message
        var alertMsg = "Bitte füllen Sie alle Felder aus:\n";

        var l_Msg = alertMsg.length;

        for (var i = 0; i < fieldRequired.length; i++){
                var obj = formobj.elements[fieldRequired[i]];
                if (obj){
                        switch(obj.type){
                        case "select-one":
                                if (obj.selectedIndex == -1 || obj.options[obj.selectedIndex].text == ""){
                                        alertMsg += " - " + fieldDescription[i] + "\n";
                                }
                                break;
                        case "select-multiple":
                                if (obj.selectedIndex == -1){
                                        alertMsg += " - " + fieldDescription[i] + "\n";
                                }
                                break;
                        case "text":
                        case "textarea":
                                if (obj.value == "" || obj.value == null){
                                        alertMsg += " - " + fieldDescription[i] + "\n";
                                }
                                break;
                        default:
                        }
                        if (obj.type == undefined){
                                var blnchecked = false;
                                for (var j = 0; j < obj.length; j++){
                                        if (obj[j].checked){
                                                blnchecked = true;
                                        }
                                }
                                if (!blnchecked){
                                        alertMsg += " - " + fieldDescription[i] + "\n";
                                }
                        }
                }
        }

        if (alertMsg.length == l_Msg){
                return true;
        }else{
                alert(alertMsg);
                return false;
        }
}


function formCheck2(formobj){
        // Enter name of mandatory fields
        var fieldRequired = Array("nname_g", "vname_g", "strasse_g", "plz_g", "ort_g", "nname", "vname", "strasse", "plz", "ort", "telefon", "email");
        // Enter field description to appear in the dialog box
        var fieldDescription = Array("Nachname Empfänger", "Vorname Empänger", "Strasse Empfänger", "PLZ (Postleitzahl) Empfänger", "Ort Empfänger", "Nachname", "Vorname", "Strasse", "PLZ (Postleitzahl)", "Ort", "Telefon", "Email");
        // dialog message
        var alertMsg = "Bitte füllen Sie alle Felder aus:\n";

        var l_Msg = alertMsg.length;

        for (var i = 0; i < fieldRequired.length; i++){
                var obj = formobj.elements[fieldRequired[i]];
                if (obj){
                        switch(obj.type){
                        case "select-one":
                                if (obj.selectedIndex == -1 || obj.options[obj.selectedIndex].text == ""){
                                        alertMsg += " - " + fieldDescription[i] + "\n";
                                }
                                break;
                        case "select-multiple":
                                if (obj.selectedIndex == -1){
                                        alertMsg += " - " + fieldDescription[i] + "\n";
                                }
                                break;
                        case "text":
                        case "textarea":
                                if (obj.value == "" || obj.value == null){
                                        alertMsg += " - " + fieldDescription[i] + "\n";
                                }
                                break;
                        default:
                        }
                        if (obj.type == undefined){
                                var blnchecked = false;
                                for (var j = 0; j < obj.length; j++){
                                        if (obj[j].checked){
                                                blnchecked = true;
                                        }
                                }
                                if (!blnchecked){
                                        alertMsg += " - " + fieldDescription[i] + "\n";
                                }
                        }
                }
        }

        if (alertMsg.length == l_Msg){
                return true;
        }else{
                alert(alertMsg);
                return false;
        }
}
