﻿ 
  function function1(){document.getElementById('marTop').behavior = "alternate";}  function function2(){document.getElementById('marTop1').behavior = "alternate";}
function AssignVal(Name,Rank,Photo,Remarks,Email,phone,currently){ document.getElementById("TprName").innerHTML = Name; document.getElementById("tprCourse").innerHTML = Rank;
document.getElementById("imgtpr").src=Photo; document.getElementById("tprRemark").innerHTML="<strong>Testimonials:</strong><br />"+ Remarks;
document.getElementById("tpr_dtl").innerHTML="<strong>Phone</strong> : "+phone+"<br /><strong>Email</strong> : "+Email+"<br /><strong>Currently</strong> : "+currently; return false;}
jQuery(function(){ jQuery('#closelink').click(function() {document.getElementById('txtPassword2').value=''; jQuery('#loginForm').slideDown(); jQuery.unblockUI(); });  });
jQuery(function() { jQuery("a[rel]").overlay({expose: '#242424'}); });
function marqueeLeft() {document.getElementById("videoStrip").direction="left";};
function marqueeRight() { document.getElementById("videoStrip").direction="right";};
function onUser() {var user = document.getElementById('login2'); if (user.value == 'Enter User Name') { user.value = '';} }
function ValidateForm() { var sMsg = ''; if (document.getElementById('login2').value == '') sMsg += 'UserName' + ', '; if (document.getElementById('pass').value == '')
sMsg += 'Password' + ', '; if (sMsg.length > 0) { sMsg = "Please enter " + sMsg; sMsg = sMsg.substring(0, sMsg.length - 2); var Loc = sMsg.lastIndexOf(",");
var sMsg1; sMsg1 = sMsg.substring(0, sMsg.length - 2); if (sMsg.lastIndexOf(",") > -1) { sMsg = sMsg.substring(0, sMsg.lastIndexOf(",")) + " and" + sMsg.substring(1 + sMsg.lastIndexOf(","), sMsg1.length + 2);
sMsg += "."; } else {sMsg += ".";  } alert(sMsg); return false; } else { return getUserDetail(); }}
function getUserDetail() { var sServerName = new String(document.location); if (window.XMLHttpRequest) { var XML = new XMLHttpRequest(); } else if (window.ActiveXObject) {var XML = new ActiveXObject("Microsoft.XMLHTTP");}
 var URL = "CheckLoginAjax.aspx?data=me";
        var parameters ;
                if (document.getElementById('chkEntrance').checked == true)
                  {
                parameters = "UserName=" + document.getElementById('login2').value + "&Password=" + document.getElementById('pass').value+"&Type=EU";
                  }  
                  else
                  {
                   parameters = "UserName=" + document.getElementById('login2').value + "&Password=" + document.getElementById('pass').value+"&Type=U";

                  }
                  XML.open("POST", URL, false);
         XML.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
         XML.setRequestHeader("Content-length", parameters.length);

         XML.send(parameters);
         var s = XML.responseText;
         document.getElementById('pass').value='';
if (s == "I") { alert('Login Id does not exists.');  return false;  }
 else  if (s == "U") {window.location = "UserProfile.aspx"; return false;} 
else if (s == "F") {window.location = "FacultyProfile.aspx";  return false;}
 else if (s == "A") {getAdmin();  return false;}
 else if (s == "IV"){ alert('Your Profile is deactive');  return false; }
 else if (s == "T")
          {
             alert('Already Given Test.Your Account is deactive');
              document.getElementById('login2').value='';
               document.getElementById('pass').value='';
             return false;
         }
          else if (s == "E") 
         {
         window.location =("EntranceUser.aspx");
             return false;
         } } 
function getAdmin() { $.blockUI({ message: $('#loginForm') });}
function checkadminPassword() { var sServerName = new String(document.location); if (window.XMLHttpRequest) {var XML = new XMLHttpRequest();}
else if (window.ActiveXObject) { var XML = new ActiveXObject("Microsoft.XMLHTTP");}  var URL = "CheckAdminLoginAjax.aspx?data=me";
                var parameters = "Password=" + document.getElementById('txtPassword2').value+"&Type=";
                XML.open("POST", URL, false);
                XML.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
                 XML.setRequestHeader("Content-length", parameters.length);
                  XML.send(parameters);
                var s = XML.responseText;
if (s == "I") { alert('Login Id does not exists.'); return false; } else {window.location.href = "admin/moduleicon.aspx?PageID=0";} }


function getIESToppers() 
     {
 
         var sServerName = new String(document.location);
         if (window.XMLHttpRequest) {
             var XML = new XMLHttpRequest();
         }
         else if (window.ActiveXObject) {
             var XML = new ActiveXObject("Microsoft.XMLHTTP");
         }

                 var URL = "test.aspx?data=me";
         var parameters = "Type=";
         XML.open("POST", URL, false);
         XML.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
         XML.setRequestHeader("Content-length", parameters.length);

         XML.send(parameters);
        
          var s =XML.responseText;         
         
 
  Call1(s);
           }
           
           $(document).ready(function() {
          var sServerName = new String(document.location);
           var XML;
          if (window.XMLHttpRequest) {
              XML= new XMLHttpRequest();
          }
          else if (window.ActiveXObject) {
              XML = new ActiveXObject("Microsoft.XMLHTTP");
          }

          var URL = "GetPhotoGallery.aspx?type=1";

          Type = "Type=";
          XML.open("POST", URL, false);

          XML.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
          XML.send(Type);

          var s = XML.responseText;
         
          if (s != "") {
           
            document.getElementById('myslides').innerHTML = s;
            return true;
           
         }
         
    });
 
$(document).ready(function(){
$('.slideshow').cycle({ 
    fx:    'zoom', 
    sync:   0, 
    delay: -4000 
 });
 });
