﻿var comonpop = "<div class='poclose' style='cursor: pointer;' onclick='javascript:disablePopup();'></div><div class='popclose'><div class='popmain' ><div class='popheading solid_color '><div id='cpophead' ></div><label id='lblmsg' style='font-size: 10px; line-height: normal; color: #FF0000'></label></div><div id='cpopbody' class='popformbox Light_color'><div class='commonbox_icon'><div class='commonbox_main'><div class='commonbox_icon1'></div><div id='cpopbodyMsg' class='commonbox_icon2'></div></div><div class='commonbox_button'><div id='mainbtnconta' class='commonbox_button1'><input id='cpopMainbtn' name='OK' type='button' class='commonbox_but' value='OK'  /></div><div class='commonbox_button1'><input id='cpopbtncalcle' name='Cancel' type='button' class='commonbox_but' value='Cancel' onclick='javascript:disablePopup();' /></div></div></div></div></div></div><input type='hidden' id='hdcpop' />";

String.prototype.trim = function () {
    return this.replace(/^\s*/, "").replace(/\s*$/, "");
}
//window.onscroll = function() { Cpositionpopup(); CloadPopup(); }
function download(val) {
    $('#slidMSG').load("../DownloadHandler.ashx?File=" + val);
}
function Chkalertinb() {//alert('alert');
    $("#alertID").html("<img style='margin:10px;' title='Please Wait..' src='http://www.edupal.in/img/load.gif' />");
    $("#alertID").fadeIn("slow");
    $get('btninbox').className = "alrtact";
    $.ajax({
        type: "POST",
        contentType: "application/json; charset=utf-8",
        url: "http://www.edupal.in/PalGroupServices.asmx/alertinb",
        data: "{}",
        dataType: "json",
        success: function(data) {

            var out = data.d; //alert(out);
            if (out != 'fail' || out.length > 10) {
                $get('alertID').innerHTML = out;
                $get("ctl00_ucheaser1_alertI").onclick = function() { hidealertI(); }
                
            }
            else hidealertI();

        },
        failure: function(msg) {
            //$('#output').text(msg);
            alert("Please Try Next Time Your Request Has Not Been Completed");
        }
    });
}
function hidealertI() {
    $("#alertID").fadeOut("fast");
    $("#alertID").empty();
    $get('btninbox').className = "";
    $get("ctl00_ucheaser1_alertI").onclick = function() { Chkalertinb(); }
}
function homeact() {
    // $("#PrashantContact").fadeOut("slow");
    //$("#wbactivity").fadeIn("slow");
    //$("#wbactivity").fadeOut("slow");
    $("#actload").html("<img style='margin-left:470px;margin-top:10px;' title='Please Wait..' src='http://www.edupal.in/img/ajax-loader.gif' />"); 
    $("#actload").fadeIn("slow");
    $.ajax({
        type: "POST",
        contentType: "application/json; charset=utf-8",
        url: "http://www.edupal.in/PalGroupServices.asmx/letestActivity",
        data: "{}",
        dataType: "json",
        success: function(data) {
            $("#actload").fadeOut("slow");
            $("#actload").empty();
            var out = data.d;
            if (out == 'fail' || out.length < 10) {

            }
            else {
                $("#wbactivity").empty();
                $("#wbactivity").append(out);
            }

            //$("#wbactivity").fadeIn("slow");
            setTimeout('homeact()', 10000);

        },
        failure: function(msg) {
            //$('#output').text(msg);
            alert("Please Try Next Time Your Request Has Not Been Completed");
        }
    });

}

function showpwdedit() {
    var obj = document.getElementById('peditbox');
    if (obj.style.display == 'none') {
        $('#peditbox').fadeIn('slow');
        document.getElementById('peditboxbtn').innerHTML = "Hide";
        document.getElementById('propwd').focus();
    }
    else {
        $('#peditbox').fadeOut('slow');
        document.getElementById('propwd').value = '';
        document.getElementById('repropwd').value = '';
        document.getElementById('peditboxbtn').innerHTML = "Edit";
    }
}

function matchpropwd() {
    var val1 = document.getElementById('propwd');
    var val2 = document.getElementById('repropwd');
    if (val1.value != val2.value) { document.getElementById("rechkpwd").innerHTML = "*";return false;  }
}
function myalert(hd, con) {

    //var content = "<div class='commonbox_icon'><div class='commonbox_main'><div class='commonbox_icon1'></div><div class='commonbox_icon2'>This Group Will Be Deleted Permanently. Do you want to continue?</div></div><div class='commonbox_button'><div class='commonbox_button1'><input id='cpopMainbtn' name='OK'  type='button'  class='commonbox_but' value='OK'  /></div><div class='commonbox_button1'><input name='Cancel' type='button' class='commonbox_but' value='Cancel' onclick='javascript:disablePopup();'/></div></div></div>";
    positionpopup();
    loadPopup();
    $get("FeedbackContent").style.backgroundColor = "Transparent";
    $get("FeedbackContent").style.border = "none";
    $get("FeedbackContent").innerHTML = comonpop;
    $get('cpophead').innerHTML = hd;
    $get("cpopbodyMsg").innerHTML = con;
    $get('cpopbtncalcle').style.display = "none";
    $get('cpopMainbtn').onclick = function() { disablePopup(); }

}

function alertsetmsg(hd,con) {

    //var content = "<div class='commonbox_icon'><div class='commonbox_main'><div class='commonbox_icon1'></div><div class='commonbox_icon2'>This Group Will Be Deleted Permanently. Do you want to continue?</div></div><div class='commonbox_button'><div class='commonbox_button1'><input id='cpopMainbtn' name='OK'  type='button'  class='commonbox_but' value='OK'  /></div><div class='commonbox_button1'><input name='Cancel' type='button' class='commonbox_but' value='Cancel' onclick='javascript:disablePopup();'/></div></div></div>";
    positionpopup();
    loadPopup();
    $get("FeedbackContent").style.backgroundColor = "Transparent";
    $get("FeedbackContent").style.border = "none";
    $get("FeedbackContent").innerHTML = comonpop;
    $get('cpophead').innerHTML = hd;
    $get("cpopbodyMsg").innerHTML = con;
    $get('cpopMainbtn').onclick = function() { showhidealert(); disablePopup(); }

}
function showhidealert() {
    var obj = $get('alertBox');
    if (obj.style.display == 'none') { obj.style.display = "block"; }
    else { obj.style.display = "none"; }
}
function showAlert() {
$get('alertlink').innerHTML = "<img src='http://www.edupal.in/img/load.gif' title='Wait..' />";
document.getElementById('alertlink').onclick = function() { }
$get('alertsave').onclick = function() { }
saveAlert('get');
document.getElementById('alertBox').style.display = "block";
document.getElementById('alertlink').onclick = function() { showhidealert(); disablePopup(); }
$get('alertlink').innerHTML = "Email setting";
}

function saveAlert(val) {
    var pal = 1, wb = 1, msg = 1, grpm = 1, grpnp = 1, grpep = 1, grpdp = 1, grpc = 1, grpcd = 1, oth = 1;
    if (val == 'set') {
        if ($get('paly').checked == false) pal = 0;
        if ($get('wby').checked == false) wb = 0;
        if ($get('msgy').checked == false) msg = 0;
        if ($get('grpmy').checked == false) grpm = 0;
        if ($get('grpnpy').checked == false) grpnp = 0;
        if ($get('grpepy').checked == false) grpep = 0;
        if ($get('grpdpy').checked == false) grpdp = 0;
        if ($get('grpcy').checked == false) grpc = 0;
        if ($get('grpcdy').checked == false) grpcd = 0;
        if ($get('othy').checked == false) oth = 0;
    }
    $get('alertsave').onclick = function() { }
    $get('alertsave').innerHTML = "<img style='margin-top:4px;' src='http://www.edupal.in/img/load.gif' />";
    $.ajax({
        type: "POST",
        contentType: "application/json; charset=utf-8",
        url: "http://www.edupal.in/PalGroupServices.asmx/saveAlert",
        data: "{val:'" + val + "', pal:'" + pal + "', wb:'" + wb + "', msg:'" + msg + "',grpm:'" + grpm + "', grpnp:'" + grpnp + "',grpcp:'" + grpep + "',grpdp:'" + grpdp + "',grpc:'" + grpc + "',grpcd:'" + grpcd + "', oth:'" + oth + "'}",
        dataType: "json",
        success: function(data) {
            var output = data.d;
            if (val == 'get') {
                output = output.split(','); //alert('output---' + output[0] + output[1]);
                if (output.length == 10) {
                    if (output[0] == 'False') { $get('paln').checked = true; }
                    if (output[1] == 'False') { $get('wbn').checked = true; }
                    if (output[2] == 'False') { $get('msgn').checked = true; }
                    if (output[3] == 'False') { $get('grpmn').checked = true; }
                    if (output[4] == 'False') { $get('grpnpn').checked = true; }
                    if (output[5] == 'False') { $get('grpepn').checked = true; }
                    if (output[6] == 'False') { $get('grpdpn').checked = true; }
                    if (output[7] == 'False') { $get('grpcn').checked = true; }
                    if (output[8] == 'False') { $get('grpcdn').checked = true; }
                    if (output[9] == 'False') { $get('othn').checked = true; }
                }
            }
            if (output == 'login') { loginMsg(); }
            $get('alertsave').onclick = function() { saveAlert('set'); }
            $get('alertsave').innerHTML = "Save";
            if (output == 'success') {
                alertsetmsg('Alert Update', 'Alert has been updated successfully.');
            }
        },
        failure: function(msg) {
            //$('#output').text(msg);
            alert("Please Try Next Time Your Request Has Not Been Completed");
        }
    });

}

