function conf()
{
  if( confirm( 'Are you sure?' ) ) return true
  else return false;
}

function openAWindow2( pageToLoad, winName, width, height, center){

xposition=0; yposition=0;
if ((parseInt(navigator.appVersion) >= 4 ) &&(center)){
 xposition = (screen.width - width) / 8;
 yposition = (screen.height - height) / 3;
}

args = "width=" + width + ","
+ "height=" + height + ","
+ "location=0,"
+ "menubar=0,"
+ "resizable=0,"
+ "scrollbars=1,"
+ "status=0,"
+ "titlebar=0,"
+ "toolbar=0,"
+ "hotkeys=0,"
+ "screenx=" + xposition + "," //NN Only
+ "screeny=" + yposition + "," //NN Only
+ "left=" + xposition + "," //IE Only
+ "top=" + yposition; //IE Only

window.open( pageToLoad, winName, args );

}

function openAWindow( pageToLoad, winName, width, height, center){

xposition=0; yposition=0;
if ((parseInt(navigator.appVersion) >= 4 ) &&(center)){
 xposition = (screen.width - width) / 8;
 yposition = (screen.height - height) / 3;
}

args = "width=" + width + ","
+ "height=" + height + ","
+ "location=0,"
+ "menubar=0,"
+ "resizable=0,"
+ "scrollbars=0,"
+ "status=0,"
+ "titlebar=0,"
+ "toolbar=0,"
+ "hotkeys=0,"
+ "screenx=" + xposition + "," //NN Only
+ "screeny=" + yposition + "," //NN Only
+ "left=" + xposition + "," //IE Only
+ "top=" + yposition; //IE Only

window.open( pageToLoad, winName, args );

}

function openAWindow3( pageToLoad, winName, width, height, center){

xposition=0; yposition=0;
if ((parseInt(navigator.appVersion) >= 4 ) &&(center)){
 xposition = (screen.width - width) / 8;
 yposition = (screen.height - height) / 3;
}

args = "width=" + width + ","
+ "height=" + height + ","
+ "location=0,"
+ "menubar=1,"
+ "resizable=0,"
+ "scrollbars=0,"
+ "status=0,"
+ "titlebar=0,"
+ "toolbar=0,"
+ "hotkeys=0,"
+ "screenx=" + xposition + "," //NN Only
+ "screeny=" + yposition + "," //NN Only
+ "left=" + xposition + "," //IE Only
+ "top=" + yposition; //IE Only

window.open( pageToLoad, winName, args );

}

function void_() {
}

function xget(id) {
	if(document.getElementById) return document.getElementById(id);
	if(document.all) return document.all[id];
	return null;
}

var isopen=0;
function show_div(id) {
	if(xget(id).style.display=='none') 
	{
		isopen=1;
		xget(id).style.display='block';
		xget('movemenu_v').style.marginTop='0px';
		xget('scroller_v').style.top='0px';
		init1();
	}
	else
	{
		xget(id).style.display='none';
	}
}
function show_div2(id) {
	if(xget(id).style.display=='none') 
	{
		isopen=2;
		xget(id).style.display='block';
		xget('movemenu_v2').style.marginTop='0px';
		xget('scroller_v2').style.top='0px';
		init2();
	}
	else
	{
		xget(id).style.display='none';
	}
}
function show_more() {
	if(xget('text_more') && xget('text_small')) 
	{
		xget('text_small').style.display='none';		
		xget('text_more').style.display='block';
	}
}
function show_small() {
	if(xget('text_more') && xget('text_small')) 
	{
		xget('text_small').style.display='block';		
		xget('text_more').style.display='none';
	}
}

function detect_user_agent(){
	navigator.DOM=!!(document.getElementById?1:0);
	navigator.OPERA=!!(window.opera);
	navigator.OPERA5=!!(navigator.OPERA&&navigator.userAgent.indexOf("pera 5")>0);
	navigator.OPERA6=	!!(navigator.OPERA&&navigator.userAgent.indexOf("pera 6")>0);
	navigator.IE8=		!!(navigator.appVersion.indexOf("IE 8")>0&&navigator.DOM&&!navigator.OPERA?1:0);
	navigator.IE7=		!!(navigator.appVersion.indexOf("IE 7")>0&&navigator.DOM&&!navigator.OPERA?1:0);
	navigator.IE6=		!!(navigator.appVersion.indexOf("IE 6")>0&&!navigator.IE7&&!navigator.IE8&&navigator.DOM&&!navigator.OPERA?1:0);
	navigator.IE5=		!!(navigator.appVersion.indexOf("IE 5")>0&&navigator.DOM&&!navigator.OPERA?1:0);
	navigator.IE4=		!!(document.all&&!navigator.DOM?1:0);
	navigator.IE=		!!(navigator.IE4||navigator.IE5||navigator.IE6);
	navigator.MAC=		!!(navigator.userAgent.indexOf("Mac")>0);
	navigator.NS6=		!!(navigator.DOM && parseInt(navigator.appVersion)>4?1:0);
	navigator.NS4=		!!(document.layers && !navigator.DOM?1:0);
	navigator.DOMCORE1=	!!(typeof(document.getElementsByTagName)!='undefined' && typeof(document.createElement)!='undefined');
	navigator.DOMCORE2=	!!(navigator.DOMCORE1 && typeof(document.getElementById) != 'undefined' && typeof(document.createElementNS) != 'undefined');
	navigator.DOMHTML=	!!(navigator.DOMCORE1 && typeof(document.getElementById) != 'undefined');
	navigator.DOMCSS1=	!!(navigator.NS6||navigator.IE)	;
	if(navigator.DOMCORE1&&!navigator.OPERA)
	{	var check_element=document.createElement('p');
		navigator.DOMCSS2=!!(typeof(check_element)=='object');
	} else	navigator.DOMCSS2=!!(false)	
	navigator.DETECTED=	(	navigator.OPERA||navigator.OPERA6||navigator.OPERA5||navigator.IE||navigator.IE6||navigator.IE5||navigator.IE4||navigator.MAC||navigator.NS6||navigator.NS4||navigator.DOM||navigator.DOMHTML||navigator.DOMCORE1||navigator.DOMCORE2||navigator.DOMCSS1||navigator.DOMCSS2	);
	}
	
