/**
 * Checks whether the Ticker was opener in a popup window
 *
 * @return void
 */
function checkForPopup()
{
    if (!self.opener) {
        self.location = 'http://www.alemannia-aachen.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=570';
			break;
//      case 'small':
//          size_str += ',height=545';
//          break;
        case 'big':
            size_str += 'width=900,height=677';
            break;   
	}
    
    self.open(file, 'ticker',
              'left=0,top=0,status=no,resizable=no,' + size_str);
}


/**
  * opens a new Browser window
  *
  * @return void
  */

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}



/**
 * 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(520, 700);
}

/**
 * Resizes the browser window to fit the size of the big ticker
 *
 * @return void
 */
function switchTickerBig()
{
    self.resizeTo(900, 677);
}

/**
 */
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");
}
