/// <reference path="jquery-vsdoc.js" />

startList = function() {
	if (document.all&&document.getElementById) {
		navRoot = document.getElementById("nav");
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=="LI") {
				node.onmouseover=function() {
					this.className+=" over";
				}
				node.onmouseout=function() {
					this.className=this.className.replace(" over", "");
				}
			}
		}
	}
}
window.onload=startList;

function callFlash(fileName,theWidth,theHeight) {

    var intWidth = theWidth;
    var intHeight = theHeight;
    if (intWidth==null) {
        intWidth=920
    };
    if (intHeight==null) {
        intHeight=44
    };
    
    document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
    document.write('    codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" ');
    document.write('    ID="sale" WIDTH="'+intWidth+'" HEIGHT="'+intHeight+'" ALIGN="center">');
    document.write('    <PARAM NAME="movie" VALUE="' + fileName + '"/> <PARAM NAME="quality" VALUE="high"/>  <PARAM NAME="wmode" VALUE="transparent"/> ');
    
    document.write('    <EMBED src="' + fileName + '" quality=high bgcolor=#ffffff  ');
    document.write('        swLiveConnect="FALSE" WIDTH="'+intWidth+'" HEIGHT="'+intHeight+'" NAME="sale" ALIGN="center"');
    document.write('        TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer" width="'+intWidth+'" height="'+intHeight+'">');
    document.write('    </EMBED>');
    document.write('</OBJECT>'); 
    
}

$().ready(function() {
    var p = '#fader li p';
    var speed = '' // alt: slow | medium | fast or leave blank

    $(p).each(function() {
        $(this).hide();
    });

    var guid = '#fader li[guid=' + getParameterByName('guid') + '] span';

    if (guid != "") {
        $(guid).siblings('p').show(speed);
    }
    
    $('#fader li span').click(function() {
        // hide others
        $(p).each(function() {
            $(this).hide();
        });
        
        //if current one is open, then close
        if ($(this).attr('rel') == 'true')
        {
            $(this).attr({'rel':'false'}).siblings('p').hide(speed);
        }
        else
        {
            // show selected
            $(this).attr({'rel':'true'}).siblings('p').show(speed);
        }
    });
    
});
        
function getParameterByName( name )
{
  name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
  var regexS = "[\\?&]"+name+"=([^&#]*)";
  var regex = new RegExp( regexS );
  var results = regex.exec( window.location.href );
  if( results == null )
    return "";
  else
    return results[1];
}