//
// Adds some text where the cursor is.
//
// Works in IE and Mozilla 1.3b+
// In other browsers, it simply adds the text at the end of the current text
//
function addText( input, insText ) 
{
	input.focus();
	if( input.createTextRange ) {
		document.selection.createRange().text += insText;
 	} 
 	else if( input.setSelectionRange ) {
		var len = input.selectionEnd;
   		input.value = input.value.substr( 0, len ) + insText + input.value.substr( len );
   		input.setSelectionRange(len+insText.length,len+insText.length);
 	} 
 	else { 
	 	input.value += insText; 
	}
}

//
// Wraps the current selection of a textbox around with the given 'v' parameter.
// 
// Works in IE and Mozilla 1.3b+
// In other browsers, it simply adds an empty pair of tags at the end of the current
// text.
//
function wrapSelection(ta, v) 
{
	if( document.selection ) {
		// for IE
		var str = document.selection.createRange().text;
		ta.focus();
		var sel = document.selection.createRange();
		sel.text = "<" + v + ">" + str + "</" + v + ">";
    }
	else {
		// browsers other than IE
		var s = ta;
		if( s.selectionEnd ) {
			// Mozilla 1.3b+ 
			var s1 = (s.value).substring(0,s.selectionStart)
			var s2 = (s.value).substring(s.selectionEnd,s.textLength)
			selection = (s.value).substring(s.selectionStart, s.selectionEnd)
			s.value = s1 + '<' + v + '>' + selection + '</' + v + '>' + s2
		}
		else {
			// everything else
			s.value += '<' + v + '></' + v + '>';
		}
	}
	
	return;
}

//
// Asks for a url and adds a link to the textbox, at the same point where the cursor is.
//
// Uses insertText to insert the text so it has the same limitations as insertText has
//
function insertLink(ta) {
	var s  = ta;
	var my_link = prompt('Enter URL:', 'http://')
	if (my_link != null) {
		addText(ta, my_link);
	}
	
	return;
}    

////////////////
/// buttons
///////////////
function mouseover(el) {
  el.className = "button_raised";
}

function mouseout(el) {
  el.className = "button";
}

function mousedown(el) {
  el.className = "button_pressed";
}

function mouseup(el) {
  el.className = "button_raised";
}





function swf_obj(src,w,h,swfid){
	swf_html = '';
	swf_html += '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+w+'" height="'+h+'" id="'+swfid+'" align="middle">';
	swf_html += '<param name="allowScriptAccess" value="always">';
	swf_html += '<param name="movie" value="'+src+'">';
	swf_html += '<param name="quality" value="high">';
	swf_html += '<param name="bgcolor" value="#000000">';
	swf_html += '<PARAM NAME="wmode" value="opaque">';
	swf_html += '<embed src="'+src+'" quality="high" bgcolor="#000000" width="'+w+'" height="'+h+'" name="'+swfid+'" align="middle" allowScriptAccess="always" wmode="transparent" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">';
	swf_html += '</object>';
	document.write(swf_html);
}


function open_window(url,name,para) { 
window.open(url,name,para); 
} 






function gotoLink(num) {

if (num==1){
	if(document.FormNo1.SelectNo1.value=="")
	{
		alert("Please Select a Show!");
		document.FormNo1.SelectNo1.focus();
		return false;
	}
var Current = document.FormNo1.SelectNo1.selectedIndex;
window.open(document.FormNo1.SelectNo1.options[Current].value);
}

if (num==2){
	if(document.FormNo2.SelectNo2.value=="")
	{
		alert("Please Select a Show!");
		document.FormNo2.SelectNo2.focus();
		return false;
	}
var Current = document.FormNo2.SelectNo2.selectedIndex;
window.open(document.FormNo2.SelectNo2.options[Current].value);
}

if (num==3){
	if(document.FormNo3.SelectNo3.value=="")
	{
		alert("Please Select a Show!");
		document.FormNo3.SelectNo3.focus();
		return false;
	}
var Current = document.FormNo3.SelectNo3.selectedIndex;
window.open(document.FormNo3.SelectNo3.options[Current].value);
}

if (num==4){
	if(document.FormNo4.SelectNo4.value=="")
	{
		alert("Please Select a Mini Series or Telemovie!");
		document.FormNo4.SelectNo4.focus();
		return false;
	}
var Current = document.FormNo4.SelectNo4.selectedIndex;
window.open(document.FormNo4.SelectNo4.options[Current].value);
}

return false;
}