// For use within normal web clients 
var isiPad = null;
isipad = navigator.userAgent.match(/iPad/i) != null;

//iPhone detection
var isiPhone = null;
isiPhone = navigator.userAgent.match(/iPhone/i) != null;

// For use within iPad developer UIWebView
if(isipad != false){
	var ua = navigator.userAgent;
	isiPad = /iPad/i.test(ua) || /iPhone OS 3_1_2/i.test(ua) || /iPhone OS 3_2_2/i.test(ua);
}
