function playerStatus(track, album) {
  writeNewDiv('audio_track', '<h2>' + track + '</h2>');
  writeNewDiv('audio_album', '<h2>' + album + '</h2>');
}

function controlTitle(artist, track, album) {
	doPassVar("tracktitle", "titArtist", artist + ":");
	doPassVar("tracktitle", "titTrack", track);
	doPassVar("tracktitle", "titAlbum", album);
}
function controlTitleLang(lang) {
	
	if(lang == 'fin') {
		doPassVar("tracktitle", "titNowPlaying", "NYT SOITTIMESSA");
		doPassVar("tracktitle", "titFrom", "ALBUMILTA");
	} else {
		doPassVar("tracktitle", "titNowPlaying", "NOW PLAYING");
		doPassVar("tracktitle", "titFrom", "FROM THE ALBUM");
	}
}

function doPassVar(movie, theVar, args) {
   var sendText = args;
   thisMovie(movie).SetVariable(theVar, sendText);
}



function controlPlayer(func, param) {
	thisMovie("mp3player").jsControl(func,param);
}

function thisMovie(movieName) {
    if (navigator.appName.indexOf("Microsoft") != -1) {
        return window[movieName]
    }
    else {
        return document[movieName]
    }
}

function playerStatus(track, album) {
  writeNewDiv('audio_track', '<h2>' + track + '</h2>');
  writeNewDiv('audio_album', '<h2>' + album + '</h2>');
}

function alertWinSize() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
  //window.alert( 'Width = ' + myWidth );
  //window.alert( 'Height = ' + myHeight );
  return myWidth;
}

function getWinWidth() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
  //window.alert( 'Width = ' + myWidth );
  //window.alert( 'Height = ' + myHeight );
  return myWidth;
}


function resWin(h) {
	
	var toWidth = getWinWidth();
	
	window.resizeTo(toWidth, h);
	window.focus();
}

