		function successInit()
		{
			if(typeof siteType === 'undefined')
			{
				siteType = '';
			}
			switch(siteType)
			{
				case 'sex':
					confirmation_message = "<p>You will soon receive a text message, please reply to it to start SEXTING with me.</p>";
					break;
				case 'flirt150':
					confirmation_message = "<p>You will soon receive a text message, please reply to it to start FLIRTING with me.</p>";
					break;
				case 'psychic75':
					confirmation_message = "<p>You will soon receive a text message, please reply to it with your question</p>";
					break;
				case 'psychic150':
					confirmation_message = "<p>You will soon receive a text message, please reply to it with your question</p>";
					break;
				default:
					confirmation_message = "<p>You will soon receive a text message, please reply to it with your question</p>";
			}
			$('#tcc_number_div').html("<div id='tcc_message'></div>");
			$('#tcc_message').html(confirmation_message).hide().fadeIn(1500);
		}
		
		$(function()
		{
			
			$('#tcc_number_div').html('<form id="tcc_form" name="contact" action=""><fieldset id="tcc_fieldset"><input type="text" name="tcc_number" id="tcc_number" size="14" value="07" class="text-input" /><input type="submit" name="tcc_submit" class="tcc_button" id="tcc_submit_btn" value="Submit" /><label class="tcc_error" for="tcc_number" id="tcc_number_error">Please enter a number like 447000000000</label></form>');
//			$('#contact_form').append('');
//			alert('started');
			
		});
		
		  $(function() {
		    $('#tcc_number_error').hide();
		    $("#tcc_submit_btn").click(function() 
			{
		      	$('#tcc_number_error').hide();
		  	  	var number = $("input#tcc_number").val();
				
				if(/^07\d{9}$/i.test(number))
				{
					number = number.replace(/^07/, '447');
				}
		  		if (number == "" || !/^447\d{9}$/i.test(number)) 
				{
		        	$("label#tcc_number_error").show();
		        	$("input#tcc_number").focus();
		        	return false;
		     	 }

				if(typeof siteType === 'undefined')
				{
					siteType = '';
				}
			
				var dataString = 'smswebinit=true&type=' + siteType + '&number=' + number + '&shortcode=' + ukShortcode + '&keyword=' + ukKeyword + '&rand=' + Math.random()*101;
				
			  	//alert (dataString);return false;
				if ($.browser.msie && parseInt($.browser.version, 10) >= 8 && window.XDomainRequest) {
					
					// Use Microsoft XDR
					var xdr = new XDomainRequest();
					//xdr.open("get", 'http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20xml%20where%20url%20%3D%20%22'+$.URLEncode(url)+'%22&format=json&diagnostics=true?callback=?');
					xdr.open("get", 'http://www.textchatclub.co.uk/api/widgets/webinit.cfm?' + dataString);
					xdr.onload = function(){
					//				  json = 'json = '+xdr.responseText; // the string now looks like..  json = { ... };
					//					  eval(json); // json is now a regular JSON object
						successInit();
					}
					xdr.send();
				}
				else {
					$.ajax({
						type: "POST",
						url: "http://www.textchatclub.co.uk/api/widgets/webinit.cfm",
						data: dataString,
						success: successInit
						
					});
				}
			  	return false;
   			});
			  
  		});
