function load(type) {
	var url = 'http://dev.connectamillionminds.com/widget.php';
	var width = '160';
	var height = '433';
	var target = '';
	
	// Test for target
	if (!document.getElementById('camm_widget')) {
		alert('CAMM Widget: Your widget code appears to be broken.');
		return false;
	}
	
	// Set Widget Type
	if (type && type == 'wide') {
		url = url+'?t=wide';
		width = '300';
		height = '378';
	} else {
		url = url+'?t=thin';
		width = '160';
		height = '433';
	}
	
	// Determine Embed Location
	if (window.location) {
		target = window.location;
		url = url+'&l='+encodeURI(target);
	}
	
	// Set Widget Properties
	var div = document.getElementById('camm_widget');
	var iframe = document.createElement('iframe');
	iframe.setAttribute('name','camm_iframe');
	iframe.setAttribute('src',url);
	iframe.setAttribute('width',width);
	iframe.setAttribute('height',height);
	iframe.setAttribute('scrolling','no');
	iframe.frameBorder = 0;
	iframe.setAttribute('style','margin: 0; padding: 0; border: 1px solid #dbdbdb; overflow: hidden;');
	iframe.setAttribute('longdesc',target);
	div.appendChild(iframe);
}

load(camm_widget_type);
