function SwitchMylink() {
  	var buttons = document.getElementById('linkButtons').getElementsByTagName("img");
	var img_link = document.getElementById('linkMe').getElementsByTagName("a");
	var img_src = document.getElementById('linkMe').getElementsByTagName("img");

	for(var i=0; i<buttons.length; i++) {
		var button = buttons[i];
		button.onclick = function() {
			img_link[0].href='gfx/models/normal/'+this.id;
			img_src[0].src='gfx/models/midi/'+this.id;
		}
	}
}

var global_i = 1;

onerror=handleErr

function handleErr(msg,url,l)
{
//Handle the error here
return true;
}

function ImageChanger(dir) {
	if(dir == 'forward') {
		global_i++;
		if(global_i > 9)
			global_i = 1;
	}	
	if(dir == 'back') {
		global_i--;
		if(global_i < 1)
			global_i = 9;
	}
		
	var desc 		= new Array();
	var imgHandler 	= document.getElementById('changePic');
	var descHandler = document.getElementById('changeDesc');
	
	desc[1] 		= 'Adriana Recchi - Events P.A.';
	desc[2] 		= 'Chialin Chiang - Stylist';
	desc[3] 		= 'Cris Casza - Acessorisses De';
	desc[4] 		= 'Eliana Dias - Model';
	desc[5] 		= 'Fabianne Semprebom - Model';
	desc[6] 		= 'Helder - model';
	desc[7] 		= 'Jos� Camaro - Stylist';
	desc[8] 		= 'Marcelo Otaviano - Fashion';
	desc[9] 		= 'Marina Dias - Model Events P';
	
	imgHandler.src 		  = 'gfx/sfw/0'+global_i+'.jpg';
	descHandler.innerHTML = desc[global_i];
}
function paging(page) {
	document.getElementById('next_page').value=page;
	document.getElementById('search').submit();
}
function colaps(element) {
	var rollMe = document.getElementById(element);
	if(rollMe.style.display == 'none') {
		rollMe.style.display = "block";
	} else {
		rollMe.style.display = "none";
	}
}
function pop(address,title,w,h) {
	var height	= 600;
	var width	= 800;
	if (h)
		height	= h;
	if (w)
		width 	= w;
	window.open(address, title, 'height='+height+',width='+width+',resizable=yes,scrollbars=yes,status=no');
}
function popup(address,title, width, height) {
  	window.open(address, 'mini', 'height='+height+',width='+width+',resizable=1,scrollbars=no');
}
function PostAction(action,id) {
	var postForm	= document.getElementById('shortlist');
	var postAction 	= document.getElementById('action');
	var postId 		= document.getElementById('edit_id');
	postAction.value	= action;
	postId.value		= id;
	
	postForm.submit();
}
function postAlertSearch(alertid) {
	
}
/*
* Otwiera popup z drukowaniem, emailowaniem i forwardowaniem zaznaczonych talentow
*
* @param string sesid Identyfikator sesji, potrzeby do przekazania aby sesja byla zachowana w nowym oknie pod IE
*/
function searchFuncTalents(sesid, action) {
	var selectedTalents = getSelectedTalents();
	if (selectedTalents.length == 1) {// akcja dla jednego talenta
		var fn = selectedTalents[0].name;
		popup('index.php5?sid='+sesid+'&do='+action+'&shortlist=0&talent='+fn.substring(7,fn.indexOf(']')), action,800,600);
	}
	else if (selectedTalents.length > 1) {	// print dla wiecej niz jednego talenta
		var talentsURL = '';
		for (var i = 0; i < selectedTalents.length; i++) {
			talentsURL += '&'+selectedTalents[i].name+'=1';
		}
		popup('index.php5?sid='+sesid+'&do='+action+'All&noshortlist=1&shortlist=0'+talentsURL, action+'All', 800, 600);
	}
}
function emailTalents(sesid) {
	
}
/*
*	Zwraca tablice zaznaczonych talentow
*/
function getSelectedTalents() {
	var inputs = document.getElementById('clientSearch').getElementsByTagName('input');
	var checked = new Array();
	var j = 0;
	for (var i = 0; i < inputs.length; i++) {
//		if (inputs[i].title == 'checked' && inputs[i].checked) {
		if (inputs[i] && inputs[i].checked) {
			checked[j] = inputs[i];
			j++;
		}
	}
	return checked;
}
function signupFinish() {
	document.getElementById('add_').value='1';
	document.getElementById('page_').value='3';
	document.getElementById('signupform').action ='?do=talentSignup&registred=1';
}
function signupFinisho(option) {
	document.getElementById('add_').value='1';
	document.getElementById('page_').value='3';
	document.getElementById('option_').value=option;
	document.getElementById('signupform').action ='?do=talentSignup&registred=1';
}
/*
function $(id) {
	return document.getElementById(id);
}
*/
/**
 * Ukrywa lub pokazuje pola charakterystyczne dla kobiet w formularzu wyszukiwania i face alert
 */
