﻿

/*Example message arrays for the two demo scrollers*/

var pausecontent=new Array()
pausecontent[0]='<strong>REPORT RELEASED</strong><br /><img src="/img/logos/centre_mini.png" /> <strong>Guide to FDI incentives in the EU for Japanese prospective investors</strong><br /><img src="img/icons/bullet_toggle_plus.png" alt="details" class="icon" /> <a href="http://documents.eu-japan.eu/fdi/guide.pdf" title="to FDI incentives in the EU for Japanese prospective investors"><span style="text-decoration:underline">Details</span></a>'+
'<hr style="color:#CCCCCC;background-color:#CCCCCC;height:1px;" /><strong>REPORT RELEASED</strong><br /><img src="/img/logos/centre_mini.png" /><strong>Seminar</strong><br />Importance of Environmental Quality Control (EQC) for companies:<br />Insight into EU and Japan approaches<br /><img src="img/icons/bullet_toggle_plus.png" alt="details" class="icon" /> <a href="global/events/seminar-eqc-8june2010.html?year=2010" title="Seminar 8 June 2010"><span style="text-decoration:underline">Details</span></a>'+
'<hr style="color:#CCCCCC;background-color:#CCCCCC;height:1px;" /><strong>REPORT RELEASED</strong><br /><img src="/img/logos/centre_mini.png" /><strong>Seminar</strong><br />Japan-Europe Symposium on Business Reporting for Sustainability<br />Mechanisms to communicate information, including ESG/CSR, for sustainable growth<br /><img src="img/icons/bullet_toggle_plus.png" alt="details" class="icon" /> <a href="global/events/symposium-sustainability-26may2010.html?year=2010" title="Seminar 26 May 2010"><span style="text-decoration:underline">Details</span></a>';
pausecontent[1]='<strong>R&amp;D COOPERATION</strong><br /><img src="/img/logos/centre_mini.png" />Launch of <strong><br />"BILAT in Japan"</strong><br />J-BILAT is an EU-funded project for the promotion, enhancement and development of EU-Japan cooperation in RTD and Innovation. <br /><img src="img/icons/bullet_toggle_plus.png" alt="details" class="icon" /> <a href="http://www.j-bilat.eu" title="J-Bilat"><span style="text-decoration:underline">Details</span></a>'+
'<hr style="color:#CCCCCC;background-color:#CCCCCC;height:1px;" /><strong>CALLS FOR PROPOSALS</strong><br />7th  Framework programme<br />Press release by the Commissioner for Research, Innovation and Science on the FP7 calls for proposals (Brussels, 19 July 2010)<br /><img src="img/icons/bullet_toggle_plus.png" alt="details" class="icon" /> <a href="http://europa.eu/rapid/pressReleasesAction.do?reference=SPEECH/10/396&format=HTML&aged=0&language=EN&guiLanguage=en" title=""><span style="text-decoration:underline">Details</span></a>'+
'<hr style="color:#CCCCCC;background-color:#CCCCCC;height:1px;" /><img src="/img/logos/centre_mini.png" /><strong>J-Bilat 3rd Seminar</strong><br />EU-Japan collaboration in environmental technologies and sustainable management of resources<br /><span style="color:#CC0000">15th September 2010, 14:00-17:30</span><br /><img src="img/icons/bullet_toggle_plus.png" alt="details" class="icon" /> <a href="http://www.j-bilat.eu/seminar/seminar_3?l=en" title=""><span style="text-decoration:underline">Details</span></a>';
pausecontent[2]='<strong>NEXT EVENTS</strong><br />'+
'<strong>Summer School AGEING SOCIETY: Systems, Theories, Practices</strong><br />Ascoli Piceno (Italy) - 20 - 24 September 2010<br /><img src="/img/icons/bullet_toggle_plus.png" alt="details" class="icon" /><a href="http://www.csai.disco.unimib.it/CSAI/AgeingSociety-SummerSchool" target="_blank">Details</a>'+
'<hr style="color:#CCCCCC;background-color:#CCCCCC;height:1px;" /><img src="/img/logos/centre_mini.png" /> <strong>World Class R&D Seminar</strong><br />12 October 2010, Brussels, Belgium<br /><img src="/img/icons/bullet_toggle_plus.png" alt="details" class="icon" /><a href="http://www.eu-japan.eu/global/events/wcm_rd_seminar_12102010.html?year=2010" target="_blank">Details</a>'+
'<hr style="color:#CCCCCC;background-color:#CCCCCC;height:1px;" /><strong>MEET THE ICT MARKET IN BARCELONA</strong><br />The Gateway to Spain, Europe and Latin America - Inward Technological and Innovation Bridge Japan in Barcelona<br />Barcelona, Spain -  29 November - 1 December 2010<br /><img src="/img/icons/bullet_toggle_plus.png" alt="details" class="icon" /><a href="http://www.eu-japan.eu/global/events/ict-market-barcelona-event.html?year=2010"><span style="text-decoration:underline">Details</span></a>';
pausecontent[3]='<strong>NEXT TRAINING <br />FOR EU COMPANIES</strong><br /><img src="/img/logos/centre_mini.png" /><strong>5-day mission in Japan</strong> about Japanese distribution system and marketing strategy. Call for applications for <strong>Distribution & Business Practices in Japan</strong> course. <br /><span style="color:#CC0000">21 - 25 February 2011</span><br />Application deadline: <br /><span style="color:#CC0000">9 December 2010</span><br /><img src="img/icons/bullet_toggle_plus.png" alt="details" class="icon" /> <a href="global/business-training/distribution-and-business-practices.html" title="DBP"><span style="text-decoration:underline">Details</span></a>'+
'<hr style="color:#CCCCCC;background-color:#CCCCCC;height:1px;" /><img src="/img/logos/centre_mini.png" /><strong>4/5-week programme in Japan</strong> about Japanese industrial structure, business practices and management. Call for applications for <strong>HRTP-Japan Industry Insight</strong> course. <br /><span style="color:#CC0000">16 May – 10/17 June 2011</span><br />Application deadline: <br /><span style="color:#CC0000">17 February 2011</span><br /><img src="img/icons/bullet_toggle_plus.png" alt="details" class="icon" /> <a href="global/business-training/human-resources-training-programme.html" title="HRTP"><span style="text-decoration:underline">Details</span></a>';
pausecontent[4]='<strong>Vulcanus in Japan Final Reporting Session and Farewell Reception</strong><br />were held at the EU-Japan Centre in Tokyo on 26 August 2010 with 45 Vulcanus students and 24 guests from 12 host companies. The European students participating in the programme reported in Japanese about their achievements during their year in Japan.  .<br /><img src="/img/icons/bullet_toggle_plus.png" alt="details" class="icon" /><a href="http://www.eu-japan.eu/global/events/vij_farewell_26082010.html?year=2010" target="_blank">Details</a>';


