function Netscape()
{
  if (navigator.appName=="Netscape") return true;
  return false;
}

function Mozilla()
{
  if (document.getElementById) return true;
  return false;
}

function SubmitForm(name)
{
  if (!Netscape) eval('document.forms["'+name+'"].submit();');
  else eval('document.'+name+'.submit();');
}

function AskDelete(dropId,link)
{
  var txt="Sind Sie sicher den Datensatz mit der Id '"+dropId+"' zu entfernen?";
  if (confirm(txt))
  {
    location.href=link;
  }
}

function OpenSendToFriendPopUp(path)
{
//  var tmpWindow=window.open(path,"SendAFriend","toolbar=no,width=300,height=140,directories=no,status=no,resizable=no,menubar=no");
  var tmpWindow=window.open(path,"SendAFriend","toolbar=no,width=300,height=360,directories=no,status=no,resizable=no,menubar=no");
  tmpWindow.focus();
}

function ChangeLayerContent(name,content)
{
  if (!Netscape())
  {
    document.all[name].innerHTML=content;
  }
  else
  {
    if (!Mozilla())
    {
      document.layers[name].document.open();
      document.layers[name].document.write(content);
      document.layers[name].document.close();
    }
    else document.getElementById(name).innerHTML=content;
  }
}

var productDetailPicArray;
var productDetailVariationAvailableArray;
var prodVar_picPathBigArray;
var prodVar_picBigSizeXArray;
var prodVar_picBigSizeYArray;

function ChangeProductDetailPic(dropDownNr)
{
  var pos=document.forms['productBasketForm'].elements['varPosArray['+dropDownNr+']'].value;
  var htmlStr;
    var availableStr="";

  // variations
  if (productDetailVariationAvailableArray[dropDownNr][pos-1]>=0) availableStr=productDetailVariationAvailableArray[dropDownNr][pos-1];
  else if (productDetailVariationAvailableArray[dropDownNr][pos-1]==-1) availableStr="unbegrenzt";

  ChangeLayerContent("availableDIV",availableStr);
  document.forms['productBasketForm'].variationAvailable.value=productDetailVariationAvailableArray[dropDownNr][pos-1];


  document.forms['productBasketForm'].productVariationPos.value=pos;
  document.forms['productBasketForm'].productVariationDropDownNr.value=dropDownNr;

  // Product picture
  if (productDetailPicArray[dropDownNr][pos-1])
  {
  	if (prodVar_picPathBigArray[dropDownNr][pos-1]) htmlStr="<a href='javascript:OpenProductPicture(\""+prodVar_picPathBigArray[dropDownNr][pos-1]+"\","+prodVar_picBigSizeXArray[dropDownNr][pos-1]+","+prodVar_picBigSizeYArray[dropDownNr][pos-1]+");'><img border=0 src='"+productDetailPicArray[dropDownNr][pos-1]+"'></a>";
  	else htmlStr="<img src='"+productDetailPicArray[dropDownNr][pos-1]+"'>";
  }
  else return;
  ChangeLayerContent("productPic",htmlStr);


  // Change text
  htmlStr="";
  if (prodVar_picPathBigArray[dropDownNr][pos-1]) htmlStr="<center><a href='javascript:OpenProductPicture(\""+prodVar_picPathBigArray[dropDownNr][pos-1]+"\","+prodVar_picBigSizeXArray[dropDownNr][pos-1]+","+prodVar_picBigSizeYArray[dropDownNr][pos-1]+");'>Grossansicht</a></center>";
  ChangeLayerContent("productPicText",htmlStr);

  if(document.forms['productBasketForm'].variationAvailable.value==0) htmlStr=document.forms['productBasketForm'].intoBasketOff.value;
  else htmlStr=document.forms['productBasketForm'].intoBasketOn.value;

  ChangeLayerContent("intoBasketDIV",htmlStr);
}

function IsEmailValid(email)
{
  if (email.search(/.+@+./)==-1) return false;
  if (email.search(/.+[.]+./)==-1) return false;
  if (email.length<5) return false;
  return true;
}