function setGirlField() {
	var il = $('#girl_il');
	var ds = $('#girl_ds');
	var cu = $('#girl_cu');
	var female = $('#female');
	if (female && il && ds) {
		if (female.checked) {
			cu.attr('class', 'fieldsShown');
			il.attr('class', 'fieldsShown');
			ds.attr('class', 'fieldsShown');
		}
		else {
			cu.attr('class', 'fieldsHidden');
			il.attr('class', 'fieldsHidden');
			ds.attr('class', 'fieldsHidden');
		}
	}
}
/*
 * Wyswietla wyniki wyszukiwania face alerta
 */
function postFaceAlertResults() {
	var dovar = $('#do');			// pobieram wskaznik do kolejnej akcji
	var faceform = $('#searchForm');	// pobieram formularz face alerta
	dovar.val('clientSeach');	// ten formularz bedzie wyswietlal wyniki a nie zapisywal face alerta
	faceform.submit();				// wyslij formularz
}
/**
 * 
 */
function add2ShortlistFunc(sesid) {
	var selectedTalents = getSelectedTalents();		// lista
	if (selectedTalents.length > 0) {
		var talentsURL = '';
		for (var i = 0; i < selectedTalents.length; i++) {
			talentsURL += '&'+selectedTalents[i].name+'=1';
		}
		popup('index.php5?sid='+sesid+'&do=clientAdd2Shortlist'+talentsURL, 'add2shortlist', 400, 185);
	}
}
/**
 * Wyswietla chmurke z podpowiedzia
 */
function cloud(that,t){
	that.title=''
	that.parentNode.getElementsByTagName('div')[0].style.display=t?'block':'none';
}
function cloudId(that,t,what){
	that.title=''
	document.getElementById(what).style.display=t?'block':'none';
}
function qm(that, disp) {
	//that.src = disp?'gfx/layout/qmo.gif':'gfx/layout/qm.gif';
	that.parentNode.getElementsByTagName('div')[0].style.display=disp?'block':'none';

	//if (disp)
	//	alert();
	//that.parentNode.lastChild.style.display=disp?'block':'none';
}

function qm2(that, disp) {
	that.parentNode.getElementsByTagName('span')[0].style.display=disp?'block':'none';
}
function showthunbail(pic_id) {
	var pic = document.getElementById('link_pic');
	var link = document.getElementById('showlink');
	if (pic) {
		pic.src = 'gfx/models/midi/'+pic_id;
		link.href = 'gfx/models/normal/'+pic_id;
	}
}

/**
 * Date w zlym formacie sprowadza do dobrego formatu
 */
function y2k(number) { return (number < 1000) ? number + 1900 : number; }

/**
 * Odlicza roznice czasu od aktualnego do podanego i zapisuje efekt w obiekcie HTML
 */
