var rnd = gup('rnd');

function yes_open_link(url, target)
{
		if (target == '_self') window.location = url;
		else window.open(url);
}

function shuffle(v){
    for(var j, x, i = v.length; i; j = parseInt(Math.random() * i), x = v[--i], v[i] = v[j], v[j] = x);
    return v;
};

//TRY START
//try{
		var thumbsShow = in_array(gup('thumb_numb'),new Array(1,2,3,4,5,6,7,8,9,10))? gup('thumb_numb'):"5";
		var spacing = spacing1 = (gup('spacing')>-1 && gup('spacing')<51 && gup('spacing')!='')? gup('spacing')*1:2;
		//image

		var thumb_size = in_array(gup('thumb_size'),new Array('60x60', '100x100', '120x120', '150x150'))? gup('thumb_size'):"100x100";
		temp = thumb_size.split('x');


		var thumb_width = temp[0]*1;
		var thumb_height = temp[1]*1;
	if(gup('slide')){
		<!-- control -->
		// speed of the animation
		var scrollWait = 3;
		if(gup('slide') == false){
			scrollWait = 0;
		}

		/* how many to scroll each time.
			if it's vertical, horizontal or grid it must be set to - 3 .. if single - 1
		*/
		var scroll_items = gup('thumb_numb')*1;

		//scroll direction (true or false)
		var vertical_direction = (gup('ban_type') == "horizontal")? false:true;


		var iWidth = thumb_width + 00;
		var iHeight = thumb_height + 40;

		if(gup('ban_type') == "horizontal"){
				var iWidth = iWidth + spacing;
		}else{
				var iHeight = iHeight + spacing;
				spacing1 = 2;
		}



		//borders
		var borderSizeOffset = gup('border_size')*2;
		var borderThumbOffset = gup('thumb_border')*2;
		var borderImgOffset = gup('img_border')*2;
		var iWidth = iWidth + borderThumbOffset + borderImgOffset;
		var iHeight = iHeight + borderThumbOffset + borderImgOffset;



		if(gup('ban_type') == "horizontal"){
			var iHeight = iHeight*1 +5;
		}

		if(gup('ban_type') == "vertical"){
			if(thumb_width ==  60 && thumb_height == 60){
				var iHeight = iHeight*1;
			}else{
				var iHeight = iHeight*1;
			}
		}

		//horizontal
		var hWidth = iWidth * thumbsShow;

		var hHeight = iHeight;

		//vertical
		var vWidth = iWidth;
		var vHeight = iHeight*thumbsShow;
		var vHeight = vHeight;

		if(thumb_width == 60 && thumb_height == 60){
			if(gup('ban_type') == "horizontal"){
				var vHeight = vHeight;
			}else{
				var vHeight = vHeight;
			}
		}


		if(gup('ban_type') == "vertical"){
			if(thumb_width == 60 && thumb_height == 60){
				var vWidth = iWidth+2;
				var vHeight = vHeight;
			}else{
				var vWidth = iWidth+2;
				var vHeight = vHeight+3;
			}
		}


		//document.write('browser info: ' + BrowserDetect.browser + ' ' + BrowserDetect.version + '<br>');

		var iHeight = iHeight*1;

		if(gup('ban_type') == "vertical"){
		if(BrowserDetect.browser == 'Explorer' || (BrowserDetect.browser == 'Firefox' && BrowserDetect.version <= 2) || BrowserDetect.browser == 'Konqueror'){
			//document.write('making smaller thumb cell height in some browsers!<br>');
			//iHeight -= 100;
		}
		}

		//document.write('new iHeight: '+iHeight+'px<br>');


		document.write('<style type="text/css">\
		\
			/*if single image */\
				.jcarousel-skin-single-'+rnd+' .jcarousel-clip-horizontal {width:186px; height:180px;}\
				.jcarousel-skin-single-'+rnd+' .jcarousel-clip-vertical {height:186px; height:180px;}\
				.jcarousel-skin-single-'+rnd+' .jcarousel-item {width: 186px; height: 180px;}\
				\
			/* if horizontal or vertical */\
				.jcarousel-skin-line-'+rnd+' .jcarousel-clip-horizontal {padding:0px; width:'+hWidth+'px; height:'+hHeight+'px;}\
				.jcarousel-skin-line-'+rnd+' .jcarousel-clip-vertical {width:'+vWidth+'px; height:'+vHeight+'px;}\
				.jcarousel-skin-line-'+rnd+' .jcarousel-item {width: '+iWidth+'px; height: '+iHeight+'px;}\
		\
			/* if grid */\
				.jcarousel-skin-grid-'+rnd+' .jcarousel-clip-horizontal {width:558px; height:540px;}\
				.jcarousel-skin-grid-'+rnd+' .jcarousel-clip-vertical {width:558px; height:540px;}\
				.jcarousel-skin-grid-'+rnd+' .jcarousel-list {width:558px; height:540px;}\
				.jcarousel-skin-grid-'+rnd+' .jcarousel-item {width: 186px; height: 180px;}\
		\
				.showBorder li{\
					/*border: 1px dotted red;*/\
				}\
		\
		</style>');


	}