function setcommentlength(val) {
    var cont = $get(val).value;
    if (cont.length > 130) { $get(val).value = cont.substring(0, 130); }
    else {
        if (val != 'ripboxtxt1' && $get(val + 'ctr'))
            $get(val + 'ctr').innerHTML = cont.length + " of 130";
    }
}
function WBcommentbox(val) {
    $get('stat' + val).style.display = 'none';
    $get('dync' + val).style.display = 'block';
    //$get('mainpostbtn').style.display = 'block';
    $get('txt' + val).focus();
}
function maincommentbox(obj, area) {
    obj.style.display = 'none';
    $get('msgCon').style.display = 'block';
    $get('mainpostbtn').style.display = 'block';
    $get('ripboxtxt').focus();
}
function maincommentbox1(obj, area) {
    obj.style.display = 'none';
    $get('msgCon1').style.display = 'block';
    $get('mainpostbtn1').style.display = 'block';
    $get('ripboxtxt1').value = $get('msgConstat1').innerHTML;
    $get('ripboxtxt1').style.height = ($get('ripboxtxt1').scrollHeight) + "px";
    $get('ripboxtxt1').focus();
}
function Post_Request(val) {
    //var Email = document.getElementById('username').value;
    var msg = document.getElementById('TxtBody').value;
    var GroupN = document.getElementById('grpid').value;
    // if (GroupN.length > 0) {
    //alert(GroupN);
    $.ajax({
        type: "POST",
        contentType: "application/json; charset=utf-8",
        url: "http://www.edupal.in/PalGroupServices.asmx/requestm",
        data: "{ msg:'" + msg + "', GroupN:'" + GroupN + "', val: '" + val + "'}",
        dataType: "json",
        success: function(data) {

        var out = data.d; var j = ''; //alert('first' + out);
         out = out.split('/');
            disablePopup();
            if (out[1] != undefined && out[0] != "fail") {
               // alert('if'+out);
                var op = out[1].replace(/ /g, '-');
                document.location.href = "http://www.edupal.in/" + op;
            }
            else alert(out);
        },
        failure: function(msg) {
            //$('#output').text(msg);
            alert("Please Try Next Time Your Request Has Not Been Completed");
        }
    });
}
function JoinGroup(obj, type) {
    positionpopup();
    loadPopup();
   // var Gn = document.getElementById('ctl00_hdgroupname').value;
    //document.getElementById('hdpostid').value = obj;
   // positionpopup();
  //  loadPopup();
    var xmlHttp;
    xmlHttp = GetXmlHttpObject();
    var url = "http://www.edupal.in/PalGroup/joingrp.aspx?gid=" + obj + "&Perform=" + type;
    if (xmlHttp != null) {
        //alert(url);
        xmlHttp.onreadystatechange = function() {
            if (xmlHttp.readyState == 4) {
                document.getElementById("FeedbackContent").innerHTML = xmlHttp.responseText;
                document.getElementById("FeedbackContent").style.backgroundColor = "Transparent";
            }
        }

        xmlHttp.open("GET", url, true);
        xmlHttp.send(null);
    }

}
function hidemailpostarea() {
    if ($get('ripboxtxt').value.length < 1) {
        $get('msgCon').style.display = 'none'; $get('mainpostbtn').style.display = 'none'; $get('msgConstat').style.display = 'block';
    }
}
function EditProMsg() {
    var cont = $get('ripboxtxt1').value;
    if (cont.length > 0) {
        $get('btneditpro').onclick = function() { }
        $get('btneditpro').innerHTML = "<img src='http://www.edupal.in/img/load.gif' />";
        $.ajax({
            type: "POST",
            contentType: "application/json; charset=utf-8",
            url: "http://www.edupal.in/PalGroupServices.asmx/EditPromsg",
            data: "{cont:'" + cont + "'}",
            dataType: "json",
            success: function(data) {
                var output = data.d;
                $get('btneditpro').onclick = function() { EditProMsg(); }
                $get('btneditpro').innerHTML = "Save";

                if (output == 'login') { alert("Login"); }
                if (output == 'success') {
                    $get('msgConstat1').innerHTML = cont;
                }

                $get('msgCon1').style.display = 'none'; $get('mainpostbtn1').style.display = 'none'; $get('msgConstat1').style.display = 'block';
            },
            failure: function(msg) {
                //$('#output').text(msg);
                alert("Please Try Next Time Your Request Has Not Been Completed");
            }
        });
    }
}

function changebg(btnid) {
    document.getElementById(btnid).style.backgroundColor = "#ff00ff";
}
function restorebg(btnid) {
    document.getElementById(btnid).style.backgroundColor = "#d3d3d3";
}
function querySt(ji) {
    try {
       var hu = window.location.search.substring(1);
          var ft = hu.split("=");
            if (ft[0] == ji) {
                document.location.href = '#' + ft[1];
            }
        }

    catch (err) {
    }
}
function lineBreak( st,len)
    {
        try
        {
            if (st.length > len)
            {
                var st1 = st.substring(0, len);
                
                if (st1.lastIndexOf(" ") < 25)
                {
                    //st = st.insert(len, "</br>");
                    var st11 = st.substring(len, st.length);
                    st = st1 + "<br>" + st11;
                }
            }
            if (st.length > (len+len))
            {
                var st111 = st.substring(0, len);
                var st2 = st.substring(len, len+len);
                if (st2.lastIndexOf(" ") < 1)
                {
                    //st = st.insert((len + len), "</br>"); 
                    var st22 = st.substring((len+len), st.length);
                    st = st111 + st2 + "<br>" + st22; 
                }
            }
            return st;
        }
        catch (err) {return st; }
    }
    
function WBcomment(val) {
    var info = $get('ctl00_uinfo').value;
    if (info.length > 1) {
        info = info.split('/');
        var htm = "<div id='cont" + val + "' class='recent'><div style='display:none;' id='stat" + val + "' class='statcombox'  onclick=javascript:WBshowcomarea('" + val + "');>Write comment</div><div id='dyna" + val + "'><div class='recent_new'><a href='http://www.edupal.in/" + info[0] + "/" + info[1] + "'><img src='http://www.edupal.in/UseridPic/" + info[2] + ".jpeg' alt='" + info[0] + "' width='24' height='24' /></a></div><div class='recent_new1'><div style='width: 345px; float: left;'><textarea id='txt" + val + "' onkeypress=\"javascript:setcommentlength('txt" + val + "');\" name='comentbox' class='comment_input' cols='' rows='' onblur=javascript:WBcommentblur('" + val + "');></textarea></div></div><div class='clear'></div><div id='btn" + val + "' class='btnpo' onclick=javascript:replysubmit('" + val + "');>Post</div></div></div>";
        $get('wbc' + val).innerHTML = htm;
        $('textarea').autoResize();
        $get('txt' + val).focus();
    }
    else {
        loginMsg();
    }
}
function WBcommentblur(val) {
 var info = $get('ctl00_uinfo').value;
 info = info.split('/');
    var con = $get('txt' + val).value;
    if (con.length < 1) {
        $get('dyna' + val).style.display = 'none';
        $get('stat' + val).style.display = 'block';
        
    }
}
function WBshowcomarea(val) {
    $get('stat' + val).style.display = 'none';
    $get('dyna' + val).style.display = 'block';
    $get('txt' + val).focus();
}
function astrodata(star,other) {
 var RandomValue = Math.random(5000);
   // var Form = document.getElementById("aspnetForm");
    //var UserId = document.getElementById('prashant').value;
    if (window.ActiveXObject) {
        PrashantDoc = new ActiveXObject("Microsoft.XMLDOM");
        PrashantDoc.async = false;
        PrashantDoc.load("http://www.edupal.in/XmlFile/astro.xml?stopcaching=" + RandomValue);
    }
    else if (document.implementation.createDocument) {
        PrashantDoc = document.implementation.createDocument("", "", null);
        var xmlhttp = new window.XMLHttpRequest();
        xmlhttp.open("GET", "http://www.edupal.in/XmlFile/astro.xml?stopcaching=" + RandomValue, false);
        xmlhttp.send(null);
        var PrashantDoc = xmlhttp.responseXML.documentElement;
    }
    else {
        alert('Your browser does not support XMLHttpRequest');
    }
    var str;
    var xmlDoc = PrashantDoc.getElementsByTagName("item");
    var desc, title;
    var isok = 0;
    for (var i = 0; i < xmlDoc.length; i++) {
        title = xmlDoc[i].getElementsByTagName("title")[0].childNodes[0].nodeValue;
        title = title.trim();
        desc = xmlDoc[i].getElementsByTagName("description")[0].childNodes[0].nodeValue;
        desc = astrosize(desc, 250, title);
        if (i == 0 && star == title) {
            $get('astrodata').innerHTML = "<div id='" + title + "' style=''><div class='astrohd'><b>" + title + "</b></div><div class='astrocon'>" + desc + "</div></div>"
        }
        else if (i == 0 ) {
        $get('astrodata').innerHTML = "<div id='" + title + "' style='visibility:hidden;display:none;'><div class='astrohd'><b>" + title + "</b></div><div class='astrocon'>" + desc + "</div></div>"
        }
        else if (i > 0 && star == title){
            $get('astrodata').innerHTML += "<div id='" + title + "' style=''><div class='astrohd'><b>" + title + "</b></div><div class='astrocon'>" + desc + "</div></div>"
        }
        else {
            $get('astrodata').innerHTML += "<div id='" + title + "' style='visibility:hidden;display:none;'><div class='astrohd'><b>" + title + "</b></div><div class='astrocon'>" + desc + "</div></div>"
        }
//       if (star == title) {//alert(eventid+" "+c);
//            
//            $get('astrohd').innerHTML = "<b>" + title + "</b>";
//            $get('astrocon').innerHTML = "<b>" + desc + "</b>";
//            $get('astronav').innerHTML = "<a id='astronavL' href='javascript:astronav();'>Previous</a>&nbsp;&nbsp;&nbsp;<a id='astronavL' href='javascript:astronav();'>Next</a> ";
//       }

    }
    //document.getElementById(star).style.visibility = "visible";
    $get('astrocontainer').style.display = "block"; $get('astloader').style.display = "none";
}
function astrosize(str, len,star) {
    var temp;
    if (str.length > len) {
        temp = "<div id='" + star + "1' style='width:100%'>" + str.substring(0, len) + "...</div><div id='" + star + "2' style='display:none;'>" + str + "</div><span><a id='" + star + "3' style='color:blue;float:right' href=\"javascript:moreastro('" + star + "');\">More</a></span>";
        str = temp;
    }
    return str;
}
function moreastro(val) {
    if (document.getElementById(val)) {
        if (document.getElementById(val + '2').style.display == 'none') {
            $('#' + val + '1').fadeOut('slow');
          setTimeout("$('#"+ val +"2').fadeIn('slow')",500);
          document.getElementById(val + '3').innerHTML = 'Less';
        }
        else {
            $('#' + val + '2').fadeOut('slow');
            setTimeout("$('#" + val + "1').fadeIn('slow')", 500);
            document.getElementById(val + '3').innerHTML = 'More';
        }
    }
}

