
function loginPasswordFocus(objOn,objOff) 
{
    objOn  = $(objOn);
    objOff = $(objOff);
    objOff.removeClass('hiddenField');
    objOn.addClass('hiddenField');
    objOff.focus();
}

function loginPasswordForgot(o) 
{
    window.open('ForgotPassword.aspx','ForgotPassword','height=220,width=200,resize=no,toolbar=no,status=no')
}

function ProfileReEditGUIUpdate() 
{
    ProfileJSReload()
}

function ProfileJSReload() 
{
    ProfileCheckReload();
    ProfileScrollReload();
}

function ProfileCheckReload() 
{
    graphicCheckBoxSetState('profileButtonPodcast','profilePodcastCheckbox');
    graphicCheckBoxSetState('profileButtonPdf','profilePdfCheckbox');
    graphicCheckBoxSetState('profileButtonLink','profileLinkCheckbox');
    graphicCheckBoxSetState('profileButtonMovie','profileMovieCheckbox');
}

function ProfileScrollReload()
{
    makeScrollbar( $('content-myprofile-industry'), $('scrollbar-myprofile-industry'), $('handle-myprofile-industry') ); 
    makeScrollbar( $('content-myprofile-keywords'), $('scrollbar-myprofile-keywords'), $('handle-myprofile-keywords') );
}

function graphicCheckBox(itemName,checkName) 
{
    var itemObj = $(itemName);
    if ( itemObj != null ) {    
        var checkObj = $$('.' + checkName + ' input')[0];
        var checkWrap = $$('.' + checkName)[0];
        var checkState = checkObj.getProperty('checked');
        
        if (checkState == 'false' || checkState == '') {
            checkObj.setProperty('checked','checked');
            itemObj.addClass('buttonActive');
        } else {
            checkObj.setProperty('checked','');   
            itemObj.removeClass('buttonActive');
        } 
    }
}

function graphicCheckBoxSetState(itemName,checkName) 
{
    var itemObj = $(itemName);
    if ( itemObj != null ) {    
        var checkObj = $$('.' + checkName + ' input')[0];
        var checkState = checkObj.getProperty('checked');

        if (checkState == true) {
            checkObj.setProperty('checked','checked');
            itemObj.addClass('buttonActive');
        } 
    }
}

 function SafeAlert(errrorID){
    if(errrorID == 1){
        alert('System error - profile is not saved');
    } else{
        alert('User Exist');
    }
 }