<?
// (c) 2011 RapidComp, Andreas Schmidt & Michael Niendorf GbR
// Das Hosting schliesst automatisch die Akzeptanz eines RapidComp Lizenzvertrages bzw. der AGBs ein,
// der/die unter anderem als Textdokument bei RapidComp GbR erhältlich ist/sind.

 $Geschlecht=getDaten("sex");                           //CamTyp-Filter, optional
 if (!in_array($Geschlecht,array('a','m','w','p','s'))) 
    $Geschlecht='a';
 $PLZ=getDaten("PLZ");                                  //PLZ Filter, optional
 $KatID=getDaten("KatID");                              //Kategorie-ID von CamDroado, optional

 $Breite=(int)trim(getDaten("w"));                      //Breite in Pixeln (178-1762)
 $Hoehe=(int)trim(getDaten("h"));                       //Höhe in Pixeln (170-1682)

 $CamSize=getDaten("CamSize");                          //Größe CamTeaser
 $Target=getDaten("Target");                            //Ziel zum Klick (click.php)
 $targeturl=getDaten("targeturl");                      //wenn auf 1 dann direkt zur Camprofilseite

 $Logo=getDaten("Logo");                                //Logo-Typ (pink oder weiss, sonst kein Logo anzeigen)
 $IconStyle=getDaten("IconStyle");                      //Iconstyle (weiss oder schwarz, sonst keine Icons)
 $BtnStyle=getDaten("BtnStyle");                        //Buttonstyle (grau,lila,orange,pink,rot,schwarz,tuerkis: pink)
 $TeasTopStyle=getDaten("TeasTopStyle");                //Teaserstyle oben (grau,lila,orange,pink,rot,schwarz,tuerkis: pink)
 $TeasBottomStyle=getDaten("TeasBottomStyle");          //Teaserstyle unten (grau,lila,orange,pink,rot,schwarz,tuerkis: pink)
 $TeasPFStyle=getDaten("TeasPFStyle");                  //TeaserProfillinkstyle (01, 02 oder 03: 01)
 $TeasPFCol=getDaten("TeasPFCol");                      //TeaserProfillinkfarbe (schw oder w: schw)
 $TeasPFHoverCol=getDaten("TeasPFHCol");                //TeaserProfillinkfarbe (Hover) (gruen, lila, orange, pink, rot, schwarz, tuerkis oder weiss: lila)

 $BGColor=getDaten("BGCol");                            //Hintergrundfarbe Seite
 $piccol=getDaten("piccol");                            //Rahmenfarbe Cover
 $pichovercol=getDaten("pichcol");                      //Rahmenfarbe Cover (Hover)
 $acol=getDaten("acol");                                //Textfarbe Profillink
 $ahover=getDaten("ahcol");                             //Textfarbe Profillink (Hover)
 $h1col=getDaten("h1col");                              //Textfarbe Camname
 $h2col=getDaten("h2col");                              //Textfarbe Online-Status
 $t1col=getDaten("t1col");                              //Textfarbe 1. Überschrift
 $t2col=getDaten("t2col");                              //Textfarbe 2. Überschrift
 
 $BorderColor=getDaten("BorderCol");                    //Rahmenfarbe Seite

 $BaseTarget=getDaten("BaseTarget");                    //Zielfenster

 $BtnHoverStyle=false; 
 $Skin=getDaten("Skin");                                 //vordefinierte Skin (1-11), optional
 switch($Skin){
     case 1:
      if (empty($h1col)) $h1col="#ffffff";
      if (empty($h2col)) $h2col="#ff7800";
      if (empty($piccol)) $piccol="#8c018e";
      if (empty($pichovercol)) $pichovercol="#ff7800";
      if (empty($acol)) $acol="#000000";
      if (empty($ahover)) $ahover="#ff7800";
      if (empty($BtnStyle)) $BtnStyle="lila";
      if (empty($TeasTopStyle)) $TeasTopStyle="lila";
      if (empty($TeasBottomStyle)) $TeasBottomStyle="grau";
      if (empty($TeasPFStyle)) $TeasPFStyle="02";
      if (empty($TeasPFCol)) $TeasPFCol="schw";
      if (empty($TeasPFHoverCol)) $TeasPFHoverCol="orange";
      break;
     case 2:
      if (empty($h1col)) $h1col="#ffffff";
      if (empty($h2col)) $h2col="#80b133";
      if (empty($piccol)) $piccol="#000000";
      if (empty($pichovercol)) $pichovercol="#00baeb";
      if (empty($acol)) $acol="#000000";
      if (empty($ahover)) $ahover="#ff7800";
      if (empty($BtnStyle)) $BtnStyle="tuerkis";
      if (empty($TeasTopStyle)) $TeasTopStyle="gruen";
      if (empty($TeasBottomStyle)) $TeasBottomStyle="grau";
      if (empty($TeasPFStyle)) $TeasPFStyle="02";
      if (empty($TeasPFCol)) $TeasPFCol="schw";
      if (empty($TeasPFHoverCol)) $TeasPFHoverCol="orange";
      break;
     case 3:
      if (empty($h1col)) $h1col="#ffffff";
      if (empty($h2col)) $h2col="#dc0025";
      if (empty($piccol)) $piccol="#000000";
      if (empty($pichovercol)) $pichovercol="#dc0025";
      if (empty($acol)) $acol="#ffffff";
      if (empty($ahover)) $ahover="#dc0025";
      if (empty($BtnStyle)) $BtnStyle="rot";
      if (empty($TeasTopStyle)) $TeasTopStyle="schwarz";
      if (empty($TeasBottomStyle)) $TeasBottomStyle="schwarz";
      if (empty($TeasPFStyle)) $TeasPFStyle="02";
      if (empty($TeasPFCol)) $TeasPFCol="w";
      if (empty($TeasPFHoverCol)) $TeasPFHoverCol="rot";
      break;
     case 4:
      if (empty($h1col)) $h1col="#000000";
      if (empty($h2col)) $h2col="#ff7800";
      if (empty($piccol)) $piccol="#000000";
      if (empty($pichovercol)) $pichovercol="#ff7800";
      if (empty($acol)) $acol="#000000";
      if (empty($ahover)) $ahover="#ff7800";
      if (empty($BtnStyle)) $BtnStyle="orange";
      if (empty($TeasTopStyle)) $TeasTopStyle="grau";
      if (empty($TeasBottomStyle)) $TeasBottomStyle="grau";
      if (empty($TeasPFStyle)) $TeasPFStyle="02";
      if (empty($TeasPFCol)) $TeasPFCol="schw";
      if (empty($TeasPFHoverCol)) $TeasPFHoverCol="orange";
      break;
     case 5:
      if (empty($h1col)) $h1col="#ffffff";
      if (empty($h2col)) $h2col="#f700b9";
      if (empty($piccol)) $piccol="#000000";
      if (empty($pichovercol)) $pichovercol="#f700b9";
      if (empty($acol)) $acol="#000000";
      if (empty($ahover)) $ahover="#f700b9";
      if (empty($BtnStyle)) $BtnStyle="schwarz";
      if (empty($TeasTopStyle)) $TeasTopStyle="pink";
      if (empty($TeasBottomStyle)) $TeasBottomStyle="grau";
      if (empty($TeasPFStyle)) $TeasPFStyle="02";
      if (empty($TeasPFCol)) $TeasPFCol="schw";
      if (empty($TeasPFHoverCol)) $TeasPFHoverCol="pink";
      break;
     case 6:
      if (empty($h1col)) $h1col="#ffffff";
      if (empty($h2col)) $h2col="#dc0025";
      if (empty($piccol)) $piccol="#000000";
      if (empty($pichovercol)) $pichovercol="#dc0025";
      if (empty($acol)) $acol="#000000";
      if (empty($ahover)) $ahover="#dc0025";
      if (empty($BtnStyle)) $BtnStyle="grau";
      if (empty($TeasTopStyle)) $TeasTopStyle="rot";
      if (empty($TeasBottomStyle)) $TeasBottomStyle="grau";
      if (empty($TeasPFStyle)) $TeasPFStyle="02";
      if (empty($TeasPFCol)) $TeasPFCol="schw";
      if (empty($TeasPFHoverCol)) $TeasPFHoverCol="rot";
      break;
     case 7:
      if (empty($h1col)) $h1col="#000000";
      if (empty($h2col)) $h2col="#ff7800";
      if (empty($piccol)) $piccol="#000000";
      if (empty($pichovercol)) $pichovercol="#ff7800";
      if (empty($acol)) $acol="#000000";
      if (empty($ahover)) $ahover="#0092ba";
      if (empty($BtnStyle)){
       $BtnStyle="tuerkis";
       $BtnHoverStyle="orange";
      }
      if (empty($TeasTopStyle)) $TeasTopStyle="orange";
      if (empty($TeasBottomStyle)) $TeasBottomStyle="grau";
      if (empty($TeasPFStyle)) $TeasPFStyle="02";
      if (empty($TeasPFCol)) $TeasPFCol="schw";
      if (empty($TeasPFHoverCol)) $TeasPFHoverCol="tuerkis";
      break;
     case 8:
      if (empty($h1col)) $h1col="#ffffff";
      if (empty($h2col)) $h2col="#80b133";
      if (empty($piccol)) $piccol="#000000";
      if (empty($pichovercol)) $pichovercol="#80b133";
      if (empty($acol)) $acol="#000000";
      if (empty($ahover)) $ahover="#80b133";
      if (empty($BtnStyle)){
       $BtnStyle="gruen";
       $BtnHoverStyle="schwarz";
      }
      if (empty($TeasTopStyle)) $TeasTopStyle="schwarz";
      if (empty($TeasBottomStyle)) $TeasBottomStyle="grau";
      if (empty($TeasPFStyle)) $TeasPFStyle="02";
      if (empty($TeasPFCol)) $TeasPFCol="schw";
      if (empty($TeasPFHoverCol)) $TeasPFHoverCol="gruen";
      break;
     case 9:
      if (empty($h1col)) $h1col="#00baeb";
      if (empty($h2col)) $h2col="#80b133";
      if (empty($piccol)) $piccol="#000000";
      if (empty($pichovercol)) $pichovercol="#00baeb";
      if (empty($acol)) $acol="#ffffff";
      if (empty($ahover)) $ahover="#00baeb";
      if (empty($BtnStyle)) $BtnStyle="tuerkis";
      if (empty($TeasTopStyle)) $TeasTopStyle="schwarz";
      if (empty($TeasBottomStyle)) $TeasBottomStyle="schwarz";
      if (empty($TeasPFStyle)) $TeasPFStyle="02";
      if (empty($TeasPFCol)) $TeasPFCol="w";
      if (empty($TeasPFHoverCol)) $TeasPFHoverCol="tuerkis";
      break;
     case 10:
      if (empty($h1col)) $h1col="#ffffff";
      if (empty($h2col)) $h2col="#ffffff";
      if (empty($piccol)) $piccol="#000000";
      if (empty($pichovercol)) $pichovercol="#ffffff";
      if (empty($acol)) $acol="#ffffff";
      if (empty($ahover)) $ahover="#dc0025";
      if (empty($BtnStyle)){
       $BtnStyle="rot";
       $BtnHoverStyle="orange";
      }
      if (empty($TeasTopStyle)) $TeasTopStyle="rot";
      if (empty($TeasBottomStyle)) $TeasBottomStyle="orange";
      if (empty($TeasPFStyle)) $TeasPFStyle="02";
      if (empty($TeasPFCol)) $TeasPFCol="w";
      if (empty($TeasPFHoverCol)) $TeasPFHoverCol="rot";
      break;
     case 11:
      if (empty($h1col)) $h1col="#ffffff";
      if (empty($h2col)) $h2col="#ff7800";
      if (empty($piccol)) $piccol="#ff7800";
      if (empty($pichovercol)) $pichovercol="#000000";
      if (empty($acol)) $acol="#ffffff";
      if (empty($ahover)) $ahover="#ff7800";
      if (empty($BtnStyle)) $BtnStyle="orange";
      if (empty($TeasTopStyle)) $TeasTopStyle="schwarz";
      if (empty($TeasBottomStyle)) $TeasBottomStyle="schwarz";
      if (empty($TeasPFStyle)) $TeasPFStyle="02";
      if (empty($TeasPFCol)) $TeasPFCol="w";
      if (empty($TeasPFHoverCol)) $TeasPFHoverCol="orange";
      break;
 }
 
 
 if ($Logo!="pink" && $Logo!="weiss") $Logo="";
 if ($BtnStyle!="grau" && $BtnStyle!="gruen" && $BtnStyle!="lila" && $BtnStyle!="orange" && $BtnStyle!="pink" && $BtnStyle!="rot" && $BtnStyle!="schwarz" && $BtnStyle!="tuerkis") $BtnStyle="pink";
 if ($IconStyle!="schwarz" && $IconStyle!="weiss") $IconStyle="";
 if ($TeasTopStyle!="grau" && $TeasTopStyle!="lila" && $TeasTopStyle!="gruen" && $TeasTopStyle!="orange" && $TeasTopStyle!="pink" && $TeasTopStyle!="rot" && $TeasTopStyle!="schwarz" && $TeasTopStyle!="tuerkis") $TeasTopStyle="pink";
 if ($TeasBottomStyle!="grau" && $TeasBottomStyle!="lila" && $TeasBottomStyle!="orange" && $TeasBottomStyle!="pink" && $TeasBottomStyle!="rot" && $TeasBottomStyle!="schwarz" && $TeasBottomStyle!="tuerkis") $TeasBottomStyle="grau";
 if ($TeasPFCol!="schw" && $TeasPFCol!="w") $TeasPFCol="schw";
 if ($TeasPFHoverCol!="gruen" && $TeasPFHoverCol!="lila" && $TeasPFHoverCol!="orange" && $TeasPFHoverCol!="pink" && $TeasPFHoverCol!="rot" && $TeasPFHoverCol!="schwarz" && $TeasPFHoverCol!="tuerkis" && $TeasPFHoverCol!="weiss") $TeasPFHoverCol="lila";
 
 if ($TeasPFStyle!="01" && $TeasPFStyle!="02" && $TeasPFStyle!="03") $TeasPFStyle="01";

 if (!preg_match("/^#[0-9A-F]{6}$/i",$BGColor)) $BGColor="#FFFFFF";
 if (!preg_match("/^#[0-9A-F]{6}$/i",$piccol)) $piccol="#F700B9";
 if (!preg_match("/^#[0-9A-F]{6}$/i",$pichovercol)) $pichovercol="#F700B9";
 if (!preg_match("/^#[0-9A-F]{6}$/i",$acol)) $acol="#000000";
 if (!preg_match("/^#[0-9A-F]{6}$/i",$ahover)) $ahover="#F700B9";
 if (!preg_match("/^#[0-9A-F]{6}$/i",$h1col)) $h1col="#FFFFFF";
 if (!preg_match("/^#[0-9A-F]{6}$/i",$h2col)) $h2col="#80b133";
 if (!preg_match("/^#[0-9A-F]{6}$/i",$t1col)) $t1col="#F700B9";
 if (!preg_match("/^#[0-9A-F]{6}$/i",$t2col)) $t2col="#000000";

 if (!preg_match("/^#[0-9A-F]{6}$/i",$BorderColor)) $BorderColor="#000000";
 
 if (!preg_match("/^[_0-9A-Z]+$/i",$BaseTarget)) $BaseTarget="_top";
 
 if (!in_array($CamSize,array("168x210px","125x175px","100x92px"))) $CamSize="168x210px";

 $KatLinks=array(
 1=>'kategorie-Frauen-1',
 2=>'kategorie-Lesben-2',
 3=>'kategorie-reife+Frauen-3',
 4=>'kategorie-Fetish+++SM-4',
 5=>'kategorie-Paare-5',
 7=>'kategorie-Gay-7',
 8=>'kategorie-TS+++TV-8' 
 );
 
 $SourceFile=$Geschlecht.".ab16";
 if ($KatID>0){
  $SourceFile=$Geschlecht.".ab16.$KatID";   
 }elseif ($PLZ===false){
/*  $Region=0;   
  $GeoRegionen=array(
    01=>array("Baden-Württemberg",'karte_baden_wuerttemb.gif'),
    02=>array("Bayern",'karte_bayern.gif'),
    03=>array("Bremen",'karte_bremen.gif'),
    04=>array("Hamburg",'karte_hamburg.gif'),
    05=>array("Hessen",'karte_hessen.gif'),
    06=>array("Niedersachsen",'karte_niedersachsen.gif'),
    07=>array("Nordrhein-Westfalen",'karte_nordrhein_westf.gif'),
    08=>array("Rheinland-Pfalz",'karte_rheinland_pfalz.gif'),
    09=>array("Saarland",'karte_saarland.gif'),
    10=>array("Schleswig-Holstein",'karte_schleswig_holstein.gif'),
    11=>array("Brandenburg",'karte_brandenburg.gif'),
    12=>array("Mecklenburg-Vorpommern",'karte_meck_vorpomm.gif'),
    13=>array("Sachsen",'karte_sachsen.gif'),
    14=>array("Sachsen-Anhalt",'karte_sachsen_anhalt.gif'),
    15=>array("Thuringen",'karte_thueringen.gif'),
    16=>array("Berlin",'karte_berlin.gif')
  );                                                                                       
  if (($GeoDaten=geoip_record_by_name($_SERVER['REMOTE_ADDR'])) && $GeoDaten['country_code']=="DE" && array_key_exists((int)$GeoDaten['region'],$GeoRegionen)){
   $Region=(int)$GeoDaten['region'];    
   $SourceFile=$Geschlecht."_region$Region.ab16";
  }*/
 }elseif (strcasecmp($PLZ,'alle')) $SourceFile=$Geschlecht."_plz".((int)$PLZ).".ab16";
 
 if (!file_exists("$relPath/WBMExportData/$SourceFile.php")) $SourceFile="a.ab16";
 
 
 $ElemWidth=0;
 $ElemHeight=0;
 $ElemBorder=0;
 switch ($CamSize){
     case "168x210px":
        $ElemBorder=8;
        $ElemWidth=168+$ElemBorder;
        $ElemHeight=210+$ElemBorder;
        break;
     case "125x175px":
        $ElemBorder=6;
        $ElemWidth=125+$ElemBorder;
        $ElemHeight=175+$ElemBorder;
        break;       
     case "100x92px":
        $ElemBorder=4;
        $ElemWidth=100+$ElemBorder;
        $ElemHeight=93+$ElemBorder;
        break;
 }
 
 $Cams=array();
 @include("$relPath/WBMExportData/stars_$SourceFile.php");
 $StarCams=$Cams;
 
 $Cams=array();
 @include("$relPath/WBMExportData/$SourceFile.php");

 if ($Breite<$ElemWidth+2) $Breite=$ElemWidth+2;      //2Pixel Border
 if ($Breite>$ElemWidth*10+2) $Breite=$ElemWidth*10+2;    //2Pixel Border
 $ElemsPerRow=floor(($Breite-2)/$ElemWidth);   //2Pixel Border

 $HeaderBreite=$ElemsPerRow*$ElemWidth-$ElemBorder;
 $RestBreite=$HeaderBreite;
 $IconHeight=0;
 $HeaderHeight=0;
 switch ($CamSize){
     case "168x210px":
        $LogoBreite=168;
        if (!empty($Logo)){
         $HeaderHeight+=41;
         $RestBreite-=$LogoBreite+$ElemBorder;
         if ($RestBreite<340 && $Breite>=530) $HeaderHeight+=41;
        }
         
        break;
     case "125x175px":
        $LogoBreite=125;
        if (!empty($Logo)){
         $HeaderHeight+=31;
         $RestBreite-=$LogoBreite+$ElemBorder;
         if ($RestBreite<340 && $Breite>=530) $HeaderHeight+=31;
        }
 
        break;       
     case "100x92px":
        $LogoBreite=100;
        if (!empty($Logo)){
         $HeaderHeight+=21;
         $RestBreite-=$LogoBreite+$ElemBorder;
         if ($RestBreite<340 && $Breite>=530) $HeaderHeight+=21;
        }                
        break;
 }
 
 if ($Hoehe<$HeaderHeight+$ElemHeight+2) $Hoehe=$HeaderHeight+$ElemHeight+2;        //2Pixel Border 
 if ($Hoehe>$HeaderHeight+$ElemHeight*10+2) $Hoehe=$HeaderHeight+$ElemHeight*10+2;      //2Pixel Border, xPixel Header

 $MaxRows=max(1,floor(($Hoehe-$HeaderHeight-2)/$ElemHeight)); //2Pixel Border
 
 $MaxElems=max(1,$ElemsPerRow*$MaxRows);

 $HeadTextWidth=$RestBreite;
 
 $StdLinkParams=" href=\"".htmlentities($Target)."\" target=\"".htmlentities($BaseTarget)."\"";

 if ($IconHeight==0)  $HeadiconBreite=$ElemsPerRow*$ElemWidth;
     
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>CamDorado</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
BODY {
    margin:0px;
    padding:0px;
    background-color: <? Print $BGColor;?>;    
}