function timeLeft(when, what) {
    var now = new Date();
    var difference = Date.UTC(y2k(when.getYear()),when.getMonth(),when.getDate(),when.getHours(),when.getMinutes(),when.getSeconds()) -
                     Date.UTC(y2k(now.getYear()),now.getMonth(),now.getDate(),now.getUTCHours(),now.getMinutes(),now.getSeconds())
    var daysDifference = Math.floor(difference/1000/60/60/24);
    difference = difference - daysDifference*1000*60*60*24
    var hoursDifference = Math.floor(difference/1000/60/60);
    difference = difference - hoursDifference*1000*60*60
    var minutesDifference = Math.floor(difference/1000/60);
    difference = difference - minutesDifference*1000*60
    var secondsDifference = Math.floor(difference/1000);
    if (daysDifference < 0) daysDifference = daysDifference * (-1);
    var fieldValue = daysDifference + ' day(s), ' + hoursDifference + ' hour(s), ' + 
                     minutesDifference + ' minute(s), ' + secondsDifference + ' second(s)';
	document.getElementById(what).innerHTML = fieldValue;
}
function timeLeftV2(when, what) {
    var now = new Date();
    var difference = Date.UTC(y2k(when.getUTCFullYear()),when.getUTCMonth(),when.getUTCDate(),when.getHours(),when.getUTCMinutes(),when.getUTCSeconds()) -
                     Date.UTC(y2k(now.getUTCFullYear()),now.getUTCMonth(),now.getUTCDate(),now.getUTCHours(),now.getUTCMinutes(),now.getUTCSeconds())
    var hoursDifference = Math.floor(difference/1000/60/60);
    difference = difference - hoursDifference*1000*60*60
    var minutesDifference = Math.floor(difference/1000/60);
    difference = difference - minutesDifference*1000*60
    var secondsDifference = Math.floor(difference/1000);
    var fieldValue = hoursDifference + ':' + 
                     (minutesDifference < 10 ? '0'+minutesDifference : minutesDifference)  + ':' + (secondsDifference < 10 ? '0'+secondsDifference : secondsDifference);
	document.getElementById(what).innerHTML = fieldValue;
}

function showDiv(id){
	//$(id).style.display = 'block';
        $('#'+id).show();
}

function hideDiv(id){
	//(id).style.display = 'none';
        $('#'+id).hide();
}

function proceedOn(that) {
	that.src='gfx/registration/proces_on.gif';
}

function proceedOff(that) {
	that.src='gfx/registration/proces.gif';
}

function accountSelected(option) {
	document.getElementById('add_').value='0';
	document.getElementById('page_').value='25';
	document.getElementById('option_').value=option;
}

// ExpressCheckout
function ECaccountSelected(option) {
	window.location = 'webapp/PPExpressCheckout.php5?type='+option+'';
}

// Detect if the browser is IE or not.
// If it is not IE, we assume that the browser is NS.
var IE = document.all?true:false

// If NS -- that is, !IE -- then set up for mouse capture
if (!IE) document.captureEvents(Event.MOUSEMOVE)

// Set-up to use getMouseXY function onMouseMove
document.onmousemove = getMouseXY;

// Temporary variables to hold mouse x-y pos.s
var tempX = 0
var tempY = 0

// Main function to retrieve mouse x-y pos.s

function getMouseXY(e) {
  if (IE) { // grab the x-y pos.s if browser is IE
    tempX = event.clientX + document.body.scrollLeft
    tempY = event.clientY + document.body.scrollTop
  } else {  // grab the x-y pos.s if browser is NS
    tempX = e.pageX
    tempY = e.pageY
  }  
  // catch possible negative values in NS4
  if (tempX < 0){tempX = 0}
  if (tempY < 0){tempY = 0}  

  return true
}

var curTname = '';

function triggerShowThumb(that, session, uid) {
	curTname = that.alt;
	id = that.id;
	setTimeout('showThumb('+'\''+that.alt+'\''+', \'' + id + '\', \'' + session + '\', \'' + uid + '\')',500);
}

function clearTname() {
	curTname = '';
}

