function openWin(theURL,winName,features) {
 Fenster = window.open(theURL,winName,features); Fenster.focus();
}

function frn_openWin(theURL,winName,features) {
 Fenster = window.open(theURL,winName,features);
 Fenster.focus();
}
function openWin(theURL,winName,features) {
 Fenster = window.open(theURL,winName,features);
 Fenster.focus();
}
 
// profile
function profile(url) {var pro = window.open(url,"_profile","width=700,height=500,scrollbars=yes,resizable=no"); pro.focus();}
// infos
function infos(url) {var inf = window.open(url,"infos","width=370,height=330,scrollbars=yes,resizable=no"); inf.focus();}
// sucheinfos
function sucheinfos(url) {var inf = window.open(url,"sucheinfos","width=650,height=320,scrollbars=yes,resizable=no"); inf.focus();}
// nickalert
function nickalert(url) {var bs = window.open(url,"_nickalert","width=300,height=400,scrollbars=yes,resizable=yes"); bs.focus(); }
// inte_an steht fuer interessen anlegen function inte_an(url) {var int1 = window.open(url,"_inte_an","width=660,height=700,scrollbars=yes,resizable=yes"); int1.focus();}
// bildgross steht fuer Bildgross
function bildgross(url) {var bg = window.open(url,"_bildgross","width=700,height=600,scrollbars=no,resizable=no"); bg.focus();}
// smilies
function smilies(url) {var bs = window.open(url,"_smilies","width=330,height=500,scrollbars=yes,resizable=yes");}
// pop
function newpop(url) {var bs = window.open(url,"_newpop","width=700,height=600,scrollbars=yes,resizable=no"); }
// pop
function profilbearbeiten(url) {var bs = window.open(url,"_profilbearbeiten","width=700,height=500,scrollbars=yes,resizable=no");   }
// full - alle links vom nickalertpopup
function full(url) {var na = window.open(url,"_full"); na.focus();}

function checkSearchForm(form1,popurl) {
 passive_opt = form1.sl_passive_sex.selectedIndex;
 active_opt = form1.sl_active_sex.selectedIndex;
if(form1.sl_active_sex.options[active_opt].value==form1.sl_passive_sex.options[passive_opt].value) {
openWin(popurl+window.location.search,'window_profilesearch','width=430,height=320,screenX=0,screenY=0,status=no,menubar=no,toolbar=no,scrollbars=no,resizable=no,location=no');
   return false;
  }else{
   return true;
  }
}

function ImageScaler( img, h, w ){
//scales an image to min width, and min height
  this.givenH = h;
  this.givenW = w;
  this.img = img;
  this.scaleW = function(){
      myh = this.givenH;
      myw = this.givenW;
      if( this.img.width > myw ){
          ow = this.img.width;
          oh = this.img.height;
          new_w = myw;
          new_h = new_w*(oh/ow);
          this.img.height = Math.round(new_h);
          this.img.width = Math.round(myw);
      }
  }

  this.scaleH = function(){
      myh = this.givenH;
      myw = this.givenW;
      if( this.img.height > myh ){
          oh = this.img.height;
          ow = this.img.width;
          new_h = myh;
          new_w = new_h*(ow/oh);
          this.img.width = Math.round(new_w);
          this.img.height = Math.round(new_h);
      }
  }
}

function scaleImage( img, h, w ){
  ow = img.width;
  oh = img.height;
  scaler = new ImageScaler( img, h, w );
  if( ow > oh ){
      scaler.scaleW();
      scaler.scaleH();
  }else{
      scaler.scaleH();
      scaler.scaleW();
  }
}

function scaleIamge( img ){
  ow = img.width;
  oh = img.height;
  scaler = new ImageScaler( img, 80, 80 );
  if( ow > oh ){
      scaler.scaleW();
      scaler.scaleH();
  }else{
      scaler.scaleH();
      scaler.scaleW();
  }
}

hrefToLower = "this.href=unescape(this.href.toLowerCase()).replace(/ü/, 'ue').replace(/ö/, 'oe')";