function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

//swap that image start
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//swap that image end

//popUp div start

var amID = "blank";

function showMe(containerId){
	

	if(amID != "blank"){
		hideMe(amID);
	}
	amID = containerId;
	showContainer(containerId);
}
function toggleVisibility(containerId){
    obj = MM_findObj(containerId);
	if (!obj) return;

	if(obj.style.display == "none") {
	    showContainer(containerId);
	}
	else if(obj.style.display == "block") {
	    hideMe(containerId);
	}
	else {
	    showContainer(containerId);
	}
}
function showContainer(containerId){
	obj = MM_findObj(containerId);
	if (!obj) return;
	obj.style.display = 'block';
}
function hideMe(containerId){
	obj2 = MM_findObj(containerId)
	if (!obj2) return;
	obj2.style.display = 'none';
}
function setMoreClass(Id, className){
	obj = MM_findObj(Id);
	if (!obj) return;
	obj.className = className;
}
function toggleMoreClass(containerId){
    obj = MM_findObj(containerId);
	if (!obj) return;
	if(obj.className == "listJobViewActive")
	    obj.className = "listJobView";
	else
	    obj.className = "listJobViewActive";   
}
/*function toggleMoreClass2(containerId){
    obj = MM_findObj(containerId);
	if (!obj) return;
	if(obj.className == "activeMore")
	    obj.className = "moreLawyerDetail";
	else
	    obj.className = "activeMore";   
}*/

//popUp div end

//change that class then back start

var amClassId = "blank";

function changeClass(Id){
	if(amClassId != "blank"){
		changeBack(amClassId);
	}
	amClassId = Id;
	setClass(Id);
}
function setClass(Id){
	obj = MM_findObj(Id);
	if (!obj) return;
	obj.className = 'dateActive';
}
function changeBack(Id){
	obj2 = MM_findObj(Id)
	if (!obj2) return;
	obj2.className = 'date';
}

//change that class then back end

//clearing form fields start

function ClearInput(value, id){
var input = document.getElementById(id);
	if(value == input.value){
		input.value = '';
	}
	else{
		input.value = input.value;
	}
}
//clearing form fields end

function KeySubmit(event, postback){
    if(event){
        if(event.keyCode==13){
            //__doPostBack('<%=lbLogin.ClientID.Replace('_', '$') %>','');
            __doPostBack(postback,'');
        }
    }
}

function showSeminarReg(itemId) {
    var obj1 = MM_findObj('s1');
    var obj2 = MM_findObj('s2');
    var obj3 = MM_findObj('s3');
    var obj4 = MM_findObj('s4');
    var obj5 = MM_findObj('s5');
	if (!obj1 || !obj2 || !obj3 || !obj4 || !obj5) return;
	
    if(itemId == "1")
    {
        showContainer('s1');
        hideMe('s2');
        hideMe('s3');
        hideMe('s4');
        hideMe('s5');
    }
    else if(itemId == "2")
    {
        showContainer('s1');
        showContainer('s2');
        hideMe('s3');
        hideMe('s4');
        hideMe('s5');
    }
    else if(itemId == "3")
    {
        showContainer('s1');
        showContainer('s2');
        showContainer('s3');
        hideMe('s4');
        hideMe('s5');
    }
    else if(itemId == "4")
    {
        showContainer('s1');
        showContainer('s2');
        showContainer('s3');
        showContainer('s4');
        hideMe('s5');
    }
    else if(itemId == "5")
    {
        showContainer('s1');
        showContainer('s2');
        showContainer('s3');
        showContainer('s4');
        showContainer('s5');
    }
}
var previousPagingToggle = '20page';
function setActivePaging(id){
    if( previousPagingToggle != null ) togglePagingClass(previousPagingToggle, '');
    if( previousPagingToggle != id ) togglePagingClass(id, 'active');
    previousPagingToggle = (previousPagingToggle == id ? null : id);
}
function togglePagingClass(id, className){ 
	obj = MM_findObj('top' + id);	
	if (!obj) return;
	obj.className = className;
	obj = MM_findObj('bottom' + id);	
	if (!obj) return;
	obj.className = className;
	}

var previousToggle = null;
function toggleActivePrevious(id){
	id = '#'+id;
    if( previousToggle != null ) toggleActive(previousToggle);
    if( previousToggle != id ) toggleActive(id);
    previousToggle = (previousToggle == id ? null : id);
}

function toggleActive(id){ toggleClass(id, 'searchResultsOpen'); }
function toggleClass(id, className){ Spry.$$(id).toggleClassName(className); }


var previousHide = null;
function toggleHideDetail(id){
	id = '#'+id;
    if( previousHide != null ) show(previousHide);
    if( previousHide != id ) hide(id);
    previousHide = (previousHide == id ? null : id);
}

var previousShow = null;
function toggleShowDetail(id){
	id = '#'+id;
    if( previousShow != null ) hide(previousShow);
    if( previousShow != id ) show(id);
    previousShow = (previousShow == id ? null : id);
}

function show(id){ Spry.$$(id).setStyle('display: block;'); }
function hide(id) { Spry.$$(id).setStyle('display: none;'); }
function setupDefaultTextReset(obj, message) {
    obj.click(function() {
        if (obj.val() == message)
            obj.val('');
    });
    obj.blur(function() {
        if (obj.val() == '')
            obj.val(message);
    });
}