function showTab(tab)
{
    if(tab == 'descriptionTab')
    {
        var description = findObj('descriptionTab');
        description.src = '/images/new/pdt/description_selected.jpg';
        var specification = findObj('specificationsTab');
        specification.src = '/images/new/pdt/specifications_normal.jpg';
        var descriptionContent = findObj('tabDescriptionContent');
        descriptionContent.style.display = 'block';
        descriptionContent.style.visibility = 'visible';
        var specificationContent = findObj('tabSpecificationsContent');
        specificationContent.style.display = 'none';
        specificationContent.style.visibility = 'hidden';        
    }
    else if(tab == 'specificationsTab')
    {
        var description = findObj('descriptionTab');
        description.src = '/images/new/pdt/description_normal.jpg';
        var specification = findObj('specificationsTab');
        specification.src = '/images/new/pdt/specifications_selected.jpg';
        var descriptionContent = findObj('tabDescriptionContent');
        descriptionContent.style.display = 'none';
        descriptionContent.style.visibility = 'hidden';
        var specificationContent = findObj('tabSpecificationsContent');
        specificationContent.style.display = 'block';
        specificationContent.style.visibility = 'visible';         
    }
}

function swapImage(imgSrc)
{
    var image = findObj('ImageMain');
    image.src = imgSrc;
}

function showPopupWindow(id) {
	showPopupLayer('popupbox');
	showPopupLayer('popupshim');
	var width = getViewportWidth();
	var height = getViewportHeight();
	document.getElementById('popupbox').style.left = (width/2)-250+'px';
	document.getElementById('popupshim').style.left = (width/2)-250+'px';
	document.getElementById('popupbox').style.top = ((height/2)-185)+document.documentElement.scrollTop+'px';
	document.getElementById('popupshim').style.top = ((height/2)-185)+document.documentElement.scrollTop+'px';
	switch(id) {
	    case 'flex':
		    frames['popupframe'].location.href="/products/assets/flex.aspx";
		    document.getElementById('popuptitle').innerHTML = 'What flex should I select?';
			break;
	    case 'length':
		    frames['popupframe'].location.href="/products/assets/length.aspx";
		    document.getElementById('popuptitle').innerHTML = 'What length should I select?';
			break;
		case 'lie':	
		    frames['popupframe'].location.href="/products/assets/length.aspx";
		    document.getElementById('popuptitle').innerHTML = 'What lie should I select?';
			break;
		case 'gripsize':	
		    frames['popupframe'].location.href="/products/assets/gripsize.aspx";
		    document.getElementById('popuptitle').innerHTML = 'What grip size should I select?';
			break;	
		case 'victory':	
		    frames['popupframe'].location.href="/products/assets/victory.aspx";
		    document.getElementById('popuptitle').innerHTML = 'Victory Tour Fit Service';
			break;
		case 'headcover':	
		    frames['popupframe'].location.href="/products/assets/headcover.aspx";
		    document.getElementById('popuptitle').innerHTML = 'Headcover';
			break;	
		case 'balance':	
		    frames['popupframe'].location.href="/products/assets/balance.aspx";
		    document.getElementById('popuptitle').innerHTML = 'Balance Certified';
			break;
		case 'balanceputter':	
		    frames['popupframe'].location.href="/products/assets/balance.aspx?view=putter";
		    document.getElementById('popuptitle').innerHTML = 'Balance-Certified';
			break;	
		case 'balancevideo':	
		    frames['popupframe'].location.href="/products/assets/balancevideo.aspx";
		    document.getElementById('popuptitle').innerHTML = 'Balance-Certified';
			break;		
		case 'spinefrequency':	
		    frames['popupframe'].location.href="/products/assets/spinefrequency.aspx";
		    document.getElementById('popuptitle').innerHTML = 'Spine Alignment/Frequency Matching';
			break;	
		case 'toursoft':	
		    frames['popupframe'].location.href="/products/assets/toursoft.aspx";
		    document.getElementById('popuptitle').innerHTML = 'Tour Soft Inserts';
			break;	
		case 'victorycomponent':	
		    frames['popupframe'].location.href="/products/assets/victorycomponent.aspx";
		    document.getElementById('popuptitle').innerHTML = 'Victory Tour Service';
			break;			
	    case 'grandopen':
		    frames['popupframe'].location.href="/vcg/grandopen.aspx";	
		    document.getElementById('popuptitle').innerHTML = 'Grand Opening Special';
			break;
	    case 'holiday':
		    frames['popupframe'].location.href="/vcg/holiday.aspx";	
		    document.getElementById('popuptitle').innerHTML = 'Holiday Special';
			break;		
	    case 'newyear':
		    frames['popupframe'].location.href="/vcg/newyear.aspx";	
		    document.getElementById('popuptitle').innerHTML = 'New Year Special';
			break;		
	    case 'taxreturn':
		    frames['popupframe'].location.href="/vcg/taxreturn.aspx";	
		    document.getElementById('popuptitle').innerHTML = 'Tax Return Special';
			break;	
	    case 'taxspecial':
		    frames['popupframe'].location.href="/vcg/taxreturn.aspx";	
		    document.getElementById('popuptitle').innerHTML = 'Tax Return Special';
			break;		
	    case 'madness':
		    frames['popupframe'].location.href="/vcg/madness.aspx";	
		    document.getElementById('popuptitle').innerHTML = 'March Madness Special';
			break;	
	    case 'golfseason':
		    frames['popupframe'].location.href="/vcg/golfseason.aspx";	
		    document.getElementById('popuptitle').innerHTML = 'Golf Season Special';
			break;
	    case 'fathersday':
		    frames['popupframe'].location.href="/vcg/fathersday.aspx";	
		    document.getElementById('popuptitle').innerHTML = 'Fathers Day Special';
			break;	
	    case 'summer':
		    frames['popupframe'].location.href="/vcg/summer.aspx";	
		    document.getElementById('popuptitle').innerHTML = 'Summer Golf Promotion';
			break;
	    case 'july':
		    frames['popupframe'].location.href="/vcg/july.aspx";	
		    document.getElementById('popuptitle').innerHTML = 'Fourth of July Special';
			break;	
	    case 'open':
		    frames['popupframe'].location.href="/vcg/openchampionship.aspx";	
		    document.getElementById('popuptitle').innerHTML = 'The Open Championship Promotion';
			break;	
	    case 'appreciation':
		    frames['popupframe'].location.href="/vcg/appreciation.aspx";	
		    document.getElementById('popuptitle').innerHTML = 'Customer Appreciation Special';
			break;																																																							        
		default:
		    frames['popupframe'].location.href="about:blank";		    		    
			break;
	}		
}
function hidePopupWindow() {
    frames['popupframe'].location.href="about:blank";	
	hidePopupLayer('popupbox');
	hidePopupLayer('popupshim');
	frames['popupframe'].location.href="about:blank";	
}

