﻿var player;var playlistNumber=0;function playerReady(obj) {	//alert('the videoplayer '+obj['id']+' has been instantiated');	player = document.getElementById(obj['id']);	var start = player.getConfig().autostart;	//player.sendEvent("ITEM",playlistNumber);	//player.sendEvent("PLAY","true");	};var open=0;var placeLogo = {    init:function(){    var resizeTimer = null;    $(window).bind('resize', function() {      if (resizeTimer) clearTimeout(resizeTimer);      resizeTimer = setTimeout(placeLogo.place, 5);    });  },    place:function(){    var windowHeight=parseInt($(window).height());    var windowWidth=parseInt($(window).width());    var logoPositionX=((windowWidth/2)-406);        var logoPositionY=((windowHeight/2)-61);    var logoPositionY1=((windowHeight/2)-100);        var contentPositionX=((windowWidth/2)-475);    var contentPositionY=((windowHeight/2)-289);        //alert(windowWidth);    $("#textLogo").css("top",logoPositionY+"px");    $("#textLogo").css("left",logoPositionX+"px");    $("#textLogo_wrapper").css("top",logoPositionY1+"px");    $("#textLogo_wrapper").css("left",0);    $("#hit_target_top").css("top",logoPositionY-500);    $("#hit_target_bottom").css("top",logoPositionY+120);    $("#content").css("top",contentPositionY);    $("#content").css("left",contentPositionX);          }}var hijax = {  innit:function(element){    $(element).each(function (i) {       var currentHref=$(this).attr("href");       //alert(currentHref);      currentHref=hijax.getPath(currentHref);       $(this).attr({                               //alert("urlvars"+urlvars);          //onClick:"hijax.HandleAjaxRequest('"+currentHref+"'); return true;",          href: "javascript:hijax.HandleAjaxRequest('"+currentHref+"');"          });      });   },  HandleAjaxRequest:function(href){   //var hrefLength=href.length;   $("#content .col_a").html("<img class=\"loader\" src=\"/imgs/loader.gif\" />");         //var hrefDef=href.substring(1);   //alert(hrefDef+' site check: IE6');   $.ajax({      type: "GET",      url: "index-ajax.php",      data: href,      success: function(msg){ $("#content").html(msg); $("#loader").html(""); window.location.hash="#"+href; }   });  },  getPath:function (url) {   result = url.indexOf("?");   //alert("url pos:"+result);   return url.substring(result+1);}}var mediaPlayer = {    init:function(){    //window height and width    var windowHeight=parseInt($(window).height());    var windowWidth=parseInt($(window).width());    var logoPositionY=((windowHeight/2)-(windowHeight/4));    $('.media_player_preview .img_wrapper').bind('click', function() {      var case_id=$(this).attr("case_id");      playlistNumber=$(this).attr("playlistNumber");      //alert();      var video_player="<div id=\"player\"><embed id=\"jw_player\" name=\"jw_player\" src='/swf/mediaplayer/player.swf' width='750' height='301' bgcolor='#000000' allowscriptaccess='always' allowfullscreen='true' flashvars='file=/includes/php/atom_rss.php?case_id="+case_id+"&lightcolor=ec008c&playlistsize=250&skin=swf/modieus/modieus.swf&playlist=right&screencolor=000000&autostart=true&stretching=uniform&item="+playlistNumber+"' /></div>";      $("#video_player_wrapper").css("top",logoPositionY+"px");      $("#video_layer").css("opacity",0.20);      $("#video_layer").css("display",'block');      $("#video_layer").fadeTo(500,0.70,function(){ $('#background').css('display','none');  $("#video_player_wrapper").css('display','block'); $("#video_player").html(video_player); });      //$('#background').css('display','none');});    $('.media_player').bind('click', function() {      var case_id=$(this).attr("case_id");      playlistNumber=$(this).attr("playlistNumber");      var video_player="<div id=\"player\"><embed id=\"jw_player\" name=\"jw_player\" src='/swf/mediaplayer/player.swf' width='750' height='301' bgcolor='#000000' allowscriptaccess='always' allowfullscreen='true' flashvars='file=/includes/php/atom_rss.php?case_id="+case_id+"&lightcolor=ec008c&playlistsize=250&skin=swf/modieus/modieus.swf&playlist=right&screencolor=000000&autostart=false&stretching=uniform' /></div>";      $("#video_player_wrapper").css("top",logoPositionY+"px");      $("#video_layer").css("opacity",0.20);      $("#video_layer").css("display",'block');      $("#video_layer").fadeTo(500,0.70,function(){ $('#background').css('display','none');  $("#video_player_wrapper").css('display','block'); $("#video_player").html(video_player); });      //$('#background').css('display','none');});        $('#media_player_close').bind('click', function() {      $("#player").html('');      $("#video_layer").css("display",'none');      $("#video_player_wrapper").css("display",'none');      $('#background').css('display','block');    });         },  video_init:function(){  var player;   function playerReady(obj) {	alert('the videoplayer '+obj['id']+' has been instantiated');	player = document.getElementById(obj['id']);};   }  }var common={  innit:function(){  $(function(){     //$("#textLogo").draggable();     //$("#div_l_1_wrapper").draggable();  });         $("#textLogo").bind("mouseover", function(e){     if(open==0){       $(this).css("z-index",100);              $(this).fadeTo("normal",1);              $("#hit_target_top").css("display","block");       $("#hit_target_bottom").css("display","block");       $("#textLogo_wrapper").css("display","block");       $("#textLogo_wrapper").css("opacity",0.6);       $("#textLogo_wrapper").css("z-index",100);       open=1;     }                });    $("#hit_target_top").bind("mouseover", function(e){      $("#textLogo_wrapper").css("display","none");            if($.browser.msie){       // alert('ie');        $("#textLogo").css("z-index",-10);      }else{        //alert('geen ie');        $("#textLogo").css("z-index",10);      }                                    $("#textLogo").css("opacity",0.3);      $(this).css("display","none");      $("#hit_target_bottom").css("display","none");      open=0;    });    $("#hit_target_bottom").bind("mouseover", function(e){      $("#textLogo_wrapper").css("display","none");      if($.browser.msie){       // alert('ie');        $("#textLogo").css("z-index",-10);      }else{        //alert('geen ie');        $("#textLogo").css("z-index",10);      }      $("#textLogo").css("opacity",0.5);      $(this).css("display","none");      $("#hit_target_top").css("display","none");      open=0;    });        $("#foreground").bind("click", function(e){       //alert($(this).css("z-index"));       //$("#textLogo").fadeTo("slow", 0.1);                });      $("#win_2").bind("click", function(e){      //$("#div_l_2_wrapper").css("display","none");       //$("#div_l_1_wrapper").fadeOut("fast");       $("#div_l_2_wrapper").fadeOut("fast");    });      $("#win_1").bind("click", function(e){      //$("#div_l_2_wrapper").css("display","none");       $("#div_l_1_wrapper").fadeOut("fast");    });   //$(".draggable").draggable({ handle: 'div.handle' });      } }jQuery(document).ready(function() {   //$('.scroll-pane').jScrollPane({scrollbarWidth:20,scrollbarMargin:0,reinitialiseOnImageLoad: true});   placeLogo.init();   placeLogo.place();   mediaPlayer.init();   hijax.innit(".ajax");   common.innit();   //$(document).pngFix();   //$(".jScrollPaneContainer").css("width","480px");   //$(".jScrollPaneContainer").css("height","550px");               });   