.MainFrame {
    border: 1px solid <? Print $BorderColor;?>;
    width:<? Print ($Breite-2)?>px;    
    height: <? Print ($Hoehe-2)?>px;    
    text-align:center;
}


.header{
    padding: 1px 0px 0px 0px ;
    width:<? Print $HeaderBreite;?>px;
    height: <? Print $HeaderHeight-1;?>px;
    margin:auto;
}
.teaserList{
    width:<? Print (int)($ElemsPerRow*$ElemWidth);?>px;
    margin:auto;
}
.teas_head{
    background-repeat: no-repeat;
    background-position: top;
}

.teas_bottom{
    background-repeat: no-repeat;
    background-position: bottom;
    margin-bottom: 1px;
    padding: 1px 0px 1px 0px;
}

.head_text1 h1{
    font-family: Tahoma;
    font-weight: bold;
    font-size: 16px;
    color: <? Print $t1col;?>;
    padding: 0px;
    margin: 0px;
}

.head_text1 h1 span{
    font-family: Tahoma;
    font-weight: bold;
    font-size: 13px;
    color: <? Print $t1col;?>;
    padding: 0px;
    margin: 0px;
}
.head_text{
    width:<? Print (int)$HeadTextWidth;?>px;
    float:left;
    display:block;
    font-family:Tahoma;
    font-size: 14px;
    color: <? Print $t2col;?>;
    font-weight: bold;
}

