// JavaScript Document


var CREATE_POSITION=new Array();
var new_interval  = new  Array();
var COUNT=0;
var let= new Array();
var tot_content = new Array();	
var input_object_length=new Array();			


  	function cre_position(div_id,left_position,top_position){
		
		COUNT++;	
		this.div_id = div_id;
		this.left_position= (document.all)?(left_position-10):left_position;
		this.top_position = top_position;
		this.cont_name;
		
		CREATE_POSITION[this.div_id] = new Object();	
		CREATE_POSITION[this.div_id].left_position = this.left_position;
		CREATE_POSITION[this.div_id].top_position = this.top_position;
		CREATE_POSITION[this.div_id].c_css =this.c_css ;
	}
	
	cre_position.prototype.cre_div = function(){
		
		var div_id  =  this.div_id;
		var cre_td = document.getElementById(div_id);
		CREATE_POSITION[div_id].cre_div = document.createElement('div');
		CREATE_POSITION[div_id].cre_div.id = 'child_div_'+COUNT;		
		cre_td.appendChild(CREATE_POSITION[div_id].cre_div);		
		//CREATE_POSITION[div_id].cre_div.style.border="1px solid #ffcc00";
		document.getElementById('child_div_'+COUNT).style.cssText='vertical-align:middle;text-align:center;width:20px;height:20px;position:absolute';
		CREATE_POSITION[div_id].cre_div.style.left=CREATE_POSITION[div_id].left_position+'px';
		CREATE_POSITION[div_id].cre_div.style.top=''+CREATE_POSITION[div_id].top_position+'px';
	}
	
	cre_position.prototype.screen_animation=function(cont_name,moving_speed){  

		let[COUNT]=0;		
		tot_content[COUNT]=cont_name;				
		// alert(tot_content[0]);
		this.cont_name=cont_name;
		this.moving_speed = moving_speed ;	
		var div_id  =  this.div_id;			
		multiplePlace(COUNT,div_id);		
		new_interval[div_id]=setInterval('input_screen('+COUNT+')',moving_speed); 	
	}	
	
	cre_position.prototype.setonClick = function(functionName) {
	
		eventFunc('click',functionName,this.div_id);
		
	}
	
	function eventFunc(eventHandle,functionName,div_id) {
		
	
		if(window.attachEvent){		
			//IE
			document.getElementById(CREATE_POSITION[div_id].cre_div.id).attachEvent("on"+eventHandle,functionName);
		
		}else {
			
			if(window.addEventListener) {
				
				// FireFox		
				document.getElementById(CREATE_POSITION[div_id].cre_div.id).addEventListener(eventHandle,functionName,false);
			}			
		}		
	}
	

	function input_screen(count) {								
	
		var  images = new Array();  // Sample input
			
		images[count]= new Array();	
		
		images[count] = tot_content[count].split(",");
		
		input_object_length[count]=images[count].length;
		document.getElementById('img_frame'+count).innerHTML =images[count][let[count] % input_object_length[count]];		
		let[count]++ ;		
	}
	
	function multiplePlace(count,div_id) {		
		
		CREATE_POSITION[div_id].imageCount ='<div   class="__position_div"   id="img_frame'+count+'" name="img_frame'+count+'" style="position:absolute;font-size:15px;"> </div>';			
		document.getElementById('child_div_'+count).innerHTML=CREATE_POSITION[div_id].imageCount;
		
	}	
	
	function handleClick1(){
		
		alert('..');
		document.location.href="clientle.html";
		
	}
	
	
