function SiteOSWindowOpen(theURL,winName,features)
{
//die SID mitanhaengen
 var newURL;
 if (theURL.indexOf("?") == -1)
  newURL = theURL + '?' + SiteOSGetSID();
 else
  newURL = theURL + '&' + SiteOSGetSID();  
 window.open(newURL,winName,features);
}

function SiteOSGetSID()
{
 var cookies=document.cookie;
 var start=cookies.indexOf("SiteOSSID=");
 if(start!=-1)
 {
  var end=cookies.indexOf(";",start);
  if(end==-1)
  {
   end=cookies.length;
  }
  var sidStr=cookies.substring(start+6,end);  
  return(sidStr); 
 }
 var loc = window.location.search;
 //die alte SID wegschneiden 
 var posSID = loc.lastIndexOf("&SID=");
 if (posSID == -1)
  posSID = loc.lastIndexOf("?SID="); 
 var posEndSID = loc.indexOf("&",posSID+1);
 var strSID;
 // es kommt kein & mehr
 if (posEndSID == -1)
  posEndSID = loc.indexOf("#",posSID+1);
 //SID ist der letzte Parameter
 if(posEndSID == -1)
  strSID = loc.substring(posSID + 1, loc.length);
 else
  strSID = loc.substring(posSID + 1, posEndSID);
 // gibt SID=session-id zurueck (ohne ? bzw. &)
 return strSID;
}


function SiteOSGetParameter(paramname)
{ 
 var loc = window.location.search; 
 var posSID = loc.lastIndexOf("&"+paramname+"=");
 if (posSID == -1)
  posSID = loc.lastIndexOf("?"+paramname+"="); 
 //ist der Parameter nicht dabei
 if(posSID == -1)
   return "";
 var posEndSID = loc.indexOf("&",posSID+1);
 var strSID;
 // es kommt kein & mehr
 if (posEndSID == -1)
  posEndSID = loc.indexOf("#",posSID+1);
 //SID ist der letzte Parameter
 if(posEndSID == -1)
  strSID = loc.substring(posSID + 1, loc.length);
 else
  strSID = loc.substring(posSID + 1, posEndSID);
 // gibt SID=session-id zurueck (ohne ? bzw. &)
 return strSID;
}



function checkEmail(totest)
{
 return ((totest.indexOf("@") >= 1) &&
         (totest.indexOf("@")+1<totest.indexOf(".",totest.indexOf("@"))) &&
         (totest.indexOf(".",totest.indexOf("@"))<totest.length -1));
}

function gaNaarBungalowNet()
{
 window.open('http://www.bungalow.net/enter.asp?exitlinkID=1806','','toolbar=no,menubar=no,location=no,height=400,width=750,top='+((screen.height - 400) / 2)+',left='+((screen.width-750)/2)+'');
}

