function toggleInput(objElement) {
  if (objElement.className=='input-normal')
    objElement.className='input-focus';
  else
    objElement.className='input-normal';
}

function toggleInputSearch(objElement) {
  if (objElement.className=='quick-search-normal')
    objElement.className='quick-search-focus';
  else
    objElement.className='quick-search-normal';
}


function toggleTxtarea(objElement) {
  if (objElement.className=='txtarea-normal')
    objElement.className='txtarea-focus';
  else
    objElement.className='txtarea-normal';
}

function toggleImg(imgSrc, imgName, status) {
    var path = 'Client/Interface/' + imgSrc;
    
    if (status == 'on'){
      document[imgName].src = path + '_mover.gif';
    } else if (status == 'off'){
      document[imgName].src = path + '_idle.gif';
    } else if (status == 'active'){
       // Do nothing
    }
     
}


function SwitchFrontPage (what,i) {
    if(what == "content") {
        document.frontpage.content_id[i].options[0].selected = true; 
    }
    if(what == "movie") {
        document.frontpage.movie_id[i].options[0].selected = true;    
    }
}

function Rate(movie_id) {
  	var left = screen.width/4;
	var top = screen.height/4;
	window.open("Popupf4b5.html?view=Rate&amp;movie_id="+ movie_id,"Rate","left="+left+",top="+top+",toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=350,height=230");
}

function Poll(poll_id) {
  	var left = screen.width/4;
	var top = screen.height/4;
	window.open("Popup20e9.html?view=Poll&amp;poll_id="+ poll_id,"Poll","left="+left+",top="+top+",toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=350,height=420");
}


function ReziseWindow() {
	window.resizeTo(360,document.body.clientHeight+60);
}


function addRate(rate) {
	document.vote_form.vote.value='';	
	document.vote_form.vote.value=rate;
	document.vote_form.submit();
}

function CheckPoll() {

	poll_choice = false;
	
  	for (counter = 0; counter < document.poll_form.poll_content_id.length; counter++) {
  		if (document.poll_form.poll_content_id[counter].checked) {
			poll_choice = true; 
		}
  	}
  	
  	if(poll_choice) {
  		document.poll_form.submit();
  	} else {
  		alert("Please make a choice");
  	}
  	
}

function SilverScreen(movie_id) {
  var left = screen.width/4;
	var top = screen.height/4;
	window.open("Popup1f2b.html?view=SilverScreen&amp;movie_id="+ movie_id,"SilverScreen","left="+left+",top="+top+",toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=800,height=600");
  //window.open("Popup.asp?view=SilverScreen&movie_id="+ movie_id,"SilverScreen","left="+left+",top="+top+",toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=800,height=600");
}

function AboutCookies() {
  var left = screen.width/4;
	var top = screen.height/4;
	window.open("Popupff24.html?view=AboutCookies","AboutCookies","left="+left+",top="+top+",toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=350,height=340");
}

var oWin;
function LaunchSilverScreen(sSrc) {
  if (!oWin|| oWin.closed || oWin.document.location != sSrc) {
    var iHeight = 600;
    var iWidth = 800;
    var i_y = parseInt((screen.availHeight - iHeight) / 2, 10);
    var i_x = parseInt((screen.availWidth - iWidth) / 2, 10);
    oWin= window.open(sSrc, "popup", "height=" + iHeight + ", width= " + iWidth + ",left=" + i_x + ", top=" + i_y + ", toolbar=0, menubar=0, scrollbars=no, resizable=no");
    oWin.focus();
    } else {
    // bring existing subwindow to the front
      oWin.focus();
    }
}

