/**
 * (c) 2010 Meridex Software Corp.
 */
function feedback() {
	
	var quotes = [
                'Calendar entries would become, in effect, the best kind of ads - targeted directly...<a target="_blank" href="http://www.zisman.ca/Articles/2008/BIV991.html" title="More">more</a><p class="FeedbackAuthor">Alan Zisman</p><p class="FeedbackSign">of Business in Vancouver</p>',
                'It looks like a great new approach to monetization services that offer real-life value to users...<a target="_blank" href="http://profy.com/2008/10/30/calgoo-innovates-in-monetizing-online-calendaring-solutions/" title="More">more</a><p class="FeedbackAuthor">Svetlana Gladkova</p><p class="FeedbackSign">of Profy</p>',
                'It is compatible across most popular desktop and web calendars: Outlook, iCal, Google, Windows Live, and more, which can then sync to most any smartphone...<a target="_blank" href="http://www.techvibes.com/blog/calgoo-suggest-you-market-to-the-calendar" title="More">more</a><p class="FeedbackAuthor">Greg Andrews</p><p class="FeedbackSign">of Tech vibes</p>',
                'The platform is a permission-based, opt-in only program that enables consumers to have better notifications of time-sensitive products or services...<a target="_blank" href="http://www.socialmediaexplorer.com/2008/10/30/calgoo-brings-permission-based-advertising-to-your-calendar/" title="More">more</a><p class="FeedbackAuthor">Jason Falls</p><p class="FeedbackSign">of Social Media Explorer</p>',
                'This new marketing concept enables you to deliver relevant, useful content into the calendars of your most loyal customers and current email subscribers...<a target="_blank" href="http://www.coolbusinessideas.com/archives/calendar_marketing.html" title="More">more</a><p class="FeedbackAuthor">Marcel Sim</p><p class="FeedbackSign">of Coolbusinessideas</p>',
                'In-Calendar Marketing is a new marketing medium that allows for the delivery of marketing messages right into the electronic calendars...<a target="_blank" href="http://suburbanstartup.wordpress.com/2008/08/27/golf-course-calendar-feeds-at-teetimesnet/" title="More">more</a><p class="FeedbackAuthor">John Lyotier</p><p class="FeedbackSign">of Diary of a Suburban<br/> Startup</p>',
                'Obviously useful for everything time-sensitive such as events, weekly specials etc...<a target="_blank" href="http://ettf.net/archives/11878" title="More">more</a><p class="FeedbackAuthor">ettf.net</p><p class="FeedbackSign"></p>',
                'By way of a simple click on an advertising event, they know everything about your offer, and can respond with an email or visit your site...<a target="_blank" href="http://www.brainstorming.fr/news_du_planneur/?p=150" title="More">more</a><p class="FeedbackAuthor">Brainstorming</p><p class="FeedbackSign"></p>',
                'A cross-platform service that promises to put events like your company s upcoming education seminars...<a target="_blank" href="http://www.unsolicitedmarketingadvice.com/2008/10/update-calendar-marketing-approaches.html" title="More">more</a><p class="FeedbackAuthor">Warren Allan Johnson</p><p class="FeedbackSign">of Unsolicited Marketing<br/> Advice</p>'
                ];

	var randomNum = Math.floor(quotes.length*Math.random());
	document.getElementById("fbtext").innerHTML = quotes[randomNum]; 
	
};



function contact() {
	
	var name,email,organization,subject,description,form;
	form = document.forms[0];
	if (form) {
		name = form.elements["name"].value;
		email = form.elements["email"].value;
		organization = form.elements["organization"].value;
		subject = form.elements["subject"].value;
		description = form.elements["description"].value;
	}
	
	document.getElementById("error").innerHTML = "";
	document.getElementById("email").style.border = "";
	document.getElementById("subject").style.border = "";
	Ext.Ajax.request({
					 url: "/submit.php",
					 params: {
						 name: name,
						 email: email,
						 org: organization,
						 subject: subject,
						 desc: description
					 },
					 success: function(response,options) {
						var result = Ext.util.JSON.decode(response.responseText);
						if (result.success) {
							document.getElementById("form").innerHTML  = result.msg;
						}
						else {
							if (result.field&&result.field=="email") {
								document.getElementById("error").innerHTML  = result.error;
								document.getElementById("email").style.border = "2px solid #FF0000";
							}
							if (result.field&&result.field=="subject") {
								document.getElementById("error").innerHTML  = result.error;
								document.getElementById("subject").style.border = "2px solid #FF0000";
							}
						}
					 },
					 failure: function(response,options) {
						 document.getElementById("error").innerHTML  = "Error: could not contact server. Please try again.";
					 }
	});
};


var zohofieldarray=new Array("Last Name","Email");
function contact_zoho() {

	for(var i=0;i<zohofieldarray.length;i++) {
	  var value=document.getElementsByName(zohofieldarray[i])[0].value;
	  if(value=="") {
		document.getElementById("error").innerHTML  = zohofieldarray[i] + " cannot be empty";
	   	document.getElementsByName(zohofieldarray[i])[0].style.border = "2px solid #FF0000";
		return false;
	  }
	}
	
};
