﻿
var ObjImg;
var ObjLoader;

function Video_Gallery(arrtitle,arrImgSmall,arrImgBig,ImgElarg,ImgLoader,Objgallery,ObjTitle,IsImage,ObjDef,IID)
{
 this.Title=arrtitle;
 this.ImgSmall=arrImgSmall;
 this.ImgBig=arrImgBig;
 this.ObjElarg=new String(ImgElarg);
 this.ObjLoader=new String(ImgLoader);
 this.Objgallery=new String(Objgallery);
 this.ObjTitle=new String(ObjTitle);
 this.ObjDef=new String(ObjDef);
 this.Index=new Number(-1);
 this.IsImage=new Number(IsImage);
 this.Total=new Number(arrtitle.length);
 this.HC=new htmlcontrol();
 this.IID = IID;
}


Video_Gallery.prototype.Show=function(IndexID)
{

   $(this.ObjTitle).innerHTML=this.Title[IndexID];    
   this.Index=IndexID;

if (this.IsImage==1)
{
    hs(this.ObjElarg,'none',0);
    hs(this.ObjLoader,'block',0);
    $(this.ObjElarg).src=this.ImgBig[IndexID];
    ObjImg=this.ObjElarg;
    ObjLoader=this.ObjLoader;
    $(this.ObjElarg).onload=function(){hs(ObjImg,'block',0);hs(ObjLoader,'none',0);};
    
    if (this.Index==0)
hs('imgprev1','none');
else
hs('imgprev1','block');



}

else
{

if (this.Index==0)
hs('imgprev2','none');
else
hs('imgprev2','block');



  this.LoadFlash();


}
   


}

Video_Gallery.prototype.Next=function()
{
 this.Index++;
 if (this.Index>=this.Total)
   this.Index=0;
 this.Show(this.Index);
 this.SlidShow();

}


Video_Gallery.prototype.Prev=function()
{
 this.Index--;
 if (this.Index<0)
 this.Index=0;
 this.Show(this.Index);
 //this.SlidShow();
}

Video_Gallery.prototype.SlidShow=function()
{ 
   this.Counter=new Number(0);
   this.css=new String('');
  $(this.Objgallery).innerHTML='';
  
  for (var i=this.Index;i<this.Total;i++)
  {
   
   /* if (this.Index==i)
    this.css='image_border_selected';
    else
    this.css='image_border';*/
   
 
   
   $(this.Objgallery).innerHTML=$(this.Objgallery).innerHTML+' '+this.HC.img(this.ImgSmall[i],this.Title[i],'','onclick="'+this.ObjDef+'.Show('+i+')"','center',83,118,this.css);
   if (this.Counter==3)
   break;
   this.Counter++;
  } 

 
}

Video_Gallery.prototype.LoadFlash=function()

 {
  
//  this.flash=new String('')   
//  this.Flashsrc=new String('../services/spicaplayer.swf') 
//  this.flash='<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"';
//  this.flash+='codebase="http://macromedia.com/cabs/swflash.cab#version=6,0,0,0" name="flaMovie" WIDTH=320 HEIGHT=240'   
//  this.flash+='ID=flaMovie>'
//  this.flash+='<PARAM NAME="movie" VALUE="../services/spicaplayer.swf">'
//  this.flash+='<PARAM NAME="FlashVars" id="FlashVars" value="fvdo='+this.ImgBig[this.Index]+'">'
//  this.flash+='<PARAM NAME=quality VALUE=medium>'
//  this.flash+='<PARAM NAME=bgcolor VALUE=#FFFFFF>'
//  this.flash+='<EMBED src="../services/spicaplayer.swf" WIDTH=320 HEIGHT=240'
//  this.flash+='bgcolor=#565656' 
//  this.flash+='TYPE="application/x-shockwave-flash" name="flaMovie">  </EMBED>'
//  this.flash+='</OBJECT>'
  
  
  
  
 //$(this.ObjElarg).innerTEXT = 

var e = document.getElementById('ctl00_ContentPlaceHolderEmpty_ifrm_Video');

e.src = "../pages/flv_Video_Player.aspx?id=" + this.IID[this.Index];

  }  