.clear{
    clear: both;
}             

/*------------168er------------*/
.divteaser_168 h1{
    font-family: Tahoma;
    font-weight: normal;
    font-size: 12px;
    color: <? Print $h1col;?>;
    padding: 2px 0px 0px 2px;
    margin: 0px 0px 0px 0px;
}

.divteaser_168 h2{
    font-family: Tahoma;
    font-weight: bold;
    font-size: 12px;
    color: <? Print $h2col;?>;
    margin: 0px 0px 0px 0px;
    padding: 0px 0px 0px 2px;
}
.divteaser_168 a.bildrahmen img{
    border: 1px solid <? Print $piccol;?>;
}
.divteaser_168 a.bildrahmen:hover img{
    border: 1px solid <? Print $pichovercol;?>;
}


.divteaser_168 .teas_head{
    background-image: url('./images/head_168_<? Print $TeasTopStyle;?>.png');
}

.divteaser_168 .teas_bottom{
    background-image: url('./images/bottom_168_<? Print $TeasBottomStyle;?>.png');
}

.divteaser_168 a.pf_link{
    background-image: url('./images/pfeil_<? Print $TeasPFCol;?>_<? Print $TeasPFHoverCol;?><? Print $TeasPFStyle;?>.gif');
    background-repeat: no-repeat;
    background-position: right 3px;
    padding: 1px 11px 0px 0px;
    font-family: Tahoma;
    font-weight: normal;
    font-size: 11px;
    color: <? Print $acol;?>;
    text-decoration: none;
    margin-right: 1px;
}

