// JavaScript Document
   
function OpenWindow(pid) {	
	var carwindow;
	carwindow=window.open('equipment.php?product_id=' + pid ,'','height=420,width=600');	
	carwindow.focus();
}

function OpenImage() {
	var imagewindow = '';
	var imagesrc = document.getElementById("mainimage").src;	
	ImageName = imagesrc.substring(55);

	if (!imagewindow.closed && imagewindow.location) {
		imagewindow.close();		
	}	
	
	imagewindow=window.open('image.php?image=' + ImageName,'imagewindow','height=496,width=656');
	if (!imagewindow.opener) imagewindow.opener = self;
	if (window.focus) {imagewindow.focus()}
	return false;
}

function OpenENForm(pid) {
	var enwindow = '';
	if (!enwindow.closed && enwindow.location) {
		enwindow.close();		
	}	
	enwindow=window.open('forms/usedmachinery_enquiry.php?product_id=' + pid ,'enwindow','height=650,width=445');	
	if (!enwindow.opener) enwindow.opener = self;
	if (window.focus) {enwindow.focus()}
	return false;
}


function ProfileWindow(id) {
	var staffwindow = '';
	if (!staffwindow.closed && staffwindow.location) {
		staffwindow.close();		
	}	
	staffwindow=window.open('staff_profile.php?id='+id,'staffwindow','height=220,width=500');	
	if (!staffwindow.opener) staffwindow.opener = self;
	if (window.focus) {staffwindow.focus()}
	return false;
}

function OpenHireForm() {	
	var hirewindow;
	hirewindow=window.open('forms/hire_enquiry.php','hirewindow','height=670,width=445');	
	hirewindow.focus();
}


function OpenPartsForm() {	
	var partswindow;
	partswindow=window.open('forms/parts_enquiry.php','partswindow','height=670,width=445');	
	partswindow.focus();
}

function OpenServiceForm() {	
	var servicewindow;
	servicewindow=window.open('forms/service_enquiry.php','servicewindow','height=670,width=445');	
	servicewindow.focus();
}

function OpenGeneralForm() {	
	var generalwindow;
	generalwindow=window.open('forms/general_enquiry.php','generalwindow','height=620,width=445');	
	generalwindow.focus();
}

function SwapImage(ImgName) {
document.getElementById("mainimage").src="images/equipment/med_" + ImgName;
}