function showThumb(tname, id, session, uid) {
	if (tname == curTname) {
		$('#midiThumb').html('<a style="cursor: pointer" onClick="javascript:popup(\'index.php5?sid='+session+'&do=clientTalentView&talent='+uid+'\', \'Viewtalent\',\'870\',\'600\')"><img src="/gfx/models/mini2/'+tname+'?' + new Date().getTime()+'" alt="'+tname+'" /></a>');
		$('#midiThumb').css('top', (tempY-90)+'px'); //jak by cos sie sypa�o to tu wczesniej bylo 'px;(�rednik)'
		$('#midiThumb').css('left',(tempX-90)+'px');
		$('#midiThumb').css('display','block');
	}
	//else
		//alert(tname+' != '+curTname);
}

function hideThumb() {
	$('#midiThumb').hide();
}

var curTnameT = '';

function triggerShowThumbT(that, session, uid) {
	curTnameT = that.alt;
	id = that.id;
	var titleA = that.title.split(':');
	var res = titleA[1].split('x');
	var widthThumb = parseInt(res[0])+20;
	var heightThumb = parseInt(res[1])+20;
	setTimeout('showThumbT('+'\''+that.alt+'\''+', \'' + id + '\', \'' + session + '\', \'' + uid + '\', \''+widthThumb+'\', \''+heightThumb+'\')',200);
}

function clearTnameT() {
	curTnameT = '';
}

function showThumbT(tname, id, session, uid, widthThumb, heightThumb) {
	if (tname == curTnameT) {
		$('#midiThumb').html('<a style="cursor: pointer" onClick="javascript:popup(\'/gfx/models/normal/'+tname+'\', \'Viewtalent\',\''+widthThumb+'\',\''+heightThumb+'\')"><img src="/gfx/models/mini2/'+tname+'?' + new Date().getTime()+'" alt="'+tname+'" /></a>');
		$('#midiThumb').css('top', (tempY-90)+'px'); //jak by cos sie sypa�o to tu wczesniej bylo 'px;(�rednik)'
		$('#midiThumb').css('left',(tempX-90)+'px');
		$('#midiThumb').css('display','block');
	}
	//else
		//alert(tname+' != '+curTname);
}

function hideThumbT() {
	$('#midiThumb').hide();
}


function triggerShowThumbForFA(that) {
	curTname = that.alt;
	id = that.id;
	setTimeout('showThumbForFA('+'\''+that.alt+'\''+', \'' + id + '\')',500);
}

function showThumbForFA(tname,id) {
	if (tname == curTname) {
		$('#midiThumb').html('<a href="http://www.modelsconnect.net/index.php5?do=clientTalentView&talent=' + id + '&fromFaceAlert=1"><img src="/gfx/models/mini2/'+tname+'?' + new Date().getTime()+'" alt="'+tname+'" /></a>');
		$('#midiThumb').css('top', (tempY-90)+'px'); //jak by cos sie sypa�o to tu wczesniej bylo 'px;(�rednik)'
		$('#midiThumb').css('left',(tempX-90)+'px');
		$('#midiThumb').css('display', 'block');
	}
}



//expands all skills
function expandAll(){
	for(var i = 1; i <= 5; i++){
		document.getElementById('s'+i).style.display = 'block';
		document.getElementById('show'+i).style.display = 'none';
	}
}

//expands one sklill
function expandOne(id){
	document.getElementById('s'+id).style.display = 'block';
	document.getElementById('show'+id).style.display = 'none';
}

//displays shop preveiws
//
//
var shopSrc = '';

function triShopShow(that){
	shopSrc = that.alt;
	setTimeout('showShop(\''+that.alt+'\')',500);
}
function showShop(aname){
	if (aname == shopSrc) {
		$('#shopThumb').html('<img style="cursor: pointer" src="/gfx/shop/'+aname+'.jpg'+'" alt="'+aname+'" />');
		$('#shopThumb').css('top', (tempY-150)+'px'); //jak by cos sie sypa�o to tu wczesniej bylo 'px;(�rednik)'
		$('#shopThumb').css('left', (tempX-150)+'px');
		$('#shopThumb').css('display', 'block');
	}
}
function shopHide(){
	shopSrc = '';
}
function shopHideThumb() {
//	$('shopThumb').style.display = 'none';
        $('#shopThumb').hide();
}


