// JScript-Datei
function objhover(obj, hoverclass){switchStyleClass(obj,hoverclass);}
function objout(obj,outclass){switchStyleClass(obj,outclass);}

var savedclass="";
function savehover(obj, hoverclass){savedclass=getAttributeValue(obj,'class');switchStyleClass(obj,hoverclass);}
function saveout(obj){switchStyleClass(obj,savedclass);}

function channelhover(obj, hoverclass){
    objhover(obj,hoverclass);
}
function channelout(obj, outclass){
    objout(obj,outclass);
}
function displayChange(obj,change,ev){
	obj.style.visibility=change;	
}
if(!self.AJAX_WebBaseURL)
    self.AJAX_WebBaseURL="";
var PlayerDim={Width:480 , Height:270};
//PlayerDim={Width:470 , Height:264};
 
function WriteFlashContent(id, interfaceId, interfaceInfo ){
    if(!interfaceId){
        var so = new SWFObject("/player/vPlayer.swf", "", PlayerDim.Width, PlayerDim.Height, "9.0.124", "#000000");
        so.addParam("quality", "high");
        so.addParam("wmode", "opaque");		
        so.addParam("allowScriptAccess","sameDomain");
        so.addParam("allowFullScreen","true");
        so.addVariable("clipID",id);
        so.useExpressInstall(AJAX_WebBaseURL+'player/expressinstall.swf');
        so.write("flash-content");
    }else{
        var so = new SWFObject("http://www.youtube.com/v/" + interfaceInfo + "&hl=en", "", PlayerDim.Width, PlayerDim.Height, "9.0.124", "#000000");
	    so.addParam("quality", "high");
	    so.addParam("wmode", "opaque");		
	    so.addParam("allowScriptAccess","sameDomain");
	    so.addParam("allowFullScreen","true");
	    so.useExpressInstall(AJAX_WebBaseURL+'player/expressinstall.swf');
	    so.write("flash-content");
    }
}
function RunScripts(){
    var scripts=document.getElementsByTagName("SCRIPT");
    for(var i=0;i<scripts.length;i++)
       if(scripts[i].id=="evalScript")
            eval(scripts[i].innerHTML);
}
var UpcomingZone=-1;
function WriteAds(type,file,url, write){		

        if(type=="Video"){
            var so = new SWFObject(AJAX_WebBaseURL+"player/in_page_ad.swf", "", "230", "110", "9.0.124", "#000000");
            so.addParam("quality", "high");
            so.addParam("wmode", "opaque");		
            so.addParam("align","middle");
            so.addParam("allowScriptAccess","sameDomain");
            so.addParam("allowFullScreen","true");
            so.addVariable("swf_url",AJAX_WebBaseURL+file);
            so.addVariable("click_url",AJAX_WebBaseURL+url);
            so.useExpressInstall(AJAX_WebBaseURL+'player/expressinstall.swf');
            if(!write)
                so.write("ad-content");
            else
                document.write(so.getSWFHTML());
        }else{
            var html="<a href='" + AJAX_WebBaseURL+url + "' target='_blank' ><img src='" + AJAX_WebBaseURL+file + "' width='240' height='108' border='0' /></a>";
            if(write)
                document.write(html);
            else
                document.getElementById("ad-content").innerHTML=html;
        }
}
function Video_Onload(ret,ctx){
   $get("videoDiv").innerHTML=ret;
	if(ctx)WriteFlashContent(ctx.Id,ctx.IId,ctx.IInfo);
}

var activeNav=new Array();
activeNav["R"]=1;
activeNav["L"]=1;

function changeNav(pos,id,obj){
    document.getElementById(pos+"Con"+activeNav[pos]).style.display="none";
    document.getElementById(pos+"Con"+id).style.display="block";
	if("undefined"!=obj){
		for(var parent = obj.parentNode.parentNode, i=0, j=parent.childNodes.length;i<j;i++){
			switchStyleClass(parent.childNodes[i].childNodes[0],'');
		}
		switchStyleClass(obj,'current');
	}
	else{
	    document.getElementById(pos+"linkCon"+activeNav[pos]).id=pos+"linkCon"+id;    
	    switchStyleClass(document.getElementById(pos+"link"+id).parentNode,'active');
	    savedclass='active';
	    switchStyleClass(document.getElementById(pos+"link"+activeNav[pos]).parentNode,' ');	    
	}
	activeNav[pos]=id;
}

