function getProp(obj,prop) {
	if(window.getComputedStyle) {
		compStyle = window.getComputedStyle(obj,null);
		return parseInt(compStyle[prop],10);
	} else if (obj.currentStyle) {
		return parseInt(obj.currentStyle[prop],10);
	} else {
		return parseInt(obj.style[prop],10);
	}
}
function openService(obj) {
	var selValue = obj.options[obj.selectedIndex].value;
	window.open(selValue);
	obj.selectedIndex = 0;
}
function body_load() {
	if (document.getElementById("pod_a_item_1")) {
		autoPlayPods("a");
	}
	if (document.getElementById("pod_b_item_1")) {
		autoPlayPods("b");
	}
}
function popDemo() {
	window.open('docs/pop/mc.swf',"demo_swf","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=800,height=600");
}


var pod_nums = {
	a_curr : 1,
	b_curr : 1,
	a_tot : 0,
	b_tot : 0,
	a_stop : false,
	b_stop : false
}

function swapPods(idx,i) {
	pod_nums[idx+"_curr"] = i;
	var cur = i;
	// cast_nums, cast_text, cast_link
	document.getElementById("pods_section_"+idx).innerHTML = document.getElementById("pod_"+idx+"_item_"+i).innerHTML;
	document.getElementById("pods_nums_"+idx).innerHTML = cur+" of "+pod_nums[idx+"_tot"];
	
	
}
function nextPods(idx) {
	var curr = pod_nums[idx+"_curr"];
	var tot = pod_nums[idx+"_tot"];
	if (curr == tot) {
		curr = 1;
	} else {
		curr += 1;
	}
	swapPods(idx,curr);
}
function prevPods(idx) {
	var curr = pod_nums[idx+"_curr"];
	var tot = pod_nums[idx+"_tot"];

	if (curr == 1) {
		curr = tot;
	} else {
		curr -= 1;
	}
	swapPods(idx,curr);
}

function stopAuto(idx) {
	pod_nums[idx+"_stop"] = true;
}

function autoPlayPods(idx) {
	setTimeout("autoNextPods('"+idx+"')",6000);
}

function autoNextPods(idx) {
	if (pod_nums[idx+"_stop"] == false) {
		nextPods(idx);
		setTimeout("autoNextPods('"+idx+"')",6000);
	}
}