// <script>

function troubleshoot() {
	hide_tabs();
	hide_support_images();
	$('troubleshoot').style.display = 'block';
	$('t_img').src = '../images/support/troubleshootHover.png';
}
function repair() {
	hide_tabs();
	hide_support_images();
	$('repair').style.display = 'block';
	$('r_img').src = '../images/support/repairHover.png';
}
function warranty() {
	hide_tabs();
	hide_support_images();
	$('warranty').style.display = 'block';
	$('w_img').src = '../images/support/warrantyHover.png';
}
function parts() {
	hide_tabs();
	hide_support_images();
	$('parts').style.display = 'block';
	$('p_img').src = '../images/support/replacementPartsHover.png';
}

function hide_tabs() {
	$('troubleshoot').style.display = 'none';
	$('parts').style.display = 'none';
	$('repair').style.display = 'none';
	$('warranty').style.display = 'none';
}
function hide_support_images() {
	$('t_img').src = '../../images/support/troubleshoot.png';
	$('r_img').src = '../../images/support/repair.png';
	$('w_img').src = '../../images/support/warranty.png';
	$('p_img').src = '../../images/support/replacementParts.png';
}



/* ********************************************************* REPAIR TAB ************************************************************************/
function validate_part_search(form) {
	bool = true;
	if ( form.model_searched.value=='') {
		form.model_searched.style.backgroundColor = '#f9a5a5';
		$('err_model_searched').innerHTML = '&nbsp;Enter model number';
		bool=false;
	} else {
		form.model_searched.style.backgroundColor = '#fff';
		$('err_model_searched').innerHTML = '';
	}
	return bool;
}


/* ********************************************************* SUPPORT TAB ************************************************************************/

function toggleOptionDisp() {
    for (var i=0;i<arguments.length;i++){
        var d = $(arguments[i]);
        if (d.style.display == 'none')
            d.style.display = 'block';
        else
            d.style.display = 'none';
    }
}

function toggleOptionTab(num,numelems,opennum) {
    if ($('tab'+num).style.display == 'none'){
        for (var i=1;i<=numelems;i++){
            if ((opennum == null) || (opennum != i)){
                var temph = 'tab_title_'+i;
                var h = $(temph);
                if (!h){
                    var h = $('tab_title_active');
                    h.id = temph;
                }
                var tempc = 'tab'+i;
                var c = $(tempc);
                if(c.style.display != 'none'){
                        toggleOptionDisp(tempc);
                }
            }
        }
        var h = $('tab_title_'+num);
        if (h)
            h.id = 'tab_title_active';
        h.blur();
        var c = $('tab'+num);
        c.style.marginTop = '2px';
		toggleOptionDisp('tab'+num);

    }
}

