function $() {
	if (arguments.length>1) {
		return false;
	}
	if (arguments.length<1) {
		return false;
	}

	var element = arguments[0];

    if (typeof element == 'string') {
        if (document.getElementById) {
            element = document.getElementById(element);
        } else if (document.all) {
            element = document.all[element];
        }
    }
	
	return element;
}


function showBig(img) {
    if (img.length > 0) {
        window.open(img, '','width=600,height=480,status=no,resizable=yes,scrollbars=auto');
    }
}
/*var okToProceed=0;
function emptyfields()
	{
		var namebox=document.getElementById('txName');
		var messagebox=document.getElementById('txMessage');
		if (namebox.value.length>0 && messagebox.value.length>0)
			{
				okToProceed=1;
			}
		else okToProceed=0;
	}
function sendmessage()
	{	
		emptyfields();		
		if (okToProceed!=0) 
			{
				document.location.href='messageSent.htm';
			}
	}*/
function highlight(obj)
	{
		obj.style.backgroundColor="#CEE293";
		obj.style.cursor="hand";
		obj.style.cursor="pointer";
	}
function resets(obj)
	{
		obj.style.backgroundColor="#E1E8D2";
	}
function doLogout() 
{
    document.location.href="SignIn.aspx?a=lo";
}

function next() {
    var items = parseInt($("hItems").value);
    var start = parseInt($("hStart").value);
    var total = parseInt($("hTotal").value);
    
    var newStart = start + items;
    if (newStart > total) {
        newStart = total;
    }
    
    $("hStart").value = newStart;
    $("frmMain").submit();
}

function previous() {
    var items = parseInt($("hItems").value);
    var start = parseInt($("hStart").value);
    var total = parseInt($("hTotal").value);
    
    var newStart = start - items;
    if (newStart < 0) {
        newStart = 0;
    }
    $("hStart").value = newStart;
    $("frmMain").submit();
}

function sort(newCol) {	
    if (parseInt($("hTotal").value) > 1) 
	{
        	//$("hSelIDs").value = getSelectedElements();
        
        	var sortCol = $("hSortField").value;
       		var sortOrder = $("hSortOrder").value;
        
        	if (newCol == sortCol) {
            		if (sortOrder == "ASC") {
                		$("hSortOrder").value = "DESC";
            		} else {
               		$("hSortOrder").value = "ASC";
            		}
        	} else {
            		$("hSortField").value = newCol;
            		$("hSortOrder").value = "ASC";
        		}
        $("hAction").value = "Sort";
        $("frmMain").submit();
    }
}

function filter() 
{	    
    var cale = "";
    if($("txFilterName").value !="")
    {
        cale += "?name="+$("txFilterName").value;
    }
    if ($("txFilterCompany").value !="")
    {
        if ( cale != "")
        {
            cale += "&afi="+$("txFilterCompany").value;
        }
        else
        {
            cale += "?afi="+$("txFilterCompany").value;
        } 
    }
    cale = "ParticipantsList.aspx" + cale;
    document.location.href = cale;
}

function filterAbstracts() 
{	    
    var cale = "";
    if($("txFilterAuthorName").value !="")
    {
        cale += "?name="+$("txFilterAuthorName").value;
    }
    if ($("txFilterTitleText").value !="")
    {
        if ( cale != "")
        {
            cale += "&tit="+$("txFilterTitleText").value;
        }
        else
        {
            cale += "?tit="+$("txFilterTitleText").value;
        } 
    }
    cale = "AbstractsList.aspx" + cale;
    document.location.href = cale;
}