var pausecontent3=new Array()

pausecontent3[0]='<strong>研究開発協力</strong><br /><img src="/img/logos/centre_mini.png" />日本におけるFP7情報サービス事業(J-BILAT)<br />J-BILATは日本-EU間の科学技術研究協力の促進、強化、発展を目的としたEU側予算によるプロジェクトです。<br /><img src="img/icons/bullet_toggle_plus.png" alt="details" class="icon" /> <a href="http://www.j-bilat.eu" title="J-Bilat"><span style="text-decoration:underline">詳細</span></a>'+
'<hr style="color:#CCCCCC;background-color:#CCCCCC;height:1px;" /><strong>欧州委員による報道発表</strong><br />「FP7の公募について」<br />（ブリュッセル、2010年7月19日）<br /><img src="/img/icons/bullet_toggle_plus.png" alt="details" class="icon" /><a href="http://europa.eu/rapid/pressReleasesAction.do?reference=SPEECH/10/396&format=HTML&aged=0&language=EN&guiLanguage=en" target="_blank">詳細</a>'+
'<hr style="color:#CCCCCC;background-color:#CCCCCC;height:1px;" /><img src="/img/logos/centre_mini.png" /><strong>J-BILAT　第3回セミナー </strong><br />「環境分野での日欧研究協力の可能性」（案）<br /><span style="color:#CC0000">2010年9月15日（水） 14:00 ～ 17:30</span><br /><img src="img/icons/bullet_toggle_plus.png" alt="details" class="icon" /> <a href="http://www.j-bilat.eu/seminar/seminar_3?l=ja" title=""><span style="text-decoration:underline">詳細</span></a>';
pausecontent3[1]='<strong>学生向け研修事業</strong><br /><img src="/img/logos/centre_mini.png" />ヴルカヌス・イン・ヨーロッパ<br />2011年4月派遣のプログラムに参加する理工系学生を募集しています。<br />募集期間:9月1日～30日<br /><img src="/img/icons/bullet_toggle_plus.png" alt="details" class="icon" /><a href="http://www.eu-japan.eu/global/vulcanus-in-europe.html" target="_blank">詳細</a>';
pausecontent3[2]='<strong>出版物</strong><br /><img src="/img/logos/centre_mini.png" />EUへの直接投資（英語）<br />海外直接投資受け入れに関するEUおよび各加盟国の政策、窓口機関等を取りまとめたガイド。2010年7月発行。<br /><img src="/img/icons/bullet_toggle_plus.png" alt="details" class="icon" /><a href="http://documents.eu-japan.eu/fdi/guide.pdf" target="_blank">詳細</a>';
pausecontent3[3]='<strong>今後のイベント</strong><br /><strong>MEET THE ICT MARKET IN BARCELONA</strong><br />The Gateway to Spain, Europe and Latin America - Inward Technological and Innovation Bridge Japan in Barcelona<br />スペイン・バルセロナ, 2010年11月29日～12月1日<br /><img src="/img/icons/bullet_toggle_plus.png" alt="details" class="icon" /><a href="http://www.eu-japan.eu/global/events/ict-market-barcelona-event.html?year=2010">詳細</a>';