getViewportWidth = function() {
  var width = 0;
  if( document.documentElement && document.documentElement.clientWidth ) {
    width = document.documentElement.clientWidth;
  }
  else if( document.body && document.body.clientWidth ) {
    width = document.body.clientWidth;
  }
  else if( window.innerWidth ) {
    width = window.innerWidth - 18;
  }
  return width;
};

getViewportHeight = function() {
  var height = 0;
  if( document.documentElement && document.documentElement.clientHeight ) {
    height = document.documentElement.clientHeight;
  }
  else if( document.body && document.body.clientHeight ) {
    height = document.body.clientHeight;
  }
  else if( window.innerHeight ) {
    height = window.innerHeight - 18;
  }
  return height;
};

function showPopupLayer(id) {
	var layer = new Object();
	if(document.getElementById) {
		layer = document.getElementById(id);
	}
	else if(document.all) {
		layer = document.all[id];
	}
	
	else if(document.layers) {
		layer = document.layers[id];
	}
	layer.style.visibility = "visible";
	layer.style.display = "block";
}

function hidePopupLayer(id) {
	var layer = new Object();
	if(document.getElementById) {
		layer = document.getElementById(id);
	}
	else if(document.all) {
		layer = document.all[id];
	}
	
	else if(document.layers) {
		layer = document.layers[id];
	}
	layer.style.visibility = "hidden";
	layer.style.display = "none";	
}
