		var s_mode_agence = "visu"; 
		function getModeAgence() 
		{// fonction appel?e par Virtools au d?marage de l'application pour savoir dans quel mode le vmo doit s'?x?cuter

		// les modes peuvent ?tre pour l'instant "edit" (pour l'outil de mise ? jour) 
			//ou "visu" (visualisation pour utilisateur lambda)
			setModeAgence(s_mode_agence); 
		}
		function setModeAgence(s_mode)
		{
			s_mode_agence = s_mode;
			//Objet qui va recevoir l'attribut
			var s_dest = "Level";
			// nom de l'atttribut
			var s_attribut = "modeAgence"; 
			//Affectation de l'attribut
			setAttribut(s_dest,s_attribut,s_mode); 
			// Call this function to count 3D access successful
			count3D();
		}

	function setAttribut(s_destinataire,s_attribut,s_valeur) 
	{// fonction d'affectation d'un attribut "s_attribut" de  valeur "s_valeur" pour un objet "s_destinataire"
		
		// Commande virtools d'affectation d'attribut
		var cmd = "SetAttribute '" + s_destinataire + "' '"+ s_attribut +"' '" + s_valeur + "' "; 
		// Envoie de la commande "cmd" a l'objet HTML "Virtools"
		virtoolsDoCommand(cmd); 
	}
	function getAttribut(s_destinataire,s_attribut) 
	{// fonction d'affectation d'un attribut "s_attribut" de  valeur "s_valeur" pour un objet "s_destinataire"
		
		// Commande virtools d'affectation d'attribut
		var cmd = "GetAttribute '" + s_destinataire + "' '"+ s_attribut + "' "; 
		// Envoie de la commande "cmd" a l'objet HTML "Virtools"
		return virtoolsDoCommand(cmd); 
	}
	function virtoolsDoCommand(cmd)
	{//fonction qui permet d'executer toute les commandes interpretables par le plugin Virtools
	
		// Recuperation de l'objet HTML virtools
		var virtoolsObject = document.getElementById('Virtools');
		if (virtoolsObject != null)
		{
			try
			{
				//Envoie de la commande
				return virtoolsObject.DoCommand(cmd);
			}
			catch (ex)
			{
				//alert(virtoolsObject.readyState + '\n' + virtoolsObject.codeBase);
			}
		}
	}
	function askUpdatePanneau(ID) // fonction appelee par Virtools pour specifier qu'un panneau a ete selectionne pour une modification dans l'outils de mise a jour
	{
		try
		{
			//document.getElementById('virtoolsName').value = ID;
			//affichage du d?tail du panneau dans la fenetre RIA
			//document.getElementById('frameFlex').contentWindow.document.getElementById('AgenceVirtuelleLoader').selectPanel(ID);
		}
		catch (ex)
		{
		}
	}
	function updatePanneaux(cmd, idPanneau)
	{	
			//OLD//<update><LA01><3><3><pan 01><http://ktd.club.fr/programmation/images/mozodojo-original-image.jpg><pan 02><http://www.insu.cnrs.fr/ib815,image-une-eruption-solaire-prise-avec-instrument-eit-installe-bord-satellite-soho-esa-nasa.jpg><pan 03><http://www.lactamme.polytechnique.fr/Mosaic/images/SOLE.31.0512.D/image.jpg>
			
			//NEW//<update><LA01><1><1><Mon nom de contenu><http://www.lactamme.polytechnique.fr/Mosaic/images/SOLE.31.0512.D/image.jpg><La terre>
			
			//var ID = "h_o3D_ad_mob_tDyn_ani_int_001_pub_02"; //Il faut ajouter un l'ID de panneau en param?tre de cette fonction a lieu de le mettre en dur ici

			if (cmd == null) { cmd = document.getElementById('commande').value; }

			setAttribut(idPanneau, "infoPanneau", cmd);  
			
			virtoolsDoCommand("ActivateScript '"+ idPanneau +"' 'scpO_dyn_downoadAndAfficheTexture' '1'");
	}
	function getInfo(ID)
	{
		}
	function UpdateMode()	
	{	
		var s_mode
		if(document.getElementById('visuID').checked == true)
		{
			s_mode= "visu";
		}
		else
		{
			s_mode = "edit";
		}
		setModeAgence(s_mode); 	
	}
	function showFrame(ID)
	{
		var contentUrl = window.top.document.getElementById('frameFlex').contentWindow.document.getElementById('AgenceVirtuelleLoader').getContentUrl(ID);
		var contentTarget = window.top.document.getElementById('frameFlex').contentWindow.document.getElementById('AgenceVirtuelleLoader').getContentTarget(ID);

		//Les panneaux de la zone MIB contienent une video 
		if ((ID == "o3D_ad_mob_tDyn_int_001_MIB_01") ||
			(ID == "o3D_ad_mob_tDyn_int_001_MIB_02") ||
			(ID == "o3D_ad_mob_tDyn_int_001_MIB_03") ||
			(ID == "o3D_ad_mob_tDyn_int_001_MIB_04"))
		{
			//setAttribut(ID, "video_URL", contentUrl);
			var urlPlayer = "./flvplayer.html?flv="+escape(contentUrl);
			showFrameUrl(urlPlayer, contentTarget, 800, 600);
		}
		else
		{
			showFrameUrl(contentUrl, contentTarget, 1024, 2048);
		}
	}
	function showFrameUrl(contentUrl, contentTarget, width, height)
	{
			//alert(contentTarget);
			if (contentTarget == "popup")
			{
				openInternalPopup(contentUrl, width, height, 30, 30);
			}
			else
			{
				window.open(contentUrl);
			}
	}
	function openInternalPopup(url, width, height, marginWidth, marginHeight)
	{
		// Pause the 3D
		pause();
		// Hide the 3D (only for Firefox because the 3D would always appear over the popup)
		if ((navigator.appName == "Netscape") || (navigator.appName == "Opera")) 
		{
			if (document.getElementById("Virtools") != null)
			{
				document.getElementById("Virtools").style.visibility = "hidden";
			}
			
			if (document.getElementById("Agence2D") != null)
			{
				document.getElementById("Agence2D").style.visibility = "hidden";
			}
			
			if (document.getElementById("AVBFlex") != null)
			{
				document.getElementById("AVBFlex").style.visibility = "hidden";
				
			}
		}

		var winWidth = 0;
		var winHeight = 0;
		var scrollX = 0;
		var scrollY = 0;
		if( typeof( window.innerWidth ) == 'number' ) {
		    //Non-IE
		    winWidth = window.innerWidth;
		    winHeight = window.innerHeight;
		} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
		    //IE 6+ in 'standards compliant mode'
		    winWidth = document.documentElement.clientWidth;
		    winHeight = document.documentElement.clientHeight;
		} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		    //IE 4 compatible
		    winWidth = document.body.clientWidth;
		    winHeight = document.body.clientHeight;
		}
		if( typeof( window.pageYOffset ) == 'number' ) {
		    //Netscape compliant
		    scrollX = window.pageXOffset;
		    scrollY = window.pageYOffset;
		} else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
		    //DOM compliant
		    scrollX = document.body.scrollLeft;
		    scrollY = document.body.scrollTop;
		} else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
		    //IE6 standards compliant mode
		    scrollX = document.documentElement.scrollLeft;
		    scrollY = document.documentElement.scrollTop;
		}

		var popupWidth = width;
		if (popupWidth > winWidth - marginWidth*2) { popupWidth = winWidth - marginWidth*2; }
		var popupHeight = height;
		if (popupHeight > winHeight - marginWidth*2) { popupHeight = winHeight - marginWidth*2; }

		document.getElementById('framePopupNiv2').style.width = popupWidth+'px';
		document.getElementById('framePopupNiv2').style.height = popupHeight+'px';
		document.getElementById('framePopupNiv2').style.left = ((winWidth - popupWidth)/2 + scrollX)+'px';
		document.getElementById('framePopupNiv2').style.top = ((winHeight - popupHeight)/2 + 14 + scrollY)+'px';
		document.getElementById('framePopupNiv2').src = url;

		// Positionnement de la frame de fermeture
		document.getElementById('frameClosePopupNiv2').style.width = (popupWidth+4)+'px';
		document.getElementById('frameClosePopupNiv2').style.height = (popupHeight+30)+'px';
		document.getElementById('frameClosePopupNiv2').style.left = ((winWidth - popupWidth)/2 - 2 + scrollX)+'px';
		document.getElementById('frameClosePopupNiv2').style.top = ((winHeight - popupHeight)/2 - 14 + scrollY)+'px';
		//document.getElementById('frameClosePopupNiv2').src = "popup.html";
	}

	function closeInternalPopup()
	{
		document.getElementById('framePopupNiv2').src = "about:blank";
		document.getElementById('framePopupNiv2').style.width = '0px';
		document.getElementById('framePopupNiv2').style.height = '0px';
		document.getElementById('framePopupNiv2').style.left = '0px';
		document.getElementById('framePopupNiv2').style.top = '0px';

		// Positionnement de la frame de fermeture
		document.getElementById('frameClosePopupNiv2').style.width = '0px';
		document.getElementById('frameClosePopupNiv2').style.height = '0px';
		document.getElementById('frameClosePopupNiv2').style.left = '0px';
		document.getElementById('frameClosePopupNiv2').style.top = '0px';
		//document.getElementById('frameClosePopupNiv2').src = "popup.html";

		// Play the 3D
		play();
		// Show the 3D (only for Firefox)
		if (document.getElementById("Virtools"))
		{
			if ((navigator.appName == "Netscape") || (navigator.appName == "Opera"))
			{
				document.getElementById("Virtools").style.visibility = "visible";
			}			
			
			// Focus on the 3D
			document.getElementById("Virtools").focus();
		}
		
		if (document.getElementById("Agence2D"))
		{
			if ((navigator.appName == "Netscape") || (navigator.appName == "Opera"))
			{
				document.getElementById("Agence2D").style.visibility = "visible";
			}			
			
			// Focus on the 3D
			document.getElementById("Agence2D").focus();
		}
		
		if (document.getElementById("AVBFlex"))
		{
			if ((navigator.appName == "Netscape") || (navigator.appName == "Opera"))
			{
				document.getElementById("AVBFlex").style.visibility = "visible";
			}			
			
			// Focus on the 3D
			document.getElementById("AVBFlex").focus();
		}
	}

	function goToObject(objectId)
	{
		var ID = objectId;
		setAttribut("cam_mob_rep_interpolationcible_001","interpolationCible",ID);
		virtoolsDoCommand("ActivateScript '"+ "h_f3D_nav_mob_subCam_001" +"' 'scpO_Interpolation_cam_mob_sub_principale' '1'");
	}
	function pause()
	{
		if (document.getElementById("Virtools") != null)
		{
			virtoolsDoCommand("Pause");
		}
		else if (document.getElementById("Agence2D") != null)
		{
			document.getElementById("Agence2D").setPause(true);
		}
		else if (document.getElementById("AVBFlex") != null)
		{
			document.getElementById("AVBFlex").setPause(true);
		}
	}
	function play()
	{
		if (document.getElementById("Virtools") != null)
		{
			virtoolsDoCommand("Play");
		}
		else if (document.getElementById("Agence2D") != null)
		{
			document.getElementById("Agence2D").setPause(false);
		}
		else if (document.getElementById("AVBFlex") != null)
		{
			document.getElementById("AVBFlex").setPause(false);
		}
	}
	function searchForID(id)
	{
		for (i=0;i<panneaux.length;i++)
		{
			if (id == panneaux[i].id)
			{
				return "<update><LA01><1><1><"+panneaux[i].titre+"><"+panneaux[i].img+"><"+panneaux[i].comment+">";
			}
		}
		return null;
	}
	function getSoundInfo()
	{	
		setAttribut("Level","soundInfo",soundInfo);
	}
	function getInfoNmo()
	{
		//This function is called by virtools to know where, how many and who are nmo.
		//Synthax: <NMO directory URL ><number of Nmo><name1.nmo><name2.nmo><name3.nmo><name4.nmo> ........
		//alert("JS:Oui");
		setAttribut("Level","infoNmo",nmoInfo);
	}
	function setList_tDyn(list)
	{
		//This function is called by virtools to send the list of the dynamical texture object.
		//This list is send in parameter of the function
		//Synthax: ID1;ID2;ID3;ID4;ID5 ........
		//alert("liste : " + list);

		// Envoi de la liste des panneaux ? l'application Flex
		window.top.document.getElementById('frameFlex').contentWindow.document.getElementById('AgenceVirtuelleLoader').setListePanneaux(list);

		// Ajout d'un appel ? une fonction Flex permettant d'avertir que le Virtools est pr?t ? communiquer
		window.top.document.getElementById('frameFlex').contentWindow.document.getElementById('AgenceVirtuelleLoader').setVirtoolsReady();
	}
	function resetTextures()
	{
		virtoolsDoCommand("ActivateScript '"+ "GP_tDyn" +"' 'scpO_reset_tDyn' '1'");
	}
	function getInfoHelp() //This fonction is called by virtools to know where is the help file
	{
	
		setAttribut("Level","infoHelpFile",pathBase+"/help.txt");
	}
	
	function loadVirtools()
	{
		setAttribut("Level", "GO", "true");
		if (getAttribut("Level", "GO") == "true")
		{
			//GESTION DU FOCUS//
			document.getElementById('Virtools').onfocus = function(){FocusOn3D();};

			if( (navigator.userAgent.indexOf("MSIE 7") != -1) || (navigator.userAgent.indexOf("MSIE 6") != -1) || (navigator.userAgent.indexOf("MSIE 8") != -1) ) 
			{																																																															
				document.getElementById('Tableau_01').onclick = function(){FocusOnPage();};
				window.onfocus = function(){FocusOnPage();}; 	
			}
			else if( (navigator.userAgent.indexOf("Firefox/2") != -1) || (navigator.userAgent.indexOf("Firefox") != -1) || (navigator.userAgent.indexOf("Netscape/7") != -1) || (navigator.userAgent.indexOf("Netscape") != -1) || (navigator.userAgent.indexOf("Safari") != -1) )
			{		
				document.getElementById('Virtools').onblur = function(){FocusOnPage();};
			}
			
			document.getElementById('frameAuth').onfocus = function(){FocusOnPage();}; 
			
			document.getElementById("Virtools").focus();
		}
		else
		{
			// Virtools pas encore pret : reessayer
			setTimeout(function() { loadVirtools(); }, 500);
		}
	}

	function setBackground()
	{	
		Mozilla_Plugin_NotInstalled = "<p align='center' style='margin-top:-160px'><font face='Arial, Helvetica, sans-serif'><strong><font color='#FFFFFF' size='big'>L'acc&#232;s &#224; Breizh Banque n&#233;cessite l'installation du plugin s&#233;curis&#233; 3DVia Player.<br/>Pour proc&#233;der &#224; l'installation (unique et rapide), cliquez sur l'image ci-dessous <br/>pour t&#233;l&#233;charger le plugin, et suivez les <a style='color:orange' target=\"_blank\" href=\"" + pathBase3D + "/aidevirtools.html\">instructions disponibles ici</a>. </font></strong></font> <font size='5'> <br></font>";         
		err_object_embed_failed = "<p align='center'><font face='Arial, Helvetica, sans-serif'><strong><font color='white' size='big'>L'acc&#232;s &#224; Breizh Banque n&#233;cessite l'installation du plugin s&#233;curis&#233; 3DVia Player.<br/>Pour proc&#233;der &#224; l'installation (unique et rapide), cliquez sur la barre Active X <br>en haut de l'&#233;cran et suivez les <a style='color:orange' target=\"_blank\" href=\"" + pathBase3D + "/aidevirtools.html\">instructions disponibles ici</a>.</font></strong></font><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>&nbsp;</p>";
		
		if( (navigator.userAgent.indexOf("MSIE 7") != -1) || (navigator.userAgent.indexOf("MSIE 6") != -1) || (navigator.userAgent.indexOf("MSIE 8") != -1) ) 
		{																																																															
			window.top.document.getElementById("tdVirtools").background = "images/attente_plugin.jpg";
		}
		else 
		{		
			window.top.document.getElementById("tdVirtools").style.backgroundImage= "url(./images/attente_plugin.jpg)" ;
		}
	}
	function FocusOnPage()
	{	
		
		var ObjectName = "f3D_focusReceiver_001";
		var AttributeName = "focusState";
		var value = "false";
		
		setAttribut(ObjectName,AttributeName,value);
		virtoolsDoCommand("ActivateScript '"+ ObjectName +"' 'scpO_f3D_focusReceiver_001' '1'");				
	}
	function FocusOn3D()
	{	
		
		var ObjectName = "f3D_focusReceiver_001";
		var AttributeName = "focusState";
		var value = "true";
		
		setAttribut(ObjectName,AttributeName,value);
		virtoolsDoCommand("ActivateScript '"+ ObjectName +"' 'scpO_f3D_focusReceiver_001' '1'");				
	}

