/**
* This function loads the offerings json file into a JS var
* @author: rrobles
* @copyright: Domaingurus 2011
*/
var offerings ;
var buyDomain = 'https://www.domaingurus.com/';
function getBuyUrl(serverInfo) {
	url = serverInfo.buy_url_value
	if (serverInfo.uses_ibizproduct == 'yes') {
		return url;
	} else {
		url += '\&attrib_cpu_type=' + serverInfo.cpu;
		url += '\;attrib_ram_size=' + serverInfo.ram;
		url += '\;attrib_disk1_size=' + serverInfo.storage;
		url += '\;attrib_bandwidth_plan=' + serverInfo.bandwidth;
		url += '\;attrib_interface_speed=' + serverInfo.port;
		url += '\;attrib_os_name=' ;
		url += '\;attrib_control_panel=' ;
		return url;
	}	
}

function getBuyLink(serverInfo, tagValue) {
	return '<a href="'+buyDomain+getBuyUrl(serverInfo)+'" >'+tagValue+'</a>';
}

function getImageTag(src) {
	return '<img src="'+src+'" alt="no-image"/>';
}

$(function(){
	protocol = document.location.protocol;
	$.ajax({
		url: protocol+'//www.domaingurus.com/offerings.json',
		dataType: 'json',
		async: false,
		success: function(response){
			offerings = response.list;
			
		}
	});
	
});

