﻿function ChangeImage(id, url){
	document.getElementById(id).src = url;
}
function show_hide_tab(id, resetID){
	document.getElementById(id).style.display = ''
	document.getElementById(resetID).style.display = 'none'
}
function navigate_to(webpage, qs)
{
	location.href='default.aspx?s=' + webpage + '&' + qs;
	return true;
}
function navigate_indexchange(dropdown,webpage, qs){
    
    var myindex = dropdown.selectedIndex;
    var selValue = dropdown.options[myindex].value;

	location.href='default.aspx?s=' + webpage + '&' + qs + "=" + selValue;
    return true;    
}
function goto()
{
	var serieslist = document.getElementById("ddlMediaList");
	if (serieslist.selectedIndex > -1)
	{
		var destpage = serieslist[serieslist.selectedIndex].value
		location.href='default.aspx?s=' + destpage;		
	}	
	return true;
}

function LoginWait()
{
    if(document.getElementById('globalLogin')) {document.getElementById('globalLogin').style.display="none";}
    if(document.getElementById('globalLoginWait')) {document.getElementById('globalLoginWait').style.display="block";}
    alert('test');
}

function LogoutWait()
{
    if(document.getElementById('globalLoginMessage')) {document.getElementById('globalLoginMessage').style.display="none";}
    if(document.getElementById('globalLogoutWait')) {document.getElementById('globalLogoutWait').style.display="block";}
}

function nolink() {
	// simple do nothing
}

// this function is to redirect the 
function redirect(list) { 
    var url;
	if (list.selectedIndex > 0){
	    url = list.options[list.selectedIndex].value
	    if (url.indexOf("http://") < 0){
	        url = 'http://' + url
	    }	    
	    
	    location.href = url
	}
}
function rowflip(itemobj,onoroff) {
	if (onoroff == 1) itemobj.style.backgroundColor = '#C9CACC'; else itemobj.style.backgroundColor = '#EAEAEA';
}