function hidebtnfrnd() {
    $get('chkfrndreq').style.visibility = "visible"; $get('chkfrndreq').style.display = "block";
}
function btnfrndreqadded(val) {
    if (val == 2) {
        $get('ctl00_ContentPlaceHolderLeft1_DefaultLeft1_btnaddfrnd').onclick = function() { alert('Your pal request has not confirmed yet.'); }
        $get('addpalmsg').innerHTML = 'Waiting...';
        $get('chkfrndreq').style.visibility = "visible"; $get('chkfrndreq').style.display = "block";
    }
    else {
        $get('ctl00_ContentPlaceHolderLeft1_DefaultLeft1_btnaddfrnd').onclick = function() { alert('This User has requested you to be a Pal on Edupal!'); }
        $get('addpalmsg').innerHTML = 'Requested...';
        $get('chkfrndreq').style.visibility = "visible"; $get('chkfrndreq').style.display = "block";
    }
}
function checkspecialchar(str) {
    var iChars = "\\!@#$%^&*()+=-[]\';,./{}|\":<>?";
    var exist = 0;
    for (var i = 0; i < str.length; i++) {
        if (iChars.indexOf(str.charAt(i)) != -1) {
            exist = 1;return exist;
        }
    }
    return exist;
}
function checkspecialcharinname(str) {
    var iChars = "\\!@#$%^&*()+=-[]\';,/{}|\":<>?";
    var exist = 0;
    for (var i = 0; i < str.length; i++) {
        if (iChars.indexOf(str.charAt(i)) != -1) {
            exist = 1; return exist;
        }
    }
    return exist;
}
function viewcapproach() {
    if (document.getElementById("TabCtr_Carrer_Aproach").style.display == "none") {
        document.getElementById("TabCtr_Carrer_Aproach").style.display = "";
        document.getElementById("ctl00_HiddenTabidCareer").value = "TabCtr_Carrer_Aproach"; //alert(document.getElementById("ctl00_HiddenTabidCareer").value);
    }
    else {
        document.getElementById("TabCtr_Carrer_Aproach").style.display = "none";
        document.getElementById("ctl00_HiddenTabidCareer").value = null; //alert(document.getElementById("ctl00_HiddenTabidCareer").value);
    }
    return void (0);
}
function vieworganiser() {
    if (document.getElementById("TabCtr_Organiser").style.display == "none") {
        document.getElementById("TabCtr_Organiser").style.display = "";
        document.getElementById("ctl00_HiddenTabidOrganiser").value = "TabCtr_Organiser";
        //alert(document.getElementById("ctl00_HiddenTabidOrganiser").value);
    }
    else {
        document.getElementById("TabCtr_Organiser").style.display = "none";
        document.getElementById("ctl00_HiddenTabidOrganiser").value = null;
        //alert(document.getElementById("ctl00_HiddenTabidOrganiser").value);
    }
    return void (0);
}


function addRow() {
    var Form = document.getElementById("aspnetForm");
    i = document.getElementById('tbl').rows.length;
    tn = document.getElementById("tno");
    tn.value = i;
    var b1 = document.createElement('Input');
    var b2 = document.createElement('Input');
    var b22 = document.createElement('Input');
    var b3 = document.createElement('Input');
    b1.setAttribute("name", 'sub' + i);
    b1.setAttribute("id", 'sub' + i);
    b1.setAttribute("size", 40);
    b1.setAttribute("maxlength", 50);
    b1.setAttribute("class", "txtbox");
    b1.setAttribute("style", "border: 1px solid #999;  font-size:11px;");
    //b1.style.setAttribute('cssText', 'border:solid 1px #999999; background-color:#666666; font-size:11px', 0);
    //b2.style.setAttribute('cssText', 'border:solid 1px #999999; background-color:#666666; font-size:11px', 0);
    //b22.style.setAttribute('cssText', 'border:solid 1px #999999; background-color:#666666; font-size:11px', 0);
    //b3.style.setAttribute('cssText', 'border:solid 1px #999999; background-color:#666666; font-size:11px', 0);
    b2.setAttribute("name", 'M' + i);
    b2.setAttribute("id", 'M' + i);
    b2.setAttribute("size", 3);
    b2.setAttribute("maxlength", 3);
    b2.setAttribute("class", "txtbox");
    b2.setAttribute("style", "border: 1px solid #999;  font-size:11px;");
    b22.setAttribute("name", 'MM' + i);
    b22.setAttribute("id", 'MM' + i);
    b22.setAttribute("size", 3);
    b22.setAttribute("maxlength", 3);
    b22.setAttribute("class", "txtbox margin");
    b22.setAttribute("style", "border: 1px solid #999;  font-size:11px;");
    b3.setAttribute("name", 'G' + i);
    b3.setAttribute("id", 'G' + i);
    b3.setAttribute("size", 3);
    b3.setAttribute("maxlength", 3);
    b3.setAttribute("class", "txtbox");
    b3.setAttribute("style", "border: 1px solid #999;  font-size:11px;");
    var r = document.createElement('tr');
    var ca = document.createElement('td');
    var cb = document.createElement('td');
    var cc = document.createElement('td');
    var cd = document.createElement('td');
    var txt = document.createTextNode(' / ');
    var txt1 = document.createTextNode(i);
    var t = document.getElementById('tbl');
    r.setAttribute("height", 20);
    cd.appendChild(txt1);
    ca.appendChild(b1);
    cb.appendChild(b2);
    cb.appendChild(txt);
    cb.appendChild(b22);
    cc.appendChild(b3);

    r.appendChild(cd);
    r.appendChild(ca);
    r.appendChild(cb);
    r.appendChild(cc);

    t.appendChild(r);
}
function PostAcademicContent(ToDo) {
    var Form = document.getElementById("Forminsertmarks");

    var xmlHttp;
    xmlHttp = GetXmlHttpObject();
    //Form.ddSelectYear.options[Form.ddSelectYear.value].text
    if (xmlHttp != null) {
        var url = "http://www.edupal.in/UserDiary/AcademicRecord.aspx?";
        url = url + "school=" + Form.school.value;
        url = url + "&ddSelectSchool=" + Form.ddSelectSchool.options[Form.ddSelectSchool.value].text;
        url = url + "&ddSelectClass=" + Form.ddSelectClass.options[Form.ddSelectClass.value].text;
        url = url + "&ddSelectYear=" + Form.ddSelectYear.options[Form.ddSelectYear.value].text;
        url = url + "&sub1=" + Form.sub1.value;
        url = url + "&M1=" + Form.M1.value;
        url = url + "&MM1=" + Form.MM1.value;
        url = url + "&G1=" + Form.G1.value;
        url = url + "&sub2=" + Form.sub2.value;
        url = url + "&M2=" + Form.M2.value;
        url = url + "&MM2=" + Form.MM2.value;
        url = url + "&G2=" + Form.G2.value;
        url = url + "&sub3=" + Form.sub3.value;
        url = url + "&M3=" + Form.M3.value;
        url = url + "&MM3=" + Form.MM3.value;
        url = url + "&G3=" + Form.G3.value;
        url = url + "&sub4=" + Form.sub4.value;
        url = url + "&M4=" + Form.M4.value;
        url = url + "&MM4=" + Form.MM4.value;
        url = url + "&G4=" + Form.G4.value;
        url = url + "&sub5=" + Form.sub5.value;
        url = url + "&M5=" + Form.M5.value;
        url = url + "&MM5=" + Form.MM5.value;
        url = url + "&G5=" + Form.G5.value;
        url = url + "&Remark=" + Form.Rank.value;
        url = url + "&hidden=" + Form.tno.value;
        url = url + "&UserMail=" + document.getElementById("ctl00_ContentPlaceHolderMid_HiddenUserMail").value;
        if (ToDo == "Insert") { url = url + "&Perform=AddAcademicRecord"; }
        else if (ToDo == "Update") { url = url + "&Perform=UpdateAcademicRecord"; }
        else if (ToDo == "Delete") { url = url + "&Perform=DeleteAcademicRecord"; }
        //alert(url);
        xmlHttp.onreadystatechange = function() {
            if (xmlHttp.readyState == 4) {
                document.getElementById("FeedbackContent").innerHTML = xmlHttp.responseText;
            }
        }
        xmlHttp.open("GET", url, true);
        xmlHttp.send(null);
        return (false);
    }

}
//function ShowMarksheet(school, SelectedClass, Year) {
//    positionpopup();
//    loadPopup();
//    document.getElementById("FeedbackContent").style.backgroundColor = "Transparent";
//    document.getElementById("FeedbackContent").style.border = "none";
//    UserId = document.getElementById('ctl00_HiddenUserId').value;
//    document.getElementById('HiddenAcademicSchool').value = school;
//    document.getElementById('HiddenAcademicClass').value = SelectedClass;
//    GetUploadFile('http://www.edupal.in/UserDiary/MarksSheet.aspx?school=' + school + '&SelectedClass=' + SelectedClass + '&year=' + Year + '&UserId=' + UserId + '&Perform=ShowMarks');
//}



function AddAcadmicRecord() {
    positionpopup();
    loadPopup();
    document.getElementById("FeedbackContent").style.backgroundColor = "Transparent";
    document.getElementById("FeedbackContent").style.border = "none";

    GetUploadFile('http://www.edupal.in/UserDiary/AcademicRecord.aspx');
 
    //Expand('UserDiary/AcademicRecord.aspx');
}
function privacyChange() {
    var priv = document.getElementById('optprivate');
    var pub = document.getElementById('optpublic');
    if (priv.checked == true) {
        document.getElementById('chkpermition2').checked = false;
        document.getElementById('chkpermition2').disabled = true;
    }
    else {
        document.getElementById('chkpermition2').disabled = false;
        document.getElementById('chkpermition2').checked = true;
    }
}

function CheckMSM() {
    $.ajax({
        type: "POST",
        contentType: "application/json; charset=utf-8",
        url: "http://www.edupal.in/PalGroupServices.asmx/MSM",
        data: "{}",
        dataType: "json",
        success: function(data) {
            $('#marksdetail').empty();
            $('#marksdetail').append(data.d);
        },
        failure: function(msg) {
            //$('#output').text(msg);
            alert("Please Try Next Time Your Request Has Not Been Completed");
        }
    });
}

function CheckETA(val) {
  
    $.ajax({
        type: "POST",
        contentType: "application/json; charset=utf-8",
        url: "http://www.edupal.in/PalGroupServices.asmx/ETA",
        data: "{uid: '" + val + "'}",
        dataType: "json",
        success: function(data) {
            $('#marksdetail').empty();
            $('#marksdetail').append(data.d); 
        },
        failure: function(msg) {
            //$('#output').text(msg);
            alert("Please Try Next Time Your Request Has Not Been Completed");
        }
    });
}

