function calc() {
	var wid = document.getElementById("wid").value;
	var hgt = document.getElementById("hgt").value;
	
	wid = str_replace(" ", "", wid);
	hgt = str_replace(" ", "", hgt);
	wid = str_replace("'", "", wid);
	hgt = str_replace("'", "", hgt);
	wid = str_replace(",", ".", wid);
	hgt = str_replace(",", ".", hgt);
	
	wid = parseInt(wid);
	hgt = parseInt(hgt);

	var smaller = wid;
	if (hgt < wid) { smaller = hgt; }
	
	if (smaller > 1100) {
		alert("PrintWild can print your image any length, as long as the width is 1.1m or smaller.  \nPlease ensure one of your dimensions is smaller than 1100mm.");
		slideup('prods');
	} else {
		document.getElementById("p1").innerHTML = "R" + get_price('Canvas stretched frame', wid, hgt, 1);
		document.getElementById("p2").innerHTML = "R" + get_price('Acrylic print', wid, hgt, 1);
		document.getElementById("p3").innerHTML = "R" + get_price('Box frames', wid, hgt, 1);
		document.getElementById("p4").innerHTML = "R" + get_price('Loose glossy print', wid, hgt, 1);
		document.getElementById("p5").innerHTML = "R" + get_price('Loose canvas print', wid, hgt, 1);
		document.getElementById("p6").innerHTML = "R" + get_price('Mounted gloss print', wid, hgt, 1);

		document.getElementById("widd").innerHTML = wid;
		document.getElementById("hgtt").innerHTML = hgt;
	
		slidedown('prods');
	}
}


function str_replace(search, replace, subject) {
    var f = search, r = replace, s = subject;
    var ra = is_array(r), sa = is_array(s), f = [].concat(f), r = [].concat(r), i = (s = [].concat(s)).length;
 
    while (j = 0, i--) {
        while (s[i] = s[i].split(f[j]).join(ra ? r[j] || "" : r[0]), ++j in f){};
    };
     
    return sa ? s : s[0];
}

function is_array( mixed_var ) {
    return ( mixed_var instanceof Array );
}