﻿//overlayPlayer config
feedUrl = "http://www.specials.sphe.de/schluempfe/videofeed.xml";
clipName = 1;
autocloseToggle = true;
singlevideoToggle = true;
callbackToggle = true;
downloadBaseURL = "http://www.specials.sphe.de/schluempfe/";
downloadVisible = false;
downloadPopUpLarge = true;

// share config
share.url = 'http://www.specials.sphe.de/schluempfe/share.html';
share.title = 'DIE SCHLÜMPFE!';
share.tweet = 'DIE SCHLÜMPFE! http://www.specials.sphe.de/schluempfe/';
share.description = 'DIE SCHLÜMPFE! Die Schlümpfe verlassen ihre magische Welt & erobern den Großstadt-Dschungel New York. Gejagt vom bösen Zauberer Gargamel müssen sie ein schlumpfiges Abenteuer bestehen.';

/**
 * SWF Resizing Javascript Template
 * 
 * What it does:
 *		- Sets minimum width and height of the swf
 *		- Resizes swf size when user resizes the browser window
 *
 * Required Scripts:
 *		- common.js
 *		- swfobject2.js
 *
 * Notes:
 *		- The only thing you need to edit are the properties in the FLPROPS object and everything should work
 *		- If the page has HTML elements (ex. footer) below the swf, please set the heightOffset in FLPROPS
 *		- This script assumes that only ONE swf gets embeded into the HTML document. 
 *		- This script assumes that max width is 100%, and max height to be the height of browser window.
 */


/**** EDITABLE PROPERTIES BELOW ****/

var FLPROPS = {	
	// Editable properties/methods
	flashversion: '10',
	divId: 'flashcontent',
	minWidth: '980',
	minHeight: '1070',	
	heightOffset: '',
	flashvars: {},
	params: {
		base:'media/',
		allowScriptAccess:'always',
		allowfullscreen: 'true',
		scale: 'noscale',
		wmode: 'opaque'
	},
	attributes: {},
	path: 'media/preLoader.swf',
	
	// Uneditable properties/methods
	getWidth: function() {
		var browserWidth = document.documentElement.clientWidth;
		if(this.minWidth != '' && this.minWidth != null) {
			if(browserWidth < this.minWidth) {
				return this.minWidth + 'px';
			} else {
				return '100%';
			}
		}
	},
	
	getHeight: function() {
		var browserHeight = document.documentElement.clientHeight;
		if(this.minHeight != '' && this.minHeight != null) {
			if(this.heightOffset != '' && this.heightOffset != null) {
				var newHeight = browserHeight - this.heightOffset;
				return (newHeight < FLPROPS.minHeight ? FLPROPS.minHeight : newHeight);
			} else {
				return (browserHeight < FLPROPS.minHeight ? FLPROPS.minHeight : browserHeight);
			}
		} else {
			return browserHeight;
		}
	}
}

/**** DO NOT EDIT BELOW ****/

/**
 * Gets rid of the the text content in the flash div
 * It assumes only h1 and/or p tags are included in the div
 */
var removeTextContent = (function() {
	if(typeof(swfobject) == 'object' && swfobject.hasFlashPlayerVersion(FLPROPS.flashversion)) {
		var head = document.getElementsByTagName('head');
		var flashstyle = document.createElement('style');
		var css = '#' + FLPROPS.divId + ' p, #' + FLPROPS.divId + ' h1 {display: none}';
		flashstyle.setAttribute('type','text/css');
		if(head[0]){
			if(flashstyle.styleSheet){
				flashstyle.styleSheet.cssText = css;
			}else{
				flashstyle.appendChild(document.createTextNode(css));
			}
			head[0].appendChild(flashstyle);
		}
	}
}());

/**
 * Resizes the swf upon resizing the browser window.
 * It also sets minimum width and height
 */
function swfResize(divId) {
	var width = FLPROPS.getWidth(),
		height = FLPROPS.getHeight();
		
	// set new width and height
	document.getElementById(divId).style.width = width;	
	document.getElementById(divId).style.height = height + 'px';
}

// Initialize events
addLoadEvent(function() {
	swfobject.embedSWF(FLPROPS.path, FLPROPS.divId, FLPROPS.getWidth(), FLPROPS.getHeight(), FLPROPS.flashversion, "", FLPROPS.flashvars, FLPROPS.params, FLPROPS.attributes);
});

addResizeEvent(function() {
	swfResize(FLPROPS.divId);
});

