/*
 * Tooltip script 
 * powered by jQuery (http://www.jquery.com)
 * 
 * written by Alen Grakalic (http://cssglobe.com)
 * 
 * for more info visit http://cssglobe.com/post/1695/easiest-tooltip-and-image-preview-using-jquery
 *
 */
 
 var s1 = "<span class='tooltip-popup'>Onsite OG<i>sql</i> &nbsp; Installation</span><br /><br />We expedite the installation process by visiting our clients and helping them organize their data and prepare it for electronic conversion into OG<i>sql</i>. <br /><br /> We go on to project manage the conversion process and assist clients with system set up. <br /><br><a href='mailto:support@ogsys.com?subject=Onsite OGsql Installation'>Schedule this Service Now.</a>";
 var s2 = "<span class='tooltip-popup'>Training</span><br /><br>OG<i>sys</i> software training seminars are offered at our corporate office in Fort Worth at no extra charge to clients currently in a Support agreement.  <br><br>Clients may also schedule personalized, onsite training at their location for an additional fee.  Please allow a minimum of two weeks prior notice to schedule on-site training.   <br><br>Online classes are also available upon request. <br><br><a href='mailto:training@ogsys.com?subject=Training'>Schedule this Service Now.</a>";
 var s3 = "<span class='tooltip-popup'>Consulting</span><br />Our OG<i>sys</i> Certified Consultants provide our clients with unparalleled expertise in a wide range of areas including: <br><br />- Process Improvement <br />- Audit Preparation Assistance <br />- Divestiture Projects <br />- Acquisition Conversion Assistance <br />- Reorganization Projects <br />- System Conversion and Implementation<br><br><a href='mailto:administration@ogsys.com?subject=Consulting'>Schedule this Service Now.</a>";
 var s4 = "<span class='tooltip-popup'>Customized Software Enhancements</span><br /><br />OG<i>sys</i> will customize software to meet individual client requirements.  <br /><br /><a href='mailto:support@ogsys.com?subject=Customized Software Enhancements'>Schedule this Service Now.</a>";
 var s5 = "<span class='tooltip-popup'>Onsite DocVue Installation</span><br /><br />We make sure our clients understand how to optimize their software by helping them create electronic workflow documentation and personally training users on the DocVue system.<br /> <br><a href='mailto:support@ogsys.com?subject=Onsite DocVue Installation'>Schedule this Service Now.</a>";
 var s6 = "<span class='tooltip-popup'>Two Days of Onsite Consulting</span><br /><br /><b>Have you ever wondered if you are getting the most out of OG<i>sql</i>?</b>  <br><br>OG<i>elite</i> clients are entitled to an onsite visit by one of our OG<i>sys</i> consultants.  During this 2 day onsite visit, we will review your processes to make sure you are maximizing the powerful product that is OG<i>sql</i> and operating under best practices for your company’s success.  The consulting days are included in the OG<i>elite</i> package; travel expenses are an additional charge.";
 var s7 = "<span class='tooltip-popup'>40 Hours of Professional Customization Services</span><br /><br /><b>Would you like to customize an OG<i>sql</i> report?</b> <br><br> OG<i>elite</i> clients have access to 40 hours of professional services for custom reporting.  And, if this is not enough, you also receive a discount on hours over the included amount.   Our OG<i>sql</i> consultants will help you design the right reports to meet your needs.";
 var s8 = "<span class='tooltip-popup'>Assigned OG<i>sys</i>&nbsp; Account Manager</span><br /><br /><b>Do you need an OG<i>sql</i> expert on your team?</b> <br><br> When you have questions, we accelerate answers. OG<i>elite</i> offers an assigned account manager who knows your company, your profile and history at an instant.  With this knowledge, new enhancements and OG<i>sql</i> industry changes are promptly offered, so you are certain that your operations environment is optimized.  Think of your account manager as your partner in success. ";
 var s9 = "<span class='tooltip-popup'>Scheduled Weekend Access to Support Team</span><br /><br /><b>Do you ever need OG<i>sys</i> support on Saturday or Sunday?</b>  <br><br>OG<i>elite</i> clients can schedule support on the weekend.  This means that if you are performing critical updates or processing on the weekend, you can have access to our world-class OG<i>elite</i> support team.";
 var s10 = "<span class='tooltip-popup'>Scheduled After Hours Access to Support Team</span><br /><br /><b>Do you ever need OG<i>sys</i> support after hours?</b>  <br><br>OG<i>elite</i> clients can schedule support before or after standard business hours.  This means that if you are performing critical updates or processing after hours, you can have access to our world-class OG<i>elite</i> support.";
 var s11 = "<span class='tooltip-popup'>Discount on Professional Service Hours</span><br /><br /><b>Need additional professional service hours?</b>  <br><br>OG<i>elite</i> clients have access to 40 hours of professional services for custom reporting.  And if this is not enough, you also receive a discount on hours over the included amount.   ";