function count3D()
{
var sc_project=5352602; 
var sc_invisible=1; 
var sc_partition=57; 
var sc_click_stat=1; 
var sc_security="98dddc30"; 
var sc_width=screen.width;var sc_height=screen.height;var sc_referer=""+document.referrer;try{sc_referer=""+parent.document.referrer}catch(ex){sc_referer=""+document.referrer}var sc_unique=0;var sc_returning=0;var sc_returns=0;var sc_error=0;var sc_remove=0;var sc_cls=-1;var sc_inv=0;var sc_os="";var sc_title="";var sc_url="";var sc_base_dir="";var sc_click_dir="";var sc_link_back_start="";var sc_link_back_end="";var sc_security_code="";var sc_http_url="http";var sc_host="statcounter.com";if(window.sc_invisible){if(window.sc_invisible==1){sc_inv=1}}if(window.sc_click_stat){sc_cls=window.sc_click_stat}if(window.sc_https){if(sc_https==1){sc_doc_loc=''+document.location;myRE=new RegExp("^https","i");if(sc_doc_loc.match(myRE)){sc_http_url="https"}}}if(window.sc_local){sc_base_dir=sc_local}else{if(window.sc_partition){if(sc_cls==-1&&sc_partition==3){sc_cls=1}var sc_counter="";if(window.sc_partition!=34&&sc_partition<=45){sc_counter=sc_partition+1}sc_base_dir=sc_http_url+"://c"+sc_counter+"."+sc_host+"/"}else{sc_base_dir=sc_http_url+"://c1."+sc_host+"/"}}sc_click_dir=sc_base_dir;if(window.sc_text){sc_base_dir+="text.php?"}else{sc_base_dir+="t.php?"}if(window.sc_project){sc_base_dir+="sc_project="+sc_project}else if(window.usr){sc_base_dir+="usr="+usr}else{sc_error=1}if(window.sc_remove_link){sc_link_back_start="";sc_link_back_end=""}else{sc_link_back_start="<a class=\"statcounter\" href=\"http://www."+sc_host+"\" target=\"_blank\">";sc_link_back_end="<\/a>"}sc_date=new Date();sc_time=sc_date.getTime();sc_time_difference=3600000;sc_title=""+document.title;sc_url=""+document.location;sc_referer=sc_referer.substring(0,255);sc_title=sc_title.substring(0,150);sc_url=sc_url.substring(0,150);sc_referer=escape(sc_referer);if(encodeURIComponent){sc_title=encodeURIComponent(sc_title)}else{sc_title=escape(sc_title)}sc_url=escape(sc_url);if(window.sc_security){sc_security_code=sc_security}if(sc_script_num){sc_script_num++}else{var sc_script_num=1}var sc_tracking_url=sc_base_dir+"&resolution="+sc_width+"&h="+sc_height+"&camefrom="+sc_referer+"&u="+sc_url+"&t="+sc_title+"&java=1&security="+sc_security_code+"&sc_random="+Math.random()+"&sc_snum="+sc_script_num;var sc_clstr="<span class=\"statcounter\">";var sc_cltext="\" alt=\"StatCounter - Free Web Tracker and Counter\" border=\"0\">";var sc_strout=sc_clstr+sc_link_back_start+"<img src=\""+sc_tracking_url+sc_cltext+sc_link_back_end+"</span>";if(sc_error==1){document.writeln("Code corrupted. Insert fresh copy.")}else if(sc_remove==1){}else{if(sc_inv==1){if(window.sc_call){sc_call++}else{sc_call=1}eval("var sc_img"+sc_call+" = new Image();sc_img"+sc_call+".src = \""+sc_tracking_url+"&invisible=1\"")}else if(window.sc_text){document.writeln('<scr'+'ipt language="JavaScript"'+' src='+sc_tracking_url+"&text="+sc_text+'></scr'+'ipt>')}else{document.writeln(sc_strout)}}if(sc_cls>0){if(clickstat_done!=1){var clickstat_done=1;var clickstat_project=window.sc_project;var clickstat_security=window.sc_security_code;var dlext="7z|aac|avi|csv|doc|exe|flv|gif|gz|jpe?g|js|mp(3|4|e?g)|mov|pdf|phps|png|ppt|rar|sit|tar|torrent|txt|wma|wmv|xls|xml|zip";if(typeof(window.sc_download_type)=='string'){dlext=window.sc_download_type}var ltype="https?|ftp|telnet|ssh|ssl|mailto";var second="ac|co|gov|ltd|me|mod|net|nic|nhs|org|plc|police|sch|com";var dl=new RegExp("\\.("+dlext+")$","i");var lnk=new RegExp("^("+ltype+"):","i");var domsec=new RegExp("\^("+second+")$","i");var host_name=location.host.replace(/^www\./i,"");var host_splitted=host_name.split(".");var domain=host_splitted.pop();var host_split=host_splitted.pop();if(domsec.test(host_split)){domain=host_split+"."+domain;host_split=host_splitted.pop()}domain=host_split+"."+domain;var lnklocal_mask="^https?:\/\/(.*)"+domain;var lnklocal=new RegExp(lnklocal_mask,"i");if(document.getElementsByTagName){var anchors=document.getElementsByTagName('a');for(var i=0;i<anchors.length;i++){var anchor=anchors[i];if(anchor.onmousedown){var original_click=anchor.onmousedown;var s=original_click.toString().split("\n").join(" ");var bs=s.indexOf('{');var head=s.substr(0,bs);var ps=head.indexOf('(');var pe=head.indexOf(')');var params=head.substring(ps+1,pe);var plist=params.split(",");var body=s.substr(bs+1,s.length-bs-2);var insert="sc_clickstat_call(this,'"+sc_click_dir+"');";var final_body=insert+body;var ev_head="new Function (";var ev_params="";var ev_sep="";for(var sc_i=0;sc_i<plist.length;sc_i++){ev_params=ev_sep+"'"+plist[sc_i]+"'";ev_sep=","}if(ev_sep==","){ev_params+=","}var ev_foot="final_body);";var ev_final=ev_head+ev_params+ev_foot;anchor.onmousedown=eval(ev_final)}else{anchor.onmousedown=new Function("event","sc_clickstat_call(this,'"+sc_click_dir+"');return true;")}}}function sc_none(){return}function sc_delay(){var d=typeof(window.sc_delay)!="undefined"?sc_delay:250;var n=new Date();var t=n.getTime()+d;while(n.getTime()<t){var n=new Date()}}function sc_clickstat_call(adata,sc_click_dir){if(adata){var clickmode=0;if(lnk.test(adata)){if((lnklocal.test(adata))){if(dl.test(adata)){clickmode=1}else{if(sc_cls==2){clickmode=2}}}else{clickmode=2}}if(clickmode!=0){var sc_link=escape(adata);if(sc_link.length>0){var sc_req=sc_click_dir+"click.gif?sc_project="+clickstat_project+"&security="+clickstat_security+"&c="+sc_link+"&m="+clickmode+"&u="+sc_url+"&t="+sc_title+"&rand="+Math.random();var sc_req_image=new Image();sc_req_image.onload=sc_none;sc_req_image.src=sc_req;sc_delay()}}}}var sc_gsyn_pattern='googlesyndication\.com|ypn-js\.overture\.com|ypn-js\.ysm\.yahoo\.com|googleads\.g\.doubleclick\.net';var sc_px;var sc_py;function sc_adsense_click(sc_data){var sc_link=escape(sc_data.src);var i=new Image();var sc_req=sc_click_dir+"click.gif?sc_project="+clickstat_project+"&security="+clickstat_security+"&c="+sc_link+"&m=2&u="+sc_url+"&t="+sc_title+"&rand="+Math.random();i.src=sc_req;sc_delay()}function sc_adsense_init(){if(document.all&&typeof window.opera=="undefined"){var el=document.getElementsByTagName("iframe");for(var i=0;i<el.length;i++){if(el[i].src.match(sc_gsyn_pattern)){el[i].onfocus=function(){sc_adsense_click(this)}}}}else{if(typeof window.addEventListener!="undefined"){window.addEventListener("unload",sc_exitpage,false);window.addEventListener("mousemove",sc_getmouse,true)}}}if(typeof window.addEventListener!='undefined'){window.addEventListener('load',sc_adsense_init,false)}else{if(typeof document.addEventListener!='undefined'){document.addEventListener('load',sc_adsense_init,false)}else{if(typeof window.attachEvent!='undefined'){window.attachEvent('onload',sc_adsense_init)}else{if(typeof window.onload=='function'){var sc_existing=onload;window.onload=function(){sc_existing();sc_adsense_init()}}else{window.onload=sc_adsense_init}}}}function sc_getmouse(e){if(typeof e.pageX=="number"){sc_px=e.pageX;sc_py=e.pageY}else{if(typeof e.clientX=="number"){sc_px=e.clientX;sc_py=e.clientY;if(document.body&&(document.body.scrollLeft||document.body.scrollTop)){sc_px+=document.body.scrollLeft;sc_py+=document.body.scrollTop}else{if(document.documentElement&&(document.documentElement.scrollLeft||document.documentElement.scrollTop)){sc_px+=document.documentElement.scrollLeft;sc_py+=document.documentElement.scrollTop}}}}}function sc_findy(obj){var y=0;while(obj){y+=obj.offsetTop;obj=obj.offsetParent}return(y)}function sc_findx(obj){var x=0;while(obj){x+=obj.offsetLeft;obj=obj.offsetParent}return(x)}function sc_exitpage(e){ad=document.getElementsByTagName("iframe");if(typeof sc_px=="undefined"){return}for(i=0;i<ad.length;i++){var adLeft=sc_findx(ad[i]);var adTop=sc_findy(ad[i]);var adW=parseInt(adLeft)+parseInt(ad[i].width)+15;var adH=parseInt(adTop)+parseInt(ad[i].height)+10;var inFrameX=(sc_px>(adLeft-10)&&sc_px<adW);var inFrameY=(sc_py>(adTop-10)&&sc_py<adH);if(inFrameY&&inFrameX){if(ad[i].src.match(sc_gsyn_pattern)){sc_adsense_click(ad[i])}}}}}}}
