function toggle_tabs(row_base_id,row_show_id,rows)
{	
	show_row_id = row_base_id + "_show_" + row_show_id;
	obj_show = document.getElementById(show_row_id);
	for(i=0; i<=rows; i++) {
		row_id = row_base_id + "_show_" + i;
		obj = document.getElementById(row_id);
		row_id2 = row_base_id + "_button_" + i;
		obj2 = document.getElementById(row_id2);
		if (row_id == show_row_id) {
			obj.style.display='';
			obj2.className='tab_on';
		}
		else {
			obj.style.display='none';
			obj2.className='tab';
		}
	}
}

// show/hide rows
function toggle_rows(row_base_id,row_show_id,rows)
{	
	show_row_id = row_base_id + "_" + row_show_id;
	obj_show = document.getElementById(show_row_id);
	for(i=1; i<=rows; i++) {
		row_id = row_base_id + "_" + i;
		obj = document.getElementById(row_id);
		if (row_id == show_row_id) {
			obj.style.display='';
		}
		else {
			obj.style.display='none';
		}
	}
}

// switch the show/hide state of two IDs
function toggle_switch(show_id,hide_id) {
	document.getElementById(show_id).style.display = 'none';
	document.getElementById(hide_id).style.display = '';
}

// Simple show/hide
function toggle_simple(id)
{
	var obj = document.getElementById(id);
	if (obj.style.display == '')
	{
		obj.style.display='none';
	}
	else
	{
		obj.style.display='';
	}
}

// ?
function toggle(id,status)
{
	var obj = document.getElementById(id);
	if (obj.style.display == '' && status == 'off')
	{
		obj.style.display='none';
	}
	else if (obj.style.display == 'none' && status == 'on')
	{
		obj.style.display='';
	}
}

// ?
function product_usage_select(prod_use_count) {	
	for(i=0; i<=prod_use_count; i++) {
		if (document.getElementById('product_usage_select').options[i].selected && document.getElementById('product_usage_select').options[i].value == i) {
			document.getElementById('prod_' + i).style.display = '';
		}
		else {
			document.getElementById('prod_' + i).style.display = 'none';
		}
	}
}

// Used on the contact us form
function check_subject() {
	subject_id = document.getElementById('destination');
	subject_value = subject_id.options[subject_id.selectedIndex].value;
	if (subject_value == '4') {
		alert("Please note: Return requests cannot be accepted via email at this time. \nPlease contact us by phone (listed above).");
		subject_id.selectedIndex = 0;
	}
}

// Clear form's default form value
function clearText(thefield){
	if (thefield.defaultValue==thefield.value) {
		thefield.value = ""
	}
}

Global = {
	FixPng: function( img ){
		if(document.all){
			img.parentNode.style.width = img.offsetWidth;
			img.parentNode.style.height = img.offsetHeight;
			img.parentNode.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=scale src='"+ img.src +"')"
		} else {
			img.style.visibility = "visible"
		}
	}
}