/**

   Dynamic font sizer

**/
//Specify affected tags. Add or remove from list:
var tgs = new Array( 'div','td','tr', 'span', 'font', 'p');

//Specify spectrum of different font sizes:
var szs = new Array( 'x-small','','medium');
var startSz = 1;
var srcs = new Array( 'small', 'normal', 'big');

var activeSize = 1;

function ts( trgt,inc ) {
	if (!document.getElementById) return
	var d = document,cEl = null,sz = startSz,i,j,cTags;
	
	activeSize = inc;
	
	for ( var ix = 0; ix <=2; ix++){
		if(ix == inc){
			$('#size'+(ix+1)).attr('src', '/gfx/layout/font_size/'+srcs[ix]+'_on.jpg');
		}else{
			$('#size'+(ix+1)).attr('src', '/gfx/layout/font_size/'+srcs[ix]+'_off.jpg');
		}
	}
	
	sz = inc;
	if ( sz < 0 ) sz = 0;
	if ( sz > (szs.length-1) ) sz = (szs.length-1);
	startSz = sz;
		
	if ( !( cEl = d.getElementById( trgt ) ) ) cEl = d.getElementsByTagName( trgt )[ 0 ];

	cEl.style.fontSize = szs[ sz ];

	for ( i = 0 ; i < tgs.length ; i++ ) {
		cTags = cEl.getElementsByTagName( tgs[ i ] );
		for ( j = 0 ; j < cTags.length ; j++ ) cTags[ j ].style.fontSize = szs[ sz ];
	}
}


/**

	FOTM - Foace Of The Month

**/
function go(dir){
	if(dir == 1)
		current++;
	else if(dir == 0)
		current--;
	else current++;
	if(current==max && dir == 1)
		current = 0;
	if(current==0 && dir == 0)
		current = (max-1);
		
	$('#fotm_picture').css('background-image', 'url("'+arFotmImgList[current].src+'")');
	$('#fotm_namesurname').html(fotms[current]['name']+' '+fotms[current]['surname']+'.');
	$('#fotm_age').html('Age:&nbsp;'+fotms[current]['birthdate']);
	$('#fotm_height').html('Height:&nbsp;'+fotms[current]['height']+"&quot;");
	$('#fotm_hips').html('Hips:&nbsp;'+fotms[current]['hips']+"&quot;");
	$('#fotm_chest').html('Chest:&nbsp;'+fotms[current]['chest']+"&quot;");
	$('#fotm_waist').html('Waist:&nbsp;'+fotms[current]['waist']+"&quot;");
}
function play(dir){
	var tmp = direction;
	switch(dir){
	case 0:
		active = 1;
		clearInterval(interval);
		activate(0); 
	break;
	case 1:
		active = 1;
		clearInterval(interval);
		activate(1); 
	break;
	case 2:
		active = 0;
		clearInterval(interval); 
	break;
	default:
		active = 1;
		activate(tmp); 
	break;
	}
}
function openFOTM(){
	window.location = 'fotm'+fotms[current]['user_id']+'.html';
}
function activate(dir){
	direction = dir;
	interval = window.setInterval("go("+dir+")", 6000);
}

function aar(question, location) {	
	if(confirm(question))
		window.location = location;
}
/**
 * This script contains embed functions for common plugins. This scripts are complety free to use for any purpose.
 */

function writeFlash(p) {
	writeEmbed(
		'D27CDB6E-AE6D-11cf-96B8-444553540000',
		'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0',
		'application/x-shockwave-flash',
		p
	);
}

