function full(str, elem, name) {
	if (elem.value == 0) {
		alert(str + " " + name + ".")
	    elem.focus();
	    return false;
	}
	return true;
}

function checkEmail(str, elem) {
	if (elem.value == 0) {
		alert(str);
	    elem.focus();
	    return false;
	} else {
		var re=/^[\w\.\_\+-]*@[\w\_\+-]+(\.[\w\_\+-]+)*\.[\w\+-]+$/;
		if (elem.value.search(re)==-1) {
			alert(str);
			elem.focus();
			return false;
		}
		return true;
	}
}

function getNewXMLHttp() {
	xmlhttp = null;

    // branch for native XMLHttpRequest object
    if(window.XMLHttpRequest) {
    	try {
			xmlhttp = new XMLHttpRequest();
        } catch(e) {
			xmlhttp = null;
        }
   
    // branch for IE/Windows ActiveX version
    } else if(window.ActiveXObject) {
       	try {
        	xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
      	} catch(e) {
        	try {
          		xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
        	} catch(e) {
          		xmlhttp = null;
        	}
		}
    }
    
    return xmlhttp;
}



function approveDisclaimer() {
	ajaxDiscApprove = getNewXMLHttp();
	ajaxDiscApprove.open("GET", "/appdisc.php", true);
	ajaxDiscApprove.send(null);

	var fadeInFx = new Fx.Elements
	(
		$('content'), 
		{
			onComplete: function()
			{
				$('content').className = '';
 			},
	    	duration: 1000, 
	    	transition: Fx.Transitions.Sine.easeOut
		}
	);
	
	var fadeOutFx = new Fx.Elements
	(
		$('over18'), 
		{
			onComplete: function()
			{
				$('over18').style.display = 'none';
 			},
	    	duration: 1000, 
	    	transition: Fx.Transitions.Sine.easeIn
		}
	);
	
	fadeInFx.start({ '0': { 'opacity': [0,1] } });
	fadeOutFx.start({ '0': { 'opacity': [1,0] } });	
	
	return false;
}

function startGallery(c) {
	if(imgCount > 0) {
		var myGallery = new gallery( $('the-pic-div'), {
			timed: true,
			delay: 2500,
			fadeDuration: 500,
			showArrows: false,
			showCarousel: false,
			embedLinks: false,
			useHistoryManager: false,
			useThumbGenerator: false,
			showInfopane: false,
			slideInfoZoneSlide: false,
			titleSelector: "span",
			slideInfoZoneOpacity: 0,
			defaultTransition: "crossfade",
			textShowCarousel: strAllImages,
			carouselMinimizedOpacity: 0.5,
			carouselMinimizedHeight: 20,
			carouselMaximizedOpacity: 0.9,
			thumbHeight: 56,
			thumbWidth: 37,
			thumbSpacing: 5,
			thumbIdleOpacity: 0.65,
			showCarouselLabel: false,
			thumbCloseCarousel: true,
			carouselHorizontal: true,
			activateCarouselScroller: true,
			carouselPreloader: true,
			textPreloadingCarousel: strLoading + ' ...'
		} );
	} 
	$('the-pic-div').style.display = 'block';
}

