/*
	####################################################################################

	File Name 			:	product.js
	Scope Of program 		:       Displaying Brand combo using AJAX
	Created On			:	03-02-2007

	####################################################################################

*/

var root ="../../";

/* The variable http will hold our new XMLHttpRequest object. */
var http = createRequestObject();
  //alert(http);
/* The following function creates an XMLHttpRequest object... */
function createRequestObject()
{
    if(typeof ActiveXObject!="undefined")
    {

      try
      {
        return new ActiveXObject("Msxml2.XMLHTTP");
      }
      catch(a)
      {
          try
          {
        return new ActiveXObject("Microsoft.XMLHTTP");
          }
          catch(a){}
      }
    }
    if(typeof XMLHttpRequest!="undefined")
    {

      request_o = new XMLHttpRequest();
      //request_o.overrideMimeType('text/xml');
      return request_o;
    }
}

function read_WhitePapers(tmp_str_status)
{
	
	http.open('get', './display_whitePapers.jsp?mail='+tmp_str_status);		
	http.onreadystatechange = handleFile;

	/* Send the data. We use something other than null when we are sending using the POST
	  method. */

	http.send(null);
	
}
function handleFile()
{
  if (http.readyState == 4)
  {
    /* We have got the response from the server-side script,
      let's see just what it was. using the responseText property of
      the XMLHttpRequest object. */

     var response = http.responseText;
     document.getElementById('FileId').innerHTML = response;
     return;
   }
}

function read_whitePapersDetail(tmp_str_link)
{
	
	http.open('get', './newsDetail.jsp?'+tmp_str_link);		
	http.onreadystatechange = handleFile;

	/* Send the data. We use something other than null when we are sending using the POST
	  method. */

	http.send(null);
}
function check_submit(sThis)
{
	if(validate_form(sThis))
	{
		if((!document.getElementById('bestway1').checked) && (!document.getElementById('bestway2').checked))
		{
			alert("Please select atleast one way to reach you.");
			return false;
		}
		else if((sThis.clientTel1.value != "") && (isNaN(sThis.clientTel1.value)))
		{
			alert("Please enter valid telephone country code.");
			return false;
		}
		else if((sThis.clientTel2.value != "") && (isNaN(sThis.clientTel2.value)))
		{
			alert("Please enter valid telephone state code.");
			return false;
		}
		else if((sThis.clientTel3.value != "") && (isNaN(sThis.clientTel3.value)))
		{
			alert("Please enter valid telephone number.");
			return false;
		}
		else if(1)
		{
			if(sThis.clientEmailConfirm.value == sThis.clientEmail.value)
			{
				return true;
			}
			else
			{
				alert("Email address and Confirm email address should match.");
				return false;
			}
		}
		else
		{
			return true;
		}
	}
	else
	{
		return false;
	}
}