function CheckAvailG(val) {
if(val.length<1){$get('chkres').innerHTML = "<img src='http://www.indiaeducation.net/images/cross.png'/> max(50)"; return false;}
    $get("btnCreateGroup").onclick = function() { alert('please fill information properly.'); }
    $get('chkres').innerHTML = '<img style="margin-top:4px;" src="http://www.edupal.in/img/load.gif" /> ';
    $.ajax({
        type: "POST",
        contentType: "application/json; charset=utf-8",
        url: "http://www.edupal.in/PalGroupServices.asmx/IsAvalable",
        data: "{val:'" + val + "'}",
        dataType: "json",
        success: function(data) {
            $('#chkres').empty();
            if (data.d == 'exist') {
               // alert('This Group Is All Ready Exist. Please Try Another Name.');
                $get('chkres').innerHTML = "<img src='http://www.indiaeducation.net/images/cross.png'/> max(50)";
            }
            if (data.d == 'notexist') {
                $get('chkres').innerHTML = "<img src='http://www.indiaeducation.net/images/accept.png'/> max(50)";
                $get("btnCreateGroup").onclick = function() { createNewGroup(); }
            }
        },
        failure: function(msg) {
            //$('#output').text(msg);
            alert("Please Try Next Time Your Request Has Not Been Completed");
        }
    });
}

function Searchfrndbyloc(val, size, len) {
   
    $('#MainContainer').fadeOut('slow'); $get('srcloader').style.display = "block"; $get('pagingContainer').style.display = "none";
    //if (document.getElementById('chkloc').checked == true) {
    var cont = $get('contryhtml').options[$get('contryhtml').selectedIndex].text;
    var state = $get('statehtml').options[$get('statehtml').selectedIndex].text;
    if ($get('cityhtml').selectedIndex != -1) {
        var city = $get('cityhtml').options[$get('cityhtml').selectedIndex].text;
    }
    else
    { state = ""; city = ""; }
    //alert(cont + ' /' + state + ' /' + city);
        $.ajax({
            type: "POST",
            contentType: "application/json; charset=utf-8",
            url: "http://www.edupal.in/PalGroupServices.asmx/Searchfriendloc",
            data: "{val:'" + val + "', size:" + size + ", len:'" + len + "', cont:'" + cont + "', state:'" + state + "', city:'" + city + "'}",
            dataType: "json",
            success: function(data) {
                //alert(data.d);
                $('#output').empty(); $('#MainContainer').empty();
                $get('srcloader').style.display = "none"; $get('pagingContainer').style.display = "block";
                if (data.d == 'NULL' || data.d == 'fail') {
                    document.getElementById('pagingContainer').style.display = "none";
                    $('#MainContainer').append("<h3>There are no search results. </h3>");

                }

                else {

                    if (size == 0) {
                        var D = data.d.split('<>');// alert('len-' + D[0]); alert('data-' + D[1]);
                        if (D[0] != '0') {
                            $get('ctl00_ContentPlaceHolderMid_tota').value = D[0];
                            $get('ctl00_ContentPlaceHolderMid_sho').value = $get('ctl00_ContentPlaceHolderMid_sho').value;
                            $get('ctl00_ContentPlaceHolderMid_key').value = val;
                            $get('ctl00_ContentPlaceHolderMid_total').innerHTML = D[0];
                            $get('ctl00_ContentPlaceHolderMid_typesrch').value = "Loc";
                            $('#MainContainer').append(D[1]); $('#MainContainer').fadeIn('slow');
                            clearDDLPageNo($get('DDLPageNo'));
                            paging();
                            $get('DDLPageNo').value = 1;
                            pageChange('0');

                        }
                        else {
                            document.getElementById('pagingContainer').style.display = "none";
                            $('#MainContainer').append("<h3>There are no search results. </h3>");
                            $('#MainContainer').fadeIn('slow');
                        }
                    }
                    else {
                        $('#MainContainer').append(data.d); $('#MainContainer').fadeIn('slow');
                    }
                    //document.getElementById('MainBtn').onclick = function() { Searchfrnd(val, (size + 10)); }
                    // if (size == 10) { $get('ctl00_ContentPlaceHolderMid_btnsrc').onclick = function() { }; }
                }

            },
            failure: function(msg) {
                //$('#output').text(msg);
                alert("Please Try Next Time Your Request Has Not Been Completed");
            }
        });

}
    function Searchfrnd(val, size, len) {
        $('#MainContainer').fadeOut('slow'); $get('srcloader').style.display = "block"; $get('pagingContainer').style.display = "none";
          $.ajax({
                type: "POST",
                contentType: "application/json; charset=utf-8",
                url: "http://www.edupal.in/PalGroupServices.asmx/Searchfriend",
                data: "{val:'" + val + "', size:" + size + ", len:'" + len + "'}",
                dataType: "json",
                success: function(data) {
                $('#output').empty(); $('#MainContainer').empty();
                $get('srcloader').style.display = "none"; $get('pagingContainer').style.display = "block";
                    if (data.d == 'NULL' || data.d == 'fail') {
                        document.getElementById('pagingContainer').style.display = "none";
                        $('#MainContainer').append("<h3>There are no search results. </h3>");
                        
                    }

                    else {
                        $('#MainContainer').append(data.d); $('#MainContainer').fadeIn('slow');
                        //document.getElementById('MainBtn').onclick = function() { Searchfrnd(val, (size + 10)); }
                       // if (size == 10) { $get('ctl00_ContentPlaceHolderMid_btnsrc').onclick = function() { }; }
                    }
                   
                },
                failure: function(msg) {
                    //$('#output').text(msg);
                    alert("Please Try Next Time Your Request Has Not Been Completed");
                }
            });

        }
        function SearchGroup(val, size, len) {
            $('#MainContainer').fadeOut('slow'); $get('srcloader').style.display = "block"; $get('pagingContainer').style.display = "none";
            $.ajax({
                type: "POST",
                contentType: "application/json; charset=utf-8",
                url: "http://www.edupal.in/PalGroupServices.asmx/Searchgroups",
                data: "{val:'" + val + "', size:" + size + ", len:'" + len + "'}",
                dataType: "json",
                success: function(data) {
                    $('#output').empty(); $('#MainContainer').empty();
                    $get('srcloader').style.display = "none"; $get('pagingContainer').style.display = "block";
                    if (data.d == 'NULL' || data.d == 'fail') {
                        document.getElementById('pagingContainer').style.display = "none";
                        $('#MainContainer').append("<h3>There are no search results. </h3>");

                    }

                    else {
                        $('#MainContainer').append(data.d); $('#MainContainer').fadeIn('slow');
                        //document.getElementById('MainBtn').onclick = function() { Searchfrnd(val, (size + 10)); }
                        // if (size == 10) { $get('ctl00_ContentPlaceHolderMid_btnsrc').onclick = function() { }; }
                    }

                },
                failure: function(msg) {
                    //$('#output').text(msg);
                    alert("Please Try Next Time Your Request Has Not Been Completed");
                }
            });

        }
    function dGroup(val) {
        $get('delg' + val).innerHTML = '<img style="margin-top:4px;" src="http://www.edupal.in/img/load.gif" /> ';
        $.ajax({
            type: "POST",
            contentType: "application/json; charset=utf-8",
            url: "http://www.edupal.in/PalGroupServices.asmx/deleteGroup",
            data: "{val:'" + val + "'}",
            dataType: "json",
            success: function(data) {
                $get('delg' + val).style.visibility = "hidden";
                if (data.d == 'login') alert("please login");
                else if (data.d == 'fail' || data.d.length < 2) alert('We are getting some problem. Plese try again letter');
                else if (data.d == 'success') { disablePopup(); document.location.href = document.URL; }
                else { alert('there are some problem try again letter'); }
            },
            failure: function(msg) {
                //$('#output').text(msg);
                alert("Please Try Next Time Your Request Has Not Been Completed");
            }
        });
    }

    function RedirectLoc() {

        var content = "<div class='commonbox_icon'><div class='commonbox_main'><div class='commonbox_icon1'></div><div class='commonbox_icon2'>This Group Will Be Deleted Permanently. Do you want to continue?</div></div><div class='commonbox_button'><div class='commonbox_button1'><input id='cpopMainbtn' name='OK'  type='button'  class='commonbox_but' value='OK'  /></div><div class='commonbox_button1'><input name='Cancel' type='button' class='commonbox_but' value='Cancel' onclick='javascript:disablePopup();'/></div></div></div>";
        positionpopup();
        loadPopup();
        $get("FeedbackContent").style.backgroundColor = "Transparent";
        $get("FeedbackContent").style.border = "none";
        $get("FeedbackContent").innerHTML = comonpop;
        $get('cpophead').innerHTML = "Update profile information";
        $get("cpopbodyMsg").innerHTML = "Please fill this form properly in order to complete your profile.<br> &nbsp;&nbsp;Click cancel if not at this time.";
        $get('cpopMainbtn').onclick = function() { disablePopup(); }
        $get('cpopbtncalcle').onclick = function() { chkredirect(); }
    }
    
    function deletemember(uid,gid) {

        var content = "<div class='commonbox_icon'><div class='commonbox_main'><div class='commonbox_icon1'></div><div class='commonbox_icon2'>This Group Will Be Deleted Permanently. Do you want to continue?</div></div><div class='commonbox_button'><div class='commonbox_button1'><input id='cpopMainbtn' name='OK'  type='button'  class='commonbox_but' value='OK'  /></div><div class='commonbox_button1'><input name='Cancel' type='button' class='commonbox_but' value='Cancel' onclick='javascript:disablePopup();'/></div></div></div>";
        positionpopup();
        loadPopup();
        $get("FeedbackContent").style.backgroundColor = "Transparent";
        $get("FeedbackContent").style.border = "none";
        $get("FeedbackContent").innerHTML = comonpop;
        $get('cpophead').innerHTML = "Update membership";
        $get("cpopbodyMsg").innerHTML = "This Member Will Be Deleted Permanently. Do you want to continue?";
        $get('cpopMainbtn').onclick = function() { deletemember1(uid, gid); }

    }
    function deletemember1(uid, gid) {
        $get('mainbtnconta').innerHTML = '<img style="margin-top:4px;" src="http://www.edupal.in/img/load.gif" /> ';
        $.ajax({
            type: "POST",
            contentType: "application/json; charset=utf-8",
            url: "http://www.edupal.in/PalGroupServices.asmx/Memdel",
            data: "{uid:'" + uid + "', gid:'" + gid + "'}",
            dataType: "json",
            success: function(data) {

                if (data.d == 'login') alert("please login");
                else if (data.d == 'fail' || data.d.length < 2) alert('We are getting some problem. Plese try again letter');
                else if (data.d == 'success') { $get('mainbtnconta').innerHTML = "<input id='cpopMainbtn' name='OK' type='button' class='commonbox_but' value='OK'  />"; disablePopup(); document.location.href = document.URL; }
                else { alert('there are some problem try again letter'); }
            },
            failure: function(msg) {
                //$('#output').text(msg);
                alert("Please Try Next Time Your Request Has Not Been Completed");
            }
        });
    }
    function deletefrnd(val) {

        var content = "<div class='commonbox_icon'><div class='commonbox_main'><div class='commonbox_icon1'></div><div class='commonbox_icon2'>This Group Will Be Deleted Permanently. Do you want to continue?</div></div><div class='commonbox_button'><div class='commonbox_button1'><input id='cpopMainbtn' name='OK'  type='button'  class='commonbox_but' value='OK'  /></div><div class='commonbox_button1'><input name='Cancel' type='button' class='commonbox_but' value='Cancel' onclick='javascript:disablePopup();'/></div></div></div>";
        positionpopup();
        loadPopup();
        $get("FeedbackContent").style.backgroundColor = "Transparent";
        $get("FeedbackContent").style.border = "none";
        $get("FeedbackContent").innerHTML = comonpop;
        $get('cpophead').innerHTML = "Update your pal ";
        $get("cpopbodyMsg").innerHTML = "This Pal Will Be Deleted Permanently. Do you want to continue?";
        $get('cpopMainbtn').onclick = function() { deletefrnd1(val); }

    }
    function deletefrnd1(val) {
        $get('mainbtnconta').innerHTML = '<img style="margin-top:4px;" src="http://www.edupal.in/img/load.gif" /> ';
        $.ajax({
            type: "POST",
            contentType: "application/json; charset=utf-8",
            url: "http://www.edupal.in/PalGroupServices.asmx/Frnddel",
            data: "{val:'" + val + "'}",
            dataType: "json",
            success: function(data) {
               
                if (data.d == 'login') alert("please login");
                else if (data.d == 'fail' || data.d.length < 2) alert('We are getting some problem. Plese try again letter');
                else if (data.d == 'success') { $get('mainbtnconta').innerHTML = "<input id='cpopMainbtn' name='OK' type='button' class='commonbox_but' value='OK'  />"; disablePopup(); document.location.href = document.URL; }
                else { alert('there are some problem try again letter'); }
            },
            failure: function(msg) {
                //$('#output').text(msg);
                alert("Please Try Next Time Your Request Has Not Been Completed");
            }
        });
    }
    function deleteGroup(val) {
    
    //var content = "<div class='commonbox_icon'><div class='commonbox_main'><div class='commonbox_icon1'></div><div class='commonbox_icon2'>This Group Will Be Deleted Permanently. Do you want to continue?</div></div><div class='commonbox_button'><div class='commonbox_button1'><input id='cpopMainbtn' name='OK'  type='button'  class='commonbox_but' value='OK'  /></div><div class='commonbox_button1'><input name='Cancel' type='button' class='commonbox_but' value='Cancel' onclick='javascript:disablePopup();'/></div></div></div>";
    positionpopup();
    loadPopup();
    $get("FeedbackContent").style.backgroundColor = "Transparent";
    $get("FeedbackContent").style.border = "none";
    $get("FeedbackContent").innerHTML = comonpop;
    $get('cpophead').innerHTML = "Security Information ";
    $get("cpopbodyMsg").innerHTML = "This Group Will Be Deleted Permanently. Do you want to continue?";
    $get('cpopMainbtn').onclick=function(){dGroup(val);}

}
function loginMsg() {

    //var content = "<div class='commonbox_icon'><div class='commonbox_main'><div class='commonbox_icon1'></div><div class='commonbox_icon2'>This Group Will Be Deleted Permanently. Do you want to continue?</div></div><div class='commonbox_button'><div class='commonbox_button1'><input id='cpopMainbtn' name='OK'  type='button'  class='commonbox_but' value='OK'  /></div><div class='commonbox_button1'><input name='Cancel' type='button' class='commonbox_but' value='Cancel' onclick='javascript:disablePopup();'/></div></div></div>";
    positionpopup();
    loadPopup();
    $get("FeedbackContent").style.backgroundColor = "Transparent";
    $get("FeedbackContent").style.border = "none";
    $get("FeedbackContent").innerHTML = comonpop;
    $get('cpophead').innerHTML = "Alert ";
    $get("cpopbodyMsg").innerHTML = "You will have to first login to continue.";
    $get('cpopMainbtn').onclick = function() { changelocation();}
    
}
function changelocation() {
    var uri = document.URL.toString();
    uri = uri.split('edupal.in/'); //alert("http://www.edupal.in/login.aspx?ReturnUrl=/" + uri[1]);
    document.location.href = "http://www.edupal.in/default.aspx?ReturnUrl=/"+uri[1];
}
function createNewGroup() {
    var btn = $get('btnCreateGroup');  var btnval=btn.value;
    btn.value = ''; btn.onclick = function() { }
   
    $get('loder').style.visibility = 'visible'; $get('loder').style.display = 'inline';
    var name = $get('posthead').value;
    var desc = $get('postdata').value;
    var url = $get('txturl').value;
    var title = $get('title').value;
    if (name.length < 1 || desc.length < 1) { alert('please Enter Name & Description of Group '); $get('loder').style.visibility = 'hidden'; $get('loder').style.display = 'none'; btn.value =btnval; btn.onclick = function() { createNewGroup(); }; return false; }
    var chk = checkspecialchar(name);
    if (chk == '1') { $get('loder').style.display = 'none'; alert('Special character not allowed other then space and underscore(_)'); btn.value = btnval; btn.onclick = function() { alert("special character is not allowed other then space."); }; return false; }
    var rul1 = 0, rul2 = 0, rul3 = 0, rul4 = 0;
    if ($get('optprivate').checked) rul4 = 1; else rul4 = 0;
    if ($get('chkpermition1').checked) rul1 = 1;
    if ($get('chkpermition2').checked) rul2 = 1;
    if ($get('chkpermition3').checked) rul3 = 1; //alert(name + desc + rul1 + rul2 + rul3 + rul4);
    $.ajax({
        type: "POST",
        contentType: "application/json; charset=utf-8",
        url: "http://www.edupal.in/PalGroupServices.asmx/createNewGroup",
        data: "{name:'" + name + "', title:'" + title + "', desc:'" + desc + "', url:'" + url + "', rul1:'" + rul1 + "', rul2:'" + rul2 + "', rul3:'" + rul3 + "', rul4:'" + rul4 + "'}",
        dataType: "json",
        success: function(data) {
            $get('loder').style.visibility = 'hidden'; $get('loder').style.display = 'none';
            //alert(data.d);
            btn.value = btnval; btn.onclick = function() { createNewGroup(); };
            if (data.d == 'login') { alert('Please Login'); }
            if (data.d == 'success') { disablePopup(); document.location.href = document.URL; }
            if (data.d == 'fail') { alert('Please try again letter'); }
            if (data.d == 'notvalid') { alert('Please do not put any special character to the name of your group'); }
        },
        failure: function(msg) {
            //$('#output').text(msg);
            alert("Please Try Next Time Your Request Has Not Been Completed");
        }
    });
}
function CountHead() {
    if (document.getElementById('posthead') != null)
        document.getElementById('hdmsgcount').innerHTML = document.getElementById('posthead').value.length + " Chars"; 
}

