function test(){
	var num = document.getElementById("total").value;
	alert("Expand DIV: "+num);
	
	}


function display(item, elemId){
	//alert("Expand DIV");
identity=document.getElementById(elemId);
if(identity.className=='link'){
	identity.className='linkselected'
	//alert('change to 2nd');
}else{
	identity.className='link'
	//alert('change to 1st');
}

  if(document.getElementById(item).style.display  == "inline"){
    document.getElementById(item).style.display = "none";
//	elem = document.getElementById(elemId);
//	elem.className='link';
  }else{
    document.getElementById(item).style.display = "inline";
	//document.write(document.getElementById(item).style.display);
	
	
//	elem = document.getElementById(elemId);
//	elem.className='linkselected';
	
  };
  
  //alert (elemId);
}

function display2(item, elemId){
	// This second display function is for image links instead of the regular text links
identity=document.getElementById(elemId);
if(identity.className=='imglink'){
	identity.className='imglinkselected'
}else{
	identity.className='imglink'
}


  if(document.getElementById(item).style.display  == "inline"){
    document.getElementById(item).style.display = "none";
//	elem = document.getElementById(elemId);
//	elem.className='link';
  }else{
    document.getElementById(item).style.display = "inline";
	//document.write(document.getElementById(item).style.display);
	
	
//	elem = document.getElementById(elemId);
//	elem.className='linkselected';
	
  };
  
  //alert (elemId);
}


function display3(item, elemId){
	//alert("Expand DIV");
identity=document.getElementById(elemId);
if(identity.className=='linkoscar'){
	identity.className='linkselectedoscar'
	//alert('change to 2nd');
}else{
	identity.className='linkoscar'
	//alert('change to 1st');
}

// tests if oscar feature to swap to alternate css styles
//if(identity.className=='linkoscar'){
//	identity.className='linkselectedoscar'
//}else{
//	identity.className='linkoscar'
//}

  if(document.getElementById(item).style.display  == "inline"){
    document.getElementById(item).style.display = "none";
  }else{
    document.getElementById(item).style.display = "inline";
	
	
	
  };
  
}



function testing(item){
	var test = document.getElementById('testing');
	var html = test.innerHTML + "<br>" + "item == " + item;
	test.innerHTML = html;
	test.scrollTop = test.scrollHeight;
	
	document.getElementById(item).className='minusbg';
}

function reseticons(){
	//alert("reset Icons");
	// resets the style of all the trailer links so that the rotating icon appears & disappears when switch between trailers
//var nlinks = 12;  // this needs to be set to the nnumber of trailer/video links on page
 var nlinks = document.getElementById("total").value; // this value comes from a hidden form field on page
 var olinks = document.getElementById("totaloscar").value; // this value comes from a hidden form field on page
 
 
	for (var x = 1; x <= nlinks; x++){
		var t = "trailer"+x;
		identity=document.getElementById(t);
		identity.className='trailerlink';
	}
	
	
	for (var y = 1; y <= olinks; y++){
		var s = "traileroscar"+y;
		identity2=document.getElementById(s);
		identity2.className='trailerlinkoscar';
	}
//alert(nlinks);
//alert(olinks);
}	
	
	
	
function playQTvideo(item, height, width, elemId){
	//alert("play QT video");
	scroll(0,0); //scrolls browser to top
	reseticons();
	identity=document.getElementById(elemId);
	if(identity.className=='trailerlink'){
		identity.className='trailerlinkselected'
	}
	
	if(identity.className=='trailerlinkoscar'){
		identity.className='trailerlinkselectedoscar'
	}
	
<!-- 12px have been added to the height to accomadate the video nav bar -->
	var test = document.getElementById('testing');
	var html = test.innerHTML + "<br>" + "playVideo::: " + "H:" + height + " " + "W: " + width;
	test.innerHTML = html;
	
	var vid = document.getElementById('mydiv');
	var html = "<center><br><object classid=\"clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B\" codebase=\"http://www.apple.com/qtactivex/qtplugin.cab\" width=\"" +
	width +
	"\" height=\"" +
	height +
	"\">" +
	"<param name=\"src\" value=\"" +
	item +
	"\" />" +
	"<param name=\"controller\" value=\"true\" />" +
	"<object type=\"video/quicktime\" data=\"" +
	item +
	"\" width=\"" +
	width +
	"\" height=\"" +
	height +
	"\" class=\"mov\">" +
	"<param name=\"controller\" value=\"true\" />" +
	"</object>" +
	"</object></center>";
	
	vid.innerHTML = html;
	

};

