var cGookie="";
var nCookie="";
var zs_img_left=0;

var mac    = window.navigator.platform == "MacPPC" && navigator.appName == "Netscape" && navigator.appVersion.substring(0,1) == "4";
var mac_ie = window.navigator.platform == "MacPPC" && navigator.userAgent.match(/MSIE/i);
var ie4    = navigator.userAgent.match(/MSIE\s4.*/i);
var ie     = navigator.userAgent.match(/MSIE\s5.*/i);
var ie7     = navigator.userAgent.match(/MSIE\s7.*/i);
var ie8     = navigator.userAgent.match(/MSIE\s8.*/i);
var ie6    = navigator.userAgent.match(/MSIE\s6.*/i);
var op     = navigator.userAgent.indexOf('Opera') != -1;
var ns4    = navigator.appName == "Netscape" && navigator.appVersion.substring(0,1) == "4";
var ns6    = navigator.appName == "Netscape" && navigator.appVersion.substring(0,1) > "4";


//alert("IE:" + ie + " IE4:" + ie4 + " IE6:" + ie6 + " IE7:" + ie7 + " IE8:" + ie8 + " NS4:" + ns4 + " OP:" +op + " NS6:" +ns6);
 

if(ie8 || ie7 || ie || ie6 && !op)
  { 
  var v_visible="visible";
  var v_hidden="hidden";
  var v_layer="document.all";
  var v_style=".style";
  var v_blend="blendTrans(duration=0.5)";
  }

if(ns4)
  { 
  var v_visible="show";
  var v_hidden="hide";
  var v_layer="document.layers";
  var v_style="";
  }

if(ns6)
  { 
  var v_visible="visible";
  var v_hidden="hidden";
  var v_layer="document.layers";
  var v_style=".style";
  }


function makeCookie(cShop)
{
var cValue = null;
var cName = "UID";
var callValue = null;
var enddatum = new Date();
var myCookie = " " + document.cookie + ";";
var searchName = " " +  cName + "=";
var startOfCookie = myCookie.indexOf(searchName);
if(startOfCookie != - 1)
  {
  startOfCookie += searchName.length;
  endOfCookie = myCookie.indexOf(";",startOfCookie);
  cValue=unescape(myCookie.substring(startOfCookie,endOfCookie));
  nCookie=cValue;
  return;
  }
if(cValue != "")
  {
  enddatum.setTime (enddatum.getTime() + (24*60*60*1000*365));
  document.cookie = cName   + "=" + escape(cShop) + "; expires=" + enddatum.toGMTString () + ";path=/";
  nCookie=cShop;
  }
}


function t_top(t_l,t_top)
{
if(ie7 || ie4 || ie6)
  eval(v_layer+'[t_l]'+ v_style+'.pixelTop = t_top');
else if(ns4)
  eval(v_layer+'[t_l]'+ v_style+'.top = t_top');
else if(ns6)
  eval("document.getElementById('"+t_l+"').style.top = '"+t_top+"px'");
else                                              
  eval("document.getElementById('"+t_l+"').style.top = '"+t_top+"px'");           
 
return;
                                                                                                   
}                                                                                                         
                                                                                                          
function t_left(t_l,t_left)                                                                               
{                                                                                                        
if(ie7 || ie4 || ie6)                                                                                            
  eval(v_layer+'[t_l]'+ v_style+'.pixelLeft = t_left');                                                                                                                                                           
else if(ns4)                                                                                                   
  eval(v_layer+'[t_l]'+ v_style+'.left = t_left');                                                        
else if(ns6)
  eval("document.getElementById('"+t_l+"').style.left = '"+t_left+"px'");                                          
else                                                       
  eval("document.getElementById('"+t_l+"').style.left = '"+t_left+"px'");                                             
return;                                                                                                   
}


function t_display(t_l,t_v)
{
document.getElementById(t_l).style.display = t_v;
}


function t_hidden(t_l)
{
document.getElementById(t_l).style.visibility= v_hidden;
return;
}

function t_visible(t_l)
{
document.getElementById(t_l).style.visibility = v_visible ;
return;
}

function t_image(img_name,img_src)
{
document.images[img_name].src = img_src;
}

function show_zs_img(zs_name,zs_top)
{
zs_src="/zeitschrift/images/mini/" + zs_name + ".jpg";

t_image("menu_zs_img",zs_src);
t_left("zs_img",zs_img_left);
t_top("zs_img",zs_top);
t_visible("zs_img","block");
return;
}

function hide_zs_img()
{
t_hidden("zs_img");
}




function open_shop(lang)
{
// Cookie ist gesetzt oder gelsen
loc="/modules/shop/oivshop.php?lang=" + lang;
window.location.href=loc;
}



function input_shop(shopnr,lang)
{
loc="/modules/shop/oivshop.php?index=I&lang=" + lang + "&shopnr=" + shopnr;
window.location.href=loc;
}

function open_notes()
{
// Cookie ist gesetzt oder gelsen
loc="/modules/notes/oivnotes.php";
window.location.href=loc;
}

function input_notes(notesnr,stichwort)
{
loc="/modules/notes/oivnotes.php?&index=I&notesnr=" + notesnr +"&stichwort=" + stichwort;
window.location.href=loc;
}

function update_ausgabe(zs)
{
selectbox_ausgabe=document.suche.ausgabe;
for(i=0,j=0;i < heft.length; i++)
   if(heft[i][1] == zs.value)
     j++;

j++;
selectbox_ausgabe.length=j;

selectbox_ausgabe.options[0].value="XX";
selectbox_ausgabe.options[0].text="Ausgabe ...";
for(i=0,j=1;i < heft.length; i++)
   {
   if(heft[i][1] == zs.value)
     {
     selbox_value=heft[i][1] + "_" + heft[i][0] + "_" + heft[i][2];
     selbox_text="Heft " + heft[i][0] + " - - Jahrgang " + heft[i][2];
     selectbox_ausgabe.options[j].value=selbox_value;
     selectbox_ausgabe.options[j].text=selbox_text;
     j++;
     }
   }
return;
}

function t_wrap(t_l)
{ 
if(ns6)
  v_state=document.getElementById(t_l).style.visibility;
  else
    v_state=eval(v_layer+'["'+t_l+'"]'+v_style+'.visibility');

if(v_state == "hidden")
  {
  t_visible(t_l);
  document.getElementById(t_l).style.display = "block";
  document.images["button_wrap"].src="/images/button_less.jpg";
  }
  else
     {
     t_hidden(t_l);
     document.getElementById(t_l).style.display = "none";
     document.images["button_wrap"].src="/images/button_more.jpg";
     }
}



function check_ausgabe(ausgabe)
{
selectbox_ausgabe=document.suche.ausgabe;
if(selectbox_ausgabe.length == 1)
  {
  alert("Bitte wählen Sie zuerst die gewünschte Zeitschrift");
  document.suche.zeitschrift.focus();
  }
}