function CountHeadBody() {
    if (document.getElementById('postdata') != null) {
        var txt = document.getElementById('postdata');
        document.getElementById('bodymsgcount').innerHTML = txt.value.length + " Chars";
        if (txt.value.length > 500) {txt.value = txt.value.substring(0, 500); document.getElementById('bodymsgcount').innerHTML = "500 Chars"; }
    }
}
function createGroup() {
    positionpopup();
    loadPopup();
    document.getElementById("FeedbackContent").style.backgroundColor = "Transparent";
    document.getElementById("FeedbackContent").style.border = "none";

    GetUploadFile('http://www.edupal.in/UserDiary/CreateEditGroup.aspx?Perform=create');
    //document.getElementById('btnCreateGroup').onclick = function() { createNewGroup(); }
}
// popup layer code
var popupStatus = 0;
function loadPopup() {
    $("#FeedbackContent").empty();
    $("#FeedbackContent").html('<img style="margin-left:200px;margin-top:50px;" title="Please Wait.." src="http://www.edupal.in/img/ajax-loader.gif" id="loder">');
    if (popupStatus == 0) {
        $("#backgroundPopup").css({
            "opacity": "0.1"
        });
        $("#backgroundPopup").fadeIn("slow");
        $("#popupContact").fadeIn("slow");
        $("#FeedbackContent").fadeIn("slow");
        
        popupStatus = 1;
    }
}
//disabling popup with jQuery magic!
function disablePopup() {
    //disables popup only if it is enabled
    if (popupStatus == 1) {
        $("#backgroundPopup").fadeOut("slow");
        $("#popupContact").fadeOut("slow");
        $("#FeedbackContent").fadeOut("slow");
        if (document.getElementById('posthead'))
            document.getElementById('posthead').value = "";
        if (document.getElementById('postdata'))
            document.getElementById('postdata').value = "";

        popupStatus = 0;
    }
}
function positionpopup(){
    var windowWidth = document.documentElement.clientWidth / 2;
    var windowHeight = document.documentElement.clientHeight / 2;
    var popupWidth = document.getElementById('FeedbackContent').style.width;
    if (popupWidth.indexOf('px') != -1)
    { popupWidth = popupWidth.split('px'); }
    if (navigator.appName == "Microsoft Internet Explorer") {
        if (windowHeight < 1) { windowHeight = document.body.clientHeight / 2; }
        if (windowWidth < 1) { windowWidth = document.body.clientWidth / 2; }
    }
    var pos = windowWidth - popupWidth[0] / 2;
    document.getElementById('FeedbackContent').style.position = 'absolute';
    document.getElementById('FeedbackContent').style.left = pos + 'px';
    document.getElementById('FeedbackContent').style.top = 50 + 'px';
}


