

var Tv_Arte_ClockModel;(function(){var a=function(a){return parseInt(a,10)<10?"0"+a:a};var b=function(a){for(i=0;i<a._listeners.length;i++){a._listeners[i](a.getTime())}};var c={de:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],fr:["Dimanche","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi"]};var d={de:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],fr:["Janvier","Février","Mars","Avril","Mai","Juin","Juillet","Août","Septembre","Octobre","Novembre","Décembre"]};Tv_Arte_ClockModel=function(a){this._refreshEvery=a;this._listeners=[];this._interval};Tv_Arte_ClockModel.prototype={getTime:function(){this._date=new Date;var b=locale||"fr";return{dayI18n:c[b][this._date.getDay()],monthI18n:d[b][this._date.getMonth()],day:this._date.getDay(),d:a(this._date.getDate()),m:a(this._date.getMonth()+1),y:this._date.getFullYear(),h:a(this._date.getHours()),i:a(this._date.getMinutes()),s:a(this._date.getSeconds()),date:this._date}},start:function(){var a=this,c;this._interval=setInterval(function(){b(a)},this._refreshEvery);b(a);return this},stop:function(){clearInterval(this._interval);return this},addListener:function(a){this._listeners.push(a);return this}}})();



$('document').ready(function() {


    // ARTE Journal 
    /*$('img[src="/i18n/CoreMedia/com.arte-tv.www/admin/styles/default/images/bg__logo__journal/3042692,property=data,v=1.png"]').click(function(event) {
        event.preventDefault();
        var s = '/i18n/ARTE-Journal/103288.html';
        window.location = s.replace(/i18n/, locale);
    });*/


//load new right colum

try{



if(locale == 'fr')

$('#right_column_container').load('/rightcolumnV3/?cat=3',function(response,data){});

else

$('#right_column_container').load('/rightcolumnV3/?cat=4',function(response,data){});



}

catch(err){

//instructions to handle error

}



$('#toolbar_right ul li a:first').addClass('selected');
$('#content_right div:first').show();



$('#toolbar_right ul li a').click(function() {
//hide all contents
    $('#content_right div').hide();
//erase all selected styles
    $('#toolbar_right ul li a').removeClass('selected');

//catch clicked element's id
   var id=$(this).attr('id');
//apply selected style
   $(this).addClass('selected');
//show the selected content div
   $('#content_'+id).show();
});



//open/close btn for video journal
$('#close_btn').click(function() {
if( $('#teaser_video_journal').is(':visible') ) {
	$('#teaser_video_journal').slideUp('normal', 
	function() {
	$('#close_btn').html('open');
	$('#close_btn').addClass('open');
	});
	
}
else {
	$('#teaser_video_journal').slideDown('normal', 
	function() {
	$('#close_btn').html('close');
	$('#close_btn').removeClass('open');
	});
	
}
});



/*

//clock flash
var clock_instance = new SWFObject(clock_uri,"clockid",150,51,'9,0,115,0');
//clock_instance.useExpressInstall('/flash/express_installation/playerProductInstall.swf');
clock_instance.addParam('allowscriptaccess','always');
clock_instance.addParam('wmode','transparent');
clock_instance.write("date_hour");

*/



// clock javascript

$('#date_hour').html('<div class="tv-arte-clock"><div id="tv-arte-clock-hour"></div><div id="tv-arte-clock-date"></div></div>');

var onClockRefresh = function(o)

{

  $('#tv-arte-clock-hour').html(o.h + ':' + o.i + ':' + o.s);

  $('#tv-arte-clock-date').html(o.d + ((locale == 'de') ? '.' : '') + ' ' + o.monthI18n +  ' ' + o.y);

  Cufon.replace('#tv-arte-clock-hour', {fontFamily:'LTOksanaWIPRegular', fontSize:'24px', color:'#fff'}).replace('#tv-arte-clock-date', {fontFamily:'Arial', fontSize:'18px', color:'#fff'});

};

new Tv_Arte_ClockModel(1000).addListener(onClockRefresh).start();

// bg cliquable

//$('#holder_n1').prepend('<a href="/i18n/ARTE-Journal/103288.html" style="position:absolute; left:0; z-index:3;"><img src="/i18n/4271702,property=data,v=1.png" alt="" /></a>');

//$('#arte-journal-logo-transparent').mouseover(function() { $(this).css({cursor:'pointer'}); });

/*if (locale == 'fr') {

    $('#holder_n1 a:first').after('<a id="bt-date-journal" href="http://www.arte.tv/fr/ARTE-Journal/3014152.html"><img src="/i18n/6318406,property=data,v=1.png" alt="" /></a>');

    $('#bt-date-journal').css({position:'absolute', top:'46px', left:'12px', zIndex:3});

    $('#holder_n1').css({height:'150px'});

    $('ul#n1.has_two_lines').css({margin:'25px 0 0 4px'});

} else if (locale == 'de') {

    $('#holder_n1 a:first').after('<a id="bt-date-journal" href="http://www.arte.tv/de/ARTE-Journal/3014152.html"><img src="/i18n/6318402,property=data,v=2.png" alt="" /></a>');

    $('#bt-date-journal').css({position:'absolute', top:'46px', left:'12px', zIndex:3});

    $('#holder_n1').css({height:'150px'});

    $('ul#n1.has_two_lines').css({margin:'25px 0 0 4px'});

}*/



});



function toggleVideo(obj,doc_id,  image_uri,filename){


if( $('#teaser_video_journal').is(':visible') ==false )
{
	$('#teaser_video_journal').slideDown('normal', 
	function() {
	$('#close_btn').html('close');
	$('#close_btn').removeClass('open');
	});
}

loadFile('player_journal_'+doc_id,{file:filename,javascriptid:'main_video_player_jw',click_link:'',autostart:'true',image:image_uri,width:'676',height:'380',volume:'50',controlbar:'over',type:'rtmp'});

$('ul#select_journal li a').removeClass("selected");

obj.className=this.classname+' selected';


}