.divteaser_168  a.pf_link:hover{
    background-position: right -20px;
    color: <? Print $ahover;?>;
}

.divteaser_168 a.teas_button{
    background-image: url('./images/button_168_<? Print $BtnStyle;?>.png');
    background-repeat: no-repeat;
    background-position: 0px 0px;
    display: block;
    padding: 0px;
    margin: 0px;
    height: 50px;
}

.divteaser_168 a.teas_button:hover{
<? if (!empty($BtnHoverStyle)){?>
    background-image: url('./images/button_168_<? Print $BtnHoverStyle;?>.png');
<? }else{?>
    background-position: 0px -50px;
<? }?>
}

.head_icons{
    width:<? Print $HeadiconBreite?>px;
    float:left;
    display:block;
    text-align:center;
}

.divteaser_168{
    width:168px;
    float:left;
    display:block;
    margin: 4px;
    height: auto;
    overflow:hidden;
}

/*------------125er------------*/

.divteaser_125 h1{
    font-family: Tahoma;
    font-weight: normal;
    font-size: 12px;
    color: <? Print $h1col;?>;
    padding: 2px 0px 0px 2px;
    margin: 0px 0px 0px 0px;
}

.divteaser_125 h2{
    font-family: Tahoma;
    font-weight: bold;
    font-size: 11px;
    color: <? Print $h2col;?>;
    margin: 0px 0px 0px 0px;
    padding: 0px 0px 0px 2px;
}

