///////////////////////////////////////////////////////
//
//	HKJFC		: HK510 JAVASCRIPT FLASH CLASS
//	Version 	: 8.46
//	Last modified	: 29.10.06
//	Author		: HK510.com
//
///////////////////////////////////////////////////////
//
function __flash(n)
{	
	// dev
	//this.dtaUrl			= 'http://php.prospek.ca/gsi/song.php';
	
	// online
	this.dtaUrl			= 'http://www.gsimusique.com/song.php';
	
	this.generateId			= function(n)
	{
		var e = (typeof(n)!='undefined' && typeof(n)=='number')?n:3001;
		return new Date(e, 00, 01, 00, 00, 00)-new Date();
	};
	this.getPlatform 		= function()
	{
		var v = 'others';
		if(navigator.appVersion.indexOf('Mac')!=-1) v = 'mac';
		if(navigator.appVersion.indexOf('Win')!=-1) v = 'win';
		return v;
	};
	this.getType			= function()
	{
		var v = 'others';
		if(document.all && document.getElementById) v = 'ie';
		if(document.all && navigator.userAgent.toLowerCase( ).indexOf("opera") != -1) v = 'opera'; 
		if(!document.all && document.addEventListener) v = 'moz';
		if(document.layers) v = 'ns4';
		return v;
	};
	this.getSize		= function(s1,s2,k)
	{
		var r 		= (s2=='width')?160:65;
		if(k=='player')
		{
			if(s1=='video') r = (s2=='width')?249:275;
			if(s1=='audio' || s1=='piece' || s1=='radio') r = (s2=='width')?122: (s1=='audio' || s1=='radio')? 275 : 90;
			if(s1=='mini') 	r = (s2=='width')?169:57;
		}else{
			r = (s2=='width')?19:18;
		}
		return r;
	};
	this.player = function(o,p,l)
	{
		var k  = (typeof(p)!='undefined')? p : 'player' ;
		if(typeof(o)=='undefined') var o = {type:null,file:null}
		var n0  = this.pageId;
		var n1	= this.getSize(o.type,'width',k);
		var n2	= this.getSize(o.type,'height',k);
		var s1	= '?UID='+n0;
		var s2	= (typeof(o.file)!='undefined')?'jsFile='+o.file :'';
		var s3	= (typeof(o.type)!='undefined')?'jsType='+o.type :'';
		var s4	= (typeof(o.time)!='undefined')?'jsTime='+o.time :'';
		var s5	= (typeof(o.pochette)!='undefined')?'jsPochette='+o.pochette :'';
		var s6	= (typeof(o.album)!='undefined')?'jsAlbum='+o.album :'';
		var s7	= (typeof(o.artist)!='undefined')?'jsArtist='+o.artist :'';
		var s8	= (typeof(o.track)!='undefined')?'jsTrack='+o.track :'';
		var s9	= (typeof(o.title)!='undefined')?'jsTitle='+o.title :'';
		var s10	= (typeof(l)!='undefined')?'subId='+l :'';
		var s11	= (o.type=='radio')?'xmID='+this.count :'';
		var e1	= (s3=='')?'':'&';
		var e2	= (s4=='')?'':'&';
		var e3	= (s5=='')?'':'&';
		var e4	= (s6=='')?'':'&';
		var e5	= (s7=='')?'':'&';
		var e6	= (s8=='')?'':'&';
		var e7	= (s9=='')?'':'&';
		var e8	= (s10=='')?'':'&';
		var e9	= (s11=='')?'':'&';
		var e	= s2+e1+s3+e2+s4+e3+s5+e4+s6+e5+s7+e6+s8+e7+s9+e8+s10+e9+s11+'&dtaUrl='+this.dtaUrl;
		var s 	= "";
		s	+="<object ";
		s	+="classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' ";
		s	+="codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0' ";
		s	+="width='"+n1+"' height='"+n2+"' id='player"+n0+this.generateId()+"' align='middle' >";
		s	+="<param name='allowScriptAccess' value='sameDomain' /> ";
		s	+="<param name='movie' value='"+k+".swf"+s1+"' /> ";
		s	+="<param name='quality' value='high' /> ";
		s	+="<param name='menu' value='false' /> ";
		s	+="<param name='bgcolor' value='#BCBABA' /> ";
		s	+="<param name='wmode' value='transparent' /> ";
		s	+="<param name='FlashVars' value=\""+e+"\">";
		/////////////////////
		s	+="<embed ";
		s	+="src='"+k+".swf"+s1+"' quality='high' ";
		s	+="FlashVars=\""+e+"\" wmode='transparent' ";
		s	+="bgcolor='#BCBABA' width='"+n1+"' ";
		s	+="height='"+n2+"' name='player"+n0+this.generateId()+"' ";
		s	+="align='middle' allowScriptAccess='sameDomain' ";
		s	+="menu='false' type='application/x-shockwave-flash' ";
		s	+="pluginspage='http://www.macromedia.com/go/getflashplayer' ";
		s	+="/> ";
		/////////////////////
		s	+="</object> ";
		if(o.type=='radio') this.count++;
		document.write(s);
	};
	this.btn = function(o)
	{
		this.player(o,'btn',this.generateId((Math.random()*100)+5000));
	};
	this.toString 			= function()
	{
		return 'HK510 JAVASCRIPT FLASH CLASS';
	};
	this.getVersion = function(w)
	{
		var e,r,q;
		var n = navigator.plugins;
		var p = 'ShockwaveFlash.ShockwaveFlash';
		if(this.type == 'ie' && this.platform=='win')
		{
			try{q=new ActiveXObject(p+".7");r=q.GetVariable("$version").match('\\d');}
			catch(e){try{q=new ActiveXObject(p+".6");r=6;}
			catch(e){try{q=new ActiveXObject(p+".3");r=q.GetVariable("$version").match('\\d');}
			catch(e){}}}
		}
		if(n)
		{
			var s1 	= 'Shockwave Flash';
			var s2 	= ' 2.0';
			var b	= n[s1+s2];
			if(b || n[s1]) r = Number(n[s1+((b)? s2 : '')].description.match('\\d'));
		}
		return r;
	};
	this.pageId	= (n==null || typeof(n)=='undefined')? this.generateId() : n.pageId;
	this.type 	= this.getType();
	this.platform 	= this.getPlatform();
	this.version 	= this.getVersion();
	this.count	= 0;
};
///////////////////////////////////////////////////////
var n = (typeof(parent.flash)!='undefined')? parent.flash : null ;
var flash = new __flash(n);
///////////////////////////////////////////////////////