function writeShockWave(p) {
	writeEmbed(
	'166B1BCA-3F9C-11CF-8075-444553540000',
	'http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0',
	'application/x-director',
		p
	);
}

function writeQuickTime(p) {
	writeEmbed(
		'02BF25D5-8C17-4B23-BC80-D3488ABDDC6B',
		'http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0',
		'video/quicktime',
		p
	);
}

function writeRealMedia(p) {
	writeEmbed(
		'CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA',
		'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0',
		'audio/x-pn-realaudio-plugin',
		p
	);
}

function writeWindowsMedia(p) {
	p.url = p.src;
	writeEmbed(
		'6BF52A52-394A-11D3-B153-00C04F79FAA6',
		'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701',
		'application/x-mplayer2',
		p
	);
}

function writeEmbed(cls, cb, mt, p) {
	var h = '', n;

	h += '<object classid="clsid:' + cls + '" codebase="' + cb + '"';
	h += typeof(p.id) != "undefined" ? 'id="' + p.id + '"' : '';
	h += typeof(p.name) != "undefined" ? 'name="' + p.name + '"' : '';
	h += typeof(p.width) != "undefined" ? 'width="' + p.width + '"' : '';
	h += typeof(p.height) != "undefined" ? 'height="' + p.height + '"' : '';
	h += typeof(p.align) != "undefined" ? 'align="' + p.align + '"' : '';
	h += '>';

	for (n in p)
		h += '<param name="' + n + '" value="' + p[n] + '">';

	h += '<embed type="' + mt + '"';

	for (n in p)
		h += n + '="' + p[n] + '" ';

	h += '></embed></object>';

	document.write(h);
}

function advBar(element) {
	var rollMe = document.getElementById(element);
	var advField = document.getElementById('advancedOptions');
	//var pic = document.getElementById('switch_pic');
	
	if(rollMe.className == 'hidden') {
		advField.value="1";
		rollMe.className = "show";
		//pic.src="gfx/layout/client/more_opt_1.gif";
	} else {
		advField.value="0";
		rollMe.className = "hidden";
		//pic.src="gfx/layout/client/more_opt.gif";
	}
}

function randInt(){
	var rNum = Math.ceil(Math.random()*5);
	return rNum;
}