.divteaser_125 a.bildrahmen img{
    border: 1px solid <? Print $piccol;?>;
}
.divteaser_125 a.bildrahmen:hover img{
    border: 1px solid <? Print $pichovercol;?>;
}

.divteaser_125 .teas_head{
    background-image: url('./images/head_125_<? Print $TeasTopStyle;?>.png');
}

.divteaser_125 .teas_bottom{
    background-image: url('./images/bottom_125_<? Print $TeasBottomStyle;?>.png');
}

.divteaser_125 a.pf_link{
    background-image: url('./images/pfeil_<? Print $TeasPFCol;?>_<? Print $TeasPFHoverCol;?><? Print $TeasPFStyle;?>.gif');
    background-repeat: no-repeat;
    background-position: right 3px;
    padding: 1px 11px 0px 0px;
    font-family: Tahoma;
    font-weight: normal;
    font-size: 11px;
    color: <? Print $acol;?>;
    text-decoration: none;
    margin-right: 1px;
}

.divteaser_125  a.pf_link:hover{
    background-position: right -20px;
    color: <? Print $ahover;?>;
}

.divteaser_125 a.teas_button{
    background-image: url('./images/button_125_<? Print $BtnStyle;?>.png');
    background-repeat: no-repeat;
    background-position: 0px 0px;
    display: block;
    padding: 0px;
    margin: 0px;
    height: 50px;
}

