function showcode(myurl)
{
    window.open(myurl,"scode","width=600,height=600,menubar=no,status=no,location=no,toolbar=no,scrollbars=yes");
    return;
}
function select_tprofile()
{
    document.getElementById("tp").style.display = '';
    document.getElementById("bp").style.display = 'none';
}
function select_bprofile()
{
    document.getElementById("tp").style.display = 'none';
    document.getElementById("bp").style.display = '';
}
function link_action(itemid, lid, act, msg366, msg367)
{
    var msg, acturl;
    
    if (act == 1)
    {
        msg = msg366;
        acturl = "index.php?option=com_jvse&Itemid="+itemid+"&controller=manage&task=linkaction&approve=1&lid="+lid;
    }
    else if (act == 0)
    {
        msg = msg367;        
        acturl = "index.php?option=com_jvse&Itemid="+itemid+"&controller=manage&task=linkaction&approve=0&lid="+lid;
    }
    else
        return;
        
    if (confirm(msg))
    {
        document.location.href = acturl;
        return;
    }
}
function close_me(murl)
{
    window.opener.location=murl; 
    window.close();                
}
function countleft(field, count, max) 
{ 
    if (field.value.length > max) 
        field.value = field.value.substring(0, max); 
    else 
        count.value = max - field.value.length; 
}
function confirm_link_delete(itemid, lid, msg)
{
    if (confirm(msg))
    {
        document.location.href = "index.php?option=com_jvse&Itemid="+itemid+"&controller=manage&task=deletelink&lid="+lid;
        return;
    }
}
function confirm_delete(itemid, pid, msg)
{
    if (confirm(msg))
    {
        document.location.href = "index.php?option=com_jvse&Itemid="+itemid+"&controller=manage&task=delprof&pid="+pid;
        return;
    }
}
function showlinks(sby, sord)
{
    document.slf.sby.value = sby;    
    document.slf.sord.value = sord;
    document.slf.submit();
}
function check_newtestimonial(obj, msg)
{
    if (obj.revcomm.value == '')
    {
        alert(msg);
        return false;
    }
    
    return true;
}
function check_recform(obj, msg)
{
    if ((obj.w_name.value == '') || (obj.w_email.value == '') || (obj.w_url.value == '') || (obj.w_reason.value == ''))
    {
        alert(msg);
        return false;
    }
    
    return true;
}
function check_scatform(obj, msg)
{
    if ((obj.s_name.value == '') || (obj.s_desc.value == '') || (obj.s_by.value == ''))
    {
        alert(msg);
        return false;
    }
    
    return true;
}
function check_tafform(obj, msg)
{
    if ((obj.sender_name.value == '') || (obj.friend_email.value == '') || (obj.comments.value == ''))
    {
        alert(msg);
        return false;
    }
    
    return true;
}
function check_cls(obj, msg)
{
    if (obj.w_url.value == '')
    {
        alert(msg);
        return false;
    }
    
    return true;
}
function jvld_checkaddform_fields(obj, msg1, msg2)
{
    if (obj.agreement.checked == 0) 
    {
        alert(msg1);
        return false;
    }
    
    if ((obj.url.value == '') || (obj.email.value == '')) 
    {
        alert(msg2);
        return false;
    }
    
    return true;
}


var copytoclip=1;
function HighlightAll(theField, msg) 
{
    var tempval=eval("document."+theField);
    tempval.focus();
    tempval.select();

    if (document.all&&copytoclip==1)
    {
        therange=tempval.createTextRange();
        therange.execCommand("Copy");
        window.status=msg;
        setTimeout("window.status=''",1800);
    }
}

