var feature_timer = 0

window.onload = function() {
    
    //feature_timer = setTimeout("ScrollArrow('right', 'toolbar', 'scroller', 'one-pane');", 30000);
    
    var currentlocation = location.href;
    var playlist = "playlist";
    
    if(currentlocation.indexOf('photos') != '-1') {
    	playlist = "photos";
    }else if(currentlocation.indexOf('music') != '-1') {
    	playlist = "music";
    }
    
    var s1 = new SWFObject("/player.swf","videoplayer","500","400","9","#FFFFFF");
	s1.addParam("allowfullscreen","true");
	s1.addParam("allownetworking","all");
	s1.addParam("allowscriptaccess","always");
	s1.addParam("wmode","opaque");
	s1.addParam("flashvars","file=/videos/"+playlist+".xml&controlbar=none&autostart=true&backcolor=FFFFFF&screencolor=FFFFFF&displayclick=play&repeat=always&shuffle=true&smoothing=false");
	s1.write("video_header");
	setMainImageSize();
}

window.onresize = function() {
    setMainImageSize();
}

function setMainImageSize() {
	var myWidth = 0, myHeight = 0;
	myWidth = document.getElementById('main').clientWidth;
	myHeight = document.getElementById('main').clientHeight;
	
	var new_image_width = (myWidth);
	var new_image_height = new_image_width * (1080/1920);
	var left = 0;
	var right = 0;
	
	var videoplayer = document.getElementById('videoplayer');
	videoplayer.style.height = new_image_height + "px";
	videoplayer.style.width = new_image_width + "px";
}

function fieldFocus(element, text)
{
	if(text == element.value) {
		element.value = "";
	}
}
function fieldBlur(element, text)
{
	if("" == element.value) {
		element.value = text;
	}
}

function toggleMore() {
    var latestMenu = document.getElementById("more_menu");
    
    if(latestMenu.style.top == '50px') {
        latestMenu.style.top = '-1000px';
        document.getElementById("morelink").setAttribute('class', '');
		document.getElementById("morelink").setAttribute('className', '');
    } else {
        latestMenu.style.top = '50px';
        document.getElementById("morelink").setAttribute('class', 'active');
		document.getElementById("morelink").setAttribute('className', 'active');
    }
}