function disableContent() {
    document.getElementById("FeedbackContent").innerHTML = "";
    document.getElementById("FeedbackContent").style.height = "25px";
    document.getElementById("FeedbackContent").style.width = "25px";
}
//common message layer
// popup layer code
var CpopupStatus = 0;
function CloadPopup() {
    if (CpopupStatus == 0) {
//        $("#backgroundPopup").css({
//            "opacity": "0.1"
//        });
       // $("#backgroundPopup").fadeIn("slow");
        $("#PrashantContact").fadeIn("slow");
        $("#PrashantContent").fadeIn("slow");
        CpopupStatus = 1;
    }
}
//disabling popup with jQuery magic!
function CdisablePopup() {
    //disables popup only if it is enabled
    if (CpopupStatus == 1) {
        //$("#backgroundPopup").fadeOut("slow");
        $("#PrashantContact").fadeOut("slow");
        $("#PrashantContent").fadeOut("slow");
        CpopupStatus = 0;
    }
}
function Cpositionpopup() {
    var windowWidth = document.documentElement.clientWidth;
    var windowHeight = document.documentElement.clientHeight;
    var theWidth, theHeight;

    if (navigator.appName == "Microsoft Internet Explorer") {
        if (windowHeight < 1) {windowHeight = document.body.clientHeight;}
        document.getElementById('PrashantContent').style.position = 'absolute';
        document.getElementById('PrashantContent').style.left = 280 + 'px';
        document.getElementById('PrashantContent').style.top = (windowHeight - 3) + 'px';
        document.getElementById('popslide1').style.top = (windowHeight - 3) + 'px';
       
    }
    else {
        document.getElementById('PrashantContent').style.position = 'absolute';
        document.getElementById('PrashantContent').style.left = (windowWidth - 230) + 'px';
        document.getElementById('PrashantContent').style.top = (windowHeight - 3) + 'px';
        document.getElementById('popslide1').style.top = (windowHeight - 3) + 'px';
    }
}
function GetUploadFile(url) {
    var xmlHttp;
    xmlHttp = GetXmlHttpObject();
    var geturl = url;
    //alert(url);
    if (xmlHttp != null) {

        var url = geturl;
        xmlHttp.onreadystatechange = function() {
            if (xmlHttp.readyState == 4) {
                $("#FeedbackContent").empty();
                document.getElementById("FeedbackContent").innerHTML = xmlHttp.responseText;
                document.getElementById("FeedbackContent").style.backgroundColor = "Transparent";
                //document.getElementById("FeedbackContent").style.border = "solid 1px #FFFFFF";
            }
        }

        xmlHttp.open("GET", url, true);
        xmlHttp.send(null);
    }
}
// popup layer code
//timer
var updateTime = new Date();
function startTime() {
    var today = new Date();
    var h = today.getHours();
    var m = today.getMinutes();
    var s = today.getSeconds();
    var ampm = '';
    //var mode = document.getElementById('Mode').value;
    //var enablesave = document.getElementById('cbautosave');
    if (updateTime != null) {
        var uh = updateTime.getHours();
        var um = updateTime.getMinutes();
        var us = updateTime.getSeconds();
        if (um >= 58) { um = 0; uh = uh + 1; } //if (h > uh) { updateTime = new Date(); }
        if (h == uh) { if (um == m && s == us + 20) { PrashantSingh(); } }
    }

    if (h == 12) { ampm = "pm" } else if (h > 12) { h = h - 12; ampm = "pm"; } else { ampm = "am"; }
    m = checkTime(m);
    s = checkTime(s);
    t = setTimeout('startTime()', 500);
}

function checkTime(i) {
    if (i < 10) {
        i = "0" + i;
    }
    return i;
}
//window.onload = function() {
//    startTime();
//}
function filterNum(str) {
    re = /\$|,|@|#|~|`|\%|\*|\^|\&|\(|\)|\+|\=|\[|\-|\_|\]|\[|\}|\{|\;|\:|\'|\"|\<|\>|\?|\||\\|\!|\$|/g;
    // remove special characters like "$" and "," etc...
    return str.replace(re, "");
}

function PrashantSingh() {
    $.ajax({
        type: "POST",
        contentType: "application/json; charset=utf-8",
        url: "http://www.edupal.in/PalGroupServices.asmx/FriendlayMsg",
        data: "{}",
        dataType: "json",
        success: function(data) {
            $('#info4U').empty();
            animatedcollapse.show('palinfocenter');
            $('#info4U').append(data.d);
            setTimeout("animatedcollapse.hide('palinfocenter');", 5000)
            //document.location.href = "#automsg";
            updateTime = new Date();
            updateTime.setMinutes(updateTime.getMinutes() + 1, updateTime.getSeconds(), updateTime.getMilliseconds());
            //document.getElementById('setfocs').focus();  
        },
        failure: function(msg) {
            //$('#output').text(msg);
            alert("Please Try Next Time Your Request Has Not Been Completed");
        }
    });
}
function showAstro(val, ctrlhd, ctrlcon) {
    $get('astroLoader').style.visibility = "visible";
    $.ajax({
        type: "POST",
        contentType: "application/json; charset=utf-8",
        url: "http://www.edupal.in/PalGroupServices.asmx/astrology",
        data: "{val:'" + val + "'}",
        dataType: "json",
        success: function(data) {
            $get('astroLoader').style.visibility = "hidden";
            var output = data.d;
            val = parseInt(val);
            if (output.length > 10) {
                $('#' + ctrlhd).empty(); $('#' + ctrlcon).empty();
                output = output.split('<>');
                $('#' + ctrlhd).append(output[0]);
                $('#' + ctrlcon).append(output[1]);
            }
            if ((val - 1) == 0) {
                $get('astnxt').href = "javascript:showAstro('" + 2 + "', '" + ctrlhd + "', '" + ctrlcon + "')";
                $get('ctl00_ContentPlaceHolderLeft1_DefaultLeft1_astroPre').style.visibility = "hidden";
            }
            else if ((val + 1) == 13) {
                $get('astpre').href = "javascript:showAstro('" + 11 + "', '" + ctrlhd + "', '" + ctrlcon + "')";
                $get('ctl00_ContentPlaceHolderLeft1_DefaultLeft1_astronext').style.visibility = "hidden";
            }
            else {
                $get('ctl00_ContentPlaceHolderLeft1_DefaultLeft1_astroPre').style.visibility = "";
                $get('ctl00_ContentPlaceHolderLeft1_DefaultLeft1_astronext').style.visibility = "";
                $get('astpre').href = "javascript:showAstro('" + (val - 1) + "', '" + ctrlhd + "', '" + ctrlcon + "')";
                $get('astnxt').href = "javascript:showAstro('" + (val + 1) + "', '" + ctrlhd + "', '" + ctrlcon + "')";
            }
        },
        failure: function(msg) {
            //$('#output').text(msg);
            alert("Please Try Next Time Your Request Has Not Been Completed");
        }
    });
}
////////////////
//search box
/////////////
var request;
document.onclick = function() {
    if (document.getElementById('srcout')) {
        document.getElementById('srcout').style.visibility = 'hidden';
    }
}
function checkKey(e) {
    //    if (window.event) {
    //        e = window.event;alert('windowevent'+e.keyCode);
    //     }
   // eventSrcID = (event.srcElement) ? event.srcElement.id : event.target.id;
    var Frm = document.getElementById("ctl00_ucheaser1_edusrch");
    var srcEl = e.srcElement ? e.srcElement : e.target;
    if (e.keyCode == 13) {
        if (Frm != null && Frm.value.length > 0) {
            setsrcenterkey(Frm.value); //return (true);
        }

    }
    else if (e.keyCode == 38 || e.keyCode == 40) {
        if (e.keyCode == 40) {
            try {
                var children = document.getElementById("srcout").childNodes;
                var status = 0;
                for (var i = 0; i < children.length; i++) {
                    // if (children[i].className == 'mover') {
                    if ($(children[i]).is('.mover')) {
                        //alert(children[i]);
                        $(children[i]).removeClass("mover");
                        $(children[i]).addClass("white");
                        if (children[i + 1] != undefined) {
                            $(children[i + 1]).addClass("mover"); status = 1;
                            document.getElementById("ctl00_ucheaser1_edusrch").value = $get('sd' + (i + 1)).innerHTML; //children[i + 1].innerHTML;
                            break;
                        }
                        else {
                            $(children[0]).addClass("mover"); status = 1;
                            document.getElementById("ctl00_ucheaser1_edusrch").value = $get('sd' + (1)).innerHTML; //children[0].innerHTML;
                            break;
                        }
                    }
                    //alert(children[i]);
                }
                if (status == 0) {
                    $(children[0]).addClass("mover"); status = 1;
                }
            }
            catch (err) {
            }
        }
        else if (e.keyCode == 38) {
        try {
            var children = document.getElementById("srcout").childNodes;
            var status = 0;
            for (var i = 0; i < children.length; i++) {
                // if (children[i].className == 'mover') {
                if ($(children[i]).is('.mover')) {
                    //alert(children[i]);
                    $(children[i]).removeClass("mover");
                    $(children[i]).addClass("white");
                    if (children[i - 1] != undefined) {
                        $(children[i - 1]).addClass("mover"); status = 1;
                        document.getElementById("ctl00_ucheaser1_edusrch").value = $get('sd' + (i - 1)).innerHTML;  //children[i - 1].innerHTML;
                        break;
                    }
                    else {
                        $(children[children.length - 1]).addClass("mover"); status = 1;
                        document.getElementById("ctl00_ucheaser1_edusrch").value = $get('sd' + (children.length - 1)).innerHTML; //children[children.length - 1].innerHTML;
                        break;
                    }
                }
                //alert(children[i]);
            }
            if (status == 0) {
                $(children[children.length - 1]).addClass("mover"); status = 1;
                document.getElementById("ctl00_ucheaser1_edusrch").value = $get('sd' + (children.length - 1)).innerHTML; //children[children.length - 1].innerHTML;
            }
        }
        catch (err) {
        }
        }
        return false;
    }
    else {
        if (request == undefined || request == 0) { request = 1; Search_Box(Frm.value); }
    }
    // srcEl now can be used x-browser.  
    // (rest of the script here)
}

function Search_Box1(type) {
    var Form = document.getElementById("aspnetForm");
    var show = document.getElementById("srcout");
    var val = document.getElementById('HDV');

   
    if (type.length < 1) { show.innerHTML = '&nbsp;'; show.style.visibility = "hidden"; show.style.display = "none"; return false; }
    else { show.style.visibility = "visible"; show.style.display = "block"; }
    
        $.ajax({
            type: "POST",
            contentType: "application/json; charset=utf-8",
            url: "http://www.edupal.in/PalGroupServices.asmx/searchasist",
            data: "{ value: '" + type + "'}",
            dataType: "json",
            success: function(data) {
                $('#srcout').empty();
                $('#srcout').append(data.d);
                if (data.d.length < 10) {
                    show.style.visibility = "hidden"; show.style.display = "none"; return false; 
                }

            },
            failure: function(msg) {
                $('#output').text(msg);
                alert("Please Try Next Time Your Request Has Not Been Completed");
            }
        });
}
////////////////////////////////////////
function GetXmlHttpObject() {
    var xmlHttp = null;
    try {
        // Firefox, Opera 8.0+, Safari
        xmlHttp = new XMLHttpRequest();
    }
    catch (e) {
        // Internet Explorer
        try {
            xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
        }
        catch (e) {
            xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
        }
    }

    if (xmlHttp == null) {
        alert("Your browser does not support AJAX!");
        return;
    }

    return xmlHttp;
}

