function update_images(dept_img,dept_id){
document.getElementById('home_image').src= "images/gallery_departments/"+dept_img+""
document.getElementById('dept_'+dept_id).className='switch_bg'
}

function image_reset(dept_img,dept_id){
document.getElementById('home_image').src= "images/gallery_departments/"+dept_img+""
document.getElementById('dept_'+dept_id).className=''
}

function clear_field(the_text,the_element){
	if (document.getElementById(the_element).value==the_text)
		{
			document.getElementById(the_element).value=''
		}
}

if (typeof String.prototype.trim !== 'function') {
    String.prototype.trim = function () {
        return this.replace(/^\s+|\s+$/g, '');
    }
}

function display_tab(product_id,the_tab){
var tab 

if(the_tab==1){
tab='tab_details'}

if(the_tab==2){
tab='tab_compatibility'}

if(the_tab==3){
tab='tab_similar'}

document.getElementById('tab_details').className='pd_tab_off'
document.getElementById('tab_compatibility').className='pd_tab_off'
document.getElementById('tab_similar').className='pd_tab_off'
document.getElementById(tab).className='pd_tab_on'

document.getElementById('pt_updatater').contentWindow.location.replace('http://dev.blueswitch.com/cwg/pd_updater.asp?product_id='+product_id+'&tab='+the_tab)
}


function submit_form()
{
document.getElementById('final_submit').value='1';
//document.purchase_order_form.submit();
}


function submit_shipping_change() {
    if (on_shipping_change) {
        try {
            on_shipping_change();
        }
        catch (ex) { }
    }
    
    document.getElementById('placeorder').disabled=true;
    document.getElementById('update_shipping').value='1'
    document.purchase_order_form.submit()
}

function display_adv_search(){
document.getElementById('adv_search').style.display='block'
}