function popUp(URL){day = new Date();id=day.getTime();eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=640,height=450');");}

/**
 * Funkcja odpowiadajaca za przygotowanie bocznego, wysuwajacego sie okienka
 * z likeboxem Facebook'a
 *
 * PKuzminski 2010-09-08
 */
function fbsilder() {
     $(document).ready(function(){
	$('.fbdiv').mouseover(function()
	{
		$('.fblikeboxcontainer').stop(true, false).animate({width: 360, height: 587}, 100, function() {
                    $('#fbtoggle').attr('src', '/gfx/fblogo01.png');
                });
		$('.fbdiv').stop(true, false).animate({left: 0}, 150);

	});

	$('.fbdiv').mouseout(function()
	{
		$('.fbdiv').stop(true, false).animate({left: -292}, 500, function() {
                    $('#fbtoggle').attr('src', '/gfx/fblogo02.png');
                });
		$('.fblikeboxcontainer').stop(true, false).animate({width: 68, height: 85}, 1000);

	});

    });
}

/**
 * Funkcja wyswietlajaca flasha w topie strony
 *
 * PKuzminski 2010-09-08
 */
function topbemodel() {
    var flashvars = {};
    var params = {
             menu: "false",
             wmode: "transparent"
    };
    var attributes = {};

    swfobject.embedSWF("/gfx/beamodel.swf", "centerInsideadv", "510", "109", "9.0.0", "", flashvars, params, attributes);
}

/**
 * Uruchamia statystyki - Google Analytics (zlo!!) i Quantserve (nie wiem co to)
 *
 * PKuzminski 2010-09-08
 */
function runStats() {
    _uacct = "UA-231225-1";
    urchinTracker();
    _qacct="p-b7I0ORxyCPNTo";
    quantserve();
}

/**
 * Set Flash Main Page
 *
 * PKuzminski 2010-09-07
 */
function setFlashMP() {
    if($('#pictureFrame').is('.become_a_model')){
    	
        $('#pictureFrame').html('<iframe src="http://player.vimeo.com/video/33022417?title=0&amp;byline=0&amp;portrait=0&amp;color=ff0179&amp;autoplay=1" width="640" height="360" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>');
        
        /*
    	$('#pictureFrame').html('<a href="/index.php5?do=talentSignup"><img src="/gfx/become_a_model_movie/become_a_model_trigger.jpg" width="637" height="200" alt="Do you want to become a model?" /></a>').find('a').click(function(){
    		
    		$.post('become_a_model_counter.php5', {'count':'1'}, function(){});
    		
    		// BACKGROUND
			var $bam_bg = $('<div id="bam_player_bg" style="background:#000000;top:0;left:0;position:absolute;z-index:99;display:block;"></div>');
			$bam_bg.prependTo('body');
			$bam_bg.width($(document).width());
			$bam_bg.height($(document).height());
			$bam_bg.css('opacity',0.7);
			$bam_bg.click(function(){
				$('#bam_video_area').remove();
				$bam_bg.remove();
				$bam.remove();
			});
			// PLAYER
			var $bam = $(''+
				'<div id="bam_player" style="background:#000000;position:absolute;width:637px;height:400px;display:block;z-index:1000;padding:2px;">'+
				'	<div style="padding:2px;background:#000000;height:380px;width:637px;" id="bam_video_area">VIDEO</div>'+
				'	<div class="bam_close" style="background:url(\'/gfx/become_a_model_movie/close.png\') no-repeat top right #000000;cursor:pointer;height:22px;line-height:22px;clear:both;">&nbsp;</div>'+
				'</div>'+
			'');
			$bam.prependTo('body');
			$bam.css({
				'left': ( $(window).width() - 641) / 2,
				'top': ( $(window).height() - 402) / 2
			});
			
			// CLOSE
			$bam.find('.bam_close').click(function(){
				$('#bam_video_area').remove();
				$bam_bg.remove();
				$bam.remove();
			});
			
			// VIDEO EMBED
			swfobject.embedSWF("/gfx/become_a_model_movie/become_a_model_video.swf", "bam_video_area", "637", "380", "9.0.0", "", {}, {menu: "false"}, {});
			
			return false;
    		
    	});
        */
//    	
//    	// Sprawdzamy czy odwiedza pierwszy raz / oraz czy ma włączoną obsługe cookie
//    	$.post('become_a_model_counter.php5', {'cookie':'1'}, function(response){
//    		if(response == 'YES')
//    			$('#pictureFrame').find('a').click();
//    	});
    	
    }else{
		var flashvars2 = {};
        var params2 = {
                 menu: "false",
                 wmode: "transparent"
        };
        var attributes2 = {};

		var moovieArray = new Array('baner.swf','baner2.swf','baner3.swf','baner4.swf','baner5.swf','baner6.swf','baner7.swf');
		var randValue = Math.floor(Math.random() * moovieArray.length);
		var movie = '/gfx/v2/swf/'+moovieArray[randValue];
		var emswf = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="637" height="200"><param name="movie" value="'+movie+'" /><param name="quality" value="high" /><param name="menu" value="false" /><param name="wmode" value="" /><embed src="'+movie+'" wmode="" quality="high" menu="false" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="637" height="200"></embed></object>';
	
		if(document.getElementById('pictureFrame')){
			swfobject.embedSWF(movie, "pictureFrame", "637", "200", "9.0.0", "", flashvars2, params2, attributes2);
		}else{
			document.write(emswf);
		}
    }
}

function toggleCloud() {
	if (document.getElementById('evaluationCloud')){
		document.getElementById('evaluationCloud').className = 'cloud';
		document.getElementById('evaluationCloud').style.display = 'none';
	}
}

