
if(false) {
    var old = window.onload;
    window.onload = function() {
        if(document.getElementById("MovieDetailPage")) {
            var node = document.createElement("div");
            node.id = "importantMessage";
            node.innerHTML = "<p><b>Videothek bis Samstag geschlossen!</b></p><p>Die Nutzerzahlen in der Videothek sind in den vergangenen Tagen dramatisch gestiegen. Um die Streaming Qualität zu sichern, führen wir bis zum Wochenende Wartungsarbeiten durch. In dieser Zeit können leider keine Filme abgespielt werden.</p><p>Bitte habt Verständnis dafür - vielen Dank!</p><p>Falls Probleme auftraten, wendet euch bitte an unser <a href='javascript:navigate(\"FeedbackNavigationItem\")'>Feedback.</a></p>";
            var content = document.getElementById("Content");
            content.insertBefore(node,content.firstChild);
        }
        if(old) {
            old();
        }
    }
    
}


function navigate(anItemIdentifier) {
    var theNode = window.document.getElementById(anItemIdentifier);
    if(theNode != null) {
        window.open(theNode, "_self");
    }
}

function thumbnailSwapIn(src) {
	var dst = document.imageView;
	if(dst) {
		src.originalSrc=dst.src;
		src.originalImage=dst.style.backgroundImage;
		dst.src=src.src;
		dst.style.backgroundImage=src.style.backgroundImage;
	}
}

function thumbnailSwapOut(src) {
	var dst = document.imageView;
	if(dst) {
		dst.src=src.originalSrc; 
		dst.style.backgroundImage=src.originalImage
	}
}

function getDocumentLocation() {
    return accountReloadURL;
}

// call with:
//   jump({area:'HPCamAreaAll', feature:'TopDeliverables, supplier:'imckg', deliverable: '7516', offline:'yes'});
// or
//   jump({action: 'goDisclaimer'});
function jump(parameters) {
    var url = getDocumentLocation();
    var woa = url.indexOf(".woa") 
    if(woa != -1) {
    	 url = url.substring(0, woa+4) + "/wa/jump?";
    } else {
	   var re = /^(http:\/\/[^\/]+)\//; // matches http://....
       url = url.match(re)[1];
       url = url + "/cgi-bin/COSADA/Front.woa/wa/jump?";
    }
    if(parameters.area)         url+= "&area=" + parameters.area;
    if(parameters.feature)      url+= "&feature=" + parameters.feature;
    if(parameters.category)     url+= "&category=" + parameters.category;
    if(parameters.supplier)     url+= "&supplier=" + parameters.supplier;
    if(parameters.deliverable)  url+= "&deliverable=" + parameters.deliverable;
    if(parameters.action)       url+= "&action=" + parameters.action;
    if(parameters.offline)      url+= "&offline=" + parameters.offline;
    if(parameters.searchKey)    url+= "&searchKey=" + parameters.searchKey;
    if(parameters.searchValue)  url+= "&searchValue=" + parameters.searchValue;
    if(parameters.setCard)      url+= "&setCard=" + parameters.setCard;
    window.open(url, "_self");
}

function jumpExtern(parameters) {
    var url = getDocumentLocation();
    var woa = url.indexOf(".woa") 
    if(woa != -1) {
    	 url = url.substring(0, woa+4) + "/wa/jump?";
    } else {
	   var re = /^(http:\/\/[^\/]+)\//; // matches http://....
       url = url.match(re)[1];
       url = url + "/cgi-bin/COSADA/Front.woa/wa/jump?";
    }
    if(parameters.site) {
        if(url.indexOf("http:") == 0) {
            url = url.replace(/^(http:\/\/[^\/]+)/, parameters.site);
        } else {
            url = parameters.site + url;
        }
    }
    if(parameters.area)         url+= "&area=" + parameters.area;
    if(parameters.feature)      url+= "&feature=" + parameters.feature;
    if(parameters.category)     url+= "&category=" + parameters.category;
    if(parameters.supplier)     url+= "&supplier=" + parameters.supplier;
    if(parameters.promotion)    url+= "&promotion=" + parameters.promotion;
    if(parameters.partner)      url+= "&partner=" + parameters.partner;
    if(parameters.deliverable)  url+= "&deliverable=" + parameters.deliverable;
    if(parameters.action)       url+= "&action=" + parameters.action;
    if(parameters.offline)      url+= "&offline=" + parameters.offline;
    if(parameters.searchKey)    url+= "&searchKey=" + parameters.searchKey;
    if(parameters.searchValue)  url+= "&searchValue=" + parameters.searchValue;
    if(parameters.setCard)      url+= "&setCard=" + parameters.setCard;
    window.open(url, "_self");
}