this.tooltip = function(){	
	/* CONFIG */		
		xOffset = 25;
		yOffset = 30;		
		axOffset = -15; /* Arrow */
		ayOffset = -30;		
		// these 2 variable determine popup's distance from the cursor
		// you might want to adjust to get the right result		
	/* END CONFIG */		
	$("a.tooltip").hover(function(e){											  
		if(this.id=="s1")			
			this.t = s1;
		else if(this.id=="s2")			
			this.t = s2;
		else if(this.id=="s3")			
			this.t = s3;
		else if(this.id=="s4")			
			this.t = s4;
		else if(this.id=="s5")			
			this.t = s5;
				else if(this.id=="s6")			
			this.t = s6;
			else if(this.id=="s7")			
			this.t = s7;
		else if(this.id=="s8")			
			this.t = s8;
		else if(this.id=="s9")			
			this.t = s9;
			else if(this.id=="s10")			
			this.t = s10;
			else if(this.id=="s11")			
			this.t = s11;
		
					
		//this.title = "";		
		
		$("#tooltip").remove();
		$("#tooltip-arrow").remove();
									  
		$("body").append("<p id='tooltip'>"+ this.t +"</p>");
		$("#tooltip")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px")
			.fadeIn("fast");		
			
		$("body").append("<p id='tooltip-arrow'></p>");
		$("#tooltip-arrow")
			.css("top",(e.pageY - xOffset - axOffset) + "px")
			.css("left",(e.pageX + yOffset + ayOffset) + "px")
			.fadeIn("fast");		
    },
    function(){
		//~ this.title = this.t;		
		//~ $("#tooltip").remove();
		//~ $("#tooltip-arrow").remove();
    });	
	
	$(".service_main_image, #right_sidebar_service").hover(function(e){
		//this.title = this.t;		
		$("#tooltip").remove();
		$("#tooltip-arrow").remove();
		
	},
    function(){
		//~ this.title = this.t;		
		//~ $("#tooltip").remove();
		//~ $("#tooltip-arrow").remove();
    });						
};



// starting the script on page load
$(document).ready(function(){
	tooltip();
	$('body').replace(/accelerates answers/g, '<i>accelerates answers</i>');	
	$('body').replace(/ACCELERATES ANSWERS/g, '<i>ACCELERATES ANSWERS</i>');	
	$('body').replace(/OGSYS/ig, 'OG<i>sys</i>');
	$('body').replace(/OGSys/ig, 'OG<i>sys</i>');
	$('body').replace(/OGsys/ig, 'OG<i>sys</i>');	
	$('body').replace(/OGSQL/ig, 'OG<i>sql</i>');
	$('body').replace(/OGSql/ig, 'OG<i>sql</i>');
	$('body').replace(/OGsql/ig, 'OG<i>sql</i>');	
	$('body').replace(/OGWIN/ig, 'OG<i>win</i>');	
	$('body').replace(/OGWin/ig, 'OG<i>win</i>');	
	$('body').replace(/OGwin/ig, 'OG<i>win</i>');	
	$('body').replace(/OGELITE/ig, 'OG<i>elite</i>');	
	$('body').replace(/OGElite/ig, 'OG<i>elite</i>');	
	$('body').replace(/OGelite/ig, 'OG<i>elite</i>');	
});

