/*************************************************
	CHAT
*************************************************/
function chatSend(userCodeTo,urlFlash,urlMacaron) {

//	parent.document.varPopChat = window.open('','chatVIP','width=730,height=500');
	document.varPopChat = window.open('','chatVIP','width=730,height=500');
//	if(!parent.document.varPopChat.document.getElementsByTagName('a')[0]) {
	if(!document.varPopChat.document.getElementsByTagName('a')[0]) {
		// window.open(urlFlash,'chatVIP','width=730,height=500');
		/* modif 06/10/2006 - alex */
		window.open(urlFlash+'?userCodeTo='+userCodeTo,'chatVIP','width=730,height=500');
	}
//	else if ( !parent.document.varPopChat.closed ) {
	else if ( !document.varPopChat.closed ) {
//		parent.document.varPopChat.focus();	
		document.varPopChat.focus();	
	}
	document.getElementById('imacaron').src = urlMacaron + '?action=chatSend&userCodeTo=' + userCodeTo ;		
}
function writeChatSwf(paramUserCode) {
	codeChatSwf = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" name="vipchat" id="vipchat" width="557" height="600" align="middle">';
	codeChatSwf += '<param name="allowScriptAccess" value="sameDomain" />';
	codeChatSwf += '<param name="movie" value="vipchat_wip.swf" />';
	codeChatSwf += '<param name="loop" value="false" />';
	codeChatSwf += '<param name="quality" value="high" />';
	codeChatSwf += '<param name="bgcolor" value="#cccccc" />';
	codeChatSwf += '<param name="FlashVars" value="userCode='+paramUserCode+'" />';
	codeChatSwf += '<embed src="vipchat_wip.swf" FlashVars="userCode='+paramUserCode+'" loop="false" quality="high" bgcolor="#cccccc" width="557" height="600" swLiveConnect=true id="vipchat" name="vipchat" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
	codeChatSwf += '</object>';
	document.write(codeChatSwf);	
}
function setFocus(){
}
function recupFocus(){
/*
	if ( testFocus == 0 ) {
		window.self.focus();
		testFocus = 1;
	}
	else {
		document.getElementsByName("vipchat")[0].focus();
	}
*/
}
function initFocus(){
	//testFocus = 0;
}
function initFocus2(){
	testFocus = 0;
}
