// JavaScript Document




		var scr_animation = new Array();
		var img_fade = new Array();   
				
		
		var COUNT=0;
		
		var  images = new Array();  // Sample input
				
        images[1]=Array('<img src="images/inner_wear.png">' ,'<img src="images/mens_collection.png">');

	
		//var images[2] = new Array('<img src="images/homepg.jpg">','<img src="images/logo.jpg">','<img src="images/debian.png">','<img src="images/logonew.gif">','<img src="images/apache_logo.gif">','<img src="images/hd_imgSolution.jpg">');
		
	
		var dec_array = new Array(100,90,80,70,60,50,40,30,20,10,5,3,2,0);  // sample color 

		var dec_array_reverse = new Array(0,1,2,3,10,20,30,40,50,60,70,80,90,100);

		var let1 = new Array();
		
		var let= new Array();

		var fade= new Array();
			
		var dec_fade= new Array();
					
		var input_object_length=new Array();
		
		var pointer=new Array();
		
		var next_pointer=new Array();
		 
		
		
		



	function screen_animation() {      																// fucntion start 

		COUNT++;	
		
		fade[COUNT]=0;
		
		dec_fade[COUNT]=0;
		
		let[COUNT]=0;
		
		multiplePlace_div1(COUNT);
		
		multiplePlace_div2(COUNT);
		
		input_object_length[COUNT]=images[COUNT].length;
		
		scr_animation[COUNT]= setInterval('input_screen('+COUNT+')',1000);    										// seting duration of time  for input_screen function running.
		
	}  																								// function end. 


	function input_screen(count) {																		// funtion start 

        fade[count]++;																						// add + 1 in fade 

		if(fade[count]==3){       																			// if fade = 3 means its enter to the condition . 

	
		

				fade[count]=0;																				// then we assign fade = 0. 
							
				clearInterval(img_fade[count]); 															// clear the img_fade funtion.

				pointer[count]=Number(let[count]%input_object_length[count]);    									// pointer variable we store the let % 8 . 
				
				next_pointer[count]=((pointer[count]+1)==input_object_length[count])?0:(pointer[count]+1);    				// in this ((pointer+1)==8) its return '0' otherwise its add '1' to pointer.(i.e) (pointer+1).
				
				if(document.all) {
					
					document.getElementById('parent_div'+count).innerHTML =images[count][pointer[count]];					// images input value we insert into DIV. 
				
					document.getElementById('parent_div'+count).style.filter="Alpha(opacity=100)";	//b					// first object  assign black  color 
				
				
		//Div 2
				
					document.getElementById('child_div'+count).style.filter="Alpha(opacity=0)"; 	//w					// first object  assign black  color 
				
					document.getElementById('child_div'+count).innerHTML =images[count][next_pointer[count]];				// images input value we insert into DIV 2. 				
				}
				else {
					
			//alert('...'); 
				
					document.getElementById('parent_div'+count).innerHTML =images[count][pointer[count]];					// images input value we insert into DIV. 
					
					document.getElementById('parent_div'+count).style.opacity=1.0;	//b					// first object  assign black  color 
					
					
			//Div 2
				//	
					document.getElementById('child_div'+count).style.opacity=0.0; 	//w					// first object  assign black  color 
					
					document.getElementById('child_div'+count).innerHTML =images[count][next_pointer[count]];				// images input value we insert into DIV 2. 
					
				}
				

		//	alert(document.getElementById('div1').style.backgroundColor);
				
			
				 let1[count]=let[count] % input_object_length[count];					
				
				let[count]++ ;																			// add let + 1 . 
				
		}

		else if(fade[count]==2){																			// if fade = 2 means this condtion working .			   


				img_fade[count]=setInterval('image_fade('+count+')',100); 											//  interval set by 80 milsec onces.
				
		}

		else  {

				clearInterval(img_fade[count]);															// else means function will be stop .

				dec_fade[count]=0;
		}
					
	}

	
	function image_fade(count) {																			// image_fade function if fade=2 only its execude. 

			if(fade[count]==2){
			
					
				dec_fade[count]++;
				
				if(document.all){
				
					document.getElementById('parent_div'+count).style.filter="Alpha(opacity="+dec_array[dec_fade[count]]+")";	
							
					
					document.getElementById('child_div'+count).style.filter="Alpha(opacity="+dec_array_reverse[dec_fade[count]]+")";  		// we store color one by one in div 2 wit dec_array_reverse array.
				}
				
				else {  
						
	// mozilla browser
								
						document.getElementById('parent_div'+count).style.opacity=Number((dec_array[dec_fade[count]])/100);	
						
						
						document.getElementById('child_div'+count).style.opacity=Number((dec_array_reverse[dec_fade[count]]) / 100);  		// we store color one by one in div 2 wit 				        																	
				}
			
   			 }																								// end function.
	}

	function stop_running_mosueeventfire() {														// if we cal this function the operation should be stop. 
		
			clearInterval(scr_animation);															// stop the operation.
	
	}																								//end function. 

	
	function div_click()  {																			//function start .
		
		
			document.location.href=page[let[count]];														// in this operation perfrom load the page which based with 'let'
	}
	
	
	
		
	function multiplePlace_div1(count) {
		
		
		div1 ='<div id="parent_div'+count+'" name="parent_div'+count+'" style="position:absolute;z-index:1; width: 335px; height: 102px; " >'+images[count][1]+'</div>';
		
		document.write(div1);				
		
	}
	
	
	function multiplePlace_div2(count) {
		
		
		div2 ='<div  id="child_div'+count+'" name="child_div'+count+'" style="position:absolute;z-index:0; width: 335px; height: 102px;" >  </div>';
		
		document.write(div2);				
		
	}
	
	