//version special HP
	var BannerArray=new Array();
//	BannerArray[0]=new Array(2);
//	BannerArray[0][0]='IdOfBanner1';
//	BannerArray[0][1]='banner name for analytics';
//	BannerArray[1]=new Array(2);
//	BannerArray[1][0]='IdOfBanner2';
//	BannerArray[1][1]='banner2 name for analytics';
	
	function initFlash(arr){
		var ua = window.navigator.userAgent;
		var curFlash;
					
		for (var i=0; i<arr.length; i++){
			try{
				curFlash = document.getElementById(arr[i][0]);
				if( ua.indexOf("MSIE")==-1 && curFlash.getElementsByTagName('embed')) 
					if(curFlash.getElementsByTagName('embed')[0] != undefined)
						curFlash = curFlash.getElementsByTagName('embed')[0];
				if (curFlash !=null && curFlash != undefined)
					arr[i][2] = findPos(curFlash)
			}catch(err){}
		}
		
		document.getElementsByTagName('body')[0].onmousedown=function(q){
			var pSeoPage;
			if (document.getElementById("seoPage").value == undefined)
				pSeoPage = location.href ;
			else
				pSeoPage = document.getElementById("seoPage").value;
			var mousePos = getCursorPosition(q);
			for(var i=0; i<=arr.length; i++){
				try{
					var curPos=arr[i][2];
					var d=(mousePos.x>=curPos.left && mousePos.x<=curPos.left+curPos.width);
					var c= (mousePos.y>=curPos.top && mousePos.y<=curPos.top+curPos.height)
				}catch(err){}
				try{
					if(d && c){
					_gaq.push(['_trackEvent', 'Clicks', arr[i][1], pSeoPage]);
					if(arr[i][0]=='BannerCenter')
						_gaq.push(['_trackPageview','/fp/?Page=HP&Pos=Center_Top&Type=Main_banner&Label='+arr[i][1]]);
					else if(arr[i][0]=='SubNetex')
						_gaq.push(['_trackPageview','/fp/?Page=HP&Pos=Left_Bottom&Type=Banner&Label='+arr[i][1]+'&Location=3']);
					else if(arr[i][0]=='objAdvLeft')
						_gaq.push(['_trackPageview','/fp/?Page=HP&Pos=Left_Banner&Type=Banner&Label='+arr[i][1]]);
					break;
					}
				}catch(err){}
			}
		return true;
		}
	}

	function findPos(obj) {
		if (obj==null || obj == undefined)
			return false;
		var curleft = curtop = 0;
		var curWidth = getElementWidth(obj);
		var curHeight = getElementHeight(obj);
		while (obj) {
			curleft += obj.offsetLeft;
			curtop += obj.offsetTop;
			obj = obj.offsetParent
		}
		q={left:curleft, top:curtop, width:curWidth, height:curHeight}
		return q
	}
	
	function getElementWidth(obj) {
		if (obj==null || obj == undefined)
			return false;
	   if (typeof obj.clip !== "undefined") {
		  return obj.clip.width;
	   } else {
		  if (obj.style.pixelWidth) {
			 return obj.style.pixelWidth;
		  } else {
			 return obj.offsetWidth
		  }
	   }
	}
	
	function getElementHeight(obj) {
	   if (typeof obj.clip !== "undefined") {
		  return obj.clip.height;
	   } else {
		  if (obj.style.pixelHeight) {
			 return obj.style.pixelHeight;
		  } else {
			 return obj.offsetHeight
		  }
	   }
	}
	
	function getCursorPosition(e) {
		e = e || window.event;
		var cursor = {x:0, y:0};
		if (e.pageX || e.pageY) {
			cursor.x = e.pageX;
			cursor.y = e.pageY
		} 
		else {
			cursor.x = e.clientX + 
				(document.documentElement.scrollLeft || 
				document.body.scrollLeft) - 
				document.documentElement.clientLeft;
			cursor.y = e.clientY + 
				(document.documentElement.scrollTop || 
				document.body.scrollTop) - 
				document.documentElement.clientTop;
		}
		return cursor
	}
function addOnloadEvent(fnc){
if (fnc==undefined) return false;
  if ( typeof window.addEventListener != "undefined" ){
    window.addEventListener( "load", fnc, false );
  }
  else if ( typeof window.attachEvent != "undefined" ) {
    window.attachEvent( "onload", fnc );
  }
  else {
    if ( window.onload != null ) {
      var oldOnload = window.onload;
      window.onload = function ( e ) {
        window[fnc]();
      };
    }
    else 
      window.onload = fnc;
  }
}
addOnloadEvent(function(){ initFlash(BannerArray) });