function navigateParent(anItemIdentifier) {
    var theNode = parent.window.document.getElementById(anItemIdentifier);
    if(theNode != null) {
        parent.window.open(theNode, "_self");
    }
}

function addCSS(url) {
    var stylesheet = document.createElement('link');
    stylesheet.rel='stylesheet';
    stylesheet.type='text/css';
    stylesheet.href=url;
    document.documentElement.childNodes[0].appendChild(stylesheet);
}    

function windowStatus(aString) {
    window.status=aString;
}

function createXMLHTTPRequest() {
    var xmlhttp = false;
    try {
        xmlhttp = new XMLHttpRequest();
    } catch (e) {
        try {
            xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
        } catch(e) {
            try {
                xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
            } catch(e) {
            }
        }
    }
    return xmlhttp;
}

function loadAccountInfo(accountReloadURL) {
    try {
        var xmlRequest = createXMLHTTPRequest();
        xmlRequest.onreadystatechange = function() {
   		   if(xmlRequest && xmlRequest.readyState==4) {
                var accountInfo = xmlRequest.responseText;
                if(accountInfo) {
                     //alert(accountInfo);
		     eval(accountInfo);
                }
            }
        };
        xmlRequest.open("GET", accountReloadURL, true);
        xmlRequest.send(null);
    } catch(e) {
        // should handle errors here
        // alert(e);
    }
    setTimeout("loadAccountInfo('"+accountReloadURL+"');", accountReloadTime);
}

function openPornInArt(url)
{
	newwindow=window.open(url,"porninart","height=580,width=780,scrollbars=no");
	if (window.focus) {newwindow.focus()}
}

function openDeelineSchedule(url)
{
	newwindow=window.open(url,"Schedule","height=600,width=600,scrollbars=yes");
	if (window.focus) {newwindow.focus()}
}


function openSupportWindow(aUrl) {
	
		supportWindow = window.open(aUrl, "Support","toolbar=no,width=800,height=350,status=no,scrollbars=yes, resize=yes, menubar=no" );
		supportWindow.focus();
}

function rotateTeaserImage(mode, start, end, alt, type, path) {
	imgPath = (path != null) ? path : "/img/";
	myMode=(mode != null) ? mode : "misc";

	myImgType = (type != null) ? type : "gif";
	myAlt = (alt != null) ? alt : myMode;

  imgNumberStart = (start != null) ? start : 1;
	imgNumberEnd = (end != null) ? end : 8;
	imgNumberDelta = imgNumberEnd - imgNumberStart;

	rnd = Math.random()*imgNumberDelta;
	myImgNumber = Math.round(rnd)+imgNumberStart;
	if (myImgNumber < 10) {
        myImgNumber = "0"+myImgNumber;
	        }

	myImgSrc = "teaser_"+myMode+"_"+myImgNumber+"."+myImgType;

	myImgTag = "<img src=\""+imgPath+myImgSrc+"\" border=0"+" alt=\""+myAlt+"\"></img>"

	document.write(myImgTag);
}


var version = 0;

function isObject(type){
   return ( "undefined" != typeof(type) );
}

