home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2002 December
/
Chip_2002-12_cd1.bin
/
zkuste
/
wmakeup
/
download
/
cfs.wmz
/
cfs3.js
next >
Wrap
Text (UTF-16)
|
2002-08-07
|
28KB
|
667 lines
/*
http://www.theskinsfactory.com
info@theskinsfactory.com
*/
function checkMediaOnLoad(){
if (player) {}
view.width = 0;
view.height = 0;
view.backgroundImage = "";
theme.currentViewID = 'mainView';
loadGlobalPrefs();
}
function mainStartUp(){
theme.closeView('videoView');
loadMainPrefs();
volume.value = player.settings.volume;
seekSlider.value = player.controls.currentPosition;
visEffects.currentEffectType = mediacenter.effectType;
visEffects.currentPreset = mediacenter.effectPreset;
disableButtons();
updateVolToolTip();
updateSeekToolTip();
if (player.controls.isAvailable("Stop")) {
enableButtons();
}
checkPlayerState();
}
function mainTimer() {
if (!mainIntro.visible) {
if (mainShutter.visible) {
if (wbuttonsShutter.down) {
hideVisButtons();
killVis();
toggleShutter();
mainView.timerInterval=1800;
} else {
startUpVoodoo=false;
mainScreenGirl.image="main_screen_girl_"+girlNumber+".jpg"
mainShutter.visible=false;
mainView.timerInterval=0;
showVisButtons();
checkPlayerState();
}
}
} else {
hideIntro();
}
}
function hideIntro() {
mainIntro.visible=false;
wbuttonsShutter.down=false;
toggleShutter();
enableButtons();
}
function toggleShutter() {
killVis();
mainShutter.visible=true;
mainView.timerInterval=1800;
hideVisButtons();
if (wbuttonsShutter.down) {
mainShutter.image="main_shutter_anim_close.gif";
mainView.timerInterval=0;
mainGirlButton.visible=false;
wbuttonsShutter.down=true;
} else {
mainShutter.image="main_shutter_anim_open.gif";
mainGirlButton.visible=true;
wbuttonsShutter.down=false;
}
}
var girlNumber=1;
var lastGirl=8;
function switchGirl() {
girlNumber=(girlNumber<lastGirl) ? girlNumber+1 : 1;
mainScreenGirl.image="main_screen_girl_"+girlNumber+".jpg";
}
function disableButtons(){
wbuttons.visible=false;
mainGirlButton.visible=false;
seekSlider.visible=false;
volume.visible=false;
hideVisButtons();
}
function enableButtons(){
wbuttons.visible=true;
mainGirlButton.visible=true;
seekSlider.visible=true;
volume.visible=true;
}
function disableVisButtons(){
mainVisButtons.enabled=false;
}
function hideVisButtons(){
visButtonView.visible=false;
disableVisButtons();
}
function showVisButtons(){
visButtonView.visible=true;
disableVisButtons();
}
var startUpVoodoo = true;
function enableVisButtons(){
if (!startUpVoodoo) {
visButtonView.visible=true;
mainVisButtons.enabled=true;
}
}
function checkPlayerState(){
killVis();
if (player){
switch (player.playState){
case 0: //undefined
break;
case 1: //stopped
mainGirlButton.visible=true;
break;
case 2: //paused
mainGirlButton.visible=false;
if(mainIntro.visible) {hideIntro();}
enableButtons();
toggleVis();
break;
case 3: //playing
mainGirlButton.visible=false;
if(mainIntro.visible) {hideIntro();}
enableButtons();
toggleVis();
break;
case 6: //buffering
break;
case 7: //waiting
break;
case 8: //media ended
break;
case 9: //Transitioning
break;
case 10: //Ready
break;
}
}
if (player.controls.isAvailable("Play")) {
killVis();
disableVisButtons();
mainGirlButton.visible=true;
}
updateMetadata();
if((player.OpenState == osMediaOpen) && (player.currentMedia.ImageSourceWidth>0)){
toggleVid();
} else {
theme.closeView('videoView');
}
}
function checkPlayerMediaGlobal(){
checkPlayerState();
}
function updateMetadata(){
if(player.openState!=13) return;
metadata.value = player.status;
authorppl = player.currentmedia.getiteminfo("#author");
if (authorppl == "") {
authorppl = player.currentmedia.getiteminfo("author");
}
if (authorppl != "") {
authorppl += " - ";
}
if (metadata.value != "") {
metadata.value += " - ";
}
metadata.value += authorppl;
metadata.value += player.currentmedia.name;
metadata.scrolling = (metadata.textWidth>metadata.width);
}
function killVis(){
disableVisButtons();
playbackAnim.visible = false;
vis.visible = false;
playbackAnim.image = "";
}
var visMark = 1;
function toggleVis(){
if (!mainShutter.visible) {
killVis();
enableVisButtons();
switch(visMark){
case 1:
mainGirlButton.visible=false;
visBg.visible=true;
playbackAnim.visible = true;
playbackAnim.image = "main_playback.gif";
break;
case 2:
visBg.visible=true;
vis.visible = true;
mainGirlButton.visible=false;
break;
case 3:
visBg.visible=false;
mainGirlButton.visible=true;
visMark = 0;
break;
}
saveMainPrefs();
}
}
function loadMainPrefs(){
var _visMark = theme.loadPreference('visMark');
if (_visMark != '--') {
visMark = _visMark;
} else {
visMark = 1;
}
visMark--;
visMark++;
var _girlNumber = theme.loadPreference('girlNumber');
if (_girlNumber != '--') {
girlNumber = _girlNumber;
} else {
girlNumber = 1;
}
girlNumber--;
girlNumber++;
}
function saveMainPrefs() {
theme.savePreference('visMark',visMark);
theme.savePreference('girlNumber',girlNumber);
}
function mainShutDown(){
mediacenter.effectType = visEffects.currentEffectType;
mediacenter.effectPreset = visEffects.currentPreset;
saveMainPrefs();
}
function updateVolToolTip(){
volume.toolTip = "Volume - [";
volume.toolTip += player.settings.volume;
volume.toolTip += "%]";
}
function updateSeekToolTip(){
seekSlider.toolTip = "Seek - [";
var seekHours = Math.floor((seekSlider.value / 3600));
if (seekHours < 10) seekHours = "0" + seekHours;
var seekMinutes = Math.floor((seekSlider.value - (seekHours*3600))/60);
if (seekMinutes < 10) seekMinutes = "0" + seekMinutes;
var seekSeconds = Math.floor((seekSlider.value - (seekMinutes*60) - (seekHours*3600)));
if (seekSeconds < 10) seekSeconds = "0" + seekSeconds;
var seekString;
if (seekHours) seekString = seekHours + ":";
seekString += seekMinutes + ":" + seekSeconds;
seekSlider.toolTip += seekString;
seekSlider.toolTip += "]";
}
function volUpDown(event){
switch(event.keycode){
case 39:
case 38:
if(player.settings.volume < 95){
player.settings.volume+=5;
}else{
player.settings.volume = 100;
}
break;
case 37:
case 40:
if(player.settings.volume > 5){
player.settings.volume-=5;
}else{
player.settings.volume = 0;
}
break;
}
}
function seekUpDown(event){
switch(event.keycode){
case 39:
case 38:
if(player.controls.currentPosition > 10){
player.controls.currentPosition-=10;
}else{
player.controls.currentPosition = 0;
}
break;
case 37:
case 40:
if(player.controls.currentPosition < 900){
player.controls.currentPosition+=10;
}else{
player.controls.currentPosition = 1000;
}
break;
}
}
function viewResizer(event){
switch(event.keycode){
case 37:
view.width-=20;
break;
case 38:
view.height-=20
break;
case 39:
view.width+=20;
break;
case 40:
view.height+=20;
break;
}
}
function viewHotKeys(){
switch(event.keycode){
case 122:
case 90:
player.controls.previous();
break;
case 120:
case 88:
player.controls.play();
break;
case 99:
case 67:
player.controls.pause();
break;
case 118:
case 86:
player.controls.stop();
break;
case 98:
case 66:
player.controls.next();
break;
case 108:
case 76:
player.URL=theme.openDialog('FILE_OPEN','FILES_ALLMEDIA');
break;
case 80:
case 112:
togglePL();
break;
case 102:
case 70:
break;
}
}
function toggleEQ(){
if("true"==theme.loadPreference("eqViewer")){
theme.savePreference("eqViewer", "false");
theme.closeView( "eqView" );
}else{
theme.openView( "eqView" );
}
}
function toggleContent(){
if("true"==theme.loadPreference("contentViewer")){
theme.savePreference("contentViewer", "false");
theme.closeView( "contentView" );
}else{
theme.openView( "contentView" );
}
}
function contentGoToMenu(){
contentShots.visible=false;
contentArea.visible=false;
contentMenu.visible=true;
}
var contentMode = 1;
var currentPage=1;
var maxPage = new Array();
maxPage[1]=1;
maxPage[2]=9;
maxPage[3]=6;
function contentSwitch(_contentMenu){
contentMode=_contentMenu;
contentArea.visible = true;
navArrows.visible = true;
currentPage=0;
contentNextPage();
}
function contentNextPage(){
currentPage++;
if ((currentPage+1) > maxPage[contentMode]) {
navArrowNext.enabled=false;
navArrowNext.cursor="system";
navArrowNext.upTooltip="";
} else {
navArrowNext.enabled=true;
navArrowNext.cursor="hand";
navArrowNext.upTooltip="Next Page";
}
contentShowPage(currentPage);
}
function contentPrevPage() {
currentPage--;
navArrowNext.enabled=true; navArrowNext.cursor="hand"; navArrowNext.upTooltip="Next Page";
if ((currentPage-1) < 0) { contentGoToMenu(); }
contentShowPage(currentPage);
}
function contentShowPage(pageToShow) {
switch (contentMode) {
case 1:
contentShots.visible=false;
contentArea.backgroundImage="content_about_"+pageToShow+".jpg";
break;
case 2:
contentArea.backgroundImage="content_bg.jpg";
contentShots.visible=true;
contentShots.backgroundImage="content_shot_"+pageToShow+".jpg";
break;
case 3:
contentShots.visible=false;
contentArea.backgroundImage="content_unit_"+pageToShow+".jpg";
break;
}
}
function loadPlPrefs(){
theme.savePreference( 'plViewer', "true" );
var dwScale = theme.loadPreference( "PlaylistWidth" );
if( "--" != dwScale )
{
plView.width = dwScale;
}
dwScale = theme.loadpreference( "PlaylistHeight" );
if( "--" != dwScale )
{
plView.height = dwScale;
}
plFrame.setColumnResizeMode( 0, "stretches" );
plFrame.setColumnResizeMode( 1, "autosizedata" );
plFrame.setColumnResizeMode( 2, "autosizedata" );
plFrame.setColumnResizeMode( 3, "autosizedata" );
}
function savePlPrefs(){
theme.savepreference( "PlaylistWidth", plView.width );
theme.savepreference( "PlaylistHeight", plView.height );
}
function togglePL(){
if("true"==theme.loadPreference("plViewer")){
theme.savePreference("plViewer", "false");
theme.closeView( "plView" );
}else{
theme.openView( "plView" );
}
}
function toggleVid(){
visMark=3;
toggleVis();
theme.openView( "videoView" );
}
function loadVidPrefs(){
var _vidDrawer = theme.loadPreference('vidDrawer');
if (_vidDrawer != '--') {
vidDrawer = (_vidDrawer.toLowerCase()=="true") ? true : false;
} else {
vidDrawer = false;
}
if (vidDrawer) {
vidSettings.moveTo(0,view.height-56,500);
vidSliderSet.visible = true;
vidControlButton.down = true;
}
updateZoomToolTip();
checkVideoPlayerState();
}
function toggleVidDrawer(){
if(vidDrawer){
vidSettings.moveTo(0,view.height-112,500);
vidSliderSet.visible=true;
vidControlButton.down = false;
}else{
vidSettings.moveTo(0,view.height-56,500);
vidSliderSet.visible=true;
vidControlButton.down = true;
}
vidDrawer = !vidDrawer;
saveVidPrefs();
}
function checkVideoPlayerState(){
centerBox.visible = true;
if (player){
switch (player.playState){
case 0: //undefined
break;
case 1: //stopped
break;
case 2: //paused
SnapToVideo();
break;
case 3: //playing
SnapToVideo();
break;
case 6: //buffering
break;
case 7: //waiting
break;
case 8: //media ended
break;
case 9: //Transitioning
break;
case 10: //Ready
break;
}
vidZoom.enabled = true;
vidResizer.enabled = true;
vidResizer.visible = true;
}
if (!player.controls.isAvailable("Stop")) {
centerBox.visible = false;
vidZoom.enabled = false;
vidResizer.enabled = false;
vidResizer.visible = false;
videoView.width = "380";
videoView.height = "333";
}
updateVideoMetadata();
}
function videoZoom(){
if(mediacenter.videoZoom < 76){
mediacenter.videoZoom = 100;
}else if(mediacenter.videoZoom <101){
mediacenter.videoZoom = 150;
}else if(mediacenter.videoZoom < 156){
mediacenter.videoZoom = 200;
}else{
mediacenter.videoZoom = 75;
}
SnapToVideo();
updateZoomToolTip();
}
function updateZoomToolTip(){
vidZoom.upToolTip = "Zoom - [current: ";
vidZoom.upToolTip += mediacenter.videoZoom;
vidZoom.upToolTip += "%] - [next: ";
if(mediacenter.videoZoom < 76){
nextZoom = 100;
}else if(mediacenter.videoZoom <101){
nextZoom = 150;
}else if(mediacenter.videoZoom < 156){
nextZoom = 200;
}else{
nextZoom = 75;
}
vidZoom.upToolTip += nextZoom;
vidZoom.upToolTip += "%]";
}
function SnapToVideo(){
var zoom = mediacenter.videoZoom;
var viewWidth = (player.currentMedia.imageSourceWidth * (zoom/100.00));
var viewHeight = (player.currentMedia.imageSourceHeight * (zoom/100.00));
view.width = viewWidth + 20;
view.height = viewHeight + 92;
}
function saveVidPrefs(){
theme.savePreference('vidDrawer',vidDrawer);
}
function loadGlobalPrefs(){
if ("true"==theme.loadPreference("eqViewer")){
theme.openView( 'eqView' );
}
if ("true"==theme.loadPreference("plViewer")){
theme.openView( 'plView' );
}
if ("true"==theme.loadPreference("contentViewer")){
theme.openView( 'contentView' );
}
}