// function for handling the episode guide dropdown

function formHandler(form){
var URL = document.form.site.options[document.form.site.selectedIndex].value;
window.location.href = URL;
}


// function for login and bbs

function talkcity(bbslink) {

bbswindow=window.open(bbslink,"","personalbar=no,menubar=yes,toolbar=no,location=no,resizable=yes,scrollbars=yes,status=yes,height=500,width=710")
}


// function for popup poll results

function popUpResultsWin(height, width, url) {
window.open(
            "",
            "PollResults",
            "width="+width+",height="+height+",RESIZABLE=NO,SCROLLBARS=YES"
     );
}


// functions for video room

function seriesVideo0(playertype) {


	var num = document.city0.menudo.selectedIndex;

	var infostring = document.city0.menudo.options[num].value;

		if (infostring == "blank") {

		alert("Choose a clip first from the Episode Promos pulldown menu, then click your player to view!") ;

		return ;

		}

	var info = infostring.split('+');

	var videotitle = info[0];

	var qtlocation = info[1];

	var reallocation = info[2];

	if (playertype == 'qt') {

		video(info[1],info[0],playertype,'320','256','/city/img/template/banner.jpg','#ffffff','promo-dkgrey')

		}

	else if (playertype == 'real') {

		video(info[2],info[0],playertype,'320','240','/city/img/template/banner.jpg','#ffffff','promo-dkgrey')

		}
	}



function seriesVideo1(playertype) {


	var num = document.city1.menudo.selectedIndex;

	var infostring = document.city1.menudo.options[num].value;

		if (infostring == "blank") {

		alert("Choose a clip first from the Episode Clips pulldown menu, then click your player to view!") ;

		return ;

		}

	var info = infostring.split('+');

	var videotitle = info[0];

	var qtlocation = info[1];

	var reallocation = info[2];

	if (playertype == 'qt') {

		video(info[1],info[0],playertype,'320','256','/city/img/template/banner.jpg','#ffffff','promo-dkgrey')

		}

	else if (playertype == 'real') {

		video(info[2],info[0],playertype,'320','240','/city/img/template/banner.jpg','#ffffff','promo-dkgrey')

		}
	}


function seriesVideo2(playertype) {


	var num = document.city2.menudo.selectedIndex;

	var infostring = document.city2.menudo.options[num].value;

		if (infostring == "blank") {

		alert("Choose a clip first from the Interviews pulldown menu, then click your player to view!") ;

		return ;

		}

	var info = infostring.split('+');

	var videotitle = info[0];

	var qtlocation = info[1];

	var reallocation = info[2];

	if (playertype == 'qt') {

		video(info[1],info[0],playertype,'320','256','/city/img/template/banner.jpg','#ffffff','promo-dkgrey')

		}

	else if (playertype == 'real') {

		video(info[2],info[0],playertype,'320','240','/city/img/template/banner.jpg','#ffffff','promo-dkgrey')

		}
	}


// function for kostas flash objects


var extWin;

function openWin(url,w,h){
	var x = (screen.width - w)/2;
	var y = (screen.height - h)/3;
	if(typeof(extWin)=="undefined" || extWin.closed==true){
		extWin = window.open(url,"external","width="+w+",height="+h+",left="+x+",top="+y+",toolbar=no,location=no,menubar=no,status=no,scrollbars=no,resizable=no");
		if(extWin.opener == null) extWin.opener = window;
		extWin.w = w;
		extWin.h = h;
	} else {
		if(w != extWin.w || h != extWin.h){
			extWin.resizeTo(w,h);
			extWin.moveTo(x,y);
			extWin.w = w;
			extWin.h = h;
		}
		if(extWin.location != url) extWin.location = url;
		extWin.focus();
	}
}

// generic open window script

function openWindow(theURL,winName,features) {

window.open(theURL,winName,features);

}

// nav highlight script for Book pages

function highlight(x) {
var el = ('link' + x);
document.getElementById(el).className = "on";
}
