function updatePrice(){
	var form=$('order_form');
	var div=$('order_price');
	var url    = '/inc/order_price.php';
	
	div.innerHTML='';
	
	div.addClass('loading');
	
	new Ajax(url, {
		update: div,
		method: 'post',
		postBody: form,
		onComplete: function(){
			div.removeClass('loading');
		}
	}).request();
}

function postForm(form, url){
	var div=$(form+'_div');
	var form=$(form);
			
	form.setProperty('action', url);
	
	div.addClass('loading');
	
	form.send({
		update: div,
		evalScripts: true,
		onComplete: function() {
			div.removeClass('loading');
		}
	});
}

function website(url){
	popupWindow = window.open(url, '_blank','');
	popupWindow.focus();
}

function external(){
	if (!document.getElementsByTagName){ return; }
	var anchors = document.getElementsByTagName('a');

	for (var i=0; i<anchors.length; i++){
		var anchor = anchors[i];
		
		var relAttribute = String(anchor.getAttribute('rel'));
		
		if (anchor.getAttribute('href')){
			if(relAttribute=='external'){
				anchor.onclick = function() {
					website(this);
					return false;
				};
			} else if(relAttribute=='track'){
				anchor.onclick = function() {
					pageTracker._trackPageview('/outgoing/2degreesmobile.co.nz');
					website(this);					
					return false;
				};				
			}
		}
	}
}

window.onload=external;