﻿$(document).ready(function() {
$("#formID").validationEngine()
$("#loginx").validationEngine()
});
/************************************************************************/
$(function() { $(".lavaLamp").lavaLamp({ fx: "backout", speed: 700 })});
/************************************************************************/
function fixfooter(){
$("#footer").css({bottom: "0"})
}
/************************************************************************/

$(window).bind("load", function() { 
fixfooter();
});
/************************************************************************/

function ajaxTimeout(){
   http.abort();
   $("#loadcontent").html('<br><br><br><p class=notfounderr>'+ timeouttext  +'</p>');
   $('#loadcontent').show('fast');

}
/************************************************************************/
var http = getHTTPObject() ;
/************************************************************************/
function  getHTTPObject  (){
if (window.ActiveXObject) 
return new ActiveXObject("Microsoft.XMLHTTP");
else if (window.XMLHttpRequest) 
return new XMLHttpRequest();
else {
alert("Your browser does not support AJAX.");
return null;
}
}
/************************************************************************/
function apendloadericon(){
$("#loadcontent").html('<span id="load"><table style="width: 120px;" align="center" border="0"><tr><td align="center"><img title="Loading Page" src="images/loader.gif"></td></tr><tr><td style="font-family:Tahoma;font-weight:bold;font-size:10px;color:#FFFFFF" align="center">' + loadtext  + '</td></tr></table></span>');
}
/************************************************************************/
function loadingsx(){
$('#loadcontent').hide('slow');
$('#loadcontent').fadeTo("fast", 0.0);
$('#loadcontent').fadeTo("fast", 1.0);
$('#loadcontent').show('fast');
setTimeout('apendloadericon()',1000);
}
/************************************************************************/
function apendgallery(){
    Galleria.loadTheme('galleria.classic.js');
    $('#galleria').galleria();
}
/************************************************************************/
function openfastpanel(){
$("div#panel").slideDown("slow");
}
/************************************************************************/

function loadpagex(url){
$('#loadcontent').show('fast');
loadingsx();
http.abort();


if ( url == 'gallery' ) {
document.getElementById("loadcontent").innerHTML = '<div id="makeMeScrollable"><div class="scrollingHotSpotLeft"></div><div class="scrollingHotSpotRight"></div><div class="scrollWrapper"><div class="scrollableArea"></div></div></div>';
}


url2 = "page-loader.php?page=" + url ;
http.open("GET", url2, true);
http.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
http.onreadystatechange = function() {
if(http.readyState == 4 && http.status == 200) {

clearTimeout(xmlHttpTimeout);

document.getElementById("loadcontent").innerHTML = http.responseText + "<br>";
if ( url == 'home' ) { jQuery('#slider').fadeIn(400).nivoSlider({effect:'fade',slices:15,animSpeed:500,pauseTime:5000,directionNav:true,directionNavHide:false,controlNav:true,pauseOnHover:true,manualAdvance:false,captionOpacity:0.8});}
if ( url == 'contact'){$("#contactform").validationEngine();}


if ( url == 'gallery' ){
			$(document).ready(
				function (){
					$("#pikame").PikaChoose({autoPlay:true, text: {previous: "", next: "" } });

					$("#pikame").jcarousel({scroll:4,					
						initCallback: function(carousel) 
						{
					        $(carousel.list).find('img').click(function() {
					        	//console.log($(this).parents('.jcarousel-item').attr('jcarouselindex'));
					            carousel.scroll(parseInt($(this).parents('.jcarousel-item').attr('jcarouselindex')));
					        });
					    }
				    });

				});


}


}
}

http.send(null);
var xmlHttpTimeout=setTimeout(ajaxTimeout,15000);
}
/**********************************/
$(document).ready(function(){
						   $("#prixilogo").fadeTo("slow", 0.3);
						   $("#prixilogo").hover(function(){
						   $(this).fadeTo("slow", 1.0); 
						   },function(){
						   $(this).fadeTo("slow", 0.3);
						   });
						   });
/**********************************/
$(document).ready(function(){
						   $("#henzalogo").fadeTo("slow", 0.3);
						   $("#henzalogo").hover(function(){
						   $(this).fadeTo("slow", 1.0); 
						   },function(){
						   $(this).fadeTo("slow", 0.3);
						   });
						   });
						   
/**********************************/
$(function() {
$(this).bind("contextmenu", function(e) {
e.preventDefault();
});
}); 
/**********************************/
function disableSelection(target){
if (typeof target.onselectstart!="undefined") //For IE
	target.onselectstart=function(){return false}
else if (typeof target.style.MozUserSelect!="undefined") //For Firefox
	target.style.MozUserSelect="none"
else //All other route (For Opera)
	target.onmousedown=function(){return false}
target.style.cursor = "default"
}
/**********************************/
$(document).ready(function() {
	$("#open").click(function(){$("div#panel").slideDown("slow");	});
	$("#open2").click(function(){$("div#panel").slideDown("slow");	});
	$("#close").click(function(){$("div#panel").slideUp("slow");	});
	$("#toggle a").click(function () {$("#toggle a").toggle();		});
});
/**********************************/
function gallerymoveleft(){
document.getElementById("gallerymarq").direction = "right"; 
}
/**********************************/
function gallerymoveright(){
document.getElementById("gallerymarq").direction = "left"; 
}
/**********************************/