function unpackVersionNumber(n)
{
    return "" + (n >> 28) + "." +
    ((n & 0xFF00000) >> 20) + "." +
    ((n & 0xFF000) >> 12) + "." +
    ( n & 0xFFF);
}

function winIE5upPlyrDetect(){
    var player;
    var iectl;
    try{
        iectl = new ActiveXObject("Shell.Explorer");
    } catch(e) {  }
    
    try{
        player = new ActiveXObject("rmocx.RealPlayer G2 Control.1");
        version = (player.GetVersionInfo());
    }catch(e){ }
    
    if(!isObject(iectl)) {
        return "unknown"; //ActiveX disabled
    }
    
    return new String(isObject(player));
}

function checkPlugin(name){
    plugin = navigator.plugins[name];
    if(isObject(plugin)){
        version = plugin.description;
       return true;
    }
    return false;
}

function pluginDetect(){
    return ( (checkPlugin("RealPlayer Version Plugin")) || (checkPlugin("RealOne Player Version Plugin")) );
}

function mimeTypeDetect() {
    return ( isObject(navigator.mimeTypes) && isObject(navigator.mimeTypes["audio/x-pn-realaudio-plugin"]) );
}

function getCookieExpirationDate(nodays){
	var Today = new Date();
	var nomilli=Date.parse(Today);
	Today.setTime(nomilli+nodays*24*60*60*1000);
	return Today.toUTCString();
}

function getCookie(name) {
 	if(document.cookie) {
		var regex = new RegExp("(^|\;) *" + name + "=(.*?)" + "(\;|$)", "i");
		regex.test(document.cookie);
		if(RegExp.$2) {
			return unescape(RegExp.$2);
		}
	}
	return null;
}

function setCookie(name,value,days) {
    var cookiestring = name + "=" + escape(value) + ";" + (days ? "expires="+ getCookieExpirationDate(days) : "");
    document.cookie = cookiestring;
    return getCookie(name) != null;
}

function isWinIE5plus(){
    var result = false;
    var uaLower = navigator.userAgent.toLowerCase();
    
    if(uaLower.indexOf("windows") >=0 && uaLower.indexOf("msie")>=0){
        var versRX = /msie\s+[5-9]/;
        result = versRX.test(uaLower);
    }

    return result;
}


function hasRealPlayer() {
    if( isWinIE5plus() ){
        return winIE5upPlyrDetect();
    } else {
        return ((pluginDetect() || mimeTypeDetect() )?"true":"unknown");
    }
}

function checkRealPlayerDE() {
    if (  hasRealPlayer() != "true" ) {
      if (confirm("Sie brauchen den Real Player für dieses Angebot. Wir leiten Sie jetzt zur Download Seite von Real")) {
        document.location.href = 'http://germany.real.com/player/?';
        }
    }
}

function checkRealPlayerEN() {
    if (  hasRealPlayer() != "true" ) {
       if (confirm("You need the Real Player for this content. We will now direct you to the download page for the Real player.")) {
           document.location.href = 'http://europe.real.com/player/?';
      }
    }
}

function checkRealPlayerFR() {
    if (  hasRealPlayer() != "true" ) {
       if (confirm("Vous avez besoin de lecteur Real. La page suivant sera la page pour télécharger le lecteur Real.")) {
           document.location.href = 'http://france.real.com/player/?';
      }
    }
}

function checkRealPlayerIT() {
    if (  hasRealPlayer() != "true" ) {
       if (confirm("You need the Real Player for this content. We will now direct you to the download page for the Real player.")) {
           document.location.href = 'http://italy.real.com/player/?';
      }
    }
}
function rmou(node,val) {
	var childNodes = node.parentNode.childNodes;
    if(childNodes.length < 3) {
        return;
    }
    var zeroImg = childNodes[0];
	var rateImg	= childNodes[1];
	var resetImg= childNodes[2];
	var base = rateImg.src;
	base = base.substring(0,base.lastIndexOf("/")+1);

    resetImg.src = base+"erase.gif";
	
	zeroImg.src = base+"zero.gif";

    rateImg.setAttribute("src", rateImg.getAttribute("orig"));
	
}