function Search_Box(type) {
    if (document.getElementById('srchloader')) document.getElementById('srchloader').style.display = "inline";
    var Form = document.getElementById("aspnetForm");
    var show = document.getElementById("srcout");
    var val = document.getElementById('HDV');
    var what;
    if (srcchmsg == "search group") what = "G"; else what = "P";
    //alert(type);
    //            if(val.value == null || val.value == ""){val.value = type;}
    //            else { 
    //             var len1 = val.value; if(len1.length + 3 != type.length){val.value = type;return false;} else {val.value = type;}
    //            }
    if (type.length < 1) { show.innerHTML = '&nbsp;'; show.style.visibility = "hidden"; show.style.display = "none"; document.getElementById('srchloader').style.display = "none"; request = 0; return (false); }
    else { show.style.visibility = "visible"; show.style.display = "block"; }

    var xmlHttp;
    xmlHttp = GetXmlHttpObject();
    //Form.ddSelectYear.options[Form.ddSelectYear.value].text
    if (xmlHttp != null) {
        var url = "http://www.edupal.in/UserDiary/srchbyname.aspx?";
        var burl = document.URL.toLowerCase();
        if (burl.indexOf('www.') < 0) { url = "http://edupal.in/UserDiary/srchbyname.aspx?"; }
        url = url + "srcval=" + type; url = url + "&what=" + what;
        url = url + "&Perform=sbn";
        xmlHttp.onreadystatechange = function() {
            if (xmlHttp.readyState == 4) {
                request = 0;
                if (document.getElementById('srchloader')) document.getElementById('srchloader').style.display = "none";
                $('#srcout').empty();
                if (xmlHttp.responseText == "nomsg") { show.style.visibility = "hidden"; show.style.display = "none"; request = 0; return false; }
                if (xmlHttp.responseText != "nomsg") {
                    var output = xmlHttp.responseText;
                    show.innerHTML = output; request = 0;

                    //                    var out = output.split(",");
                    //                    show.innerText = "";

                    //                    if (show != null) {
                    //                        for (var i = 0; i < out.length; i++) {
                    //                            if (i == 0)//.setAttribute('class', 'myClass');
                    //                                show.innerHTML = "<div id='s" + i + "' class='' style='height:23px; border-bottom:solid 1px #cad4dc; padding:2px; font-size:11px; margin:1px;cursor:pointer' onmouseout=javascript:this.setAttribute('class',''); onmouseover=javascript:this.setAttribute('class','mover'); onclick=javascript:setsrcout('" + i + "');>" + out[i] + "</div>";
                    //                            else
                    //                                show.innerHTML += "<div id='s" + i + "' class='' style='height:23px; padding:2px; border-bottom:solid 1px #cad4dc; font-size:11px; margin:1px;cursor:pointer' onmouseout=javascript:this.setAttribute('class',''); onmouseover=javascript:this.setAttribute('class','mover'); onclick=javascript:setsrcout('" + i + "');>" + out[i] + "</div>";
                    //                        }
                    //                    }
                }
                if (document.getElementById("ctl00_ucheaser1_edusrch").value != type) { request = 1; Search_Box(document.getElementById("ctl00_ucheaser1_edusrch").value); }
            }
        }
        xmlHttp.open("GET", url, true);
        xmlHttp.send(null);
        return (false);
    }
    else request = 0;
}

function setsrcout(obj) {
    var txt = $get('sd' + obj).innerHTML; var newTxt;
    var Frm = document.getElementById("ctl00_ucheaser1_edusrch");
    if (Frm != null) {
        Frm.value = txt;
        document.getElementById('srcout').innerHTML = "";
        document.getElementById('srcout').style.visibility = "hidden";
        txt = txt.split(" ");
        for (var i = 0; i < txt.length; i++) {
            if (i == 0)
                newTxt = txt[i];
            else
                newTxt = newTxt + "-" + txt[i];
        }
        if (srcchmsg == "search group")
            document.location.href = "http://www.edupal.in/Search/Group/?Name=" + newTxt;
        else
            document.location.href = "http://www.edupal.in/Search/Profile/?Name=" + newTxt;
    }
}
function setsrcbtnpress() {
    var newTxt;
    var Frm = document.getElementById("ctl00_ucheaser1_edusrch");

    if (Frm != null && Frm.value.length > 1) {
        var txt = Frm.value; //alert(Frm.value);
        if (txt == "search your pal" || txt == "search group") { return (false);}
        document.getElementById('srcout').innerHTML = "";
        document.getElementById('srcout').style.visibility = "hidden";
        txt = txt.split(" ");
        for (var i = 0; i < txt.length; i++) {
            if (i == 0)
                newTxt = txt[i];
            else
                newTxt = newTxt + "-" + txt[i];
        }

        if (srcchmsg == "search group")
            document.location.href = "http://www.edupal.in/Search/Group/?Name=" + newTxt;
        else
            document.location.href = "http://www.edupal.in/Search/Profile/?Name=" + newTxt;
    }
}
function setsrcenterkey(txt) {
    var newTxt;
    txt = filterNum(txt);
    //document.getElementById('srcout').innerHTML = "";
    //document.getElementById('srcout').style.visibility = "hidden";
    txt = txt.split(" ");
    for (var i = 0; i < txt.length; i++) {
        if (i == 0)
            newTxt = txt[i];
        else
            newTxt = newTxt + "-" + txt[i];
    }

    if (srcchmsg == "search group")
        document.location.href = "http://www.edupal.in/Search/Group/?Name=" + newTxt;
    else
        document.location.href = "http://www.edupal.in/Search/Profile/?Name=" + newTxt;
}
function setHeightGM(id) {
    var TheCount = document.getElementById(id).getElementsByTagName("img").length / 6;
    if (TheCount >= 0 && TheCount <= 1) TheCount = 1;
    if (TheCount > 1 && TheCount <= 2) TheCount = 2;
    if (TheCount > 2 && TheCount <= 3) TheCount = 3;
    document.getElementById(id).style.height = TheCount * 38 + 'px'; //alert('grouph-' + document.getElementById(id).style.height);
    document.getElementById('ctl00_ContentPlaceHolderRight_ucright1_topRowPanel').style.height = (TheCount * 38) + 20 + 'px';
}
function setHeightPro(id1,id2) {
    var TheCount1 = document.getElementById(id1).getElementsByTagName("img").length / 3;
    if (TheCount1 >= 0 && TheCount1 <= 1) TheCount1 = 1;
    if (TheCount1 > 1 && TheCount1 <= 2) TheCount1 = 2;
    if (TheCount1 > 2 && TheCount1 <= 3) TheCount1 = 3;
    document.getElementById(id1).style.height = TheCount1 * 86 + 'px'; //alert('TheCount1*92=' + TheCount1 * 84+ 'px');
    document.getElementById('ctl00_ContentPlaceHolderRight_Defaultright1_topRowPanel').style.height = (TheCount1 * 86)+ 20 + 'px';
    //document.getElementById('handleTop').style.top = (TheCount1 * 95) - 20 + 'px';
    //document.getElementById('ctl00_ContentPlaceHolderRight_Defaultright1_mypals').style.height = (TheCount1 * 95) + 'px';
    var TheCount2 = document.getElementById(id2).getElementsByTagName("img").length / 3;
    if (TheCount2 >= 0 && TheCount2 <= 1) TheCount2 = 1;
    if (TheCount2 > 1 && TheCount2 <= 2) TheCount2 = 2;
    if (TheCount2 > 2 && TheCount2 <= 3) TheCount2 = 3;
    document.getElementById(id2).style.height = TheCount2 * 95 + 'px';
    document.getElementById('ctl00_ContentPlaceHolderRight_Defaultright1_MemberPanel').style.height = (TheCount2 * 95) + 20 + 'px';
}
function SlideMenuCtrl(SlideMenuCtrl_Id, SlideMenuPic) {
    var flag = document.getElementById(SlideMenuCtrl_Id).offsetHeight;
    $(".handleTop").css("border", "solid 1px #FF0000");
    //alert('SlideMenuCtrl_Id='+SlideMenuCtrl_Id+'flag='+flag);
    if (flag == 0) {

        var TheCount = document.getElementById(SlideMenuCtrl_Id).getElementsByTagName("img").length / 3;
        //alert('TheCount'+TheCount+" totalimg="+document.getElementById(SlideMenuCtrl_Id).getElementsByTagName("img").length);
        var MinCount = Math.round(TheCount);

        if (MinCount < TheCount) {
            MinCount = MinCount + 1;
        }
        //alert(MinCount);
        SlideDown(MinCount, SlideMenuCtrl_Id, SlideMenuPic);
        return void (0);

    }
    else (flag != 0)
    {
        SlideUp(SlideMenuCtrl_Id, SlideMenuPic);
        return void (0);
    }

}

function SlideDown(TheCount, SlideMenuCtrl_Id, SlideMenuPic) {
    //alert(SlideMenuCtrl_Id);
    var TheHeight = document.getElementById(SlideMenuCtrl_Id).offsetHeight;
    //var scrollposition = document.getElementById(SlideMenuPic).className('handleTop');

    if (SlideMenuPic == 'mypalspic1') {
        if (TheHeight <= TheCount * 30) {

            document.getElementById(SlideMenuCtrl_Id).style.height = TheHeight + 2 + "px";

            if (document.getElementById(SlideMenuCtrl_Id).offsetHeight > TheCount * 30) {
                document.getElementById(SlideMenuCtrl_Id).style.height = TheCount * 30 + "px";
            }
            else if (document.getElementById(SlideMenuCtrl_Id).offsetHeight >= ((TheCount * 30) - 1)) {
                document.getElementById(SlideMenuPic).src = "http://www.edupal.in/images/upside.gif";
            }
            else {
                setTimeout("SlideDown(" + TheCount + ",'" + SlideMenuCtrl_Id + "','" + SlideMenuPic + "')", 0);
            }
            //alert('down height='+TheHeight+', thecount*65='+((TheCount * 77)-1));
        }
    }
    else {
        var TheHeightScroll = document.getElementById('ctl00_ContentPlaceHolderRight_Defaultright1_topRowPanel').offsetHeight;
        if (TheHeight <= TheCount * 76) {

            document.getElementById(SlideMenuCtrl_Id).style.height = TheHeight + 2 + "px";
            document.getElementById('ctl00_ContentPlaceHolderRight_Defaultright1_topRowPanel').style.height = TheHeight + 2 + "px";
            $(".handleTop").css("top", TheHeight + 2 + "px"); $get("bottomRowPanel").style.top = TheHeight + 2 + "px";
            if (document.getElementById(SlideMenuCtrl_Id).offsetHeight > TheCount * 76) {
                document.getElementById(SlideMenuCtrl_Id).style.height = TheCount * 76 + "px";
                document.getElementById('ctl00_ContentPlaceHolderRight_Defaultright1_topRowPanel').style.height = TheCount * 76 + "px";
                $(".handleTop").css("top", TheCount * 76 + "px"); $get("bottomRowPanel").style.top = TheCount * 76 + "px";
                $get("ctl00_ContentPlaceHolderRight_Defaultright1_ResizableControlExtender_ClientState").value = 304 + ',' + TheCount * 76;
            }
            else if (document.getElementById(SlideMenuCtrl_Id).offsetHeight >= ((TheCount * 76) - 1)) {
                document.getElementById(SlideMenuPic).src = "http://www.edupal.in/images/upside.gif";
            }
            else {
                setTimeout("SlideDown(" + TheCount + ",'" + SlideMenuCtrl_Id + "','" + SlideMenuPic + "')", 0);
            }
            //alert('down height='+TheHeight+', thecount*65='+((TheCount * 77)-1));
        }
    }


}

