/*
 * 
 * Copyright © 2012 All Rights Reserved, http://simpletrees.co.uk
 * 
 * NOTICE:  All information contained herein is, and remains the property 
 * of Simple Trees Ltd and its suppliers, if any. The intellectual and 
 * technical concepts contained herein are proprietary to Simple Trees Ltd 
 * and its suppliers and may be covered by UK, EU and Foreign Patents, 
 * patents in process, and are protected by copyright law. Dissemination of 
 * this information or reproduction of this material is strictly forbidden
 * unless prior written permission is obtained from Simple Trees Ltd. 
 *
 * This version of the product and all associated intellectual/technical
 * concepts are intended for demo purposes only and not for resale.
 *
 * Contact conor@simpletrees.com for license agreements or more details.
 *
 */

/*
 * This requires the crmhelper.js to run some functions
 */

function refreshTrafficLights(webResourceName) {
	var controls = Xrm.Page.ui.controls.get();
	for (var i in controls) {
		if (controls[i].getName().toLowerCase() == webResourceName.toString().toLowerCase()) {
			controls[i].getObject().contentWindow.refresh();
			return;
		}
		if (controls[i].getName().toLowerCase() == "webresource_" + webResourceName.toString().toLowerCase()) {
			controls[i].getObject().contentWindow.refresh();
			return;
		}
		if (controls[i].getName().toLowerCase() == "webresource" + webResourceName.toString().toLowerCase()) {
			controls[i].getObject().contentWindow.refresh();
			return;
		}
	}
}
