function update_vendor_fulfil() { 
	JsHttpRequest.query(
		'ajax.php',
		{
			'vendor_fulfil_id': document.getElementById("vendor_fulfil_id").value
		},
		function(result, errors) {
			if (result) {
				document.getElementById("vendor_fulfil_name").value = result["vendor_fulfil_name"];
				document.getElementById("vendor_fulfil_phone").value = result["vendor_fulfil_phone"];
				document.getElementById("vendor_fulfil_email").value = result["vendor_fulfil_email"];
			}
		},
		false  
	);
}

function update_vendor_notify() { 
	JsHttpRequest.query(
		'ajax.php',
		{
			'vendor_notify_id': document.getElementById("vendor_notify_id").value
		},
		function(result, errors) {
			if (result) {
				document.getElementById("vendor_notify_fax").value = result["vendor_notify_fax"];
				document.getElementById("vendor_notify_email").value = result["vendor_notify_email"];
			}
		},
		false  
	);
}

function update_sales_executive() { 
	JsHttpRequest.query(
		'ajax.php',
		{
			'sales_executive_id': document.getElementById("sales_executive_id").value
		},
		function(result, errors) {
			if (result) {
				document.getElementById("sales_executive").value = result["sales_executive_name"];
				document.getElementById("sales_executive_contact").value = result["sales_executive_contact_no"];
			}
		},
		false  
	);
}

function myHref() {
	document.location.href="?vid="+document.getElementById("vendor_id").value
}

function myHrefRecall() {
	document.location.href="?mode=recall&vid="+document.getElementById("vendor_id").value
}

function set_reserve() {
	if (document.getElementById("retail_value").value != 0) {
		//document.sell.with_reserve[1].checked='true'
		document.getElementById("reserve_price").value = (document.getElementById("retail_value").value/2).toFixed(2)
	} else {
		//document.sell.with_reserve[0].checked='true'
		document.getElementById("reserve_price").value = '0.00'
	}
}

function makeVisible() {
	if (document.getElementById('TPL_home_delivery_yes').checked==true) {
		document.getElementById('home_delivery').style.display = "";
	} else if (document.getElementById('TPL_home_delivery_no').checked==true) {
		document.getElementById('home_delivery').style.display = "none";
	}
}

var xmlHttp

function showtime() {
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null){
		alert ("Browser does not support HTTP Request")
		return
	} 
	var url="gettime.php"
	url=url+"?sid="+Math.random()
	xmlHttp.onreadystatechange=stateChanged 
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
} 

function stateChanged() { 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){ 
		document.getElementById("txtHint").innerHTML=xmlHttp.responseText 
	} 
} 

function GetXmlHttpObject(){ 
	var objXMLHttp=null
	if (window.XMLHttpRequest)	{
		objXMLHttp=new XMLHttpRequest()
	} else if (window.ActiveXObject){
		objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
	}
	return objXMLHttp
} 

<!-- hide the code from old browsers that do not support javascript
function clock(date) {	 

	if (date) {
		var time_split = date.split(':');
		var hours = time_split[0];
		var minutes = time_split[1];
		var seconds = time_split[2];
	} else {
		var date = new Date();
		var hours = date.getHours();
		var minutes = date.getMinutes();
		var seconds = date.getSeconds();
		
		// convert the hour to 12-hours format                
		// javascript returns midnight as 0, but since the time is in the 12-hours format                
		// force javascript to return 12                
		hours = ((hours == 0) ? "12" : (hours > 12) ? hours - 12 : hours);                  
		// add a leading zero if less than 10                
		minutes = ((minutes < 10) ? "0" + minutes : minutes);                 
		seconds = ((seconds < 10) ? "0" + seconds : seconds);                 
	}	

	var time_holder; // holds the time
	var time_holder_string; // holds the time string
	var future_time_holder; // holds the time in a minute

    // add "AM" or "PM" if the 12-hours format is chosen                
	//var ampm = ((hours >= 12) ? " pm" : " am");                     
	
	time_holder = hours + ":" + minutes + ":" + seconds;  
	//time_holder_string = "Current time: " + time_holder + ampm + ' WST';                  
	time_holder_string = "Current time: " + time_holder + ' WST';                  
	
	document.getElementById('jsClock').innerHTML = time_holder_string;	
	
	//refresh page if 9.00 pm or 8.00 am
	//if (hours == 9 && minutes == 00 && seconds == 00 && ampm == ' pm') window.location.reload(true);
	//if (hours == 8 && minutes == 00 && seconds == 00 && ampm == ' am') window.location.reload(true);
	if (hours == 9 && minutes == 00 && seconds == 00) window.location.reload(true);
	if (hours == 8 && minutes == 00 && seconds == 00) window.location.reload(true);

	// keep the clock ticking	 
	showtime();  
	var newtime = document.getElementById('txtHint').innerHTML;
	setTimeout("clock('"+newtime+"')", 1000);
	
}
// end hiding -->

