/* Developer: Ashok Kumar Gupta */
	/* This function work only with div block */
	/* Copyright @ Warner / Chappall Music */
	// Declaring global variables
	var _width;
	var _height;
	// Checking whether animation is ready or not
	var animainready = false;
	// This is for Interval ID
	var aniTime;
	// Highlight animation ten times
	var maxtentime = 0;
	function highlightBlock(obj){
		// Intially when the page loads we need to check whether seInterval is cleared or not
		clearInterval(aniTime);
		var initHeight = 0;
		// Is CMS access is permissible or not
		if(isCMSAccess == false || isIE6) return;
		var h_obj = document.getElementById(obj);
		// Top Position of the reference element
		var initTop;
		var initLeft;
		var top;
		// Verifying initLeft specific to browser
		if(isIE){
			if(arguments[2] == undefined){ 
				initTop = 385; 
				initLeft = ((document.documentElement.clientWidth - 965)/2);
			}
			else
			{ 
				initTop = 385 + arguments[2] - 35; 
				initLeft = ((document.documentElement.clientWidth - 982)/2);	
			}
		}
		
		else{
			if(arguments[2] == undefined){ initTop = 383; }else{initTop = arguments[2];}
			initLeft = 0;
			//initTop = 383;
		}
		if(h_obj!=null &&  h_obj != 'undefined'){
			top = h_obj.offsetTop + initTop;
			// Top Position of the reference object
			left = h_obj.offsetLeft + initLeft;
			// width of the refrence object 
			_width = h_obj.offsetWidth;
			// height of the refrence element 
			if(arguments[1] == undefined){ initHeight = 0; }else{ initHeight = arguments[1];}
			_height = Number(h_obj.offsetHeight) + Number(initHeight);
			// These are four side highlight object
			var dot1;
			var dot2;
			var dot3;
			var dot4;
			// Positioning highlight object
			a_obj = document.getElementById('dotted_highlight');
			a_obj.style.top = (top)+"px";
			a_obj.style.left = (left+ -2) + "px";
			a_obj.style.width = _width + 4 + "px";
			a_obj.style.height = _height + 5 + "px";
			
			for (var i=0; i<a_obj.childNodes.length; i++)
			{		
				// Now validating the DOM object and if it is div then need to assign style
				if (a_obj.childNodes[i].nodeName.toLowerCase() == 'div'){
					
					if(isIE){
						dot1 = a_obj.childNodes[0];
						dot1.style.left = (_width + 2)  + "px";
						dot2 = a_obj.childNodes[1];
						dot2.style.left = 0+ "px";
						dot3 = a_obj.childNodes[2];
						dot3.style.top = 0 + "px";
						dot4 = a_obj.childNodes[3];
						dot4.style.top = (_height + 3) + "px";
						
					}// if end
					else{
						dot1 = a_obj.childNodes[1];
						dot1.style.left = (_width + 2)  + "px";
						dot2 = a_obj.childNodes[3];
						dot2.style.left = 0+ "px";
						//dot2.style.top = "-40px";
						dot3 = a_obj.childNodes[a_obj.childNodes.length - 4];
						dot3.style.top = 0 + "px";
						dot4 = a_obj.childNodes[a_obj.childNodes.length-2];
						dot4.style.top = (_height + 3) + "px";
					
					}// else end
				}// if end
				if(i === a_obj.childNodes.length -1){
					a_obj.style.display = "block";
					readytoAnimate(dot1,dot2,dot3,dot4);
					//alert(dot1);
					//
					return; 
				}
			}// For end
		}
	}	
	function readytoAnimate(ll,lf,tf,tl){
		aniTime = setInterval(function() {nowAnimateMarkUp(ll,lf,tf,tl)}, 100);
	}
	function nowAnimateMarkUp(ll,lf,tf,tl){
		if(maxtentime <= 10){
			ll.style.top = Number(ll.offsetTop) - 2 + "px";
			lf.style.top = Number(lf.offsetTop) + 2 + "px";
			tf.style.left = Number(lf.offsetTop) - 2 + "px";
			tl.style.left = Number(lf.offsetTop) + 2 + "px";
			maxtentime++;
		}else{
			ll.style.top = "0px";
			lf.style.top = "-23px";
			tf.style.left = "-4px";
			tl.style.left = "-16px";
			maxtentime = 0;
		}
	}
