﻿function selectUni(obj, valid)
{
    
       
    table_RowSelect(obj)    
    var a_uni = document.getElementById('uniID');
    if(a_uni){
        a_uni.value=valid;
    }
    AIAx_DoCallBack('panel_uniinfo',valid);
    var obj = document.getElementById('panel_uniinfo');
    obj.style.display = 'none';
    var objw = document.getElementById('panel_wait');
    objw.style.display = 'block';
}

function openUni(obj, valid)
{
    
    if(obj && valid != ""){
        window.open('/Uni_Profile.aspx?uid='+valid,'_self');
    }
}

function table_SelectRow(objid){
    var tbl = document.getElementById(objid);
}

function setStyle(obj, a)
{
   if(obj){
    if(a==1)
      table_RowHover(obj)
    else
      table_RowUnhover(obj)
   }
}

var row_curr = null;
var rowstyle = new Object();
rowstyle.itemClass = ""
rowstyle.selectClass = "rowselect"
rowstyle.hoverClass = "rowhover"

function table_RowSelect(tbl_row) {
    if(tbl_row){
        table_RowUnselect(row_curr);
        tbl_row.className += ' ' + rowstyle.selectClass;
        row_curr = tbl_row;
        
    }    
}
function table_RowUnselect(tbl_row) {
    if(tbl_row){
        var re = new RegExp(rowstyle.selectClass,"ig")
        tbl_row.className = tbl_row.className.toString().replace(re, '');
        //tbl_row.className = tbl_row.className.replace(' '+rowstyle.selectClass, '');
    }
}
function table_RowHover(tbl_row) {
    if(tbl_row && tbl_row != row_curr){
        tbl_row.className += ' ' + rowstyle.hoverClass;
    }    
}
function table_RowUnhover(tbl_row) {
    if(tbl_row){
        var re = new RegExp(rowstyle.hoverClass,"ig")
        tbl_row.className = tbl_row.className.toString().replace(re, '');
        //tbl_row.className = tbl_row.className.replace(' '+rowstyle.hoverClass, '');
    }
}
/* call back*/
function AIAx_DoCallBack(target,param) {
        var targetPanel = document.getElementById(target);
        if(!targetPanel)
            targetPanel = this;

        WebForm_DoCallback(target,param,AIAx_CallBackResult,targetPanel,AIAx_CallBackResult,false);
}
function AIAx_CallBackResult(result, context) {
        var objw = document.getElementById('panel_wait');
        objw.style.display = 'none';
        if(context.innerHTML){               
            context.innerHTML = result; 
            context.style.display = 'block';           
        }                          
}
function CloseInfo(objid)
{        
    var obj = document.getElementById(objid);
    obj.style.display = 'none';
}

