function showImage(image)
{
	var overlay = document.getElementById('overlay');
	var popup = document.getElementById('popup');
	var popupwait = document.getElementById('popupwait');
	var popupcontent = document.getElementById('popupcontent');
	//overlay.style.height = document.height + "px";
	overlay.style.display="block";
	popupwait.style.display="block";
	popupwait.innerHTML = "<div align='center'><h2>Please Wait ...</h2><img src='/images/loadingAnimation.gif'/></div>";
	makeRequest("/includes/simpleajax.php?image=" + image + "&w=" + document.body.clientWidth + "&h=" + document.documentElement.clientHeight,"popupcontent" );
}
function showMovie(movie, size)
{
	var overlay = document.getElementById('overlay');
	var popup = document.getElementById('popup');
	var popupwait = document.getElementById('popupwait');
	var popupcontent = document.getElementById('popupcontent');
	//overlay.style.height = document.height + "px";
	overlay.style.display="block";
	popupwait.style.display="block";
	popupwait.innerHTML = "<div align='center'><h2>Please Wait ...</h2><img src='/images/loadingAnimation.gif'/></div>";
	makeRequest("/includes/simpleajaxmovie.php?movie=" + movie + "&w=" + document.body.clientWidth + "&h=" + document.documentElement.clientHeight + "&sz=" + size,"popupcontent" );
}
function hideOverlay()
{
	var overlay = document.getElementById('overlay');
	var popup = document.getElementById('popup');
	var popupcontent = document.getElementById('popupcontent');
	overlay.style.display="none";
	popup.style.display="none";
	popupcontent.innerHTML="";
	
}
function showSignUpForm(form)
{
	var overlay = document.getElementById('overlay');
	var popup = document.getElementById('popup');
	var popupcontent = document.getElementById('popupcontent');
	//overlay.style.height = document.height + "px";
	overlay.style.display="block";
	
	if (form == 'ITC_Trial')
		popupcontent.innerHTML = "<form name='itctrialform' method='post' action='https://www.mcssl.com/app/contactsave.asp'> <input name='merchantid' type='hidden' id='merchantid' value='191238'> <input name='ARThankyouURL' type='hidden' id='ARThankyouURL' value='http://www.inspirationssoftwaredesign.com/products/inspired-time-clock?msg=thankyou'> <input name='copyarresponse' type='hidden' id='copyarresponse' value='1'> <input name='custom' type='hidden' id='custom' value='0'> <input name='defaultar' type='hidden' id='defaultar' value='617795'> <input name='allowmulti' type='hidden' id='allowmulti' value='0'> <input name='visiblefields' type='hidden' id='visiblefields' value='Name,Email1'> <input name='requiredfields' type='hidden' id='requiredfields' value='Name,Email1'> <table style='font-weight:bold;' class='ibsfreeform' > <tr> <td colspan='2'>To download your free copy of the Inspired Time Clock trial, simply add your name and email address below to receive our free Inspired FileMaker Business e-newsletter with FileMaker Tips and special offers.</td> </tr> <tr> <td>Name</td> <td><input name='Name' type='text' size='30'></td> </tr> <tr> <td>Email</td> <td><input name='Email1' type='text' size='30'></td> </tr> <tr align='center'> <td colspan='2'> <input type='button' name='cmdCancel' value='Cancel' onClick='hideOverlay();return false;'>&nbsp;&nbsp;&nbsp;<input type='Submit' name='cmdSubmit' value='Submit'> </td> </tr> </table> </form>";				
	else
		popupcontent.innerHTML = "<form name='ibsfreeform' method='post' action='https://www.mcssl.com/app/contactsave.asp'> <input name='merchantid' type='hidden' id='merchantid' value='191238'> <input name='ARThankyouURL' type='hidden' id='ARThankyouURL' value='http://www.inspirationssoftwaredesign.com/products/inspired-business-suite?thankyou'> <input name='copyarresponse' type='hidden' id='copyarresponse' value='1'> <input name='custom' type='hidden' id='custom' value='0'> <input name='defaultar' type='hidden' id='defaultar' value='607297'> <input name='allowmulti' type='hidden' id='allowmulti' value='0'> <input name='visiblefields' type='hidden' id='visiblefields' value='Name,Email1'> <input name='requiredfields' type='hidden' id='requiredfields' value='Name,Email1'> <table style='font-weight:bold;' class='ibsfreeform' > <tr> <td colspan='2'>To download your free copy of the Inspired Business Suite contact manager, simply add your name and email address below to receive our free Inspired FileMaker Business e-newsletter with FileMaker Tips and special offers.</td> </tr> <tr> <td>Name</td> <td><input name='Name' type='text' size='30'></td> </tr> <tr> <td>Email</td> <td><input name='Email1' type='text' size='30'></td> </tr> <tr align='center'> <td colspan='2'> <input type='button' name='cmdCancel' value='Cancel' onClick='hideOverlay();return false;'>&nbsp;&nbsp;&nbsp;<input type='Submit' name='cmdSubmit' value='Submit'> </td> </tr> </table> </form>";
	
	popup.style.width='350px';
	var winwidth = document.body.clientWidth;
	popup.style.left=((winwidth-350)/2) + 'px';
	
	popupcontent.style.display="block";
	popup.style.display='block';
	
}



//Carousel

function mycarousel_initCallback(carousel)
{
    // Disable autoscrolling if the user clicks the prev or next button.
    carousel.buttonNext.bind('click', function() {
        carousel.startAuto(0);
    });

    carousel.buttonPrev.bind('click', function() {
        carousel.startAuto(0);
    });

    // Pause autoscrolling if the user moves with the cursor over the clip.
    carousel.clip.hover(function() {
        carousel.startAuto(0);
    }, function() {
        carousel.startAuto();
    });
};

if ( navigator.appName == "Microsoft Internet Explorer" )
{
	jQuery(document).ready(function() {
			jQuery('#mycarousel').jcarousel({
					auto: 10,
					wrap: 'last',
					initCallback: mycarousel_initCallback,
					visible: 2,
					scroll: 1,
					// This tells jCarousel NOT to autobuild prev/next buttons
					buttonNextHTML: null,
					buttonPrevHTML: null,
					itemFallbackDimension: 270,
					vertical: true
			});
	});
}
else
{
	jQuery(document).ready(function() {
			jQuery('#mycarousel').jcarousel({
					auto: 10,
					wrap: 'last',
					initCallback: mycarousel_initCallback,
					visible: 1,
					scroll: 1,
					// This tells jCarousel NOT to autobuild prev/next buttons
					buttonNextHTML: null,
					buttonPrevHTML: null
			});
	});
}

/**
 * We use the initCallback callback
 * to assign functionality to the controls
 */
function mycarousel_initCallback(carousel) {
    jQuery('.jcarousel-control a').bind('click', function() {
	 		var panel=1;
			if(jQuery(this).text()=='Inspired Business Suite')panel=4;
			else if(jQuery(this).text()=='Instant Messenger')panel=3;
			else if(jQuery(this).text()=='Time Clock')panel=2;
        carousel.scroll(jQuery.jcarousel.intval(panel));
		  carousel.startAuto(60);
        return false;
    });

    jQuery('.jcarousel-scroll select').bind('change', function() {
        carousel.options.scroll = jQuery.jcarousel.intval(this.options[this.selectedIndex].value);
        return false;
    });

    jQuery('#mycarousel-next').bind('click', function() {
        carousel.next();
        return false;
    });

    jQuery('#mycarousel-prev').bind('click', function() {
        carousel.prev();
        return false;
    });
};

