var url = "getproduct.php?p=";
 function change_st_image(pd_id){
	 
	 url = "getst_image.php?p=";
var st_name=document.productlist.st_name.value;
 http.open("GET", url + escape(pd_id)+"&st_name="+st_name, true); 
http.onreadystatechange = getHttpResponse;
http.send(null);
 }
function getHttpResponse() {

  if (http.readyState == 4) {

    // Split the comma delimited response into an array

    var image_results= http.responseText;
	  
    document.getElementById('st_image_url').innerHTML = image_results;

    

  }

}

function change_product(pd_id,st_name){
window.parent.change_parent_product(pd_id,st_name);
}


 function handleHttpResponse() {

  if (http.readyState == 4) {

    // Split the comma delimited response into an array

    var results= http.responseText;
	 
    document.getElementById('productid').innerHTML = results;

    

  }

}

function change_parent_product(pd_id,st_name) {
 url = "getproduct.php?p=";
http.open("GET", url + escape(pd_id), true); 
http.onreadystatechange = handleHttpResponse;
http.send(null);


 }

function getHTTPObject() {

  var xmlhttp;

  /*@cc_on

  @if (@_jscript_version >= 5)

    try {

      xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");

    } catch (e) {

      try {

        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");

      } catch (E) {

        xmlhttp = false;

      }

    }

  @else

  xmlhttp = false;

  @end @*/

  if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {

    try {

      xmlhttp = new XMLHttpRequest();

    } catch (e) {

      xmlhttp = false;

    }

  }

  return xmlhttp;

}

var http = getHTTPObject(); // We create the HTTP Object

 function changerelationproduct(){
	 with (window.document.productlist) {
var pd_id=st_name.options[st_name.selectedIndex].value
	window.location.href = 'index.php?cp=' + pd_id;
	 } 
 }

 function submit_contact(){	
with (window.document.contact) {
	 
		if (isEmpty(firstname, 'Please Enter First name')) {
			return;
		}else if (isEmpty(lastname, 'Please Enter Last name')) {
			return;
		} else if (isEmpty(streetaddress, 'Please Enter street address')) {
			return;
		}else if (isEmpty(email, 'Please Enter Email')) {
			return;
		}else if (!echeck(email, 'Please Enter right Email')) {
			return;
		} else {
			submit();
		}
	}
 }
