var swapColor = function(obj, fColor, bgColor) {
	if(obj == null) {
		return;
	}

	obj.style.backgroundColor = bgColor;
	obj.style.color = fColor;
}

var runFlash = function() {
	// iefix.js
	objects = document.getElementsByTagName("object");
	for (var i = 0; i < objects.length; i++)
	{
		objects[i].outerHTML = objects[i].outerHTML;
	}
}

var loadSwf = function(layer, base, src) {
	
	layer.innerHTML = 
		'<object type="application/x-shockwave-flash" data="' + base + '/media/img/musicplayer.swf?song_url=' 
		+ src 
		+ '&autoload=true&autoplay=true&b_bgcolor=fefefe&b_fgcolor=d1a1d1&b_colors=,d1a1d1,," width="17" height="17">'
		+ '<param name="movie" value="' + base + '/media/img/musicplayer.swf?song_url=' 
		+ src 
		+ '&autoload=true&autoplay=true&b_bgcolor=fefefe&b_fgcolor=d1a1d1&b_colors=,d1a1d1,," />'
		+ '<img src="noflash.gif" width="17" height="17" alt="" />' 
		+ '<embed src="' + base + '/media/img/musicplayer.swf?song_url=' 
		+ src 
		+ '&autoload=true&autoplay=true&b_bgcolor=fefefe&b_fgcolor=d1a1d1&b_colors=,d1a1d1,," width="17" height="17"'
		+ '</embed>'
		+ '</object>';
}

var testQ = function(q) {
	if(q == null) {
		return false;
	}

	if(q.value == '') {
		return false;
	}

	return true;
}

var resize = function() {
	var s = getWindowSize();
        document.getElementById("viewFrame").style.height = (s[1] - 92) + "px";
        document.getElementById("viewFrame").style.width = (s[0]) + "px";
}

var getWindowSize = function() {
        var myWidth = 0, myHeight = 0;
        if( typeof( window.innerWidth ) == 'number' ) {
                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;
        }
        return [myWidth, myHeight];
}