/***********************************************
* Pausing up-down scroller- © Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/

function pausescroller(content, divId, divClass, delay){
this.content=content //message array content
this.tickerid=divId //ID of ticker div to display information
this.delay=delay //Delay between msg change, in miliseconds.
this.mouseoverBol=0 //Boolean to indicate whether mouse is currently over scroller (and pause it if it is)
this.hiddendivpointer=1 //index of message array for hidden div
document.write('<div id="'+divId+'" class="'+divClass+'" style="position: relative; overflow: hidden"><div class="innerDiv" style="position: absolute; width: 100%" id="'+divId+'1">'+content[0]+'</div><div class="innerDiv" style="position: absolute; width: 100%; visibility: hidden" id="'+divId+'2">'+content[1]+'</div></div>')
var scrollerinstance=this
if (window.addEventListener) //run onload in DOM2 browsers
window.addEventListener("load", function(){scrollerinstance.initialize()}, false)
else if (window.attachEvent) //run onload in IE5.5+
window.attachEvent("onload", function(){scrollerinstance.initialize()})
else if (document.getElementById) //if legacy DOM browsers, just start scroller after 0.5 sec
setTimeout(function(){scrollerinstance.initialize()}, 500)
}

// -------------------------------------------------------------------
// initialize()- Initialize scroller method.
// -Get div objects, set initial positions, start up down animation
// -------------------------------------------------------------------

pausescroller.prototype.initialize=function(){
this.tickerdiv=document.getElementById(this.tickerid)
this.visiblediv=document.getElementById(this.tickerid+"1")
this.hiddendiv=document.getElementById(this.tickerid+"2")
this.visibledivtop=parseInt(pausescroller.getCSSpadding(this.tickerdiv))
//set width of inner DIVs to outer DIV's width minus padding (padding assumed to be top padding x 2)
this.visiblediv.style.width=this.hiddendiv.style.width=this.tickerdiv.offsetWidth-(this.visibledivtop*2)+"px"
this.getinline(this.visiblediv, this.hiddendiv)
this.hiddendiv.style.visibility="visible"
var scrollerinstance=this
document.getElementById(this.tickerid).onmouseover=function(){scrollerinstance.mouseoverBol=1}
document.getElementById(this.tickerid).onmouseout=function(){scrollerinstance.mouseoverBol=0}
if (window.attachEvent) //Clean up loose references in IE
window.attachEvent("onunload", function(){scrollerinstance.tickerdiv.onmouseover=scrollerinstance.tickerdiv.onmouseout=null})
setTimeout(function(){scrollerinstance.animateup()}, this.delay)
}


// -------------------------------------------------------------------
// animateup()- Move the two inner divs of the scroller up and in sync
// -------------------------------------------------------------------

pausescroller.prototype.animateup=function(){
var scrollerinstance=this
if (parseInt(this.hiddendiv.style.top)>(this.visibledivtop+5)){
this.visiblediv.style.top=parseInt(this.visiblediv.style.top)-5+"px"
this.hiddendiv.style.top=parseInt(this.hiddendiv.style.top)-5+"px"
setTimeout(function(){scrollerinstance.animateup()}, 50)
}
else{
this.getinline(this.hiddendiv, this.visiblediv)
this.swapdivs()
setTimeout(function(){scrollerinstance.setmessage()}, this.delay)
}
}

// -------------------------------------------------------------------
// swapdivs()- Swap between which is the visible and which is the hidden div
// -------------------------------------------------------------------

pausescroller.prototype.swapdivs=function(){
var tempcontainer=this.visiblediv
this.visiblediv=this.hiddendiv
this.hiddendiv=tempcontainer
}

pausescroller.prototype.getinline=function(div1, div2){
div1.style.top=this.visibledivtop+"px"
div2.style.top=Math.max(div1.parentNode.offsetHeight, div1.offsetHeight)+"px"
}

// -------------------------------------------------------------------
// setmessage()- Populate the hidden div with the next message before it's visible
// -------------------------------------------------------------------

pausescroller.prototype.setmessage=function(){
var scrollerinstance=this
if (this.mouseoverBol==1) //if mouse is currently over scoller, do nothing (pause it)
setTimeout(function(){scrollerinstance.setmessage()}, 100)
else{
var i=this.hiddendivpointer
var ceiling=this.content.length
this.hiddendivpointer=(i+1>ceiling-1)? 0 : i+1
this.hiddendiv.innerHTML=this.content[this.hiddendivpointer]
this.animateup()
}
}

pausescroller.getCSSpadding=function(tickerobj){ //get CSS padding value, if any
if (tickerobj.currentStyle)
return tickerobj.currentStyle["paddingTop"]
else if (window.getComputedStyle) //if DOM2
return window.getComputedStyle(tickerobj, "").getPropertyValue("padding-top")
else
return 0
}

