var xmlHttp;

function isEmailAddr(Email) {
 	var result = false
 	var theStr = new String(Email)
	var index = theStr.indexOf("@");
	if (index > 0) {
    var pindex = theStr.indexOf(".",index);
    if ((pindex > index+1) && (theStr.length > pindex+1))
 	result = true;
  }
 return result;
}

function ajax_prep(x) {
	var str = x;
	str = str.replace(/#/gi, "%23");
	str = str.replace(/\+/gi, "%2B");
	str = str.replace(/\n/gi, "-BREAK-");
	str = escape(str);
	return str;
}

function GetXmlHttpObject() {
	var xmlHttp = null;
	try {xmlHttp=new XMLHttpRequest();} 
	catch (e) {
		try {xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");}
		catch (e) {xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");}
	}
	return xmlHttp;
}

$(document).ready(function() {
	$("#class_schedule_link").qtip({
		content: '<div><a href="/class-schedule/fall.php" class="qtip_link">Westmont Fall Schedule</a></div><div><a href="/class-schedule/lyons.php" class="qtip_link">Lyons Fall Schedule</a></div><div><a href="/class-schedule/" class="qtip_link">Westmont Summer Schedule</a></div>',
		position: {
			corner: {
				target: 'topRight',
				tooltip: 'bottomLeft'
			},
			adjust: { x: -45, y: 15 }
		},
		show: { delay: 0 },
		hide: { fixed: true, delay: 500 },
		style: { 
			width: { min: 80, max: 400 },
			padding: 5,
			background: '#caee9a',
			color: 'black',
			textAlign: 'center',
			border: {
				width: 6,
				radius: 5,
				color: '#000'
			},
			tip: 'bottomLeft',
			name: 'dark'
		}
	});
	
	$(".class_schedule_link_right1").qtip({
		content: '<div><a href="https://app.jackrabbitclass.com/reg.asp?id=503918" target="_blank" class="qtip_link">Westmont Fall Schedule</a></div><div><a href="https://app.jackrabbitclass.com/reg.asp?id=503918" target="_blank" class="qtip_link">Lyons Fall Schedule</a></div>',
		position: {
			corner: {
				target: 'bottomLeft',
				tooltip: 'topRight'
			},
			adjust: { x: 45, y: -15 }
		},
		show: { delay: 0 },
		hide: { fixed: true, delay: 500 },
		style: { 
			width: { min: 80, max: 350 },
			padding: 5,
			background: '#caee9a',
			color: 'black',
			textAlign: 'center',
			border: {
				width: 6,
				radius: 5,
				color: '#000'
			},
			tip: 'topRight',
			name: 'dark'
		}
	});
	
	$(".class_schedule_link_right2").qtip({
		content: '<div><a href="https://app.jackrabbitclass.com/reg.asp?id=503918" class="qtip_link">Westmont Summer Schedule</a></div><div><a href="https://app.jackrabbitclass.com/reg.asp?id=503918" target="_blank" class="qtip_link">Westmont Fall Schedule</a></div><div><a href="https://app.jackrabbitclass.com/reg.asp?id=503918" target="_blank" class="qtip_link">Lyons Fall Schedule</a></div>',
		position: {
			corner: {
				target: 'bottomLeft',
				tooltip: 'topRight'
			},
			adjust: { x: 12, y: -4 }
		},
		show: { delay: 0 },
		hide: { fixed: true, delay: 500 },
		style: { 
			width: { min: 80, max: 350 },
			padding: 5,
			background: '#caee9a',
			color: 'black',
			textAlign: 'center',
			border: {
				width: 6,
				radius: 5,
				color: '#000'
			},
			tip: 'topRight',
			name: 'dark'
		}
	});
});

