// copyright (c) 2006-7 zefrank.com, all rights reserved// contributions and licensing inquiries welcome// contact usfunction $(id){    return document.getElementById(id);}var currentSearch = 4;function showSearch(id){    hide("search" + currentSearch);    $("f" + id).value = $("f" + currentSearch).value;    currentSearch = id;    show("search" + id);    $("f" + currentSearch).focus();}function toggleVis(id){    var x = $(id);    if (x.style.display == 'none' || x.style.display == '')    {        show(id);    }    else    {        hide(id);    }    return false;}function show(id){    var x = $(id);    x.style.display = 'block';    x.style.visibility = 'visible';}function hide(id){    var x = $(id);    x.style.display = 'none';    x.style.visibility = 'hidden';}function menu(m){    for (var i=1; i<=4; i++)    {        if (i != m)        {            hide('theshow' + i);        }    }    if (m == 0)    {        show('theshow');        show('rightpanelshow');        return;    }    hide('theshow');    hide('rightpanelshow');    show('theshow' + m);    if (m == 4) // search    {        showSearch(currentSearch);    }}function menuHover(m, over){    var o = '';    if (over == 1) o = 'o';    $('ma'+m).src = 'http://www.zefrank.com/theshow/site4/navarrow' + o + '.gif';}function navHover(i, over){    var o = '';    if (over == 1) o = 'o';    var n = '';    if ((i == 1) || (i >= 10)) n = 'L';    $('nav'+i).src = 'http://www.zefrank.com/theshow/site4/navarrow' + n + o + '.gif';}function setMovieDiv(result, id, useQT){    var x = $("leaderimg");    x.style.visibility = 'hidden';    x = $(id);    if (useQT)    {        if (!isQuickTimeInstalled())        {            result = "<p>This movie requires Apple QuickTime, which works great on Mac and Windows.<br />If the movie does not play, please <a href='http://www.apple.com/quicktime/download/standalone.html' target='_blank'>download and install QuickTime</a>.</p>" + result;        }    }    else    {        if (getFlashVersion() < 8)        {            result = "<p>This movie requires Flash version 8 or later.<br />If the movie does not play, please <a href='http://www.adobe.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' target='_blank'>download and install Flash</a>.</p>" + result;        }    }    x.innerHTML = result;}function showBlipFlash(mediaid, id){    var result = "<div style='position:relative; left: -20px;'class='blip'id='blip_movie_content_" + mediaid + "'></div>";    result += "<script type='text/javascript'src='http://blip.tv/syndication/write_player/?posts_id=" + mediaid +"&skin=js&file_type=flv&xplayer_width=320&xplayer_height=240'></script>";    result += "<script type='text/javascript'>PokkariPlayer.USE_SHOWPLAYER=1; play_blip_movie_" + mediaid + "();</script>";    setMovieDiv(result, id, false);} function showBlipQT(mediaurl, id){    var autoplay = "true";    var result = '<embed src="' + mediaurl + '" pluginspage="http://www.apple.com/quicktime/download/" scale="tofit" kioskmode="false" ';    result += 'qtsrc="' + mediaurl + '" cache="false" height="272" width="320" controller="true" type="video/quicktime" autoplay="' + autoplay + '">\n';    setMovieDiv(result, id, true);}function showQT(mediaid, id){    var autoplay = "true";//    try//    {//        var q = window.location.toString();//        if (q.indexOf('#') != -1) autoplay="false";//    }//    catch(e) {};    var path = 'http://media.revver.com/qt;sharer=14854/' + mediaid + '.mov';    var result = '<embed src="' + path + '" pluginspage="http://www.apple.com/quicktime/download/" scale="tofit" kioskmode="false" ';    result += 'qtsrc="' + path + '" cache="false" height="272" width="320" controller="true" type="video/quicktime" autoplay="' + autoplay + '">\n';    setMovieDiv(result, id, true);}function showFlash(mediaid, id){    var result =  '<div style="position: relative; top: 8px;"><embed ';    result     += 'type="application/x-shockwave-flash" src="http://flash.revver.com/player/1.0/player.swf" ';    result     += 'pluginspage="http://www.macromedia.com/go/getflashplayer" scale="noScale" salign="TL" bgcolor="#ffffff" ';    result     += 'flashvars="width=320&height=259&mediaId=' + mediaid + '&affiliateId=14854&javascriptContext=true';    result     += '&skinURL=http://flash.revver.com/player/1.0/skins/RevverSkin_1-1.swf';    result     += '&skinImgURL=http://flash.revver.com/player/1.0/skins/night_skin.png';    result     += '&actionBarSkinURL=http://flash.revver.com/player/1.0/skins/RevverActionBarSkin.swf';    result     += '&resizeVideo=True" width="320" height="259"></embed></div>';    setMovieDiv(result, id, false);}function isQuickTimeInstalled(){    if (navigator.plugins && navigator.plugins.length)    {    	for (x=0; x<navigator.plugins.length; x++)    	{    		if (navigator.plugins[x].name.indexOf('QuickTime Plug-in') != -1)    		{                return true;    		}    	}    }    else if (window.ActiveXObject)    {    	try    	{    		oQT=new ActiveXObject('QuickTimeCheckObject.QuickTimeCheck.1');    		if (oQT)    		{    			if (oQT.IsQuickTimeAvailable(0)) return true;    		}    	}    	catch(e)        {        }    }    return false;}// 0 = not installed// 1 = installed but unknown version// otherwise current versionfunction getFlashVersion(){    var flashVersion = 0;    if (navigator.plugins && navigator.plugins.length)    {    	x = navigator.plugins["Shockwave Flash"];    	if (x)    	{    		flashVersion = 1;    		if (x.description)    		{    			y = x.description;    			flashVersion = y.charAt(y.indexOf('.')-1);    		}    	}    }    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 case        for(var i=9; i>=7; i--)        {    		try            {			    var flash = new ActiveXObject("ShockwaveFlash.ShockwaveFlash." + i);    			flashVersion = i;			    break;    		}            catch(e)            {            }    	}    }    return flashVersion;}function comment(i,t){    toggleVis('commentblock');    if ($('commentblock').innerHTML == 'loading comments...')    {        commentRequest('http://www.zefrank.com/theshow/site4/comment.php?i=' + i + '&t=' + t);    }}function commentRequest(url){    var http_request = false;    if (window.XMLHttpRequest) { // Mozilla, Safari,...        http_request = new XMLHttpRequest();        if (http_request.overrideMimeType) {            http_request.overrideMimeType('text/xml');        }    } else if (window.ActiveXObject) { // IE        try {            http_request = new ActiveXObject("Msxml2.XMLHTTP");        } catch (e) {            try {                http_request = new ActiveXObject("Microsoft.XMLHTTP");            } catch (e) {}        }    }    if (!http_request)    {        return false;    }    http_request.onreadystatechange = function() { commentResponse(http_request); };    http_request.open('GET', url, true);    http_request.send(null);}function commentResponse(http_request){    if (http_request.readyState == 4)    {        if (http_request.status == 200)        {            $('commentblock').innerHTML = http_request.responseText;        }        else        {            return;     // ignore error        }    }}