﻿        function buttonUpdate(){
            var sln = document.getElementById('shortlist_name');
            if(sln && sln.value == ""){
                var slp = document.getElementById('panel_shortlist_name')
                if(slp)
                    slp.style.display = 'block';
            }
            else {
                document.getElementById('actiongo').value='go';
               // setUniList();
                document.forms['form_shortlist'].submit();
            }
        }
        function buttonCancel(){
            document.getElementById('actiongo').value='';
            document.forms['form_shortlist'].submit();
        } 
        function buttonLogin(){
            document.getElementById('actiongo').value='login';
            var frm = document.forms['form_shortlist'];
            if(frm){
                frm.action = 'Logon.aspx';
                frm.submit();
            }
        }
        function buttonSave(){
            var sln = document.getElementById('shortlist_name');
            if(sln && sln.value == ""){
                sln.value = Date().toString();
            }                
            document.getElementById('actiongo').value='go';
           // setUniList();
            document.forms['form_shortlist'].submit();
        }
        function buttonClear(slct){
            document.getElementById('actiongo').value=slct;
            document.forms['form_shortlist'].submit();
        }
        function findUni(uid){
           // if(uid)
           //     window.open('/Uni_Profile.aspx?uid='+uid+'&type=profile','_new');
        }
        function tagleUni(uid){
            if(uid)
                window.open('/Uni_Profile.aspx?uid='+uid+'&type=profile','_new');
        }
        function setUniList(){
            var unis = document.getElementById('uniselect');
            if(unis){
                for(var i=0; i < unis.options.length; i++)
                    unis.options[i].selected = true;
            }
        }
        function ShortlistsShow(){
            var psl = document.getElementById("panel_shortlist");
			var uni = document.getElementById("uniselect");
			//alert("hello");
			
            if(psl){
                psl.style.display = "block";
                }
            if(uni){                
				uni.style.display = "none";
            }
        }
        function ShortlistsHide(){
            var psl = document.getElementById("panel_shortlist");
			var uni = document.getElementById("uniselect");
            if(psl){
                psl.style.display = "none";
                }
            if(uni){
				uni.style.display = "block";
            }
        }
        function ShortlistsSet(lid){
            var psl = document.getElementById("tracklist");
            if(psl){
                psl.value = lid;
                document.forms['form_shortlist'].submit();
            }
        }
      
        function ShortlistsNew(lid){
            var npsl = document.getElementById("newtracklist");
            if(npsl){
                npsl.value = "1";
                document.forms['form_shortlist'].submit();
            }
        }
                
        function ShortlistsReset(lid){
            var psl = document.getElementById("tracklist");
            var act = document.getElementById('actiongo');
            if(psl && act){
                psl.value = lid;
                act.value='clear_list';
                document.forms['form_shortlist'].submit();
            }
        }    
