var typeIssue = new DynamicOptionList();

typeIssue.addDependentFields("type","00N300000011gcS");

typeIssue.selectFirstOption = true;

typeIssue.forValue("Problem / Question").addOptionsTextValue("I'm having trouble placing an order","Ordering problem");
typeIssue.forValue("Problem / Question").addOptionsTextValue("I want to know the status of my order","Order status");
typeIssue.forValue("Problem / Question").addOptionsTextValue("I made a mistake when placing my order... what can I do?","Customer Order Mistake");
typeIssue.forValue("Problem / Question").addOptionsTextValue("I need to exchange an item","Item exchange");
typeIssue.forValue("Problem / Question").addOptionsTextValue("I want to cancel my order.","Order cancellation");
typeIssue.forValue("Problem / Question").addOptionsTextValue("I need to return my order or an item","Return");

//typeIssue.forValue("Problem / Question").addOptionsTextValue("I'm having trouble downloading my item","Downloadable item");
typeIssue.forValue("Problem / Question").addOptionsTextValue("I'm having a problem paying during checkout","Payment");
typeIssue.forValue("Problem / Question").addOptionsTextValue("I received the wrong items","Wrong item(s) received");
typeIssue.forValue("Problem / Question").addOptionsTextValue("I need to know if a product is available","Product availability");
typeIssue.forValue("Problem / Question").addOptionsTextValue("I need more information about a product","Product information");
typeIssue.forValue("Problem / Question").addOptionsTextValue("I have a question about payment options","Payment");
typeIssue.forValue("Comment").addOptionsTextValue("I have a compliment","Compliment");
typeIssue.forValue("Comment").addOptionsTextValue("I have a complaint","Complaint");
typeIssue.forValue("Comment").addOptionsTextValue("I have a general comment","General");

//typeIssue.forValue("Problem / Question").addOptionsTextValue("I need to change an item in my recent order","Item modification");
//typeIssue.forValue("Problem / Question").addOptionsTextValue("I need to change the address on my recent order","Address modification");

	
function setSubjectToIssue() {
	document.getElementById('description').value = "";
	issue = document.getElementById('issue').value;
	caseType = document.getElementById('caseType').value;
	document.getElementById('subject').value = issue;
	setDesc();
}

function wimoPop() {
	orderSourceCode = document.getElementById('ordersourcecode').value;
	orderNum = document.getElementById('orderNum').value;
	email = document.getElementById('email').value;
	orderStatusPageUrl = 'http://services.amplifier.com/OrderStatusClient/Default.aspx?OrderSource=' + orderSourceCode + '&orderNum=' + orderNum + '&email=' + email;
	window.open(orderStatusPageUrl,'mywindow','width=600,height=600,resizable=yes,scrollbars=yes,toolbar=no,location=no,status=no,menubar=no,copyhistory=no');
}

function setDesc() {
	description = document.getElementById('description').value;
	issue = document.getElementById('issue').value;
	orderSourceCode = document.getElementById('ordersourcecode').value;
	orderNum = document.getElementById('orderNum').value;
	email = document.getElementById('email').value;
	orderStatusPageUrl = 'http://services.amplifier.com/OrderStatusClient/Default.aspx?OrderSource=' + orderSourceCode + '&orderNum=' + orderNum + '&email=' + email;
	if (issue == "Order status") {
		window.open(orderStatusPageUrl,'mywindow','width=600,height=600,resizable=yes,scrollbars=yes,toolbar=no,location=no,status=no,menubar=no,copyhistory=no');
	}
}

function validate(frm) {
    //
    // Check the Email field to see if any characters were entered
    //
    
		if (frm.firstName.value.length == 0)
    {
        alert("Please enter your first name.")
        frm.firstName.focus()
        return false
    }
    
		if (frm.lastName.value.length == 0)
    {
        alert("Please enter your last name.")
        frm.lastName.focus()
        return false
    }
    
   	if (frm.email.value.length == 0)
    {
        alert("Please enter an e-mail address.")
        frm.email.focus()
        return false
    }
    
}

