var Lapsurg = {


    // VARIABLE
    Variable:{
        DropMenuTop:163,
        varHt : 1,
        Ht : 680,
        x : 0,
        y : 10,
        z : 4,
        Speed : null,
        Ent:1,
        a1:0,
        b1:0,
        c1:0,
        motehar:null,
        st1:null,
        state:0
    },
    
    
    // RENDER
    MoveUp:function(){
        Lapsurg.Variable.c1=0;
        Lapsurg.Variable.motehar=document.getElementById("MoveDiv");
        Lapsurg.Variable.motehar.style.marginTop=Lapsurg.Variable.a1;
        if(Lapsurg.Variable.a1>-105+Lapsurg.Variable.b1)
        {
            Lapsurg.Variable.a1=Lapsurg.Variable.a1-2;
            Lapsurg.Variable.st1=setTimeout("Lapsurg.MoveUp()",10);
        }
        else
        {
            Lapsurg.Variable.b1=-105+Lapsurg.Variable.b1;
        }
    },
    
    Equate:function(){
        if(Lapsurg.Variable.a1!=Lapsurg.Variable.b1 && Lapsurg.Variable.c1!=1)Lapsurg.Variable.b1=Lapsurg.Variable.a1;
    },    
    
    
    MoveDown:function(){
        if(Lapsurg.Variable.b1!=0)
        {
            Lapsurg.Variable.c1=1;
            Lapsurg.Variable.motehar=document.getElementById("MoveDiv");
            Lapsurg.Variable.motehar.style.marginTop=Lapsurg.Variable.a1;
            if(Lapsurg.Variable.a1<Lapsurg.Variable.b1+105)
            {
                Lapsurg.Variable.a1=Lapsurg.Variable.a1+2;
                Lapsurg.Variable.st1=setTimeout("Lapsurg.MoveDown()",10);
            }
            else
            {
                Lapsurg.Variable.b1=Lapsurg.Variable.b1+105;
            }
        }
    },
        

    // SHOWING PICTURES
    ShowPic:function(pic){
        Lapsurg.ItemToShow=document.getElementById("ImageLocation");
        Lapsurg.ItemToShow.src=pic;
     },


    // ENLARGE PICTURES
    EnlargePic:function(pic,scr,title){
        window.open("show_pic.aspx?pic="+pic+"&scr="+scr+"&title="+title,"","width=650 height=450 top=100 left=200 scrollbars=1 resizable=1","");
    },


    // SHOWING VIDEOS STREAM
    ShowVidStream:function(video){
        window.open("show_video.aspx?VideoId="+video,"","width=650 height=450 top=100 left=200 scrollbars=1 resizable=1","");
     },
     

    // AJAX
    XmlHttpR:function(id,Maindiv,div,imgAddress){
        //var Lapsurg.xmlhttp;
        if (window.XMLHttpRequest)
        {
            // code for IE7+, Firefox, Chrome, Opera, Safari
            Lapsurg.xmlhttp=new XMLHttpRequest();
            //Maindiv.removeChild(div);
            div.style.visibility="hidden";
            div.style.height="0px";
            var img = document.createElement('img');
            img.setAttribute('src', imgAddress);
            img.setAttribute('width', '30');
            img.setAttribute('height', '30');
            img.setAttribute('style', 'margin-top:15px;');
            Maindiv.appendChild(img);
            var txt = document.createElement('p');
        }
        else if (window.ActiveXObject)
        {
            // code for IE6, IE5
            Lapsurg.xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
            Lapsurg.xmlhttp=new XMLHttpRequest();
            div.style.visibility="hidden";
            div.style.height="0px";
            var img = document.createElement('img');
            img.setAttribute('src', imgAddress);
            img.setAttribute('width', '30');
            img.setAttribute('height', '30');
            img.setAttribute('style', 'margin-top:15px;');
            Maindiv.appendChild(img);
            var txt = document.createElement('p');
        }
        else
        {
            alert("Your browser does not support XMLHTTP!");
        }
        Lapsurg.xmlhttp.onreadystatechange=function()
        {
            if(Lapsurg.xmlhttp.readyState==4)
            {
                txt.innerHTML=Lapsurg.xmlhttp.responseText;
                Maindiv.removeChild(img);
                Maindiv.appendChild(txt);
            }
        }
    },


    // WINK TEXT
    Wink:function(){
        var wi = document.getElementById('wink');
        //alert(wi.style.color); 
        if(Lapsurg.state==0)
        { 
            wi.style.color = '#f00'; 
            Lapsurg.state=1 
        }
        else
        { 
            wi.style.color = '#0038E1'; 
            Lapsurg.state=0 
        } 
        setTimeout("Lapsurg.Wink()",800) 
    } 
     
}
