var noteaser;
var noteaserHTML;
function display_video(player,fake)
{
	var txt;
	var theID = player;
	player = eval(player);
	var AutoStart="yes";
	var url_video=player['url'];
	var w;
	var h;
	if (player['format']=="56kb")  { 
		w=190;
		h=160;
	} else if (player['format']=="256kb") { 
		w=330;
		h=240;
	}
	else if (player['format']=="500kb") { 
		w=490;
		h=384;
	} else if (player['format']=="800kb") { 
		w=640;
		h=540;
	} else { 
		player['format']="256kb"; 
		w=330;
		h=240;
	}
	var img = "http://www.pornattitude.com/media/players/"+player['langue']+"/"+player['theme']+"/player-"+player['format']+".gif";
	if (noteaser=='1') fake=false;
	if (fake) {
		player['fake']=false;
		txt="<a href=\"javascript:display_video('"+theID+"',false);\">";
		txt+="<img src=\""+img+"\" border=0></a>";
		document.getElementById(theID).innerHTML=txt;
		return;
	} 

	var WMP7;

	txt = "";

	if ( navigator.appName != "Netscape" ) {   
		try  {  WMP7 = new ActiveXObject('WMPlayer.OCX'); }
		catch(e) {}
	}
	// Windows Media Player 7 Code
	if ( WMP7 )	{
		txt += '<OBJECT ID=MediaPlayer ';
		txt += ' CLASSID=CLSID:6BF52A52-394A-11D3-B153-00C04F79FAA6';
		txt += ' standby="Loading Microsoft Windows Media Player components..."';
		txt += ' TYPE="application/x-oleobject" width="'+ w +'" height="'+ h +'">';
		txt += '<PARAM NAME="url" VALUE="'+ url_video +'">';
		if (AutoStart=="yes") {
			txt += '<PARAM NAME="AutoStart" VALUE="true">';
		} else {
			txt += '<PARAM NAME="AutoStart" VALUE="false">';
		}
		txt += '<PARAM NAME="ShowControls" VALUE="1">';
		txt += '<PARAM NAME="uiMode" VALUE="mini">';
		txt += '</OBJECT>';
	}
	// Windows Media Player 6.4 Code
	else {
		//IE Code
		txt += '<OBJECT ID=MediaPlayer ';
		txt += 'CLASSID=CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95 ';
		txt += 'CODEBASE=http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715 ';
		txt += 'standby="Loading Microsoft Windows Media Player components..." ';
		txt += 'TYPE="application/x-oleobject" width="'+ w +'" height="'+ h +'">';
		txt += '<PARAM NAME="FileName" VALUE="'+ url_video +'">';
		if (AutoStart=="yes") {
			txt += '<PARAM NAME="AutoStart" VALUE="true">';
		} else {
			txt += '<PARAM NAME="AutoStart" VALUE="false">';
		}
		txt += '<PARAM NAME="ShowControls" VALUE="1">';
		//Netscape code
		txt += '    <Embed type="application/x-mplayer2"';
		txt += '        pluginspage="http://www.microsoft.com/windows/windowsmedia/"';
		txt += '        filename="'+ url_video +'"';
		txt += '        src="'+ url_video +'"';
		txt += '        Name=MediaPlayer';
		if (AutoStart=="yes") {
			txt += '        Autostart=1';
		} else {
			txt += '        Autostart=0';
		}
		txt += '        ShowControls=1';
		txt += '        ShowDisplay=0';
		txt += '        ShowStatusBar=0';
		txt += '        width='+ w;
		txt += '        height='+ h +'>';
		txt += '    </embed>';
		txt += '</OBJECT>';
	}
	if (noteaser=='1') {
		document.getElementById(theID).innerHTML=noteaserHTML;
	} else {
		document.getElementById(theID).innerHTML=txt;
	}
}

/*
   Preview de la vidéo :
*/	
function PopPaiement(url)
{
  winwidth = screen.availWidth - 10;
	winheight = screen.availHeight - 30;
	window.open(url, '_blank', 'scrollbars=yes, width=' + winwidth + ', height=' + winheight + ', top=0, left=0, resizable');
} 

/*
   Video PopUp
*/	
function video(url)
{
	winwidth = screen.availWidth - 10;
	winheight = screen.availHeight - 30;
	window.open(url, '_blank', 'scrollbars=yes, width=' + winwidth + ', height=' + winheight + ', top=0, left=0, resizable');
} 

/* 
  KTU Iframe
*/

function affiche_ktu(g, id, mode, prod, skin, lg, tracker, width, height)
{
  var Param= new Array();
	Param['id'] = id;
	Param['tracker'] = tracker;
	Param['color'] = skin;
	Param['mode'] = mode;
	Param['prod'] = prod;
	Param['dist'] = '';
	Param['lg'] = lg;
	if(g == 'hetero')
	{
	   Param['id_site'] = '1007';
	   Param['id_produit'] = '343';
	   Param['rf'] = 'pornattiudeFR_ktu';
	   Param['name_kit'] = "Pornattitude";
	   Param['synergie'] = 'h';
	}
	else
	{
	   Param['id_site'] = '1011';
	   Param['id_produit'] = '344';
	   Param['rf'] = 'gayxperienceFR_ktu';
	   Param['name_kit'] = "GayXperience";
	   Param['synergie'] = 'g';
	}
  var ktuPath="";
	var tmp_link = "http://ktu.sv2.biz/iframe.html";
	
	for (param in Param) 
	   {
		  glue = tmp_link.indexOf('?') == -1 ? '?' : '&';
		  tmp_link += glue+param+'='+Param[param];
	   }
  document.write('<iframe src="' + tmp_link +'" name="IFRAME_MICRO" width="' + width + '" height="' + height + '" scrolling="no" frameborder="0"></iframe>');
  
}

function pop(url,lg,idkit,syn) 
{
  var left = (screen.width/2)-240; // On retire la moitié de 'width'
	var top = (screen.height/2)-185; // On retire la moitié de 'height'
	mp = window.open(url+'?idkit='+idkit+'&lg='+lg+'&synergie='+syn,'mp', 'statutbar=no, width=480, height=370, left='+left+', top='+top+', menubar=no, resize=yes, scrollbars=yes');
  if (mp && mp.focus) mp.focus();
}