function rmo(node, val) {
    var childNodes = node.parentNode.childNodes;

    if(childNodes.length < 3) {
        return;
    }

    var zeroImg = childNodes[0];
	var rateImg	= childNodes[1];
	var resetImg= childNodes[2];
	var base = rateImg.src;
	
	base = base.substring(0,base.lastIndexOf("/")+1);

	rateImg.setAttribute("orig", rateImg.src);

	if(val<0) {
	   resetImg.src = base+"erase_over.gif";
	   rateImg.src = base+rateImg.getAttribute("rate")+".gif";
	} else if( val == 0 ) {	
	    zeroImg.src = base+"zero_over.gif";
		rateImg.src = base+"0_0.gif";
	} else {
        zeroImg.src	= base+"zero.gif";
        rateImg.src = base+val+"_0_e.gif";
	}
	
	
}

function rup(aNode, aUrl, aRating) {
    var url = aUrl+"?rating="+aRating+"&time="+new Date();
    rmo(aNode, aRating);
     try {
        var xmlRequest = createXMLHTTPRequest();
        xmlRequest.open("GET", url, true);
        xmlRequest.onreadystatechange = function() {
          if(xmlRequest.readyState == 4){
                if (xmlRequest.status == 200){
                    var response = xmlRequest.responseText;
                    if(xmlRequest.getResponseHeader('content-type') == 'text/javascript') {
                        try {
                            eval(response);
                        } catch(e) {
                            // should handle errors here
                            // alert(e + "->" + response);
                        }
                    }
                }
            }
        };
        xmlRequest.send(null);
    } catch(e) {
        // should handle errors here
        // alert(e);
    }
}

function rclick(aNode) {
    var childNodes = aNode.parentNode.childNodes;

    if(childNodes.length < 4) {
        return;
    }
    var link= childNodes[3];
    window.open(link, "_self");
}

function checkDeliverablesStatus(someDeliverables) {
    var url = getDocumentLocation();
    var rep = "/Updater";
    if(url.indexOf("FrontAK") > 0) {
        rep = "/Front";
    }
    url = url.replace(new RegExp("/Front([A-Za-z0-9]*)\.woa/.*"), rep + "$1.woa/wa/DeliverableStatusAction/status");
    window.statusChecker=new StatusChecker(url, someDeliverables);

	window.setTimeout( function() { 
		window.statusChecker.check();
	}, 1000);
}

function StatusChecker(aUrl, someDeliverables) {
	this.deliverables=someDeliverables;
	this.xmlrequest = createXMLHTTPRequest();
	this.url=aUrl;

	this.onreadystatechange = function() {
		var checker = window.statusChecker;
   		if(checker && checker.xmlrequest.readyState==4) {
   			checker.processResponse(checker.xmlrequest.responseText);
   		}
    };
    
    this.check = function() {
        try {
            this.xmlrequest.open("POST", this.url, true);
            this.xmlrequest.onreadystatechange=this.onreadystatechange;
            this.xmlrequest.setRequestHeader('Content-Type','text/html; charset=UTF-8');
            var post = "";
            for(var i=0; i < this.deliverables.length; i++) {
                var curr = this.deliverables[i];
                post+=curr.s+"|"+curr.i+"\n";
            }
            
            this.xmlrequest.send(post);
            window.setTimeout( function() { 
                window.statusChecker.check();
            }, 65000);
        } catch(e) {
            // should handle errors here
            // alert(e.message);
        }
    // alert(result);
    };
    
    this.processResponse = function(result) {
        if(result) {
            var lines = result.split("\n");
            for(var i=0; i<lines.length; i++) {
                var aLine = lines[i].split("|");
                if(aLine.length != 2) {
                    continue;
                }
                var anElement = document.getElementById(aLine[0]);
                if(anElement) {
                    anElement.className=aLine[1];
                 } else {
                    // alert("invalid element "+aLine);
                }
            }
        } 
    };
}