function searchFull(txt){
    JS.Page.searchList.getElementById("tSearchStr").value=txt;
    JS.Page.searchList.Submit(JS.Page.searchList.getElementById("cmdSearch"));
    try{
        JS.Page.searchList.getElementById("tSearchStr").value="";
    }catch(e){}
    document.getElementById("RChannel").style.display="none";    
    document.getElementById("RSearch").style.display="block";    
}

function searchFullBottom(txt){
    JS.Page.searchList.getElementById("tSearchStr").value=txt;
    JS.Page.searchList.Submit(JS.Page.searchList.getElementById("cmdSearch"));
    try{
        JS.Page.searchList.getElementById("tSearchStr").value="";
    }catch(e){}
    document.getElementById("RChannel").style.display="block";    
    document.getElementById("RSearch").style.display="block"; 
		scrollDown();
}

var xScroll=1;
function scrollDown(){
	if (xScroll<=660){ 
		xScroll = xScroll*1.15;	
		window.scrollTo(0,xScroll)
		setTimeout('scrollDown()',5);
	}	else {
		xScroll = 1;		
	}
}

xScrollUp =1;
function setScrollPos(){
	xScrollUp=window.pageYOffset;	
	scrollUp();
}
function scrollUp(){
	if (xScrollUp>=2){ 
		xScrollUp = xScrollUp*0.85;	
		window.scrollTo(0,xScrollUp)
		setTimeout('scrollUp()',5);
	}	else {
		xScrollUp = 1;		
	}
}

function searchTag(tag){
    searchFullBottom("TAG::" + tag);
    
}


function changeChannel(cid,vid){
if(AJAX_WebBaseURL!=""){
    AJAX_BaseURL=SetQueryString(AJAX_BaseURL,"ChannelId",cid);
    if(self.GetFullPage)self.GetFullPage();
    return;
}
   
var res=window.location.href.split("?")[0]+"?";
    if(cid&&cid!=""){
        res+="ChannelId="+cid;
        if(vid&&vid!=null){
            res+="&VideoId="+vid;                      
        }       
    }
    else if(vid&&vid!=null){
        res+="VideoId="+vid;                      
    }
window.location.href=res;    
}
function allChannel(){
if(AJAX_WebBaseURL!=""){
    AJAX_BaseURL=SetQueryString(AJAX_BaseURL,"ChannelId",null);
    if(self.GetFullPage)self.GetFullPage();
    return;
}
window.location.href=window.location.href.split("?")[0]
}
window.onload=onLoadHandler;



function TextScroll(scrollname, div_name, up_name, down_name)
{
this.div_name = div_name;
this.name = scrollname;
this.scrollCursor = 0;
this.speed = 25;
this.timeoutID = 0;
this.div_obj = null;
this.up_name = up_name;
this.dn_name = down_name;

{
if (document.getElementById) {
div_obj = document.getElementById(this.div_name);
if (div_obj) {
this.div_obj = div_obj;
this.div_obj.style.overflow = 'hidden';
}
div_up_obj = document.getElementById(this.up_name);
div_dn_obj = document.getElementById(this.dn_name);
if (div_up_obj && div_dn_obj) {
div_up_obj.onmousedown = function() { eval(scrollname + '.scrollUp();') };
div_up_obj.onmouseup = function() { eval(scrollname + '.stopScroll();') };

div_dn_obj.onmousedown = function() { eval(scrollname + '.scrollDown();') };
div_dn_obj.onmouseup = function() { eval(scrollname + '.stopScroll();') };
}
}
}

this.stopScroll = function() {
clearTimeout(this.timeoutID);
}

this.scrollUp = function() {
if (this.div_obj) {
this.scrollCursor = (this.scrollCursor - this.speed) < 0 ? 0 : this.scrollCursor - this.speed;
this.div_obj.scrollTop = this.scrollCursor;
this.timeoutID = setTimeout(this.name + '.scrollUp()', 40);
}
}

this.scrollDown = function() {
if (this.div_obj) {
this.scrollCursor += this.speed;
this.div_obj.scrollTop = this.scrollCursor;
if (this.div_obj.scrollTop == this.scrollCursor) {
this.timeoutID = setTimeout(this.name + '.scrollDown()', 60);
} else {
this.scrollCursor = this.div_obj.scrollTop;
}
}
}

this.resetScroll = function() {
if (this.div_obj) {
this.div_obj.scrollTop = 0;
this.scrollCursor = 0;
}
}
}






