<?xml version="1.0" encoding="UTF-8" ?>
<Module>
	<ModulePrefs title="Ribbit Wave">
		<Require feature="wave" />
		<Require feature="dynamic-height" />
	</ModulePrefs>
	<Content type="html">
		<![CDATA[
			<script src="http://www.google.com/jsapi"></script>
			<script type="text/javascript" src="http://ribbitwave.appspot.com/js/ribbit.1.5.2.3.js"></script>
			<link rel="stylesheet" type="text/css" href="http://ribbitwave.appspot.com/css/ribbit.css" />
			<script type="text/javascript">
			
				// #start-vars
				var token = "MjRmMDA4M2EtZjYzNi00N2E5LWI1ZGMtMGRhNDA3MzU3ZWY2";
				var appId = "RibbitWave_ConfCall";
				var username = "ribbitconf";
				var password = "ribbitconf2"; 
				// #end-vars
				
				var changed;
				// Timer for call status updates
				var timer;
				var message;
				var selectAll = true; // select all checkboxes the first time the gadget is shown
				var numValidPhones = 0;
				
				
				google.load("jquery", "1");
				
				
				String.prototype.endsWith = function(str){return (this.match(str+"$")==str)}
				String.prototype.startsWith = function(str) {return (this.match("^"+str)==str)}
				
				function addMyNumber() {
					var participant = wave.getViewer().getId()+"-num";
					var phonenum = document.getElementsByName("phonenum")[0];
					
					var map = new Object();
					
					var num = checkPhoneNumber(phonenum.value);
					if (num != null) {
						var phoneText = 'tel:'+num;
						map[participant] = phoneText;
						wave.getState().submitDelta(map);
						toggleDiv('phoneNumDiv');	
					}					
				}
				
				
				function getLegs(callId) {
					Ribbit.Calls().getCall(getCallInfoCallback, callId);
				}
				
				function muteUnmute() {
					var id = wave.getViewer().getId();
					var muteState = id + "-mute";
					var callInProgress = wave.getState().get("callInProgress");
					if ((callInProgress == 'false') || (callInProgress == null))
						return;
					if (muteState != null) {
						if (muteState == true) {
							unmute(id);
						} else mute(id);
					} else {
						mute(id);
					}
				}
				
				function mute(id) {
					var legId = wave.getState().get(id + "-num");
					var callId = wave.getState().get("callId");
					Ribbit.Calls().muteLeg(muteLegCallback, callId, legId);
				}
				
				function unmute(id) {
					var legId = wave.getState().get(id + "-num");
					var callId = wave.getState().get("callId");
					Ribbit.Calls().unmuteLeg(unmuteLegCallback, callId, legId);
				}
				
				function dropLeg() {
					var id = wave.getViewer().getId();
					var legId = wave.getState().get(id + "-num");
					var callId = wave.getState().get("callId");
					Ribbit.Calls().hangupLeg(hangUpLegCallback, callId, legId);
				}
				
				function startCall() {
					var callId = wave.getState().get("callId");
					if (callId != null) {
						endCall();
					} else {
						call();
					}
				}
				
				function call() {
					deleteStatuses();
					var phonenums = new Array();
					var boxes = $("input[type='checkbox']");
					// get all checkboxes
					for(var i=1; i<boxes.length; i++){
						if( boxes[i].getAttribute('type') == 'checkbox' && boxes[i].checked == true){	// TODO: use selector
							var id = boxes[i].getAttribute("name").split("-checkBox")[0];
							var num = wave.getState().get(id+"-num");
							var map = new Object();
							if (num != null) {
								phonenums.push(num);
								//change status to dialing
								var person = id +"-status";
								map[person] = 'STARTED';
							}
							wave.getState().submitDelta(map);
						}
					}
					if (phonenums.length <= 10) {
						Ribbit.Calls().createCall(createCallCallback, phonenums, null, null);						
					} else {
						alert("There is a maximum of ten participants on a conference call. \n"+
							"Please remove some participants and try again."); 
					}
				}
				
				function verifyThrottle() {
					var callInProgress = wave.getState().get("callInProgress");
					
					if (callInProgress == "false")
						Ribbit.Calls().getCalls(getCallsCallback, 0, 1);
					else {
						startCall();
					}
				}
				
				function getCallsCallback(result){
					if (result.hasError){
						message = "Oops! There are too many people using the Ribbit Conference Gadget right now, \n please try again in a few minutes.";
						wave.getState().submitDelta({"message":message});
					}
					else {
						var results = result.totalResults;
						var startIndex;
						if (results > 20)
							startIndex = results - 20;
						else startIndex = 0;
						Ribbit.Calls().getCalls(getCallsCallback2, startIndex, 20);
						message = "Checking for active slots to create call.";
						wave.getState().submitDelta({"message":message});
					}
				}
				
				function getCallsCallback2(result){
					if (result.hasError){
						$("#result").html(result.message);
					}
					else {
						var totalActiveLegs = 0;
						for (var i = 0; i<result.length; i++) {
							var legs = results[i].legs;
							for (var j = 0; i<legs.length; j++) {
								var leg = legs[j];
								if (leg.status != 'HUNGUP')
									totalActiveLegs++;
								if (totalActiveLegs >= 50)
									break;
							}
						}
						if (totalActiveLegs < 50) {
							startCall();
						} else {
							message = "Maximum number of concurrent calls reached, please try again later";
							wave.getState().submitDelta({"message":message});
						}
					}
				}
				
				function changeStatus(id, src, text) {
					var td = document.getElementById(id);
					var children = td.children;
					// TODO change this later
					children[0].src = src;
					children[1].innerHTML = text;
				}
				
				function changeAllStatus(text) {
					// testing
					//var participants = getParticipants();
					// production
					 var participants = wave.getParticipants();
					
					var src = "http://ribbitwave.appspot.com/images/led_white.png";
					var map = new Object();
					if (participants) {
						for (var i = 0; i<participants.length; i++) {
							var id = participants[i].getId() + "-status";
							map[id] = text;
						}
					}
					wave.getState().submitDelta(map);
				}
				
				function setStatus() {
					var legs = wave.getState().get("status");
					var vals = legs.split(";");
					for (var i = 0; i<vals.length; i++) { 
						var leg = vals[i].split("-");
						var statusTD = document.getElementById(leg[0]+"-status");
								statusTD.innerHTML = leg[1];
					}
				}
				
				function endCall() {
					var callId = wave.getState().get("callId");
					var tid = wave.getState().get("timerId");
					clearInterval(tid);
					if (callId) {
						//TODO  change this location later
						changeAllStatus("INACTIVE");
						Ribbit.Calls().hangupCall(endCallCallback, callId);	
					} else alert("No active call.");
				}
				
				function muteAll() {
					var callId = wave.getState().get("callId");
					alert("muteAll-"+callId);
					Ribbit.Calls().muteCall(muteAllCallback ,callId);
				}
				
				function checkPhoneNumber(phoneNo) {
					var temp = phoneNo.replace("(","").replace(")","").replace("-","").replace("-","").replace("tel:","").replace(/\s+/g, ""); 
					var n = null;
				
					var phoneRE = /^\d+$/;
					var regexp = new RegExp("\\+44");
					if (temp.match(phoneRE)) {
						if (temp.startsWith('0')) {
							n = "44"+temp.substr(1);
						} else if (temp.startsWith("1809") || temp.startsWith("1829") || temp.startsWith("809") || temp.startsWith("829")) {
							alert("The phone number entered is invalid or is outside the US, UK, and Canada.");
						} else if (temp.startsWith("1")) {
							n = temp;
						} else if (temp.startsWith("44") && temp.length > 10) {
							n = temp;
						} else if (temp.length == 10)
							n = "1" + temp;	
						else alert("The phone number entered is invalid or is outside the US, UK, and Canada.");				
					} else if (temp.match(regexp)) {
							n = temp.substr(1);					
					} else {
						alert("The phone number entered is invalid or is outside the US, UK, and Canada.");
					}
						
					return n;
				}
				
				// Wave specific functions
				
				function init() {
					var elem = document.getElementById("selectAll");
					elem.checked = true;
					if (wave && wave.isInWaveContainer()) {
						Ribbit.init(token, appId);
						Ribbit.Login(loginCallback, username, password);
						wave.setStateCallback(stateUpdated, changed);
						wave.setParticipantCallback(participantsChanged, changed);
					}			
				}
				
				gadgets.util.registerOnLoadHandler(init);
				
				
				function participantsChanged(changed) {
					createParticipantRows();
				}
				
				function stateUpdated(changed) {
					// Remove this in production TODO
						justForTesting();
						createParticipantRows();
					// check to see if any phone numbers changed
					numValidPhones = 0;
					var keys = changed.getKeys();
					for (var i = 0; i<keys.length; i++) {
						var key = keys[i];
						var value = wave.getState().get(key);
	
						if (key == "callInProgress") {
							if (value == "true") {
								document.getElementById("confTop").setAttribute("class","");
								document.getElementById("confBottom").setAttribute("class","endConf-button");
								
								document.getElementById("startCollapsed").setAttribute("class", "");
								document.getElementById("muteTop").setAttribute("class", "mute-off-button");
								//document.getElementById("muteBottom").setAttribute("class", "mute-off-button");
								document.getElementById("muteCollapsed").setAttribute("class", "mute-off-button");
								document.getElementById("endCollapsed").setAttribute("class", "end-button");
								document.getElementById("endTop").setAttribute("class", "end-button");
								//document.getElementById("endBottom").setAttribute("class", "end-button");
							} else {
								document.getElementById("confTop").setAttribute("class","startConf-button");
								document.getElementById("confBottom").setAttribute("class","startConf-button");
								
								document.getElementById("startCollapsed").setAttribute("class", "startConf-button");
								document.getElementById("muteTop").setAttribute("class", "");
								//document.getElementById("muteBottom").setAttribute("class", "");
								document.getElementById("endTop").setAttribute("class", "");
								//document.getElementById("endBottom").setAttribute("class", "");
								document.getElementById("muteCollapsed").setAttribute("class", "");
								document.getElementById("endCollapsed").setAttribute("class", "");
							}
						}
						if ( key.endsWith("-num") ) {
							var numTD = document.getElementById(key);
							var number = value;
							var viewer = wave.getViewer().getId();
							var participant = key.split("-num")[0];
							var numSpan = document.getElementById("currentPhoneNumber");
							if (numTD!=null) {
								if (participant != viewer)
									numTD.innerHTML = 'Available to Call';
								else numTD.innerHTML = formatPhone(number);
								
							}
							numValidPhones++;
						} 
						if (key == "message") {
							document.getElementById("result").innerHTML = value;
						}
						if (key.endsWith("-mute")) {
							var viewer = wave.getViewer().getId();
							var participant = key.split("-mute")[0];
							var callInProgress = wave.getState().get("callInProgress");
							if (callInProgess == "true"){
								if (viewer == participant) {
									if (value == "true") {
										document.getElementById("muteTop").setAttribute("class", "mute-on-button");
										document.getElementById("muteCollapsed").setAttribute("class", "mute-on-button");
									}
								}
							}
						}
						
						if (selectAll == true){
							toggleCheckboxes();
							selectAll == false;
						}
						if ( key.endsWith("-status")) {
							// STARTED, ANSWERED, HUNGUP, RINGING
							switch (value) {
								case "INACTIVE":	//white
									changeStatus(key, "http://ribbitwave.appspot.com/images/led_white.png", "inactive");
									break;
								case "STARTED": 	//yellow
									changeStatus(key, "http://ribbitwave.appspot.com/images/led_yellow.png", "dialing");
									break;
								case "ANSWERED": 	//green
									changeStatus(key, "http://ribbitwave.appspot.com/images/led_green.png", "active");
									break;
								case "HUNGUP":		//red
									changeStatus(key, "http://ribbitwave.appspot.com/images/led_red.png", "hungup");
									break;
								case "FAILURE":		//red
									changeStatus(key, "http://ribbitwave.appspot.com/images/led_red.png", "failure");
									break;
							}
						}
					}
					document.getElementById('numParticipants').children[0].innerHTML = numValidPhones + " Available Participant(s)";
					gadgets.window.adjustHeight();
		
				}
				
				function getParticipants() {
					var ppl = wave.getParticipants();
					ppl.push(createPseudoParticipant("test1", "Test Person", "http://bit.ly/JLUcN"));
					ppl.push(createPseudoParticipant("test2", "Test Person2", "http://bit.ly/JLUcN"));
					ppl.push(createPseudoParticipant("test3", "Test Person3", "http://bit.ly/JLUcN"));
					return ppl;
				}
				
				//this next function is for testing purposes only
				function createPseudoParticipant(id, displayName, thumbnail) {
					var person = new wave.Participant();
					person["id_"] = id;
					person["displayName_"] = displayName;
					person["thumbnailUrl_"] = thumbnail;
					return person;
				}
				
				function createParticipantRows() {
					// Testing
					//var participants = getParticipants();
					// Use this in production
					var participants = wave.getParticipants();
					//alert(participants);
					if (participants) {
						var table = document.getElementById("participantInfo");
						for (var i = 0; i<participants.length; i++) {
							var id = participants[i].getId();
							var thumb = participants[i].getThumbnailUrl();
							var temp = id+'-info';
							var row = document.getElementById(temp);
							
							
							if (row == null) {
								//alert("row is null");
								//row = $(document.createElement('tr')).attr({'id': id+"-info"});
								row = $(document.createElement('div')).attr({'id': id+"-info", 'class':'row'});
								
								var checkboxTD = document.createElement('div');
								var callBtnTD = document.createElement('div');
								var nameTD = document.createElement('div');
								var thumbTD = document.createElement('div');
								//var numSpan = document.createElement('span');
								//var numberTD = document.createElement('td');
								var statusTD = document.createElement('div');
								var addNumTD = document.createElement('div');
								
								checkboxTD.setAttribute('class', 'checkbox');
								thumbTD.setAttribute('class','avatar');
								nameTD.setAttribute('class','nameDiv');
								statusTD.setAttribute('class','statusDiv');
								addNumTD.setAttribute('class','addNumDiv');
								
								
								$(document.createElement('input')).attr({ "type": "checkbox", "name": id+"-checkBox",	"value": id}).appendTo(checkboxTD);
								
								var viewer = wave.getViewer().getId();
								if (viewer == id) {
									$(document.createElement('a')).attr({"class":"addNumber-button", "href":"#", "onClick":"toggleDiv('phoneNumDiv');"}).html("<span></span>").appendTo(addNumTD);
								}
								
								// End buttons
								$(document.createElement('span')).attr({"class":"name"}).html(participants[i].getDisplayName()).appendTo(nameTD);
								$(document.createElement('br')).appendTo(nameTD);
								
								var numSpan = $(document.createElement('span')).attr({"class":"phoneNumber", "id": id+"-num"});
								numSpan.appendTo(nameTD);
								
								thumbTD.innerHTML = "<img width='30' height='30' src="+ participants[i].getThumbnailUrl() + " /> "
								var number = wave.getState().get(id+"-num");
								if (number)
									numSpan.html(formatPhone(number));
								else numSpan.html("");
								
								statusTD.setAttribute("id", id+"-status");
								statusTD.innerHTML = "<img src='http://ribbitwave.appspot.com/images/led_white.png' title='inactive' alt='inactive' /> <span>inactive</span>";
								
								
								row.append(checkboxTD);
								row.append(thumbTD);
								row.append(nameTD);
								row.append(statusTD);
								row.append(addNumTD);
								
								var last = $(".stripeMe2 div.row:last")[0];
								row.insertBefore(last);
								//table.appendChild(row);
								// Stripe rows
								$(".stripeMe2 div.row:even").addClass("alt");
								$(".stripeMe2 div.row:first").addClass("header").removeClass("alt");
								$(".stripeMe2 div.row:last").addClass("header").removeClass("alt");
								 gadgets.window.adjustHeight();
							}
						}
					}
				}
				
				function formatPhone(num) {
					var temp = num.substring(4,5) +" ("+num.substring(5,8)+") "+num.substring(8,11)+"-"+num.substring(11,15);
					return num;
				}				
				
				// General Callbacks
				function loginCallback(result){
					if (result.hasError){
						$("#logged").html("Check your appid, username, and password, and that your application is set up for two legged OAuth");
					} else $("#logged").html("Logged in");
				}
				
				function createCallCallback(result){
					if (result.hasError){
						$("#result").html(result.message);
					}
					else {
						timer = setInterval("getStatuses()", 20000);
						//message = "Created call with id " + result;
						wave.getState().submitDelta({"callId": result, "callInProgress":"true", "timerId":timer, "message":message});
						$("#result").html("Created call with id " + result);
						//document.getElementById("confTop").setAttribute("class","endConf-button");
						//document.getElementById("confBottom").setAttribute("class","endConf-button");
						gadgets.window.adjustHeight();
					}
				}
				
				function muteAllCallback(result) {
					alert(result);
					if (result.hasError) {
						message = result.message;
						$("#result").html(result.message);
						wave.getState().submitDelta({"message":message});
					} else {
						
						message = "Muted all legs";
						$("#result").html(result.message);
						wave.getState().submitDelta({"message":message});
					}
					alert(message);
					gadgets.window.adjustHeight();
				}
				
				function endCallCallback(result){
					if (result.hasError){
						message = result.message;
						wave.getState().submitDelta({"callId": null, "callInProgress":"false", "message":message});
					}
					else {
						message = "Hung up call at "+ new Date();
						changeAllStatus("inactive");
						wave.getState().submitDelta({"callId": null, "callInProgress":"false", "message":message});
						document.getElementById("confTop").setAttribute("class","startConf-button");
						document.getElementById("confBottom").setAttribute("class","startConf-button");
					}
				}
				
				function muteLegCallback(result){
					if (result.hasError){
						alert("Attempt to mute you failed. Mute/Unmute doesn't work "+
						"with less than 3 parties on the line.");
					} else {
						var id = wave.getViewer().getId();
						var muteState = id + "-mute";
						
						var map = new Object();
						map[muteState] = true;
						wave.getState().submitDelta(map);
					}
					gadgets.window.adjustHeight();
				}
				
				function unmuteLegCallback(result){
					if (result.hasError){
						alert("Attempt to unmute you failed. Mute/Unmute doesn't work "+
						"with less than 3 parties on the line.");
					} else {
						var id = wave.getViewer().getId();
						var muteState = id + "-mute";
						
						var map = new Object();
						map[muteState] = false;
						wave.getState().submitDelta(map);
					}
					gadgets.window.adjustHeight();
				}
				
				function holdLegCallback(result){
					if (result.hasError){
						var heldLeg = wave.getState().get("heldLeg");
						message = "Attempt to hold leg ("+heldLeg+") failed";
						alert(message);
						alert(result.message);
						wave.getState().submitDelta({"message":message, "heldLeg":null});
						
					} else {
						var heldLeg = wave.getState().get("heldLeg");
						message = "Put leg ("+heldLeg+") on hold";
						alert(message);
						wave.getState().submitDelta({"message":message, "heldLeg":null});
					}
					gadgets.window.adjustHeight();
				}
				
				function hangUpLegCallback(result){
					if (result.hasError){
						alert('Attempt to drop you from the call failed. \n'+
						'If there are only 2 parties on the call, \n hit End Conference or '+
						'hang up your receiver.');
					} else {
						var callId = wave.getState().get("callId");
						getLegs(callId);
					}
				}
				
				function getStatuses() {
					var id = wave.getState().get("callId");
					if (id != null) {
						var tid = wave.getState().get("timerId");
						if (id != null)
							getLegs(id);
						if (callId == null)
							clearInterval(tid);
					}
				}
				
				function getCallInfoCallback(result) {
					if (result.hasError) {
						alert(result);
					} else {
						var legs = result.legs;
						var activeCount = 0;
						var map = new Object();
						for (var i = 0; i<legs.length; i++) {
							var leg = legs[i];
							var id = findIdByNumber(leg["id"]) +"-status";
							var status = leg["status"];
							var endTime = leg["endTime"];
							map[id] = status;
							//alert(status);
							if (status != "HUNGUP" && status != "FAILURE") {
								activeCount++;
							}	
							
							if (activeCount == 0) {
								endCall();
							}		
						}
						
						wave.getState().submitDelta(map);
					}
				}
				
				function findIdByNumber(num) {
					var keys = wave.getState().getKeys();
					for (var i = 0; i<keys.length; i++) {
						var key = keys[i];
						//alert(key);
						if ( key.endsWith("-num") ) {
							var value = wave.getState().get(key);
							if (value == num) {
								var id = key.split("-num");
								return id[0];
							}
						}
					}
					return null;

				}
				
				function deleteStatuses() {
					var keys = wave.getState().getKeys();
					for (var i = 0; i<keys.length; i++) {
						var key = keys[i];
						if (key.endsWith("-status")) {
							wave.getState().submitDelta({key:null});
						}
					}
				}
				
				function justForTesting() {
					//alert("just for testing");
					//wave.getState().submitDelta({"test1-num":"tel:16504503943", "test2-num":"tel:16504503975", "test3-num":"tel:16504503937"});
				}
				
				function toggleCheckboxes() {
					var boxes = $("input:checkbox");
					if (boxes[0].checked) {
						for (var i = 1; i<boxes.length; i++) {
							var box = boxes[i];
							box.checked = true;
						}
					} else {
						for (var i = 1; i<boxes.length; i++) {
							var box = boxes[i];
							box.checked = false;
						}
					}
				}
				
				function collapse() {
					document.getElementById('collapsedDiv').style.display = 'block';
					document.getElementById('participantInfo').style.display = 'none';
					gadgets.window.adjustHeight();
				}
				
				function expand() {
					document.getElementById('collapsedDiv').style.display = 'none';
					document.getElementById('participantInfo').style.display = 'block';
					gadgets.window.adjustHeight();
				}
				
				function toggleDiv(divId) {
					if (document.getElementById(divId).style.display == 'none') {
						document.getElementById(divId).style.display = 'block';
					} else {
						document.getElementById(divId).style.display = 'none';
					}
					gadgets.window.adjustHeight();
				}
			</script>
			<p></p>

			<div id="logged" style="display:none"></div>
			<div id="collapsedDiv" >
				<div id="expandButton"><a id="expandCollapse"  onClick="expand();"><span style="font-size:1em;decoration:none;">+</span></a></div>
				<div id="collapsedTitle"><span><strong>Conference Gadget-Beta </strong></span></div>
				<div id="numParticipants"><span>X Available Participants</span></div>
				<div id="collapsedPB"><a style="text-decoration:none;" href="http://www.ribbit.com/wave"><img src="http://ribbitwave.appspot.com/images/poweredby.png"/></a></div>
				<div id="collapsedButtons">
					<a id="startCollapsed" class="startConf-button" onclick="startCall();"><span></span></a>
					<a id="muteCollapsed" onClick="muteUnmute();"><span></span></a>
					<a id="endCollapsed" onclick="dropLeg();"><span></span></a>
				</div>
				
			</div>

			<div id="participantInfo" class="stripeMe2">
				<div class="row">
					<div style="position:absolute;top:5px;left:15px"><a onClick="collapse();"><span style="font-size:1.5em;">-</span></a></div>
					<div style="position:absolute;left:40px;">
						<strong>Conference Gadget</strong><br/>
						<input type="checkbox" style="float:left;" id="selectAll" value="select/deselect all" onClick="toggleCheckboxes()">select/deselect all</input>
					</div>
					<a id="confTop" class="startConf-button" onclick="verifyThrottle();"><span></span></a>
					<a id="muteTop"  onclick="muteUnmute();"><span></span>
					<a id="endTop"   onclick="dropLeg();"><span></span>
				</div>
				<div class="row">
					<div style="position:absolute;left:40px;bottom:5px;"><a alt="Get more information about Ribbit on Google Wave." style="text-decoration:none;" href="http://www.ribbit.com/wave"><img src="http://ribbitwave.appspot.com/images/poweredby.png"/></a></div>
					
					<a id="confBottom" class="startConf-button" onclick="verifyThrottle();"><span></span></a>
					<a id="muteBottom"  onClick="muteUnmute();"><span></span></a>
					<a id="endBottom"   onclick="dropLeg();"><span></span></a>
				</div>
			</div>
			<div id="phoneNumDiv" class="phoneNumDiv">
				<div style="position:absolute;right:0;"><a onclick="toggleDiv('phoneNumDiv');" style="decoration:none;">X</a></div>
					Enter your phone number:<br/>

				<input type="text" name="phonenum" size="15" /><br/>
				<a style="width:140px;" id="addNumber" class="addNumber-button" onClick="addMyNumber()"><span></span></a>
			</div>
			
			<div id="result"></div>
			<br/>
			<p>*This gadget is currently in Beta, and system access is limited to ensure a quality experience for all users. If your call cannot be completed, please wait a moment and try again.</p>
			<script type="text/javascript">
				var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
				document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
			</script>

			<script type="text/javascript">
				try {
					var pageTracker = _gat._getTracker("UA-7685495-5");
					pageTracker._trackPageview();
					} catch(err) {}
			</script>
		]]>
	</Content>
</Module>