.divteaser_125 a.teas_button:hover{
<? if (!empty($BtnHoverStyle)){?>
    background-image: url('./images/button_125_<? Print $BtnHoverStyle;?>.png');
<? }else{?>
    background-position: 0px -50px;
<? }?>
}



.divteaser_125{
    width:125px;
    float:left;
    display:block;
    margin: 3px;
    height: auto;
    overflow:hidden;
}
/*------------100er------------*/
.divteaser_100 h2{
    font-family: Tahoma;
    font-weight: bold;
    font-size: 11px;
    color: <? Print $h2col;?>;
    margin: 0px 0px 0px 0px;
    padding: 0px 0px 0px 2px;
}
.divteaser_100 a.bildrahmen img{
    border: 1px solid <? Print $piccol;?>;
}
.divteaser_100 a.bildrahmen:hover img{
    border: 1px solid <? Print $pichovercol;?>;
}

.divteaser_100 .teas_bottom{
    background-image: url('./images/bottom_100_<? Print $TeasBottomStyle;?>.png');
}

.divteaser_100 a.pf_link{
    background-image: url('./images/pfeil_<? Print $TeasPFCol;?>_<? Print $TeasPFHoverCol;?><? Print $TeasPFStyle;?>.gif');
    background-repeat: no-repeat;
    background-position: right 3px;
    padding: 1px 10px 0px 0px;
    font-family: Tahoma;
    font-weight: normal;
    font-size: 10px;
    color: <? Print $acol;?>;
    text-decoration: none;
    margin-right: 1px;
}

