function chiudi()
{
window.close();
}
function f(str) {
var x=998
var y=700
Win = window.open(str,'f','screeny=0,screenx=150,scrollbars=NO,scroll=no,resizable=no,width='+x+',height='+y+',status=no,location=no,toolbar=no');       
}
function fchat(str) {
var x=589
var y=365
Win = window.open(str,'fchat','screeny=0,screenx=150,scrollbars=NO,scroll=no,resizable=no,width='+x+',height='+y+',status=no,location=no,toolbar=no');       
}
function f2(str,x,y) {
Win = window.open(str,'f2','screeny=0,screenx=150,scrollbars=yes,scroll=yes,resizable=no,width='+x+',height='+y+',status=no,location=no,toolbar=no');       
}
function f4(str1,x,y,nome,euro,h) {
	str1=str1+"?nomep="+nome+"&euro="+euro+"&h="+h;
	
Win = window.open(str1,'f4','screeny=0,screenx=150,scrollbars=yes,scroll=yes,resizable=no,width='+x+',height='+y+',status=no,location=no,toolbar=no');       
}


var Win

function FlashJS_DoFSCommand(command, args) {
if(command=='chat'){
var x=589
var y=365
ar=args.split(",");
pag="http://"+ar[1]+"/"+ar[0]+"?indirizzo="+ar[1]+"&associato="+ar[2];

Win = window.open(pag,'FlashJS','screeny=0,screenx=150,scrollbars=NO,scroll=no,resizable=no,width='+x+',height='+y+',status=no,menubar=no,location=no,toolbar=no');       

}else if(command=='trace'){
   alert(args)
}else if(command=="FotoGrandeLayer"){
var FotoG=split(",")		
pag="http://www.regaloinweb.it/ingrandi.php?foto_prod="+FotoG[0]+"&cod_articolo="+FotoG[1]
Win2 = window.open(pag,'FlashJS','screeny=0,screenx=150,scrollbars=NO,scroll=no,resizable=no,width=1,height=1,status=no,location=no,toolbar=no');       		
}else if(command=='close'){
	
window.close();
exit()	
		}
}

str_2="<script language='VBscript'>\n"
str_2+="<!--\n" 
str_2+="// Catch the fscommand in ie with vbscript, and pass\n"
str_2+="// it on to JavaScript.\n"

str_2+="Sub FlashJS_FSCommand(ByVal command, ByVal args) \n";
str_2+="call FlashJS_DoFSCommand(command, args)\n";
str_2+="end Sub\n";

str_2+="//-->\n"
str_2+="</script>"

document.write(str_2)


function exit(){
 if(Win.closed==true){
  
  clearInterval(ChatEXE)
  exitP(ar[2])	
 
  }

}

function exitP(str) {
 var id=eval("FlashJS")
 var flashMovie=GetIDFlash("FlashJS");
 flashMovie.SetVariable("_root.Command.exitChat",str);
 
}

 function GetIDFlash(ID)
{
  if (window.document[ID]){
    return window.document[ID];
  }
  if (navigator.appName.indexOf("Microsoft Internet")==-1){
    if (document.embeds && document.embeds[ID])
      return document.embeds[ID]; 
  }
  else{
    return document.getElementById(ID);
  }
} 



