hs.showCredits = false; 
hs.graphicsDir = 'common/script/highslide/graphics/';
hs.align="center";
hs.outlineType = 'rounded-white';
hs.wrapperClassName = 'draggable-header no-footer';
hs.allowSizeReduction = false;
// always use this with flash, else the movie will be stopped on close:
hs.preserveContent = false;
hs.swfOptions = {
	version:			  "9",
	expressInstallSwfurl: null,
	params: {
		quality:'high',
		play:true,
		allowFullScreen:true,
		swliveconnect:true, 
		allowscriptaccess:'always', 
		allowfullscreen:true,
		width:380,
		height:320
	} 
};
hs.captionEval = 'this.a.title';
//hs.wrapperClassName='dark';
hs.dimmingOpacity= 0.8;

var loadFLV=Class.create();
loadFLV.prototype={
	URL_DIFINITION:"mvnumber2.txt",
	URLBASE_FLV:"http://movies.arfaetha.com/veronique/files/",
	ID_WRAPPER:"flvmovie_wrapper",
	ID_TARGET:"flvmovie",

	thumbwidth:"160",
	thumbstyle:" /*margin-left:4px*/",
	swfname:"player.swf",
	hsoption:"{ objectType: 'swf', width: 410, objectWidth: 380, objectHeight: 320 ,slideshowGroup: 'gallery'}",

	HTML_DELIMITER_START:"",
	HTML_DELIMITER_END:"",
	mode:"new",
	
	initialize:function(option){
		if(typeof option=="object"){
			for(var prop in option) {
				this[prop]=option[prop];
			}
		}
		new Ajax.Request(this.URL_DIFINITION,{
			parameters:"&cache="+(new Date()).getTime(),
			onComplete:this.afterComplete.bind(this)
		});
		
	},
	afterComplete:function(httpObj){
		if(!httpObj.responseText) return false;
		var rows= httpObj.responseText.split("\n");
		
		//for(var i=rows.length-1,L=0;i>=L;i--){
		for(var i=0,L=rows.length;i<L;i++){
			var matches=rows[i].match(/(\S+),(.*)$/);
			if(matches==null) continue;
			$(this.ID_WRAPPER).style.display="block";
			this.makeLink(matches[1],matches[2]);
			if(this.mode=="new") return false;
		}
		//$("flvmovie_wrapper").style.display="block";
		//new iacMovie("20090121123639","");
	},
	makeLink:function(flvbase,message){
		if(!$(this.ID_TARGET)) return false;
		var flvname=this.URLBASE_FLV+flvbase+".flv";
		var thumbname=this.URLBASE_FLV+flvbase+".jpg";
		this.targetObj=$(this.ID_TARGET);
		/*if(this.mode=="new"){
			var titleText="";
		} else {*/
			var date_strings=[];
			date_strings[0]=flvbase.substr(2,2);
			date_strings[1]=flvbase.substr(4,2);
			date_strings[2]=flvbase.substr(6,2);
			
			var date_string = date_strings.join("/");
			
			/*var titleText="<span class='mv_dates'>"+date_string+"<\/span><span class='mv_title'>"+message+"<\/span>";*/
			var titleText="<span class='mv_title'>"+message+"<\/span>";
		/*}*/
		
		var a=[],c=0;
		a[c++]=this.HTML_DELIMITER_START;
		a[c++]='<a href="';
		a[c++]=this.swfname;
		a[c++]="?flvName=";
		a[c++]=flvname;
		a[c++]='" onclick="return hs.htmlExpand(this,';
		a[c++]=this.hsoption;
		a[c++]=')" title="';
		a[c++]=message;
		a[c++]='" class="highslide"><img src="';
		a[c++]=thumbname;
		a[c++]='" alt="';
		a[c++]=message;
		a[c++]='" width="';
		a[c++]=this.thumbwidth;
		a[c++]='" style="';
		a[c++]=this.thumbstyle;
		a[c++]='" />';
		a[c++]='</a>';
		a[c++]=titleText;
		a[c++]=this.HTML_DELIMITER_END;
		new Insertion.Bottom(this.targetObj,a.join(""));
		/*if(this.mode=="new"){
			new Insertion.Bottom(this.targetObj,"<span>"+message+"<\/span>");
		}*/

	}
}