window.onload = function(){
	var bn = Math.floor($("#big_image_cl")[0].scrollLeft/1080);
	var bm = $("#banner_slider_cl div")[bn];
	var ca = new customAni(bm);
	// Start Banner Transitions
	startSlider();
	  //Start Pointer Focus Rotations
  	startPointerRotation();
  	// Bind onclick function to unfocused "Dots"
  	  	$(".greybox_dot_off").click(function(){moveByDot(this);});
 // 	Bind mouseover to hidden TD grid over banner for nugging effect
//	  $("#banner_view_frame_cl td").mouseover(function(){
//		  var col = ($(this).parent("tr").children().index(this))+1;
//		  var row = ($(this).parent("tr").parent("tbody").children().index($(this).parent("tr")))+1;
//		  var movement = 10;
//		  ml = Math.ceil((((10-col)/10)*movement)-160);
//		  mt = Math.ceil((((6-row)/6)*movement)-20);
//		  var bn = Math.floor($("#big_image_cl")[0].scrollLeft/1080);
//		  var bm = $("#banner_slider_cl div")[bn];
//		  ca.e = bm;
//		  ca.stop();
//		  ca.nudgeFloat(ml,mt,1250);
//		  $(bm).stop(true, true).animate({backgroundPosition: ml+"px "+mt+"px"},40); 
//	  });
	  // Bind onclick to show and hide dropdown menu onclick
		$('#red_top_right_button').click(function(){
			if($(this).hasClass('loco_br')){
  				redirectForCountrySearch2('United Kingdom');
  			}else if($(this).hasClass('loco_po')){
  				window.location = "/location/webregion/brasil";
  			}else{
				$('#agonline').hide();
				var f = $("#find_center");
				showDropDown(this,f,false);
  			}
		});
		
// Bind onclick to show and hide dropdown menu onclick
		$('#black_top_right_button').click(function(){
			$('#find_center').hide();
			var f = $("#agonline");
			showDropDown(this,f,false);
		});
	// Bind onclick to pointers for Scissor Open Visulation
	  $(".pointer").click(function(){
		  clearInterval(slider);
		  var e = $("#"+this.id+"_dropper");
		  $(e).css({
			"width":"0px",	  
			"height":"0px",	  
			"display":"block",
			"left": (this.offsetLeft+25)+"px",
			"top": this.offsetTop+"px"
		  });
		  var o = this;
		  var pi = setInterval(function(){
			  scissorOpen(e[0],10,o.offsetLeft-213,238,86,pi);
		  },50);
	  });
	// Bind onclick to droppers for Scissor Open Visulation
	  $(".dropper").click(function(){
		  var e = this;
		  var n = e.offsetLeft+184;
		  var pi = setInterval(function(){
			  scissorClose(e,15,n,238,86,pi);
		  },50);
	  });
		$(".tab").click(function(){
			var e = $(this.parentNode).children('.active');
			var tmp = e[0].innerHTML;
			tmp = $.trim(tmp);
			tmp = tmp.toLowerCase();
			tmp = tmp.replace(/ /g,'_');
			tmp = tmp.replace(/[^a-z]/ig,'');
			tmp = "tk_"+tmp;
			$("#"+tmp).hide();
			e.removeClass('active');
			$(this).addClass('active');
			var tmp = this.innerHTML;
			tmp = $.trim(tmp);
			tmp = tmp.toLowerCase();
			tmp = tmp.replace(/ /g,'_');
			tmp = tmp.replace(/[^a-z]/ig,'');
			tmp = "tk_"+tmp;
			$("#"+tmp).show();
		});
		bufferSet();
		checkForScale();
}
