document.write('<script src="include/lib/prototype.js" type="text/javascript"></script>');
document.write('<script src="include/src/scriptaculous.js" type="text/javascript"></script>');




  function FadeEffect(element){
       new Effect.Fade(element, 
       { duration:0.8});
   }
   function ShowEffect(element){
       new Effect.Appear(element, 
       {duration:0.8, from:0, to:1.0});
   }



/*
var imgList=new Array("http://demo1.smartinfo.com.hk/lifestylewedding/www/upload/product/m_645924504214.jpg","http://demo1.smartinfo.com.hk/lifestylewedding/www/upload/product/m_113990428889.jpg","http://demo1.smartinfo.com.hk/lifestylewedding/www/upload/product/m_937111282335.jpg");
*/
var i=0;
var delay=4000;

		/* preloading */
     // create object

     var imageObj = new Image();

     // start preloading

    



function funAutoChangeImg(){
	i++;
	/*
	document.title+="xx ";
	*/
	clearTimeout(timer_auto);



	// start preloading

	if(!$('empty')){
		obj = document.createElement('div');
		obj.id = 'empty';
		obj.style.display = 'none';
		document.body.appendChild(obj);
	}else{
		
	}		
	
     $('empty').innerHTML+=('<img  src="'+imgList[i+1]+'"/>');
	/* preloading */
     	
     	
	
	FadeEffect($('img'));
	
	setTimeout(function(){
		
		document.getElementById('img').src="";
		document.getElementById('img').src=imgList[i];
		
	
		
		
		setTimeout(function(){

			
			ShowEffect($('img'));
			
			timer_auto = setTimeout("funAutoChangeImg()",delay);
		
					
			if(i>=imgList.length-1){
				i=-1;
			}
		
		},500);

	
		

	
	},800);
	
	
	




	/*	document.title=i+'  '+imgList.length;*/
	
}


var timer_auto = setTimeout("funAutoChangeImg()",delay);
	if(!document.getElementById('empty')){
		obj = document.createElement('div');
		obj.id = 'empty';
		obj.style.display = 'none';
		document.body.appendChild(obj);
	}else{
		
	}		
	
     document.getElementById('empty').innerHTML+=('<img src="'+imgList[0]+'"/>');
     document.getElementById('empty').innerHTML+=('<img  src="'+imgList[1]+'"/>');