/* 

dynamic panel for the portal page, call with:

initPromoPanel({url: 'jumpXmas();', startX: -500, stopX: 330, speed: 10, stepX: 12, css:"http://web.aximus.ch/advent/banner.css", startDate: new Date("Dec 25, 2005 00:00:00 GMT"), endDate: new Date("Dec 25, 2005 00:00:00 GMT")});
  initPromoPanel({url: 'jumpXmas();', startX: -500, stopX: 330, speed: 10, stepX: 12});
*/

function initPromoPanel(def) {
    var body = document.body;
    if(def && (def.startDate >= (new Date()))) {
        return;
    }
    if(def && (def.endDate <= (new Date()))) {
        return;
    }
    if(body.id != "PortalPage") {
        return;
    }

    document.panelDefinition = def;
    window.setTimeout("doInitPromoPanel();", 0);
}

function doInitPromoPanel() {
    var body = document.body;
    if(body.id != "PortalPage") {
        return;
    }
    if(document.panelDefinition && document.panelDefinition.css) {
        addCSS(document.panelDefinition.css);
    }
    var node = document.createElement('div');
    node.innerHTML = '<div id="promoPanel">' +
        '<a class="promoContent" href="javascript:goPromoPanel();"></a>'+
        '<a class="promoCloseBox" href="javascript:hidePromoPanel();"></a>'+
        '</div>';
    body.appendChild(node);

    var panel = document.getElementById('promoPanel');
    if(panel == null) {
        return;
    }
    panel.def = document.panelDefinition;
    panel.def.currentX=panel.def.startX;
    panel.style.position="absolute";
    panel.style.left=panel.def.startX+"px";
    panel.style.zindex=500;
    displayPromoPanel();
}

function displayPromoPanel() {
    var panel = document.getElementById('promoPanel');
    if(panel == null) {
        return;
    }
    if(panel.def.currentX < panel.def.stopX) {
        panel.def.currentX += panel.def.stepX;
        panel.style.left = panel.def.currentX+"px";
        window.setTimeout("displayPromoPanel();", panel.def.speed);
    } 
}

function goPromoPanel() {
    var panel = document.getElementById('promoPanel');
    if(panel == null) {
        return;
    }
    eval(panel.def.url);
}

function hidePromoPanel() {
    var panel = document.getElementById('promoPanel');
    if(panel == null) {
        return;
    }
    panel.style.display="none";
    panel.style.zindex=-100;
}

function jumpTextPage(name) {
    var url = getDocumentLocation();
    var woa = url.indexOf(".woa") 
    if(woa != -1) {
    	 url = url.substring(0, woa+4) + "/wa/textPage?textItem=";
    } else {
	   var re = /^(http:\/\/[^\/]+)\//; // matches http://....
       url = url.match(re)[1];
       url = url + "/cgi-bin/COSADA/Front.woa/wa/textPage?textItem=";
    }
    top.location.href= url + name;
}
function jumpXmas() {
    jumpTextPage('XmasSpecial');
}

function reorderMenuesGlobal() {
    if(pageContext) {
       if(pageContext.language == "de") {
            // xmas stuff
            // initPromoPanel({url: 'jumpXmas();', startX: -500, stopX: 330, speed: 10, stepX: 12});
        }
    }
}

function reorderMenues() {
    if(pageContext) {
       var sites = ".satw.20cm.wsc.xotix-at.lp.sbits.sswiss.butv.erodrom-at.lovegirls.";
       if(sites.indexOf("." + pageContext.webSite + ".") > -1) {
            reorderMenuesGlobal();
       }
    }
}

function getParentByClassName(node, className) {
    while(node) {
        if(node.className == className) {
            return node;
        }
        node = node.parentNode;
    }
    return node;
}

