			var newPop;
			function popWin(url,h,w) {
				if (!newPop || newPop.closed) {
					newPop = window.open(url,"picker","status=1,resizable=1,scrollbars=1,height="+h+",width="+w);
				} else if (newPop.focus) {
					newPop.focus( );
				}
				return true;
			}
			
			//-----Ajax Functions---------
			function createRequestObject() {
				var ro;
				var browser = navigator.appName;
				if(browser == "Microsoft Internet Explorer"){
					ro = new ActiveXObject("Microsoft.XMLHTTP");
				}else{
					ro = new XMLHttpRequest();
				}
				return ro;
			}

			var xmlhttp = createRequestObject();

			//-----------------------------------------------------
			
			function trim(value) {
				var temp = value;
				var obj = /^(\s*)([\W\w]*)(\b\s*$)/;
				 if (obj.test(temp)) { temp = temp.replace(obj, '$2'); }
				 var obj = / +/g;
				temp = temp.replace(obj, " ");
				if (temp == " ") { temp = ""; }
				 return temp;
			}
			
			function ValidateEmail(object_value)
			{		
				email_pattern=new RegExp("^[a-zA-Z0-9]+(([_]|\\.|-)?[a-zA-Z0-9])*@([a-zA-Z0-9]+([_]|-?[a-zA-Z0-9])*(\\.))+[a-zA-Z]{2,4}$");
				return object_value.search(email_pattern);
			}
			
			function checkContact()
			{
				var formname = document.getElementById('contactForm');
				
				if (trim(formname.first_name.value) == ''){
					alert('Please Enter Your Name');
					formname.first_name.focus();
					return false;
				}				
				else if (trim(formname.email.value) == ''){
					alert('Please Enter Your Email Address');
					formname.email.focus();
					return false;
				}
				else if (ValidateEmail(formname.email.value)){
					alert('You have entered invalid Email Address');
					formname.email.focus();
					return false;
				}				
				else
				{
					upload_now('upload.php?act=upload',formname);
					return false;
				}
			}
			function upload_now(url, f)
			{
				var t = '';
												
				t = 'fName=' + f.first_name.value;				
				t = t+'&lName=' + f.last_name.value;
				t = t+'&sEmail=' + f.email.value;
				t = t+'&sComments=' + escape(f.comments.value);
				t = t+'&oriname=' + f.just.value;
				t = t+'&uploaded=' + f.uploaded_file.value;
								
				xmlhttp.open('post', url, true);
				xmlhttp.onreadystatechange = function() {
					if ((xmlhttp.readyState == 4) && (xmlhttp.status == 200))
					{
						var c = xmlhttp.responseText;
						document.getElementById("contacted").innerHTML = c;
						document.getElementById("contacted").style.display = 'inline';
						document.getElementById("contactForm").style.display = 'none';
					}
					return false;
				}
				xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
				xmlhttp.send(t);
				document.getElementById("contacted").style.display = 'inline';
				document.getElementById("contacted").innerHTML = 'Please Wait...';
				return false;
			}
			
			
			function checkContact2()
			{
				var formname = document.getElementById('contactForm');
				
				if (trim(formname.first_name.value) == ''){
					alert('Please Enter Your Name');
					formname.first_name.focus();
					return false;
				}		
				else if (trim(formname.subject.value) == ''){
					alert('Please Enter Email Subject');
					formname.subject.focus();
					return false;
				}
				else if (trim(formname.email.value) == ''){
					alert('Please Enter Email Address');
					formname.email.focus();
					return false;
				}
				else if (ValidateEmail(formname.email.value)){
					alert('You have entered invalid Email Address');
					formname.email.focus();
					return false;
				}
				else if (trim(formname.password.value) == ''){
					alert('Please Enter Image Verification');
					formname.password.focus();
					return false;
				}				
				else
				{
					sent_contact('contact.php?act=sent',formname);
					return false;
				}
			}
			
			function sent_contact(url, f)
			{
				var t = '';
				
				t = 'fName=' + f.first_name.value;				
				t = t+'&lName=' + f.last_name.value;
				t = t+'&sEmail=' + f.email.value;
				t = t+'&sSub=' + f.subject.value;
				t = t+'&sComments=' + escape(f.comments.value);
				t = t+'&random=' + f.random.value;
				t = t+'&password=' + f.password.value;
				t = t+'&company_name=' + f.company_name.value;
				t = t+'&phone=' + f.phone.value;
				t = t+'&fax=' + f.fax.value;
				t = t+'&address_1=' + f.address_1.value;
				t = t+'&address_2=' + f.address_2.value;
				t = t+'&city=' + f.city.value;
				t = t+'&state=' + f.state.value;
				t = t+'&zip=' + f.zip.value;
				t = t+'&country=' + f.country.value;
				
								
				xmlhttp.open('post', url, true);
				xmlhttp.onreadystatechange = function() {
					if ((xmlhttp.readyState == 4) && (xmlhttp.status == 200))
					{
						var c = xmlhttp.responseText;
						document.getElementById("contacted").innerHTML = c;
						document.getElementById("contacted").style.display = 'inline';
						document.getElementById("contactForm").style.display = 'none';
					}
					return false;
				}
				xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
				xmlhttp.send(t);
				document.getElementById("contacted").style.display = 'inline';
				document.getElementById("contacted").innerHTML = 'Please Wait...';
				return false;
			}
