function readmore(id, id1){
    for(var i=0; i<id1; i++){
        document.getElementById('blog-details-'+i).style.display = 'none';
        document.getElementById('blog-'+i).style.display = 'block';
        document.getElementById('respond-'+i).style.display = 'none';
    }
    try {
        document.getElementById('comreadmore-'+id).style.display = 'none';
    } catch (exception) {
        
    }
    
    document.getElementById('respond-'+id).style.display = 'block';
    document.getElementById('blog-'+id).style.display = 'none';
    document.getElementById('blog-details-'+id).style.display = 'block';

    return false;
}


function readmoreback(id, id1){
    for(var i=0; i<id1; i++){
        document.getElementById('respond-'+i).style.display = 'none';
        document.getElementById('blog-details-'+i).style.display = 'none';
        document.getElementById('blog-'+i).style.display = 'block';
    }
    try {
        document.getElementById('comreadmore-'+id).style.display = 'block';
    } catch (exception) {
        
    }
    return false;
}


function checkvalidation(id){
    var name = document.getElementById('author-'+id);
    var email = document.getElementById('email-'+id);
    var comm = document.getElementById('comment-'+id);

    if(name.value==''){
        alert('Please enter your name');
        name.value='';
        name.focus();
        return false;
    }
    if(email.value==''){
        alert('Please enter your email address');
        email.value='';
        email.focus();
        return false;
    }
    if(email.value!=''){
        var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/;
        if(!emailReg.test(email.value)) {
            alert('Please enter valid email address');
            email.value='';
            email.focus();
            return false;
        }
    }
    if(comm.value == ''){
        alert('Please enter comment');
        comm.focus();
        return false;
    }
    return true;
}

function changeToCategory(catid){
    if(catid!="-1"){
        var gotourl="/blogPosts/category/"+catid+'/';
        location.href = gotourl;
    }
}

function checkvalidationComment(id){
    var comm = document.getElementById('comment-'+id);
    if(comm.value == ''){
        alert('Please enter comment');
        comm.focus();
        return false;
    }
    return true;
}

function changeToArchive(val){
    if(val != "-1"){
        var goingTo = document.getElementById("dropdownlistArchive").value;
        location.href="/blogPosts/archive/"+goingTo+"/";
    }
}
function fbs_click_jfh5jkg8g7hdjkfng(u, t) {
    window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(u)+'&t='+encodeURIComponent(t),'sharer','toolbar=0,status=0,width=700,height=500');
    return false;
}