if (navigator.userAgent.toLowerCase().indexOf('gecko') != -1) {
     window.attachEvent = function(eventName, delegate) {
         this.addEventListener(eventName.substring(2), delegate, false);
     }
 
     window.detachEvent = function(eventName, delegate) {
         this.removeEventListener(eventName.substring(2), delegate, false);
     }
 
     window.document.attachEvent = function(eventName, delegate) {
         this.addEventListener(eventName.substring(2), delegate, false);
     }
     
     window.document.detachEvent = function(eventName, delegate) {
         this.removeEventListener(eventName.substring(2), delegate, false);
     }
 
     HTMLElement.prototype.attachEvent = function(eventName, delegate) {
         this.addEventListener(eventName.substring(2), delegate, false);
     }
 
     HTMLElement.prototype.detachEvent = function(eventName, delegate) {
         this.removeEventListener(eventName.substring(2), delegate, false);
     }
 
     HTMLElement.prototype.fireEvent = function(eventName, eventInstance) {
         var events = this.ownerDocument.createEvent("events");
         events.initEvent(eventName.substring(2), false, true);
         this.dispatchEvent(ev);
     }
     
     Event.prototype.__defineGetter__("srcElement", function () {
        var node = this.target;
        while (node.nodeType != 1) node = node.parentNode;
        return node;
     })
 }	

function makeHttpRequest(url, callback_function, return_xml) {
  var http_request = false;

  if (window.XMLHttpRequest) { // Mozilla, Safari,...
		http_request = new XMLHttpRequest();
		if (http_request.overrideMimeType && return_xml == 'xml') {
			 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) {
		alert('Unfortunately your browser doesn\'t support this feature.');
		return false;
  }

  http_request.onreadystatechange = function() {
		if (http_request.readyState == 4) {
			 if (http_request.status == 200) {
				  if (return_xml == 'xml') {
						eval(callback_function + '(http_request.responseXML)');
				  } else {
						eval(callback_function + '(http_request.responseText)');
				  }
			 } else {
				  alert('There was a problem with the request. (Code: ' + http_request.status + ')');
			 }
		}
  }
  http_request.open('GET', url, true);
  http_request.send(null);
}

function show_video(title) {
   	makeHttpRequest('/getVideo.asp?title='+title, 'displayVideo', 'text');
}
function displayVideo(text) { 
	eval(text);		
}

function set_search(coll) { 
	if (xget('search'))
	{
		if (xget('search').value.length>=0)
		{
			show_coll_ssearch(xget('search').value);
		}
	}
}

function show_coll(title,link2) {
	for (i=0;i<=100;i++)
	{
		if (xget('collmenu_'+i)) {xget('collmenu_'+i).className='coll';}
	}
	link2.className='coll_a';
	xget('search').value='Search Videos';
   	makeHttpRequest('/getVideo.asp?coll='+title, 'displaycoll', 'text');
}
function show_coll_ssearch(ssearch) {
	cc=""
	for (i=0;i<=100;i++)
	{
		if (xget('collmenu_'+i)) {
			if (xget('collmenu_'+i).className=='coll_a') {cc=xget('collmenu_'+i).innerHTML;}
		}
	}
	ssearch=ssearch.replace("&","|amp|");

   	makeHttpRequest('/getVideo.asp?coll='+cc+'&search='+ssearch, 'displaycoll', 'text');
}
function displaycoll(text) { 
	eval(text);		
	xget('movemenu_v2').style.marginTop='0px';
	xget('scroller_v2').style.top='0px';	
	init2();
}

function set_open_div()
{
	if (isopen==0)
	{		
		show_div('coll');
		show_div2('videos');
		show_more();
	}
}
function clearsearch()
{
	xget('search').value='Search Videos';
	set_search('');
}
function set_open_div_()
{
	setTimeout("set_open_div();",2000);
}

if (window.attachEvent) {window.attachEvent("onload", set_open_div_);}