
function cancelSubmit() {
  return false; // cancel event
}


function QueryString(key)
{
	var value = null;
	for (var i=0;i<QueryString.keys.length;i++)
	{
		if (QueryString.keys[i]==key)
		{
			value = QueryString.values[i];
			break;
		}
	}
	return value;
}
QueryString.keys = new Array();
QueryString.values = new Array();

function QueryString_Parse()
{
	var query = window.location.search.substring(1);
	var pairs = query.split("&");
	
	for (var i=0;i<pairs.length;i++)
	{
		var pos = pairs[i].indexOf('=');
		if (pos >= 0)
		{
			var argname = pairs[i].substring(0,pos);
			var value = pairs[i].substring(pos+1);
			QueryString.keys[QueryString.keys.length] = argname;
			QueryString.values[QueryString.values.length] = value;		
		}
	}

}

QueryString_Parse();


function ClickRegister()
{ if (document.QUOTE.eMail.value == '') {alert('You must complete your email address before you Register')} 
   else
    {var userId = '&Browser=' + QueryString('aa');
     var date = new Date();
     var d  = date.getDate();
     var day = (d < 10) ? '0' + d : d;
     var m = date.getMonth() + 1;
     var month = (m < 10) ? '0' + m : m;
     var yy = date.getYear();
     var year = (yy < 1000) ? yy + 1900 : yy;
     var dateClicked = '&Date=' + (day + "/" + month + "/" + year);
     var email = document.QUOTE.eMail.value;
     var message = userId + dateClicked + '&Email=' + email;
     var objHTTP = new ActiveXObject("Microsoft.XMLHTTP");
     objHTTP.Open('GET','http://195.218.115.121/perspective/httplisten.php?command=MSCNEWSLETTER' + message,false);
     objHTTP.Send();
     alert('Thank you - we will add your eMail address to our mailing list');
     document.QUOTE.onsubmit = cancelSubmit;
    }
  return;
}

function ClickRegisterQuickInfo()
{ if (document.QUOTE.eMail.value == '') {alert('You must complete your email address before you Register')} 
   else
    {var userId = '&Browser=' + QueryString('aa');
     var date = new Date();
     var d  = date.getDate();
     var day = (d < 10) ? '0' + d : d;
     var m = date.getMonth() + 1;
     var month = (m < 10) ? '0' + m : m;
     var yy = date.getYear();
     var year = (yy < 1000) ? yy + 1900 : yy;
     var dateClicked = '&Date=' + (day + "/" + month + "/" + year);
     var email = document.QUOTE.eMail.value;	
     var Product = document.QUOTE.Product.value;
     var message = userId + dateClicked + '&Email=' + email + '&Product=' + Product;
     var objHTTP = new ActiveXObject("Microsoft.XMLHTTP");
     objHTTP.Open('GET','http://195.218.115.121/perspective/httplisten.php?command=REAGECONQUICKINFO' + message,false);
     objHTTP.Send();
     alert('Thank you - we will contact you with respect to this product shortly');
document.QUOTE.onsubmit = cancelSubmit;
    }
  return
}


function ClickContactEnquiry()
{ if (document.QUOTE.eMail.value == '' && document.QUOTE.Phone.value == ''&& document.QUOTE.Mobile.value == '') 
    {alert('You must provide an email address, a phone number or a mobile number to allow us respond to your query')} 
   else
    {var userId = '&Browser=' + QueryString('aa');
     var date = new Date();
     var d  = date.getDate();
     var day = (d < 10) ? '0' + d : d;
     var m = date.getMonth() + 1;
     var month = (m < 10) ? '0' + m : m;
     var yy = date.getYear();
     var year = (yy < 1000) ? yy + 1900 : yy;
     var dateClicked = '&Date=' + (day + "/" + month + "/" + year);
     var email = document.QUOTE.eMail.value;
     var phone = document.QUOTE.Phone.value;
     var Mobile = document.QUOTE.Mobile.value;
     var Question = document.QUOTE.Question.value;
     var Name = document.QUOTE.Name.value;	
     var Institute = document.QUOTE.Institute.value;
     var message = userId + dateClicked + '&Email=' + email + '&Phone=' + phone + '&Mobile=' + Mobile + '&Question=' + Question + '&Name=' + Name + '&Institute=' + Institute;
     var objHTTP = new ActiveXObject("Microsoft.XMLHTTP");
     objHTTP.Open('GET','http://lws1.legacywebservices.com/perspective/httplisten.php?command=MSCENQUIRY' + message,false);
     objHTTP.Send();
     alert('Thank you - we will contact you shortly to deal with your query');
    }
}

function ClickRegisterEvent()
{if (document.QUOTE.eMail.value == '' && document.QUOTE.Phone.value == ''&& document.QUOTE.Mobile.value == '') 
    {alert('You must provide an email address, a phone number or a mobile number to allow us respond to your query')} 
   else
    {var userId = '&Browser=' + QueryString('aa');
     var date = new Date();
     var d  = date.getDate();
     var day = (d < 10) ? '0' + d : d;
     var m = date.getMonth() + 1;
     var month = (m < 10) ? '0' + m : m;
     var yy = date.getYear();
     var year = (yy < 1000) ? yy + 1900 : yy;
     var dateClicked = '&Date=' + (day + "/" + month + "/" + year);
     var Name = document.QUOTE.Name.value;
     var Institute = document.QUOTE.Institute.value;
     var eMail= document.QUOTE.eMail.value;
     var Phone = document.QUOTE.Phone.value;
     var Mobile = document.QUOTE.Mobile.value;	
     var Event = document.QUOTE.Event.value;
     var Comments = document.QUOTE.Comments.value;
     var message = userId + dateClicked + '&Name=' + Name + '&Institute=' + Institute + '&eMail=' + eMail + '&Phone=' + Phone + '&Mobile=' + Mobile + '&Event=' + Event + '&Comments=' + Comments;
     var objHTTP = new ActiveXObject("Microsoft.XMLHTTP");
     objHTTP.Open('GET','http://lws1.legacywebservices.com/perspective/httplisten.php?command=MSCEVENTREG' + message,false);
     objHTTP.Send();
     alert('Thank you - we will contact you shortly with regard to this event');
    }
}	