// j.stelzer [A T] autotoursusa.com
// autotoursusa.com
// -------------------------------------------------

function init() {}

// --- Mostly useless eye-candy --------------------

// change style by id
function changeStyleById(id,prop,newStyle) { 
   	document.getElementById(id).style[prop] = newStyle;
} 

function clearFormField(theText){
	if (theText.value == theText.defaultValue) {
		theText.value = "";
	} else if (theText.value == "") {
		theText.value = theText.defaultValue;
	}
}

function showPricePanel(panel){
	try { document.getElementById('budget-rate').className = ''; } catch(any) {}
	try { document.getElementById('budget-prices').style['display'] = 'none'; } catch(any) {}
	try { document.getElementById('standard-rate').className = ''; } catch(any) {}
	try { document.getElementById('standard-prices').style['display'] = 'none'; } catch(any) {}
	try { document.getElementById('superior-rate').className = ''; } catch(any) {}
	try { document.getElementById('superior-prices').style['display'] = 'none'; } catch(any) {}
	try { document.getElementById('delux-rate').className = ''; } catch(any) {}
	try { document.getElementById('delux-prices').style['display'] = 'none'; } catch(any) {}
	if (panel == 'budget') {
		document.getElementById('budget-rate').className = 'current';
		document.getElementById('budget-prices').style['display'] = 'block';
	}
	if (panel == 'standard') {
		document.getElementById('standard-rate').className = 'current';
		document.getElementById('standard-prices').style['display'] = 'block';
	}
	if (panel == 'superior') {
		document.getElementById('superior-rate').className = 'current';
		document.getElementById('superior-prices').style['display'] = 'block';
	}
	if (panel == 'delux') {
		document.getElementById('delux-rate').className = 'current';
		document.getElementById('delux-prices').style['display'] = 'block';
	}
}

$(function(){
	/* --- tracking ------------------------------------ */
	$('a').click(function(){
		var link_id = $(this).attr('name');
		if (link_id == ""){
			link_id = 'undefined_click';
		}
		if(link_id != 'undefined_click'){
			try{
				pageTracker._trackPageview('/test/'+link_id);
			} catch(err){}	
		}
	});	
});


