/**
 * Checks whether the Ticker was opener in a popup window
 *
 * @return void
 */
function checkForPopup()
{
    if (!self.opener) {
        self.location = 'http://www.premiere.de/';
    }
}

/**
 * Opens the Ticker in a new window
 *
 * @param String
 * @param String
 * @return void
 */
function showTicker(size, file) {
	var size_str = '';
    
    switch (size) {
        default:
        case 'normal':
            size_str += 'width=400,height=595';
            break;
//      case 'small':
//          size_str += ',height=545';
//          break;
        case 'big':
            size_str += 'width=1050,height=760';
            break;
    }
    
    self.open(file, 'ticker',
              'left=100,top=100,status=no,resizable=no,' + size_str);
}

/**
 * Resizes the browser window to fit the size of the small ticker
 *
 * @return void
 */
function switchTickerSmall()
{
//  self.resizeTo(200, 570);
}

/**
 * Resizes the browser window to fit the size of the medium ticker
 *
 * @return void
 */
function switchTickerNormal()
{
    self.resizeTo(410, 640);
}

/**
 * Resizes the browser window to fit the size of the big ticker
 *
 * @return void
 */
function switchTickerBig()
{
    self.resizeTo(805, 640);
}

/**
 */
function checkFlashClient()
{
    var minreqversion = 7;
    
    var flashinstalled = 0;
    var flashversion = 0;
    if (navigator.plugins && navigator.plugins.length) {
        x = navigator.plugins["Shockwave Flash"];
        if (x) {
            flashinstalled = 2;
            if (x.description) {
                y = x.description;
                flashversion = y.charAt(y.indexOf('.')-1);
            }
        } else {
            flashinstalled = 1;
        }
        if (navigator.plugins["Shockwave Flash 2.0"]) {
            flashinstalled = 2;
            flashversion = 2;
        }
    } else if (navigator.mimeTypes && navigator.mimeTypes.length) {
        x = navigator.mimeTypes['application/x-shockwave-flash'];
        if (x && x.enabledPlugin) {
            flashinstalled = 2;
        } else {
            flashinstalled = 1;
        }
    } else {
        // IE flash detection.
        for (var i = 8; i > 0; i--) {
            flashversion = 0;
            try {
                new ActiveXObject("ShockwaveFlash.ShockwaveFlash." + i);
            } catch (e) {
                continue;
            }
            flashversion = i;
            break;
        }
    }
    
    return (flashversion >= minreqversion);
}


/**
	IFrame Reload
 */

function reloadiframe (framename) {
 top[framename].location.reload();
}

/**
	Diese Funktion wird im Flash Ticker aufgerufen
 */

function refresh() {
 reloadiframe("iframe_xxl");
 reloadiframe("iframe_sky");
}

