$(document).ready(function() 
{
	/** ポップアップヒント表示共通ロジック **/
	// Match all link elements with href attributes within the content div
	$('#inputinfo input').focus(function()
	{
		var viewval = $('#pop_' + $(this).attr("id")).html();
		if(viewval)
		{
			$(this).qtip({
				//content: $(this).html(), // Give it some content, in this case a simple string
				content: viewval, // Give it some content, in this case a simple string
				position: {
					corner: {
						tooltip: 'bottomLeft', // Use the corner...
						target: 'topLeft' // ...and opposite corner
					},
					adjust: { //Object containing sub-options below
							x: 10, //Increment by which to increase the x value of the tooltip coordinate. To decrease, use a minus number. 	Example
							y: -2
					}
				},
				show: {
					when: false, // Don't specify a show event
					ready: true, // Show the tooltip when ready
					effect: {
						type: 'fade',
						length: 100
					}
				},
				//hide: false, // Don't specify a hide event
				hide: {
					when: {
						event: 'unfocus'
					},
					effect: {
						type: 'fade',
						length: 100
					}
				},
				style: {
					background: '#ffffff',
				    color: '#000000',
					border: {
						width: 3,
						radius: 5,
						color: '#ffbe5d'
					},
					padding: 5, 
					textAlign: 'left',
					width: { //Either a number  OR an object containing sub-options below
						min: 100, //Determines the minimum width of the tooltip.
						max: 600 //Determines the maximum width of the tooltip.
					},
					tip: true, // Give it a speech bubble tip with automatic corner detection
					name: 'cream' // Style it according to the preset 'cream' style
					//name: 'dark'
				}
			});
		}
	}).blur(function()
	{
		if($(this).data("qtip")) { $(this).qtip("hide"); }
	});
});


function browsertype()
{
	var userAgent = window.navigator.userAgent.toLowerCase();
	var appVersion = window.navigator.appVersion.toLowerCase();

	if (userAgent.indexOf("msie") > -1) {
		if (appVersion.indexOf("msie 6.0") > -1) {
			return "IE6";
		}
		else if (appVersion.indexOf("msie 7.0") > -1) {
			return "IE7";
		}
		else if (appVersion.indexOf("msie 8.0") > -1) {
			return "IE8";
		}
		else {
			return "Unknown";
		}
	}
	else if (userAgent.indexOf("firefox") > -1) {
		return "Firefox";
	}
	else if (userAgent.indexOf("opera") > -1) {
		return "Opera";
	}
	else if (userAgent.indexOf("chrome") > -1) {
		return "Google Chrome";
	}
	else if (userAgent.indexOf("safari") > -1) {
		return "Safari";
	}
	else {
		return "Unknown";
	}
}