function getChildByClassName(node, className) {
    node = node.firstChild;
    while(node) {
        if(node.className == className) {
            return node;
        }
        node = node.nextSibling;
    }
    return node;
}

var helpItemShown;

function helpItemShow(node) {
    var p = getParentByClassName(node, "helpItem");
    if(p) {
        if(helpItemShown) {
            helpItemShown.style.display="none";
        }
        var newItem = getChildByClassName(p, "helpItemContent");
        if(helpItemShown != newItem) {
            helpItemShown = newItem;
            if(helpItemShown) {
                helpItemShown.style.display="block";
            }
        } else {
            helpItemShown = null;
        }
    }
    return false;
}


function jumpSMSDating(code) {
    //smsdating
    window.open("http://sms-69.com/index.php?wmid=33568857&promotion="+code+"&gendermode=4","popup");
}

function jumpOnlineDating(code){
//phonedating
    if (document.location.href.indexOf(".at/") > 0){
	   popup = window.open("http://www.flirt-777.at?sid="+code,"popup","width=1100,height=800,toolbar=1,location=yes");	
	} else if (document.location.href.indexOf(".ch/") > 0){
	   popup = window.open("http://www.flirt-777.ch?sid="+code,"popup","width=1100,height=800,toolbar=1,location=yes");	
	} else if (document.location.href.indexOf(".com/") > 0){
	   popup = window.open("http://www.flirt-777.com?sid="+code,"popup","width=1100,height=800,toolbar=1,location=yes");
	} else if (document.location.href.indexOf(".de/") > 0){
	   popup = window.open("http://www.flirt-777.de?sid="+code,"popup","width=1100,height=800,toolbar=1,location=yes");
	} else {
	   popup = window.open("http://www.flirt-777.com?sid="+code,"popup","width=1100,height=800,toolbar=1,location=yes");
    }
}

function jumpPhoneDating(code) {
    //hierundheutedating
    window.open("http://heute-und-hier.com/","popup");
}

function flashTooOld() {
    if (confirm("Ihre Flash-Version kann diese Filme nicht abspielen. Sie brauchen mindestens Version 9.0.115. Wir leiten Sie jetzt zur Download Seite von Adobe")) {
        document.location.href = 'http://www.macromedia.com/go/getflashplayer';
    }
}

function flashError(msg) {
    if ("Errors.Money" == msg) {
        jump({action: 'goPayment'});
    } else {
        navigate("CancelNavigationItem");
    }
}

// from blogero
function phpads_deliverActiveX(content) {
	document.write(content);	
}

function showAdvert(clientID, what) {
    var url = document.location.href;
    var woa = url.indexOf(".woa") 
    if(woa != -1) {
    	 url = url.substring(0, woa+4) + "/ads?";
    } else {
	   var re = /^(http:\/\/[^\/]+)\//; // matches http://....
       url = url.match(re)[1];
       url = url + "/cgi-bin/COSADA/Front.woa/ads?";
    }
   if (!document.phpAds_used) {
        document.phpAds_used = ',';
   }
   phpAds_random = new String (Math.random()); phpAds_random = phpAds_random.substring(2,11);
   
   document.write ("<" + "script language='JavaScript' type='text/javascript' src='");
   document.write ( url + "n=" + phpAds_random);
   if(what) document.write ("&amp;what=" + what);
   if(clientID) document.write ("&amp;clientid=" + clientID);
   document.write ("&amp;exclude=" + document.phpAds_used);
   if (document.referrer)
      document.write ("&amp;referer=" + escape(document.referrer));
   document.write ("'><" + "/script>");
}

document.writeln('<script src="/js/swfobject.js" type="text/javascript"></script>');

function showVideoByID(url, func, id) {
    var node = document.getElementById(id);
    setTimeout(function() { func(url, node.height, node.width, node) }, 100);
}

function showSoftClip(url, aWidth, aHeight, dst) {

}