.divteaser_100  a.pf_link:hover{
    background-position: right -20px;
    color: <? Print $ahover;?>;
}

.head_logo{
    width:<? Print $LogoBreite?>px;
    display:block;
/*    margin-bottom: 4px;*/
    float:left;
}

.head_logo a img {border:0px;}

.divteaser_100{
    width:100px;
    float:left;
    display:block;
    margin: 2px;
    height: auto;
    overflow:hidden;
}

.KatNavi {
<?
 if ($HeadTextWidth>=340){
?>    
    float:right;
    width:<? Print $HeadTextWidth;?>px;
<? }else{?>
    width:<? Print $HeaderBreite;?>px;
    float:left;
    clear:both;
<? }?>
}
.KatNavi a{
    font-family: Tahoma;
    font-weight: normal;
    text-decoration:none;
    font-size:14px;
    padding:0px;
    margin:0px;
    display:block;
    height:40px;
    background-repeat:no-repeat;
    background-position:center top;
    background-image:Url('./images/cat_header_168.png');
    margin-right:1px;
    text-wrap:none;
    text-align:center;
    color:black;
}
.KatNavi a nobr{
    padding-top: 10px;
    text-decoration:underline;
    padding-left:10px;
    background-image: Url('./images/pfeil_schw_weiss03.gif');
    background-repeat:no-repeat;
    background-position:left 16px;
    display:inline-block;
    cursor:pointer;
    width:auto;
    height:auto;
}

.KatNavi a:hover{
    background-position:center bottom;
    color:white;
}
.KatNavi a:hover nobr{
    background-position:left -8px;
}
    
.KatNavi a.first{
    background-position:left top;    
}
.KatNavi a.first:hover{
    background-position:left bottom;
}
.KatNavi a.last{
    background-position:right top;    
}
.KatNavi a.last:hover{
    background-position:right bottom;
}

.KatNavi.KatNavi168 a{
 background-image:Url('./images/cat_header_168.png');
 height: 40px;
}

.KatNavi.KatNavi168 a nobr{
 padding-top: 10px;
 background-position:left 16px;
}
.KatNavi.KatNavi168 a:hover nobr{
    background-position:left -8px;
}

.KatNavi.KatNavi125 a{
 background-image:Url('./images/cat_header_125.png');
 height: 30px;
}

.KatNavi.KatNavi125 a nobr{
 padding-top: 7px;
 background-position:left 12px;
}
.KatNavi.KatNavi125 a:hover nobr{
 background-position:left -11px;
}

.KatNavi.KatNavi100 a{
 background-image:Url('./images/cat_header_100.png');
 height: 20px;
}

.KatNavi.KatNavi100 a nobr{
 padding-top: 2px;
 background-position:left 6px;
 font-size:12px;
}
.KatNavi.KatNavi100 a:hover nobr{
 background-position:left -17px;
}

</style>
</head>
<body>
<div class="MainFrame">
<div class="header">
<? if (!empty($Logo)){
?><div class="head_logo"><a<? Print $StdLinkParams;?>><img<? if ($Breite>2*$LogoBreite) Print " align=\"left\"";?> class="logo" src="./images/logo<? Print htmlentities($LogoBreite);?>_<? Print htmlentities($Logo);?>.png" alt="CamDorado.com by fundorado.com"></a></div><? }?>
<? if ($Breite>=530){?>
<table class="KatNavi KatNavi<? Print (int)$LogoBreite;?>" border="0" cellpadding="0" cellspacing="0"><tr><td>
<a class="first"<?
 $LinkTarget=$Target;
 if (true || !empty($targeturl)) $LinkTarget.="&turl=".urlencode("http://www.camdorado.com/free/kategorie-Frauen-1.html");

 Print " href=\"".htmlentities($LinkTarget)."\" target=\"".htmlentities($BaseTarget)."\"";
?>><nobr>Frauen</nobr></a></td><td>
<a<?
 $LinkTarget=$Target;
 if (true || !empty($targeturl)) $LinkTarget.="&turl=".urlencode("http://www.camdorado.com/free/kategorie-reife+Frauen-3.html");

 Print " href=\"".htmlentities($LinkTarget)."\" target=\"".htmlentities($BaseTarget)."\"";
?>><nobr>reife Frauen</nobr></a></td><td>
<a<?
 $LinkTarget=$Target;
 if (true || !empty($targeturl)) $LinkTarget.="&turl=".urlencode("http://www.camdorado.com/free/kategorie-Lesben-2.html");

 Print " href=\"".htmlentities($LinkTarget)."\" target=\"".htmlentities($BaseTarget)."\"";
?>><nobr>Lesben</nobr></a></td><td>
<a class="last"<?
 $LinkTarget=$Target;
 if (true || !empty($targeturl)) $LinkTarget.="&turl=".urlencode("http://www.camdorado.com/free/kategorie-Fetish+++SM-4.html");

 Print " href=\"".htmlentities($LinkTarget)."\" target=\"".htmlentities($BaseTarget)."\"";
?>><nobr>Fetish/SM</nobr></a></td></tr>
</table><? }?>
<div class="clear"></div>
</div>
<div class="teaserList">
<?