function playREALvideo(item, height, width, elemId){
		//alert("play REAL video");
	scroll(0,0); //scrolls browser to top
	reseticons();
	identity=document.getElementById(elemId);
	if(identity.className=='trailerlink'){
		identity.className='trailerlinkselected'
	}
	
	if(identity.className=='trailerlinkoscar'){
		identity.className='trailerlinkselectedoscar'
	}
	
	var test = document.getElementById('testing');
	var html = test.innerHTML + "<br>" + "playVideo::: " + "H:" + height + " " + "W: " + width;
	test.innerHTML = html;
	
	var vid = document.getElementById('mydiv');
	var html = "<OBJECT ID=RVOCX CLASSID = 'clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA' WIDTH='" + 
	width + 
	"' HEIGHT='" + 
	height + 
	"'>" +
"<PARAM name='src' value= '" +
item + "'>" +
"<PARAM name='autostart' value='true'>" +
"<PARAM name='controls' value='imagewindow'>" +
"<PARAM name='console' value='video'>" +
"<EMBED TYPE='audio/x-pn-realaudio-plugin'" +
"SRC='" +
item + "'" +
"WIDTH='320'" +
"HEIGHT='240'" +
"AUTOSTART='true'" +
"CONTROLS='all'" +
"CONSOLE='video'>" +
"</EMBED>" +
"</OBJECT>";
	
	vid.innerHTML = html;

};

function playWMPvideo(item, height, width, elemId){
	//alert("play WMP video");
	scroll(0,0); //scrolls browser to top
	reseticons();
	identity=document.getElementById(elemId);
	if(identity.className=='trailerlink'){
		identity.className='trailerlinkselected'
	}
	
	if(identity.className=='trailerlinkoscar'){
		identity.className='trailerlinkselectedoscar'
	}
	
<!-- add '45' to video height if have video 'ShowControls' turned on -->
	var test = document.getElementById('testing');
	var html = test.innerHTML + "<br>" + "playVideo::: " + "H:" + height + " " + "W: " + width;
	test.innerHTML = html;
	
	var vid = document.getElementById('mydiv');
	var html = "<OBJECT ID='MediaPlayer' WIDTH='" + 
	width + 
	"' HEIGHT='" + 
	height + 
	"' CLASSID='CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95'" +
"STANDBY='Loading Windows Media Player components...' TYPE='application/x-oleobject'>" +
"<PARAM NAME='FileName' VALUE='" +
item + "'>" +
"<PARAM name='autostart' VALUE='true'>" +
"<PARAM name='ShowControls' VALUE='true'>" +
"<param name='ShowStatusBar' value='true'>" +
"<PARAM name='ShowDisplay' VALUE='true'>" +
"<EMBED TYPE='application/x-mplayer2' SRC='" +
item + "' NAME='MediaPlayer' " +
"WIDTH='" +
width + "' HEIGHT='" + height + "' ShowControls='1' ShowStatusBar='0' ShowDisplay='0' autostart='0'> </EMBED>" +
"</OBJECT>" +
"</OBJECT>";
	
	vid.innerHTML = html;

};

function playFLVvideo(item, height, width, elemId){
		//alert("play FLASH video");
	scroll(0,0); //scrolls browser to top
	reseticons();
	identity=document.getElementById(elemId);
	if(identity.className=='trailerlink'){
		identity.className='trailerlinkselected'
	}
	
	if(identity.className=='trailerlinkoscar'){
		identity.className='trailerlinkselectedoscar'
	}
	
	var test = document.getElementById('testing');
	var html = test.innerHTML + "<br>" + "playVideo::: " + "H:" + height + " " + "W: " + width;
	test.innerHTML = html;
	
	var vid = document.getElementById('mydiv');
	var html = "<object type='application/x-shockwave-flash' data='FlowPlayerLP.swf' width='" + 
	width + 
	"' height='" + 
	height + 
	"' id='FlowPlayer'>" +
"<param name='allowScriptAccess' value='sameDomain' />" +
"<param name='movie' value='FlowPlayerLP.swf' />" +
"<param name='quality' value='high' />" +
"<param name='scale' value='noScale' />" +
"<param name='wmode' value='transparent' />" +
"<param name='flashvars' value='baseURL=&videoFile=" +
item +
"&loop=true&autoPlay=true' />" +
"</object>";
	
	vid.innerHTML = html;

};

