/**
 * 
 * @author dharris
 * 
 */
	var domain = "vmware.com"; var at = "@";
	var containers;
	var iwouldlike = "";
	var digits = "0123456789";

	// non-digit characters which are allowed in phone numbers
	var phoneNumberDelimiters = "()- ";
	// characters which are allowed in international phone numbers
	// (a leading + is OK)
	var validWorldPhoneChars = phoneNumberDelimiters + "+";
	// Minimum no of digits in an international phone no.
	var minDigitsInIPhoneNumber = 10;	

	/*
	 * Department Values: department - prod_request Request a Product Feature
	 * feature-request@vmware.com - prod_purchase Purchase a Product
	 * sales@vmware.com - support_contract_purchase Purchase a Support Contract
	 * partnerrenewals@vmware.com - feedback_kb Provide Feedback on the
	 * Knowledge Base kcs-core@vmware.com - desktop_services Ask a question
	 * about Workstation/Fusion desktop-services@vmware.com - feedback_website
	 * Provide Feedback on the Website customer_service@vmware.com -
	 * tap_alliance Become part of the Technology Alliance Program (TAP)
	 * tapalliance@vmware.com - help_licensing Get Help on a Licensing Issue
	 * qmanflex@vmware.com - help_product Get Product Help
	 * customer_service@vmware.com - mydata_update Update My Data in your
	 * Systems customer_service@vmware.com - login_assistance Get Assistance
	 * Logging In customer_service@vmware.com - inquire_training_class Inquire
	 * About a Training Class education@vmware.com - inquire_tech_certifications
	 * Inquire About VMware Technical Certification certification@vmware.com
	 */			

	jQuery(document).ready(function(){
		var departments = Array('prod_request', 'prod_purchase', 'support_contract_purchase', 'feedback_kb', 'desktop_services', 'feedback_website', 
			'tap_alliance', 'help_licensing', 'help_product', 'mydata_update', 'login_assistance', 'inquire_training_class', 'inquire_tech_certifications','customer_service');

		containers = jQuery('div#dyn_section div');
		var currSelected = jQuery('select#wouldliketo').val();
		var domainvar = getvar("domain", geturl())
		var departmentvar = '';
		var formTitle = '';
		departmentvar = formTitle = getvar('department', geturl());
		var labelvar = getvar('label', geturl());		

		if(departmentvar == '') {
			window.location = '/company/contact.html';
		}

		if(departmentvar == 'vi-hotline') {
			window.location = '/support/contacts/';
		}

		if(labelvar != '') {
			if(domainvar == "") {
				domainvar = domain;
			}			

			var rec = '';			

			if(in_array(departmentvar, departments)) {
				iwouldlike = departmentvar;
				showProductRequest(departmentvar);
			} else {
				jQuery('#cat_selection').html(rec);
				jQuery('#cat_selection').css("border-bottom", "none");
				
				if (isValidEmail(departmentvar)) {
					iwouldlike = departmentvar;
				} else {
					departmentvar = iwouldlike = departmentvar + at + domainvar;
				}

				rec += showHiddenEmail(departmentvar);
				jQuery('#dyn_section').html(rec);
			}
		} else if(departmentvar != '') {
			var inDepartments = false;
			
			if(in_array(departmentvar, departments)) {
				inDepartments = true;		
			}						

			if(inDepartments == true) {
				currSelected = iwouldlike = departmentvar;
				jQuery('select#wouldliketo #' + departmentvar).attr('selected', 'selected');
				var requestn = getRequestName(currSelected);
				var hiddent = showHiddenField('wouldliketo', requestn);
				var em = hiddent;
				jQuery('#cat_selection').html(em);

				showProductRequest(currSelected);
			} else {

				if(domainvar == "") {
					domainvar = domain;
				}

				if (isValidEmail(departmentvar)) {
					iwouldlike = departmentvar;
				} else {
					departmentvar = iwouldlike = departmentvar + at + domainvar;
				}				

				var em = '';
				jQuery('#cat_selection').html(em);
				jQuery('#cat_selection').css("border-bottom", "none");
				em = showHiddenEmail(departmentvar)					

				jQuery('#dyn_section').html(em);
			}			
		} else {			
			jQuery('#cat_selection').css("display", "none");
			showProductRequest(currSelected);
		}		

		jQuery('#submess_section').html(showSummaryTextArea('Summary', 'input_subject', 'input_message'));
		jQuery('#heading-summary').html(getSummaryTitle(formTitle));
		jQuery('#form-title').html(getMainTitle(formTitle));
		jQuery('#form-intro').html(getIntro(formTitle));
	});		

	function checkFields(form) {
		var required = Array('input_firstname','input_lastname','input_company','input_email','country');
		var alertsay = new Array();

		if (readCookie("contact_submit") == "1") {
			alert("We're sorry, you have already submitted a message and it has been delivered. To prevent abuse, we have implemented rate limiting on this contact form. Please try again later. Thank you");
			return false;
		}	

		jQuery('.content-container div').removeClass("box-selected");
	    jQuery('.content-container .form-item-error').hide();
	    jQuery('.content-container .form-item-error').html('');

	    if (form.input_firstname.value == "" || form.input_firstname.value == null) {
	        alertsay.push('input_firstname');
	    }	    

	    if (form.input_lastname.value == "" || form.input_lastname.value == null) {
	        alertsay.push('input_lastname');
	    }	    

	    if (form.input_phone.value == "" || form.input_phone.value == null) {
	        alertsay.push('input_phone');
	    }	    

	    if (checkInternationalPhone(form.input_phone.value) == false) {
	        alertsay.push('input_phone');
	    }	    

	    if (form.input_email.value == "") {
	        alertsay.push('input_email');
	    }

	    if(!isValidEmail(form.input_email.value)) {
	    	alertsay.push('input_email');
	    }	    

	    if (form.input_company.value == "") {
	        alertsay.push('input_company');
	    }	    

	    if (form.country.value == "" || form.country.value == "Select One") {
	        alertsay.push('country');
	    }	    

	    switch(iwouldlike) {
			case 'prod_request':
			case 'prod_purchase':
			case 'support_contract_purchase':
			case 'help_licensing':
			case 'help_product':
				var product = jQuery('#input_product option:selected').val();	
				
				if(checkValue(product) == false) {
					alertsay.push('input_product');
				}
				break;
			case 'feedback_kb':
				var articleid = jQuery('#input_articleid').attr('value');
				
				if(checkValue(articleid) == false) {
					alertsay.push('input_articleid');
				}
				break;
			case 'feedback_website':
				var inputurl = jQuery('#input_url').attr('value');

				if(checkValue(inputurl)== false) {
					alertsay.push('input_url');
				}
				break;
	    }		

	    var inputsummary = jQuery('#input_subject').attr('value');	
	    
	    if(checkValue(inputsummary) == false) {
	    	alertsay.push('input_subject');
	    }		

	    var inputdetails = jQuery('#input_message').attr('value');	
	    
	    if(checkValue(inputdetails) == false) {
	    	alertsay.push('input_message');
	    }

	    form.input_message.value = stripHTML(form.input_message.value);	    

	    if(jQuery('#input_studentregnum').length != 0) {
	    	var inputstudentregnum = jQuery('#input_studentregnum').attr('value');

	    	if(checkValue(inputstudentregnum) == false) {
		    	alertsay.push('input_studentregnum');
		    }
	    }	    	    

	    if(jQuery('#input_psoaccountid').length != 0) {
	    	var inputpsoaccountid = jQuery('#input_psoaccountid').attr('value');

	    	if(checkValue(inputpsoaccountid) == false) {
		    	alertsay.push('input_psoaccountid');
		    }
	    }	    	    

	    if(jQuery('#input_vcpidnum').length != 0) {
	    	var inputvcpidnum = jQuery('#input_vcpidnum').attr('value');
	    	
	    	if(checkValue(inputvcpidnum) == false) {
		    	alertsay.push('input_vcpidnum');
		    }
	    }	    

	    if(jQuery('#input_contractnum').length != 0) {
	    	var inputcontractnum = jQuery('#input_contractnum').attr('value');

	    	if(checkValue(inputcontractnum) == false) {
		    	alertsay.push('input_contractnum');
		    }
	    }	    

	    if(jQuery('#input_ordernum').length != 0) {
	    	var inputordernum = jQuery('#input_ordernum').attr('value');

	    	if(checkValue(inputordernum) == false) {
		    	alertsay.push('input_ordernum');
		    }
	    }    

	    if(jQuery('#input_licensenum').length != 0) {
	    	var inputlicensenum = jQuery('#input_licensenum').attr('value');

	    	if(checkValue(inputlicensenum) == false) {
		    	alertsay.push('input_licensenum');
		    }

	    }	    

		if(checkValue(iwouldlike)== false) {
			alertsay.push('iwouldliketo');
		}		

		if (alertsay.length > 0) {
	        jQuery.each(alertsay, function(){
	            myName = this;

	            if(myName == 'input_message') {
	            	myPick = ".content-container #con_input_subject";
		            myError = ".content-container .form-item-error#error_input_subject";
	            	jQuery(myPick).addClass("box-selected");
		            jQuery(myError).append(getErrorMessage(myName));
		            jQuery(myError).show();
	            } else {
	            	myPick = ".content-container #con_" + this;
		            myError = ".content-container .form-item-error#error_" + this;	
		            jQuery(myPick).addClass("box-selected");
		            jQuery(myError).html(getErrorMessage(myName));
		            jQuery(myError).show();	 
	            }
	        });        

	        return false;
	    }		

		// 1 day / 24 hours / 60 minutes * 5 minutes = 5 minutes

		createCookie("contact_submit", "1", 1/24/60*5);
		return true;
	}		

	function checkValue(cValue) {
		var valueChecked = true;

		if(cValue == '' || cValue == ' ' || cValue == null) {	
			valueChecked = false;
		}

		return valueChecked;
	}

	function in_array(needle, haystack, argStrict) {
    	var key = '', strict = !!argStrict;

    	if (strict) {
        	for (key in haystack) {
            	if (haystack[key] === needle) {
                	return true;
            	}
        	}
    	} else {
        	for (key in haystack) {
            	if (haystack[key] == needle) {
                	return true;
            	}
        	}
    	} 

    	return false;
	}	

	function isValidEmail(str) {
		var at="@";
		var dot=".";
		var lat=str.indexOf(at);
		var lstr=str.length;
		var ldot=str.indexOf(dot);
		
		if (str.indexOf(at)==-1) return false;
		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr) return false;
		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr) return false;
		if (str.indexOf(at,(lat+1))!=-1) return false;
		if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot) return false;
		if (str.indexOf(dot,(lat+2))==-1) return false;
		if (str.indexOf(" ")!=-1) return false;

		return true
	}		

	function scriptonload() {
		var messagevar = getvar("message", geturl());
		
		if(messagevar != "")
		document.myform.input_message.value = messagevar;
	}		

	function geturl() {
		var is_input = document.URL.indexOf('?');
		
		if (is_input > 0) {
			return unescape(document.URL.substring(is_input+1, document.URL.length));
		} else {
			return false;
		}
	}

	function getvar(variablename, variables) {
		
		if(variables) {
			var varvalue = false;
			var allvardata = variables.split('&');

			for(i = 0; i < allvardata.length; i++) {
				var thisvar = allvardata[i].split('=');
				
				if(thisvar[0] == variablename)
					varvalue = thisvar[1];
			}

			if(varvalue)
				return varvalue;
			else
				return "";
		}
		else
			return "";
	}		

	function generatesubject() {
		var subjectvar = getvar("subject", geturl())

		if (subjectvar != "") {
			document.myform.input_subject.value = subjectvar;
		} else {
			// document.write("<label
			// for=\"input_subject\">Subject:</label><input type=\"text\"
			// name=\"input_subject\" style=\"width: 300px;\" size=\"24\" />");
		}
	}

	function createCookie(name,value,days) {
		if (days) {
			var date = new Date();
			date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
			var expires = "; expires=" + date.toGMTString();
		} else {
			var expires = "";
		}

		document.cookie = name+"="+value+expires+"; path=/";
	}

	function readCookie(name) {
		var nameEQ = name + "=";
		var ca = document.cookie.split(';');

		for(var i=0;i < ca.length;i++) {
			var c = ca[i];
			while (c.charAt(0)==' ') c = c.substring(1,c.length);
			if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
		}

		return null;
	}	

	function isInteger(s){
	    var i;

	    for (i = 0; i < s.length; i++) {
	        // Check that current character is number.
	        var c = s.charAt(i);
	        if (((c < "0") || (c > "9"))) 
	            return false;
	    }

	    // All characters are numbers.
	    return true;
	}

	function trim(s){
	    var i;
	    var returnString = "";

	    // Search through string's characters one by one.
	    // If character is not a whitespace, append to returnString.

	    for (i = 0; i < s.length; i++) {
	        // Check that current character isn't whitespace.
	        var c = s.charAt(i);

	        if (c != " ") 
	            returnString += c;
	    }

	    return returnString;
	}

	function stripCharsInBag(s, bag){
	    var i;
	    var returnString = "";

	    // Search through string's characters one by one.
	    // If character is not in bag, append to returnString.
	    for (i = 0; i < s.length; i++) {
	        // Check that current character isn't whitespace.
	        var c = s.charAt(i);

	        if (bag.indexOf(c) == -1) 
	            returnString += c;
	    }

	    return returnString;
	}

	function checkInternationalPhone(strPhone){
	    var bracket = 3
	    strPhone = trim(strPhone)

	    if (strPhone.indexOf("+") > 1) 
	        return false

	    if (strPhone.indexOf("-") != -1) 
	        bracket = bracket + 1

	    if (strPhone.indexOf("(") != -1 && strPhone.indexOf("(") > bracket) 
	        return false

	    var brchr = strPhone.indexOf("(")

	    if (strPhone.indexOf("(") != -1 && strPhone.charAt(brchr + 2) != ")") 
	        return false
	    if (strPhone.indexOf("(") == -1 && strPhone.indexOf(")") != -1) 
	        return false

	    s = stripCharsInBag(strPhone, validWorldPhoneChars);
	    return (isInteger(s) && s.length >= minDigitsInIPhoneNumber);
	}	

	function stripHTML(theString) {
		theString = String("<div>" + theString + "</div>");
		var newString = jQuery(theString).text();
		return newString;

	}	

	function getErrorMessage(theError){
	    getError = String(theError);
	    fieldError = "";
	    
	    switch (getError) {
	        case 'input_firstname':
	            fieldError = "First Name is required.";
	            break;
	        case 'input_lastname':
	            fieldError = "Last Name is required.";
	            break;
	        case 'input_phone':
	            fieldError = "10 digits minimum. Include country code, city code, and area code where applicable.";
	            break;
	        case 'input_email':
	            fieldError = "Please enter a correctly formatted email address.";
	            break;
	        case "input_company":
	            fieldError = "Company is required.";
	            break;
	        case "title":
	            fieldError = "Job Title is required";
	            break;
	        case "country":
	            fieldError = "Country of residence is required.";
	            break;
	        case "city":
	            fieldError = "City is required.";
	            break;
	        case "state":
	            fieldError = "State/Province is required.";
	            break;
	        case "zip":
	            fieldError = "Zip Code is required.";
	            break;
	        case "input_message":
	            fieldError = "Message is required.";
	            break;
	        case "input_subject":
	        	fieldError = "Summary is required.<br />";
	        	break;
	        case "iwouldliketo": 
	        	fieldError = "No destination has been set.";
	        	break;
	        case "input_studentregnum":   
	        	fieldError = "Student Registration Number required.";
	        	break;
	        case "input_psoaccountid": 
	        	fieldError = "PSO Credits Account ID required.";
	        	break;
	        case "input_vcpidnum": 
	        	fieldError = "VCP ID Candidate Number required.";
	        	break;
	        case "input_contractnum": 
	        	fieldError = "Contract ID Number required.";
	        	break;
	        case "input_product":
	        	fieldError = "Please select a product.";
	        	break;
	        case "input_url":
	        	fieldError = "URL is required.";
	        	break;
	        case "input_articleid":
	        	fieldError = "Article ID is required.";
	        	break;
	        case "input_ordernum":
	        	fieldError = "Order Number is required.";
	        	break;
	        case "input_licensenum":
	        	fieldError = "License Number is required.";
	        	break;
	        default:
	            fieldError = "";
	    }

	    return fieldError;
	}	

	function getRequestName(request) {
		
		switch(request) {
			case 'prod_request':
				request = 'Request a Product Feature';
				break;
			case 'prod_purchase':
				request = 'Purchase a Product';
				break;
			case 'support_contract_purchase':
				request = 'Purchase a Support Contract';
				break;
			case 'feedback_kb':
				request = 'Provide Feedback on the Knowledge Base';
				break;
			case 'desktop_services':
				request = 'Ask a question about Workstation/Fusion';
				break;
			case 'feedback_website':
				request = 'Provide Feedback on the Website';
				break;
			case 'tap_alliance':
				request = 'Become part of the Technology Alliance Program (TAP)';
				break;
			case 'help_licensing':
				request = 'Get Help on a Licensing Issue';
				break;
			case 'help_product':
				request = 'Get Product Help';
				break;
			case 'mydata_update':
				request = 'Update My Data in your Systems';
				break;
			case 'login_assistance':
				request = 'Get Assistance Logging In';
				break;
			case 'inquire_training_class':
				request = 'Inquire About a Training Class';
				break;
			case 'inquire_tech_certifications':
				request = 'Inquire About VMware Technical Certification';
				break;
			default:
				request = 'Information Request';
		}		

		return request;		
	}	

	function getIntro(request) {
		request = request.toLowerCase();

		switch(request) {
			case 'inquire_training_class':
				request = 'Complete the form below so we can help you with your business need. Please send us your non-technical questions. For technical support visit <a href="/support/contacts/">Contact Support</a>.';
				break;
			case 'inquire_tech_certifications':
				request = 'Complete the form below so we can help you with your business need. Please send us your non-technical questions. For technical support visit <a href="/support/contacts/">Contact Support</a>.';
				break;
			case 'prod_request':
				request = 'Complete the form below so we can help you with your business need. Please send us your non-technical questions, concerns, or feedback. For technical support visit <a href="/support/contacts/">Contact Support</a>.';
				break;
			case 'feedback_website':
				request = 'We value your feedback. Please provide us your non-technical questions, concerns or website feedback. For technical support visit <a href="/support/contacts/">Contact Support</a>.';
				break;
			default:
				request = 'Complete the form below so we can help you with your business need. Please send us your non-technical questions, concerns, or feedback. For technical support visit <a href="/support/contacts/">Contact Support</a>.';
		}		

		return request;
	}	

	function getSummaryTitle(request) {

		switch(request) {
			case 'feedback_kb':	
			case 'feedback_website':
				request = 'Provide Your Feedback';
				break;
			case 'inquire_training_class':
			case 'inquire_tech_certifications':
				request = 'Provide Your Student Information';
				break;
			default:
				request = 'Provide Your Information Request';
		}

		return request;
	}	

	function getMainTitle(request) {

		switch(request) {
			case 'inquire_training_class':
				request = 'Inquire About a Training Class';
				break;
			case 'inquire_tech_certifications':
				request = 'Inquire About Technical Certification';
				break;
			case 'feedback_website':
				request = 'Website Feedback';
				break;
			case 'prod_request':
				request = 'Request a Product Feature';
				break;
			default:
				request = 'Information Request';
		}
		
		return request;
	}		

	function showProductRequest(selectVal) {

		var table = '';
		var eName = '';
		var label = '';

		switch(selectVal) {
			case "prod_request":
				eName = 'input_product';
				label = 'Product';
				table += showHiddenEmail('feature-request@vmware.com');	
				table += '<div class="content-container">'
					+ '<div>'
						+ '<div class="content-item" id="con_' + eName + '">'	
							+ '<div class="label">' + label + '</div>'
							+ '<div class="form-item">' + showProductSelect() + '</div>'
						+ '</div>'		
						+ '<div class="form-item-error" id="error_' + eName + '"></div>'
					+ '</div>'
				+ '</div>';

				jQuery('#dyn_section').html(table);	
				break;
			case "prod_purchase":
				eName = 'input_product';
				label = 'Product';
				table += showHiddenEmail('sales@vmware.com');	
				table += '<div class="content-container">'
					+ '<div>'
						+ '<div class="content-item" id="con_' + eName + '">'
							+ '<div class="label">' + label + '</div>'
							+ '<div class="form-item">' + showProductSelect() + '</div>'	
						+ '</div>'	
						+ '<div class="form-item-error" id="error_' + eName + '"></div>'
					+ '</div>'
				+ '</div>';

				jQuery('#dyn_section').html(table);		
				break;
			case "support_request":
				window.location = "http://support.vmware.com/selfsupport/ ";	
				break;
			case "feedback_kb":	
				eName = 'input_articleid';
				label = 'Article ID';
				table += showHiddenEmail('kcs-core@vmware.com');
				table += showTextInput(label, eName);
				jQuery('#dyn_section').html(table);	
				break;
			case "feedback_website":
				eName = 'input_url';
				label = 'URL';
				table += showHiddenEmail('customer_service@vmware.com');
				table += showTextInput(label, eName);	
				jQuery('#dyn_section').html(table);	
				break;
			case "help_licensing":
				eName = 'input_product';
				label = 'Product';
				table += showHiddenEmail('VI-Hotline@vmware.com');	
				table += showTextInput('Contract #', 'input_contractnum');
				table += showTextInput('Order #', 'input_ordernum');
				table += showTextInput('License #', 'input_licensenum');
				table += '<div class="content-container">'
					+ '<div>'
						+ '<div class="content-item" id="con_' + eName + '">'	
							+ '<div class="label">' + label + '</div>'
							+ '<div class="form-item">' + showProductSelect() + '</div>'
						+ '</div>'	
						+ '<div class="form-item-error" id="error_' + eName + '"></div>'
					+ '</div>'
					+ '</div>';

				jQuery('#dyn_section').html(table);	
				break; 
				case "tap_alliance":
				table += showHiddenEmail('tapalliance@vmware.com');
				jQuery('#dyn_section').html(table);	
				break;
			case "inquire_training_class":
				table += showHiddenEmail('education@vmware.com');
				table += showTextInput('Student<br />Registration #', 'input_studentregnum');
				table += showTextInput('PSO Credits Account ID #', 'input_psoaccountid');
				table += showTextInput('VCP ID<br />Candidate #', 'input_vcpidnum');				
				jQuery('#dyn_section').html(table);	
				break;
			case "inquire_tech_certifications":
				table += showHiddenEmail('certification@vmware.com');
				table += showTextInput('Student<br />Registration #', 'input_studentregnum');
				table += showTextInput('Contract ID #', 'input_contractnum');
				jQuery('#dyn_section').html(table);
				break;
			case "customer_service":
				table += showHiddenEmail('customer_service@vmware.com');				
				jQuery('#dyn_section').html(table);
				break;
			default:
				jQuery('#dyn_section').html(table);
				break;	
		}			
	}

	function showHiddenEmail(semail) {
		return '<input type="hidden" id="input_department" name="input_department" value="' + semail + '"/>';
	}				

	function showProductSelect() {
		var product = '<select id="input_product" name="input_product" size=1>';
		product += '<option value="">Select One</option>';
		product += '<option value="">Datacenter &amp; Cloud Infrastructure</option>';
        product += '<option value="VMware vSphere">&nbsp;&nbsp;VMware vSphere</option>';
        product += '<option value="VMware Hypervisor">&nbsp;&nbsp;VMware Hypervisor</option>';
        product += '<option value="VMware Go">&nbsp;&nbsp;VMware Go</option>';
        product += '<option value="VMware vCloud Product Family">&nbsp;&nbsp;VMware vCloud Product Family</option>';
        product += '<option value="VMware vCloud Director">&nbsp;&nbsp;VMware vCloud Director</option>';
        product += '<option value="VMware vCloud Request Manager">&nbsp;&nbsp;VMware vCloud Request Manager</option>';
        product += '<option value="VMware vCenter Product Family">&nbsp;&nbsp;VMware vCenter Product Family</option>';
        product += '<option value="VMware Server">&nbsp;&nbsp;VMware Server</option>';
        product += '<option value="">Security Products</option>';
        product += '<option value="VMware vShield Product Family">&nbsp;&nbsp;VMware vShield Product Family</option>';
        product += '<option value="VMware vShield App">&nbsp;&nbsp;VMware vShield App</option>';
        product += '<option value="VMware vShield Edge">&nbsp;&nbsp;VMware vShield Edge</option>';
        product += '<option value="VMware vShield Endpoint">&nbsp;&nbsp;VMware vShield Endpoint</option>';
        product += '<option value="">Desktop &amp; End-User Computing</option>';
        product += '<option value="VMware View">&nbsp;&nbsp;VMware View</option>';
        product += '<option value="VMware ThinApp">&nbsp;&nbsp;VMware ThinApp</option>';
        product += '<option value="VMware ACE">&nbsp;&nbsp;VMware ACE</option>';
        product += '<option value="VMware Workstation">&nbsp;&nbsp;VMware Workstation</option>';
        product += '<option value="VMware Player">&nbsp;&nbsp;VMware Player</option>';
        product += '<option value="Zimbra">&nbsp;&nbsp;Zimbra</option>';
        product += '<option value="VMware Mobile Virtualization">&nbsp;&nbsp;VMware Mobile Virtualization</option>';
        product += '<option value="Platform (MVP)">&nbsp;&nbsp;Platform (MVP)</option>';
        product += '<option value="">MAC Product</option>';
        product += '<option value="VMware Fusion">&nbsp;&nbsp;VMware Fusion</option>';
        product += '<option value="">VMware vFabric Cloud Application Platform</option>';
        product += '<option value="VMware vFabric tc Server">&nbsp;&nbsp;VMware vFabric tc Server</option>';
        product += '<option value="VMware vFabric Hyperic">&nbsp;&nbsp;VMware vFabric Hyperic</option>';
        product += '<option value="VMware vFabric GemFire">&nbsp;&nbsp;VMware vFabric GemFire</option>';
        product += '<option value="VMware vFabric Enterprise Ready Server">&nbsp;&nbsp;VMware vFabric Enterprise Ready Server</option>';
        product += '<option value="VMware vFabric RabbitMQ">&nbsp;&nbsp;VMware vFabric RabbitMQ</option>';
        product += '<option value="">IT Business Management</option>';
        product += '<option value="VMware vCenter Chargeback">&nbsp;&nbsp;VMware vCenter Chargeback</option>';
        product += '<option value="VMware Service Manager">&nbsp;&nbsp;VMware Service Manager</option>';
        product += '<option value="">Infrastructure &amp; Operations Management</option>';
        product += '<option value="VMware vCenter Server">&nbsp;&nbsp;VMware vCenter Server</option>';
        product += '<option value="VMware vCenter Server Heartbeat">&nbsp;&nbsp;VMware vCenter Server Heartbeat</option>';
        product += '<option value="VMware vCenter Orchestrator">&nbsp;&nbsp;VMware vCenter Orchestrator</option>';
        product += '<option value="VMware vCenter CapacityIQ">&nbsp;&nbsp;VMware vCenter CapacityIQ</option>';
        product += '<option value="VMware vCenter Site Recovery Manager">&nbsp;&nbsp;VMware vCenter Site Recovery Manager</option>';
        product += '<option value="VMware vCenter Lab Manager">&nbsp;&nbsp;VMware vCenter Lab Manager</option>';
        product += '<option value="VMware vCenter Configuration Manager">&nbsp;&nbsp;VMware vCenter Configuration Manager</option>';
        product += '<option value="VMware vCenter Converter">&nbsp;&nbsp;VMware vCenter Converter</option>';
        product += '<option value="VMware vCenter Operations">&nbsp;&nbsp;VMware vCenter Operations</option>';
        product += '<option value="">Application Management</option>';
        product += '<option value="VMware vCenter Application Discovery Manager">&nbsp;&nbsp;VMware vCenter Application Discovery Manager</option>';
        product += '<option value="VMware vCenter AppSpeed">&nbsp;&nbsp;VMware vCenter AppSpeed</option>';
        product += '<option value="VMware Studio">&nbsp;&nbsp;VMware Studio</option>';
        product += '<option value="">Other</option>';
        product += '<option value="VMware Purchasing Program">&nbsp;&nbsp;VMware Purchasing Program</option>';
        product += '<option value="VMware Data Recovery">&nbsp;&nbsp;VMware Data Recovery</option>';
        product += '<option value="VMware Vmmark">&nbsp;&nbsp;VMware Vmmark</option>';
        product += '<option value="VMware Capacity Planner">&nbsp;&nbsp;VMware Capacity Planner</option>';
        product += '<option value="Cisco Nexus 1000v">&nbsp;&nbsp;Cisco Nexus 1000v</option>';
        product += '<option value="VMware Compliance Checker">&nbsp;&nbsp;VMware Compliance Checker</option>';
        product += '<option value="SUSE Linux Enterprise Server for VMware">&nbsp;&nbsp;SUSE Linux Enterprise Server for VMware</option>';
		product += '</select>';				

		return product;		
	}		

	function showSummaryMessage(sLabel, sName, tLabel, tName) {
		var table = '';	

			table += showSummaryTextArea(sLabel, sName, tName);
			jQuery('#submess_section').html(table);
			scriptonload();
			generatesubject();			
	}	

	function showSummaryInput(label, name) {
		var summary = '<div class="content-container">'
						+ '<div>'
							+ '<div class="content-item" id="con_' + name + '">'	
								+ '<div class="label">' + label + '</div>'
								+ '<div class="form-item"><input type="text" name="' + name + '" id="' + name + '" size="30" /></div>'	
							+ '</div>'					
							+ '<div class="form-item-error" id="error_' + name + '"></div>'	
						+ '</div>'
					+ '</div>';

		return summary;
	}		

	function showDetailsTextArea(label, name) {
		var details = '<div class="content-container">'
							+ '<div>'
								+ '<div class="content-item" id="con_' + name + '">'
									+ '<div class="label">' + label + '</div>'
									+ '<div class="form-item contact-us-item">'
									+ '<p>Please provide additional information about your inquiry only. We are not able to provide technical support through this form. For technical support visit <a href="/support/contacts/">Contact Support</a>.</p>'
									+ '<textarea name="' + name + '" class="box-picker contact-comments" id="' + name + '" rows="8" cols="45"></textarea></div>'	
								+ '</div>'		
								+ '<div class="form-item-error" id="error_' + name + '"></div>'
							+ '</div>'
						+ '</div>';
		
		return details;		
	}	

	function showSummaryTextArea(label, sName, tName) {
		var details = '<div class="content-container">'
			+ '<div>'
				+ '<div class="content-item" id="con_' + sName + '">'
					+ '<div class="label">' + label + '</div>'
					+ '<div class="form-item contact-us-item">'
					+ '<input type="text" name="' + sName + '" id="' + sName + '" size="30" />'
					+ '<p>Please provide additional information about your inquiry only. We are not able to provide technical support through this form. For technical support visit <a href="/support/contacts/">Contact Support</a>.</p>'
					+ '<textarea name="' + tName + '" class="box-picker contact-comments" id="' + tName + '" rows="8" cols="45"></textarea></div>'	
				+ '</div>'			
				+ '<div class="form-item-error" id="error_' + sName + '"></div>'
			+ '</div>'
		+ '</div>';

		return details;		
	}		

	function showTextInput(label, name) {
		var textinput = '<div class="content-container">'
							+ '<div>'
								+ '<div class="content-item" id="con_' + name + '">'	
									+ '<div class="label">' + label + '</div>'
									+ '<div class="form-item"><input class="box-picker" type="text" name="' + name + '" id="' + name + '" size="30" /></div>'
								+ '</div>'		
								+ '<div class="form-item-error" id="error_' + name + '"></div>'
							+ '</div>'
						+ '</div>';

		return textinput;
	}	

	function showTextRow(label, name) {
		var textinput = '<div class="content-container">'
							+ '<div>'
								+ '<div class="content-item">'	
									+ '<div class="label">' + label + '</div>'
									+ '<div class="form-item">' + name + '</div>'	
								+ '</div>'
							+ '</div>'
						+ '</div>';

		return textinput;
	}	

	function showHiddenField(name, value) {
		var hiddenfield = '<input type="hidden" name="' + name + '" id="' + name + '" value="' + value + '" />';

		return hiddenfield;
	}