function SlideUp(SlideMenuCtrl_Id, SlideMenuPic) {
    var TheHeight = document.getElementById(SlideMenuCtrl_Id).offsetHeight;
    var TheHeightScroll = document.getElementById('ctl00_ContentPlaceHolderRight_Defaultright1_topRowPanel').offsetHeight;
    if (TheHeight > 0) {
        document.getElementById(SlideMenuCtrl_Id).style.height = TheHeight - 2 + "px";
        document.getElementById('ctl00_ContentPlaceHolderRight_Defaultright1_topRowPanel').style.height = TheHeight - 2 + "px";
        $(".handleTop").css("top", TheHeight - 2 + "px"); $get("bottomRowPanel").style.top = TheHeight - 2 + "px";
        if (document.getElementById(SlideMenuCtrl_Id).offsetHeight <= 1) {
            document.getElementById(SlideMenuCtrl_Id).style.height = 0 + "px";
            document.getElementById('ctl00_ContentPlaceHolderRight_Defaultright1_topRowPanel').style.height = 0 + "px";
            $get("ctl00_ContentPlaceHolderRight_Defaultright1_ResizableControlExtender_ClientState").value = 304 + ',' + 10;
        }
        else if (document.getElementById(SlideMenuCtrl_Id).offsetHeight <= 2) {
            document.getElementById(SlideMenuPic).src = "http://www.edupal.in/images/downside.gif";
            document.getElementById(SlideMenuCtrl_Id).style.height = 0 + "px";
        }
        else {
            setTimeout("SlideUp('" + SlideMenuCtrl_Id + "','" + SlideMenuPic + "')", 0);

        }
        //alert('up height='+TheHeight+', (thehigh<=1)='+document.getElementById(SlideMenuCtrl_Id).offsetHeight);
    }

}


function SMC_Mover(SlideMenuPic) {
    document.getElementById(SlideMenuPic).className = "solid_color";
}


function SMC_Mout(SlideMenuPic) {
    document.getElementById(SlideMenuPic).className = "Light_color";
}



function PInfoNew(value) {
   
    document.getElementById('efr').innerHTML = '&nbsp;';
    document.getElementById('ecs').innerHTML = '&nbsp;';
    document.getElementById('erv').innerHTML = '&nbsp;';
//    document.getElementById('efr').style.display = "none";
//    document.getElementById('ecs').style.display = "none";
    var xmlHttp;
    xmlHttp = GetXmlHttpObject();
    var url = "http://www.edupal.in/PalGroup/PInfo.aspx?PID=" + value + "&Perform=show";
    if (xmlHttp != null) {

        xmlHttp.onreadystatechange = function() {
            if (xmlHttp.readyState == 4) {
                var data = xmlHttp.responseText;
                data = data.split('<>');

                var alt = data[0];
                alt = alt.split('/');
                // document.getElementById('totv').innerHTML = alt[0];
                document.getElementById('totf').innerHTML = alt[1];
                document.getElementById('totm').innerHTML = alt[2];

                var view = data[1];
                var login = data[2];
                var reminder = data[3];
                var request = data[4];
                var memberreq = data[5];
                var res = data[6];

                //document.getElementById('ell').innerHTML = login;

                if (request.length < 15 && memberreq.length < 15 && res.length < 15) {
                    $get('ctl00_ContentPlaceHolderLeft1_DefaultLeft1_pinfo').style.visibility = "hidden";
                    $get('ctl00_ContentPlaceHolderLeft1_DefaultLeft1_pinfo').style.display = "none";
                }
                else {

                    if (request.length > 15) {
                        document.getElementById('efr').innerHTML = request;
                        //document.getElementById('efr').style.visibility = "visible";
                        // document.getElementById('efr').style.display = "block";
                    }
                    else
                        document.getElementById('efr').innerHTML = "<div style='height:20px;width:180px;background:none;font-size:11px;'>No new pal requests.</div>";

                    if (memberreq.length > 15)
                        document.getElementById('ecs').innerHTML = memberreq;
                    else
                        document.getElementById('ecs').innerHTML = "<div style='height:20px;width:180px;background:none;font-size:11px;'>No new member requests.</div>";

                    if (res.length > 15)
                        document.getElementById('erv').innerHTML = res;
                    else
                        document.getElementById('erv').innerHTML = "<div style='height:20px;width:180px;background:none;font-size:11px;'>No new recent visitor.</div>";
                }
                //////////////
                animatemover();
                //////////////
            }
        }

        xmlHttp.open("GET", url, true);
        xmlHttp.send(null);
    }
}

// profile stmt
function showstmtupdate() {
    document.getElementById('ctl00_ContentPlaceHolderMid_static_stmt').style.display = 'none';
    document.getElementById('ctl00_ContentPlaceHolderMid_edit_stmt').style.display = 'Block';
}
function hidestmtupdate(sta, edit) {
    document.getElementById(edit).style.display = 'none'; document.getElementById(sta).style.display = 'Block';
}
function showperinfoupdate() {
    document.getElementById('ctl00_ContentPlaceHolderMid_show_perinfo').style.display = 'none';
    document.getElementById('ctl00_ContentPlaceHolderMid_edit_personalInfo').style.display = 'Block';

}

function FriendRequest(userM, friendM,propic) {
    // alert(userM+"--"+friendM);
   // var conf = confirm("Are you sure to send friend Request To the User " + friendM);
    positionpopup();
    loadPopup();
    document.getElementById("FeedbackContent").style.backgroundColor = "Transparent";
    document.getElementById("FeedbackContent").style.border = "none";
    GetUploadFile('http://www.edupal.in/UserDiary/Frndrequestmsg.aspx?UserMail=' + userM + '&FriendMail=' + friendM + '&Perform=Requestmsg&pic='+propic);
    
        //Expand('http://www.edupal.in/UserDiary/Frndrequestmsg.aspx?UserMail=' + userM + '&FriendMail=' + friendM + '&Perform=Requestmsg');
   

}

function FriendRequestSubmit() {
    var Form = document.getElementById("formRequestMsg");

    var xmlHttp;
    xmlHttp = GetXmlHttpObject();

    if (xmlHttp != null) {
        var url = "http://www.edupal.in/UserDiary/AddFriend.aspx";
        url = url + "?TxtTitle=" + Form.TxtTitle.value;
        url = url + "&TxtBody=" + Form.TxtBody.value;
        url = url + "&UserMail=" + Form.Hiddenusrmail.value;
        url = url + "&FriendMail=" + Form.Hiddenfrndmail.value;
        url = url + "&Perform=Addfrnd";

        xmlHttp.onreadystatechange = function() {
            if (xmlHttp.readyState == 4) {
                document.getElementById("FeedbackContent").innerHTML = xmlHttp.responseText;
            }
        }
        xmlHttp.open("GET", url, true);
        xmlHttp.send(null);
        return (false);
    }

}
function AlloDnyFromP(GroupN, ToDo, rid) {

    $.ajax({
        type: "POST",
        contentType: "application/json; charset=utf-8",
        url: "http://www.edupal.in/PalGroupServices.asmx/AlloDny",
        data: "{ GroupN:'" + GroupN + "', ToDo:'" + ToDo + "', rid:'" + rid + "' }",
        dataType: "json",
        success: function(data) {
            var out = data.d;
            $get('memR' + rid).style.visibility = "hidden"; $get('memR' + rid).style.display = "none";
            //alert(out);
        },
        failure: function(msg) {
            //$('#output').text(msg);
            alert("Please Try Next Time Your Request Has Not Been Completed");
        }
    });
}
//mouse right click
if (jQuery) (function() {

    $.extend($.fn, {

        rightClick: function(handler) {
            $(this).each(function() {
                $(this).mousedown(function(e) {
                    var evt = e;
                    $(this).mouseup(function() {
                        $(this).unbind('mouseup');
                        if (evt.button == 2) {
                            handler.call($(this), evt);
                            return false;
                        } else {
                            return true;
                        }
                    });
                });
                $(this)[0].oncontextmenu = function() {
                    return false;
                }
            });
            return $(this);
        },

        rightMouseDown: function(handler) {
            $(this).each(function() {
                $(this).mousedown(function(e) {
                    if (e.button == 2) {
                        handler.call($(this), e);
                        return false;
                    } else {
                        return true;
                    }
                });
                $(this)[0].oncontextmenu = function() {
                    return false;
                }
            });
            return $(this);
        },

        rightMouseUp: function(handler) {
            $(this).each(function() {
                $(this).mouseup(function(e) {
                    if (e.button == 2) {
                        handler.call($(this), e);
                        return false;
                    } else {
                        return true;
                    }
                });
                $(this)[0].oncontextmenu = function() {
                    return false;
                }
            });
            return $(this);
        },

        noContext: function() {
            $(this).each(function() {
                $(this)[0].oncontextmenu = function() {
                    return false;
                }
            });
            return $(this);
        }

    });

})(jQuery);	
//	
//	function  SearchFilter_Box()
//	{

//		if(document.getElementById("SearchFilter").style.display == "none" )
//		{
//			document.getElementById("SearchFilter").style.display = "" 
//		}
//		else 
//		{
//			document.getElementById("SearchFilter").style.display = "none" 
//		}
//		return void(0);
//	}
//