$StarCams=array_values($StarCams);
$Cams=array_values($Cams);$IndexList=array();

$StarCntNeeded=0;
if ($MaxElems>count($Cams)) $StarCntNeeded=count($Cams)-$MaxElems;
else $StarCntNeeded=floor($MaxElems/5);

if (count($Cams)>1) $StarCntNeeded++;
$StarCntNeeded=min($StarCntNeeded,count($StarCams));

$TmpCams=array();
while (count($TmpCams)<$MaxElems && count($StarCams)>0 &&  $StarCntNeeded>0){
     $RandValStars=rand(0,count($StarCams)-1);
     $TmpCams[rand(1,10000)]=$StarCams[$RandValStars];
     array_splice($StarCams,$RandValStars,1);
     $StarCntNeeded--;
}

while (count($IndexList)<min($MaxElems-count($TmpCams),count($Cams))){
    $RandVal=rand(0,count($Cams)-1);
    if (!in_array($RandVal,$IndexList)) $IndexList[]=$RandVal;
}

$TCnt=0;

foreach($IndexList AS $k) $TmpCams[rand(1,10000)]=$Cams[$k];

ksort($TmpCams);

foreach($TmpCams AS $Data)
{
 $LinkTarget=$Target;
 $CamID=$Data['ID'];
 if (!empty($targeturl)){
  if (!empty($KatID) && array_key_exists($KatID,$KatLinks))
       $LinkTarget.="&turl=".urlencode("http://www.camdorado.com/free/$KatLinks[$KatID]Cam".$CamID.".html");
  else $LinkTarget.="&turl=".urlencode("http://www.camdorado.com/free/indexCam".$CamID.".html");
 }

 $LinkParams=" href=\"".htmlentities($LinkTarget)."\" target=\"".htmlentities($BaseTarget)."\"";

 switch ($CamSize){
    case "168x210px":?>    
<div class="divteaser_168"><table width="168" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td class="teas_head"><h1><? Print htmlentities($Data['Nick']);?></h1>
    <a<? Print $LinkParams;?> class="bildrahmen"><img src="<? Print "$absPath/CamPics/".htmlentities($CamID)."_166x124px.jpg";?>" width="166" height="124" border="0" alt=""></a></td>
  </tr>
  <tr>
    <td><table width="168" border="0" cellspacing="0" cellpadding="0" class="teas_bottom">
      <tr>
        <td height="16"><h2>Online</h2></td>
        <td align="right"><a<? Print $LinkParams;?> class="pf_link">zum Profil</a></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td><a<? Print $LinkParams;?> class="teas_button"></a></td>
  </tr>
</table>
</div>
    <? break;
    case "125x175px":?>
<div class="divteaser_125"><table width="125" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td class="teas_head"><h1><? Print htmlentities($Data['Nick']);?></h1>
    <a<? Print $LinkParams;?> class="bildrahmen"><img src="<? Print "$absPath/CamPics/".htmlentities($CamID)."_123x91px.jpg";?>" width="123" height="91" border="0" alt=""></a></td>
  </tr>
  <tr>
    <td><table width="125" border="0" cellspacing="0" cellpadding="0" class="teas_bottom">
      <tr>
        <td height="16"><h2>Online</h2></td>
        <td align="right"><a<? Print $LinkParams;?> class="pf_link">zum Profil</a></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td><a<? Print $LinkParams;?> class="teas_button"></a></td>
  </tr>
</table>
</div>
    <? break;
    case "100x92px":?>
<div class="divteaser_100"><table width="100" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><a<? Print $LinkParams;?> class="bildrahmen"><img src="<? Print "$absPath/CamPics/".htmlentities($CamID)."_98x72px.jpg";?>" width="98" height="72" border="0" alt=""></a></td>
  </tr>
  <tr>
    <td><table width="100" border="0" cellspacing="0" cellpadding="0" class="teas_bottom">
      <tr>
        <td height="16"><h2>Online</h2></td>
        <td align="right"><a<? Print $LinkParams;?> class="pf_link">zum Profil</a></td>
      </tr>
    </table></td>
  </tr>
</table>
</div>
    <? break;?>
<? }
 //if (++$TCnt%$ElemsPerRow==0) Print "<div class=\"clear\"></div>";
}?>    
<div class="clear"></div>
</div></div>
</body>
</html>