//
	switch(gup('thumb_size')){
		case '60x60':
			var max=8;
			break;
		case '100x100':
			var max=13;
			break;
		case '120x120':
			var max=14;
			break;
		case '150x150':
			var max=15;
			break;
		case '200x200':
			var max=15;
			break;
		default:
			var max = 9;
	}


	if(typeof mycarousel_itemList == 'undefined')var mycarousel_itemList = Array();
		mycarousel_itemList[rnd] = Array();
		var thumbs = new Array();

		var girlsNum = gup('thumb_numb');

		var i =0;
		var thumbs = new Array();
		if(gup('thumb_niche') == 'mix'){
			var x=loadGirls;
			thumbs = getThumbs(Math.ceil(x/2),gup('thumb_size'),'femmes');
			thumbsC = getThumbs(Math.floor(x/2),gup('thumb_size'),'couples');
			for(i = 0; i < thumbsC.length; i++){
				thumbs[thumbs.length++] = thumbsC[i];
			}
		}else{
			thumbs = getThumbs(loadGirls,gup('thumb_size'),gup('thumb_niche'));
		}

//		alert(loadGirls+","+gup('thumb_size')+","+gup('thumb_niche'));
		//document.write('thumbs shuffled!<br>');
		if(loadMen > 0){
			var thumbsMen = getThumbs(loadMen,gup('thumb_size'),'hommes');
			//document.write('loadMen got!<br>');
			for(i = 0; i < thumbsMen.length; i++){
				thumbs[thumbs.length++] = thumbsMen[i];
			}
		}

		thumbs = shuffle(thumbs);

		var cities = geoip_country_city;

		var newCity = '';

		for(i = 0; i < thumbs.length; i++){
			if(typeof cities[i] != 'undefined'){
				thumbs[i][4] = cities[i];
			}
			else{
				newCity = cities[rand(0,cities.length-1)];
				//document.write('adding new city! ' + newCity + '<br>');
				thumbs[i][4] = newCity;
			}
		}

		var country = geoip_country.replace(/'/g,"\\'");
		var city = geoip_city;
		//document.write('cities and country got!<br>');

		//document.write('populating carousel!<br>');

		//document.write('thumbs.length = ' + thumbs.length + '<br>');

		var carousel_last_index = null;

		var breakCities = false;

		for(i = 0; i < thumbs.length; i++){
			if(thumbs[i][4].length > 9 || (thumbs[i][4].length + country.length) > 15){
				breakCities = true;
				break;
			}
		}

		//if(breakCities) document.write('city+country break set!<br>');
		var openads_rnd = '';
		for(i=0;i<10;i++) {openads_rnd += Math.floor(Math.random()*3+1);}




		function url1(i){
			url = camsympa_return_url({id:gup('id'),tracker:gup('tracker'),action:gup('url'),w:gup('warn'),e:gup('exit')});
			yes_open_link(url, target);
		}



		target = in_array(gup('target'), new Array('_self', '_blank'))? gup('target') : '_blank';


		for(i = 0; i < thumbs.length; i++){
			//document.write(thumbs[i][0] + '<br>');
			carousel_last_index = mycarousel_itemList[rnd].length++;
			//cut some big nicknames
			//if(thumbs[i][1].length > 12) thumbs[i][1] = thumbs[i][1].substring(0,12);
			if(typeof cities[i] == 'undefined'){
			newCity = cities[rand(0,cities.length-1)];
			//document.write('city {$i} is undefined! adding new: '+newCity+'<br>');
			cities[i] = newCity;
		}

			var text2='';
			if(gup('name')){text2 += thumbs[i][1].substring(0,max);}
			if(gup('age') && thumbs[i][1].length<(max-3)){text2 += ', '+thumbs[i][2];}
			text2 += '<br>';
			if(gup('city')){text2 += cities[i].substring(0,max);}
			if(gup('country') && cities[i].length<(max-5)){text2 += ', '+country;}

			mycarousel_itemList[rnd][carousel_last_index] = '<a href="javascript:void(0)" class="girl_link" onclick="url1('+i+')"><span><img src="'+thumbs[i][0]+'" alt="'+thumbs[i][1]+'" width="'+thumb_width+'" height="'+thumb_height+'" style="display:block"/>'+text2;

			mycarousel_itemList[rnd][carousel_last_index] += '</span></a><br class="clear" clear="all" /> ';
		}

//Override CSS where necessary
var designs = new Array();

//design css
designs[1]='/* main background & borders */		#banner_thumbRND {background: transparent;  border:1px solid  #11467B; }/* top title */						#banner_thumbRND h4 {font-size:18px; font-weight:normal; background: #0099CC; color:white;}/* top title link color */			#banner_thumbRND h4 a {color:#FFCC00;}/* last sentence */					#banner_thumbRND h5 { font-size:11px; font-weight:normal; background:#ffcc00; color:black;}/* last sentence link color */		#banner_thumbRND h5 a {color:#990000;}/* girl thumb style */				#banner_thumbRND .girl_link span  {background: #EAFBFF; font-size:11px; border:1px solid #0099CC;}/* girl thumb hover style */		#banner_thumbRND a:hover span {text-decoration:none; background:#fff;}/* girl thumb img style */			#banner_thumbRND .girl_link img {background:#fff;}/* link color */					#banner_thumbRND .girl_link span, #banner_thumbRND a {color:#0099CC; }/* link decoration */				#banner_thumbRND a span {text-decoration:underline;}';
designs[2]='/* main background & borders */		#banner_thumbRND {background: #ff0000;  border: 1px solid  #DD0059; }/* top title */						#banner_thumbRND h4 {font-size:18px; font-weight:normal; background: #FF2B80; color:white;}/* top title link color */			#banner_thumbRND h4 a {color: White;}/* last sentence */					#banner_thumbRND h5 { font-size:11px; font-weight:normal; background: White;  color:black;}/* last sentence link color */		#banner_thumbRND h5 a {color: #FF0066;}/* girl thumb style */				#banner_thumbRND .girl_link span  {background: #FFE1EF; font-size:11px; border: 1px solid #FF2B80;}/* girl thumb hover style */		#banner_thumbRND a:hover span {text-decoration:none; background:#fff;}/* girl thumb img style */			#banner_thumbRND .girl_link img {background:#fff; border: 1px solid #FF2B80;}/* link color */					#banner_thumbRND .girl_link span, #banner_thumbRND a {color: #FF2B80; }/* link decoration */				#banner_thumbRND a span {text-decoration:underline;}'
designs[3]='/* main background & borders */		#banner_thumbRND {background: #ffb743;  border: 1px solid  #6969B4; }/* top title */						#banner_thumbRND h4 {font-size:18px; font-weight:normal; background: #494A91; color:white;}/* top title link color */			#banner_thumbRND h4 a {color: White;}/* last sentence */					#banner_thumbRND h5 { font-size:11px; font-weight:normal; background: White;  color:black;}/* last sentence link color */		#banner_thumbRND h5 a {color: #FF0066;}/* girl thumb style */				#banner_thumbRND .girl_link span  {background: #E8E8F4; font-size:11px; border: 1px solid #494A91;}/* girl thumb hover style */		#banner_thumbRND a:hover span {text-decoration:none; background:#fff;}/* girl thumb img style */			#banner_thumbRND .girl_link img {background:#fff; border: 1px solid #494A91;}/* link color */					#banner_thumbRND .girl_link span, #banner_thumbRND a {color: #494A91; }/* link decoration */				#banner_thumbRND a span {text-decoration:underline;}'
designs[4]='/* main background & borders */		#banner_thumbRND {background: #f6bff6;  border: 1px solid  #FF0033; }/* top title */						#banner_thumbRND h4 {font-size:18px; font-weight:normal; background: Black; color:white;}/* top title link color */			#banner_thumbRND h4 a {color: White;}/* last sentence */					#banner_thumbRND h5 { font-size:11px; font-weight:normal; background: White;  color:black;}/* last sentence link color */		#banner_thumbRND h5 a {color: #FF0033;}/* girl thumb style */				#banner_thumbRND .girl_link span  {background: #FFFFCC; font-size:11px; border: 1px solid Black;}/* girl thumb hover style */		#banner_thumbRND a:hover span {text-decoration:none; background:#fff;}/* girl thumb img style */			#banner_thumbRND .girl_link img {background:#fff; border: 1px solid Black;}/* link color */					#banner_thumbRND .girl_link span, #banner_thumbRND a {color: Black; }/* link decoration */				#banner_thumbRND a span {text-decoration:underline;}'
designs[5]='/* main background & borders */		#banner_thumbRND {background: #8cb2d1;  border: 1px solid  #FF1AC6; }/* top title */						#banner_thumbRND h4 {font-size:18px; font-weight:normal; background: #970072; color:white;}/* top title link color */			#banner_thumbRND h4 a {color: #FFFF33;}/* last sentence */					#banner_thumbRND h5 { font-size:11px; font-weight:normal; background: #E300AB; color: #FF77DD;}/* last sentence link color */		#banner_thumbRND h5 a {color: White;}/* girl thumb style */				#banner_thumbRND .girl_link span  {background: #FFF0FB; font-size:11px; border: 1px solid #970072;}/* girl thumb hover style */		#banner_thumbRND a:hover span {text-decoration:none; background:#fff;}/* girl thumb img style */			#banner_thumbRND .girl_link img {background:#fff; border: 1px solid #970072;}/* link color */					#banner_thumbRND .girl_link span, #banner_thumbRND a {color: #970072; }/* link decoration */				#banner_thumbRND a span {text-decoration:underline;}'
designs[6]='/* main background & borders */		#banner_thumbRND {background: #bfeef6;  border: 1px solid  #FF0033; }/* top title */						#banner_thumbRND h4 {font-size:18px; font-weight:normal; background: Black; color:white;}/* top title link color */			#banner_thumbRND h4 a {color: White;}/* last sentence */					#banner_thumbRND h5 { font-size:11px; font-weight:normal; background: White;  color:black;}/* last sentence link color */		#banner_thumbRND h5 a {color: #FF0033;}/* girl thumb style */				#banner_thumbRND .girl_link span  {background: #FFFFCC; font-size:11px; border: 1px solid Black;}/* girl thumb hover style */		#banner_thumbRND a:hover span {text-decoration:none; background:#fff;}/* girl thumb img style */			#banner_thumbRND .girl_link img {background:#fff; border: 1px solid Black;}/* link color */					#banner_thumbRND .girl_link span, #banner_thumbRND a {color: Black; }/* link decoration */				#banner_thumbRND a span {text-decoration:underline;}'
designs[7]='/* main background & borders */		#banner_thumbRND {background: #c6f0c3;  border: 1px solid  #FF1AC6; }/* top title */						#banner_thumbRND h4 {font-size:18px; font-weight:normal; background: #970072; color:white;}/* top title link color */			#banner_thumbRND h4 a {color: #FFFF33;}/* last sentence */					#banner_thumbRND h5 { font-size:11px; font-weight:normal; background: #E300AB; color: #FF77DD;}/* last sentence link color */		#banner_thumbRND h5 a {color: White;}/* girl thumb style */				#banner_thumbRND .girl_link span  {background: #FFF0FB; font-size:11px; border: 1px solid #970072;}/* girl thumb hover style */		#banner_thumbRND a:hover span {text-decoration:none; background:#fff;}/* girl thumb img style */			#banner_thumbRND .girl_link img {background:#fff; border: 1px solid #970072;}/* link color */					#banner_thumbRND .girl_link span, #banner_thumbRND a {color: #970072; }/* link decoration */				#banner_thumbRND a span {text-decoration:underline;}'
designs[8]='/* main background & borders */		#banner_thumbRND {background: #d9d9d9;  border: 1px solid  #FF0033; }/* top title */						#banner_thumbRND h4 {font-size:18px; font-weight:normal; background: Black; color:white;}/* top title link color */			#banner_thumbRND h4 a {color: White;}/* last sentence */					#banner_thumbRND h5 { font-size:11px; font-weight:normal; background: White;  color:black;}/* last sentence link color */		#banner_thumbRND h5 a {color: #FF0033;}/* girl thumb style */				#banner_thumbRND .girl_link span  {background: #FFFFCC; font-size:11px; border: 1px solid Black;}/* girl thumb hover style */		#banner_thumbRND a:hover span {text-decoration:none; background:#fff;}/* girl thumb img style */			#banner_thumbRND .girl_link img {background:#fff; border: 1px solid Black;}/* link color */					#banner_thumbRND .girl_link span, #banner_thumbRND a {color: Black; }/* link decoration */				#banner_thumbRND a span {text-decoration:underline;}'
//designs[6]='/* main background & borders */		#banner_thumbRND {}/* top title */						#banner_thumbRND h4 {font-size:18px; font-weight:normal;color:black;}/* top title link color */			#banner_thumbRND h4 a {color: #0066FF;}/* last sentence */					#banner_thumbRND h5 { font-size:11px; font-weight:normal; color: Black;}/* last sentence link color */		#banner_thumbRND h5 a {color: black;}/* girl thumb style */				#banner_thumbRND .girl_link span  {background: #F1F1F1; font-size:11px; border: 1px solid Black;}/* girl thumb hover style */		#banner_thumbRND a:hover span {text-decoration:none; background:#fff;}/* girl thumb img style */			#banner_thumbRND .girl_link img {background:#fff; border: 1px solid Black;}/* link color */					#banner_thumbRND .girl_link span, #banner_thumbRND a {color: Black; }/* link decoration */				#banner_thumbRND a span {text-decoration:underline;}'


var global_css = '#banner_thumbRND {text-align:center;  margin:0 auto; overflow:visible; }#banner_thumbRND * {padding:0; margin:0; font-family:tahoma, arial, sans-serif; }#banner_thumbRND .girl_link {cursor:pointer; cursor:hand; display:block; display:inline-block; display:-moz-inline-box; }#banner_thumbRND .girl_link span {display:table-cell; display:inline-block;text-align:center;}#banner_thumbRND .girl_link img {text-align:center; margin:0 auto 5px ; padding:0px;  display:block; display:inline-block; }#banner_thumbRND .girl_link br {font-size:0px; line-height:0px; height:0;}#banner_thumbRND.horizontal {width:auto;}#banner_thumbRND.vertical {}#banner_thumbRND.horizontal .clear {display:none;}#banner_thumbRND.vertical .girl_link {display: auto;}#banner_thumbRND.vertical .girl_link span {display:auto; clear:both;}#banner_thumbRND a {text-decoration:underline;}#banner_thumbRND a img {text-decoration:none; display:block; display:inline-block; }#banner_thumbRND a:hover { text-decoration:none;}#banner_thumbRND .girl_link span {padding:0px; margin:5px '+spacing1/2+'px;} *:first-child+html #banner_thumbRND .girl_link { margin:0;}#banner_thumbRND h4 {padding:5px;}#banner_thumbRND h5 {padding:5px;}';


document.write('<style>'+eval('designs['+gup('design')+']').replace(/RND/g,rnd)+'</style>');
document.write('<style>'+global_css.replace(/RND/g,rnd)+'</style>');
document.write('<style>');


//Custom CSS
if(gup('bgcolor')){
 var color = (gup('bgcolor') == "transparent")? "transparent":"#"+gup('bgcolor');
	document.write('#banner_thumb'+rnd+'{background: '+color+';}');
// if(color == "transparent") document.write('#banner_thumb'+rnd+' .girl_link span {margin:-4px;}');
}

border = (gup('border_size')=="")? "0":gup('border_size');
document.write('#banner_thumb'+rnd+'{border-width: '+border+'px;}');

if(gup('border_color')){
document.write('#banner_thumb'+rnd+' {border-color: #'+gup('border_color')+';}');
}

if(gup('thumb_bgcolor')){
 var color = (gup('thumb_bgcolor') == "transparent")? "transparent":"#"+gup('thumb_bgcolor');
 document.write('#banner_thumb'+rnd+' .girl_link span  {background: '+color+';}');
 if(color == "transparent") document.write('#banner_thumb'+rnd+' .girl_link span {padding:0px;}');
}

border = (gup('thumb_border')=="")? "0":gup('thumb_border');
document.write('#banner_thumb'+rnd+' .girl_link span  {border-width: '+border+'px;}');

if(gup('th_border_color')){
	document.write('#banner_thumb'+rnd+' .girl_link span  {border-color: #'+gup('th_border_color')+';}');
}

border = (gup('img_border')=="")? "0":gup('img_border');
document.write('#banner_thumb'+rnd+' .girl_link img  {border-width: '+border+'px;}');

if(gup('img_border_color')){
document.write('#banner_thumb'+rnd+' .girl_link img  {border-color: #'+gup('img_border_color')+';}');
}

if(gup('nopad')){
document.write('#banner_thumb'+rnd+' .girl_link span {padding:0px;margin:0px;}');
document.write('#banner_thumb'+rnd+' .girl_link {margin-right:-1px;}');
}

document.write('#banner_thumb'+rnd+' a:hover span {text-decoration:none; background:transparent;}');

if(gup('lnk_color')){
document.write('#banner_thumb'+rnd+' .girl_link span, #banner_thumb a {color:#'+gup('lnk_color')+';}');
}

if(gup('lnk_dec')){
document.write('#banner_thumb'+rnd+' a {text-decoration:'+gup('lnk_dec')+';}');
document.write('#banner_thumb'+rnd+' a span {text-decoration:'+gup('lnk_dec')+';}');
document.write('#banner_thumb'+rnd+' a span img {text-decoration:none;}');
}

document.write('#banner_thumb'+rnd+' a span img {display:block;}');

if(gup('bold')){
document.write('#banner_thumb'+rnd+' .girl_link {font-weight:bold;}');
document.write('#banner_thumb'+rnd+' .girl_link span {font-weight:bold;}');
}

if(gup('lnk_hover_color')){
document.write('#banner_thumb'+rnd+' a:hover span {color:#'+gup('lnk_hover_color')+';}');
}

if(gup('lnk_hover_dec')){
document.write('#banner_thumb'+rnd+' a:hover span {text-decoration:'+gup('lnk_hover_dec')+';}');
}

if(gup('head_txt_view')){
	if(gup('head_bgcolor')){
		var color = (gup('head_bgcolor') == "transparent")? "transparent":"#"+gup('head_bgcolor');
		document.write('#banner_thumb'+rnd+' h4 {background: '+color+';}');
	}
	if(gup('head_font_size')){
		document.write('#banner_thumb'+rnd+' h4 {font-size:'+gup('head_font_size')+'px;}');
	}
	if(gup('head_color')){
		document.write('#banner_thumb'+rnd+' h4 {color:#'+gup('head_color')+';}');
	}
	if(gup('head_lnk_color')){
		document.write('#banner_thumb'+rnd+' h4 a {color:'+gup('head_lnk_color')+';}');
	}
	if(gup('head_hover_color')){
		document.write('#banner_thumb'+rnd+' h4 a:hover {color:'+gup('head_hover_color')+';}');
	}
}

if(gup('foot_txt_view')){
	if(gup('foot_bgcolor')){
	var color = (gup('foot_bgcolor') == "transparent")? "transparent":"#"+gup('foot_bgcolor');
	document.write('#banner_thumb'+rnd+' h5 {background: '+color+';}');
	}
	if('foot_font_size'){
	document.write('#banner_thumb'+rnd+' h5 {font-size:'+gup('foot_font_size')+'px;}');
	}
	if('foot_color'){
	document.write('#banner_thumb'+rnd+' h5 {color:#'+gup('foot_font_size')+';}');
	}
	if('foot_lnk_color'){
	document.write('#banner_thumb'+rnd+' h5 a {color:'+gup('foot_lnk_color')+';}');
	}
	if('foot_hover_color'){
	document.write('#banner_thumb'+rnd+' h5 a:hover {color:'+gup('foot_hover_color')+';}');
	}
}

font = thumb_width/10;
font = (font<10)? 11:thumb_width/10;
font = (font>14)? font-1:font;
document.write('#banner_thumb'+rnd+' .girl_link span {font-size:'+font+'px}');

document.write('</style>');
//Override CSS where necessary
if(gup('nopad')) morgin = -1; else morgin = 5;


document.write(' <table cellpadding="0" cellspacing="0" width="1%" id="banner_thumb'+rnd+'" class="'+gup('ban_type')+'"><tr><td style="padding:0px; margin-right:'+morgin+'px;">');

if(gup('head_txt_view')){
document.write(' 	<h4>nouveau à <a target="'+target+'" href="url1(1);">'+city+'</a> : tchate avec des coquines de chez toi !</h4> ');
}

if(gup('slide')){
	document.write('<ul id="videos_promo_'+rnd+'" class="jcarousel-skin-line-'+rnd+' showBorder">');
	document.write('</ul>');
}else{
	for(i in thumbs){
		document.write(' 	<a href="javascript:void(0)" class="girl_link" onclick="url1('+i+')"><span><img src="'+thumbs[i][0]+'" alt="'+thumbs[i][1]+'" width="'+thumb_width+'" height="'+thumb_height+'"/><br />');
		if(typeof cities[i] == 'undefined'){
			newCity = cities[rand(0,cities.length-1)];
			//document.write('city {$i} is undefined! adding new: '+newCity+'<br>');
			cities[i] = newCity;
		}

		text='';
		if(gup('name')){text += thumbs[i][1].substring(0,max);}
		if(gup('age') && thumbs[i][1].length<max-3){text += ', '+thumbs[i][2];}
		text += '<br>';
		if(gup('city')){text += cities[i].substring(0,max);}
		if(gup('country') && cities[i].length<max-5){text += ', '+country;}
		document.write(text+'</span></a>');
	}
}

if(gup('foot_txt_view')){
document.write(' 	<h5>clique sur les images pour tchater avec ces femmes connectées près de <a target="'+target+'" href="'+url+'">'+city+'</a></h5> ');
}

document.write(' </td></tr></table> ');

if(gup('slide')){

	function mycarousel_initCallback(carousel)
	{

	carousel.clip.hover(function() {
		carousel.stopAuto();
	}, function() {
		carousel.startAuto();
	});
	};


	function mycarousel_itemVisibleInCallback(carousel, item, i, state, evt)
	{
	// The index() method calculates the index from a
	// given index who is out of the actual item range.


	var idx = carousel.index(i, mycarousel_itemList[carousel.options.rnd].length);
	carousel.add(i, mycarousel_itemList[carousel.options.rnd][idx-1]);
	};

	function mycarousel_itemVisibleOutCallback(carousel, item, i, state, evt)
	{
	carousel.remove(i);
	carousel.startAuto();
	};


//window.setTimeout(eval("jQuery('#videos_promo_"+rnd+"').jcarousel({auto: scrollWait,animation: 3000,wrap: 'circular',rnd:'"+rnd+"',itemVisibleInCallback: {onBeforeAnimation: mycarousel_itemVisibleInCallback},itemVisibleOutCallback: {onAfterAnimation: mycarousel_itemVisibleOutCallback},vertical: "+vertical_direction+",scroll: "+scroll_items+",initCallback: mycarousel_initCallback});"),1500);
add_onload(eval("jQuery('#videos_promo_"+rnd+"').jcarousel({auto: scrollWait,animation: 3000,wrap: 'circular',rnd:'"+rnd+"',itemVisibleInCallback: {onBeforeAnimation: mycarousel_itemVisibleInCallback},itemVisibleOutCallback: {onAfterAnimation: mycarousel_itemVisibleOutCallback},vertical: "+vertical_direction+",scroll: "+scroll_items+",initCallback: mycarousel_initCallback});"));
}
//CATCH

//}catch(e){
//	document.write('real banner error: ' + e + '<br>');
//}

//TRY END