function showSwf(url, aHeight, aWidth, dst) {
    dst = dst || document.imageView;
    if(document != top.document || !dst) {
        return;
    }
    if(dst) {
        var parent = dst.parentNode;
        var iframe = document.getElementById("previewmovie");
        if(parent) {
            iframe = document.createElement("div");
            if(!aHeight || !aWidth) {
                aWidth=dst.width;
                aHeight=dst.height;
            }
            iframe.width=aWidth;
            iframe.height=aHeight;
            iframe.scrolling="no";
            iframe.innerHTML= "<div id='previewmovie'></div>";
    		parent.replaceChild(iframe, dst);
    		document.imageViewParent = parent;
        } else {
            parent = document.imageViewParent;
        }
        swfobject.embedSWF(url, 'previewmovie', aWidth, aHeight, '9.0.0', '/flash/show/expressInstall.swf', {file:url,image:'/img/spacer.gif', autostart:'true'}, {menu:'false', allowfullscreen:'true', allowscriptaccess: 'always', showcontrols: 'false'}, {id:'player',name:'player'});
		setTimeout(function() {
    		  document.onclick = function(e) { 
    		    if(parent && dst && iframe) {
    		        parent.replaceChild(dst, iframe);
    		    }
    		    document.imageViewParent = null; 
    		    document.onclick=null; 
    		  };
        }, 1);
	}
}

function showVideo(url, aHeight, aWidth, dst) {
    dst = dst || document.imageView;  
    if(document != top.document || !dst) {
      return;
    }
    if(url.indexOf(".swf")>= 0) {
        showSwf(url, aHeight, aWidth, dst);
        return;
    }
    if(dst) {
        var parent = dst.parentNode;
        var iframe = document.getElementById("previewmovie");
        if(parent) {
            iframe = document.createElement("iframe");
            iframe.id = "previewmovie";
            iframe.src=url;
            if(aHeight && aWidth) {
                iframe.width=aWidth;
                iframe.height=aHeight;
            } else {
                iframe.width=dst.width;
                iframe.height=dst.height;
            }
            iframe.scrolling="no";
            parent.replaceChild(iframe, dst);
    		document.imageViewParent = parent;
            document.onclick = function() { 
                iframe.src=null;
                parent.replaceChild(dst, iframe);
                document.onclick=null;
            };
        } else {
            parent = document.imageViewParent;
        }
		setTimeout(function() {
		  if(!document.getElementById('previewmovie')) {
    		  document.onclick = function() { 
    		    if(parent) parent.replaceChild(dst, iframe); 
    		    document.imageViewParent = null; 
    		    document.onclick=null;
    		  };
          }
        }, 1);
    }
}

function showFlv(url, aHeight, aWidth, dst) {
    dst = dst || document.imageView;
    if(document != top.document || !dst) {
        return;
    }
    if(dst) {
        var parent = dst.parentNode;
        var iframe = document.getElementById("previewmovie");
        if(parent) {
            iframe = document.createElement("div");
            if(!aHeight || !aWidth) {
                aWidth=dst.width;
                aHeight=dst.height;
            }
            iframe.width=aWidth;
            iframe.height=aHeight;
            iframe.scrolling="no";
            iframe.innerHTML= "<div id='previewmovie'></div>";
    		parent.replaceChild(iframe, dst);
    		document.imageViewParent = parent;
        } else {
            parent = document.imageViewParent;
        }
        swfobject.embedSWF('/flash/show/player.swf', 'previewmovie', aWidth, aHeight, '9.0.0', '/flash/show/expressInstall.swf', {file:url,image:'/img/spacer.gif', autostart:'true'}, {menu:'false', allowfullscreen:'true', allowscriptaccess: 'always', showcontrols: 'false'}, {id:'player',name:'player'});
		setTimeout(function() {
		  if(!document.getElementById('CamPointClipViewer')) {
    		  document.onclick = function() { if(parent) parent.replaceChild(dst, iframe); document.imageViewParent = null; document.onclick=null;};
          }
        }, 1);
	}
}
