//Slide Up  & Slide Down Effect

jQuery(document).ready(function(){
//	jQuery().W3IssueReporting({ProjectURL:'http://beta.w3industries.com/mendo/intermat/epke/prototype/',Client:'mendo',Project:'intermatEpke'});
	jQuery(".mtpl6 ul li span.question").click(function(){
		jQuery(".question").css({"color":"#333333","background":"url(/public/_images/lists-arrow.gif) no-repeat 392px center"});		jQuery(".answer").slideUp("slow");
		currRef = this;		jQuery(this).next().slideDown("slow",function()
		{ 
			jQuery(currRef).next().css('display','block');
		});
		jQuery(this).css({"color":"#0099ff"});		jQuery(this).css({"background":"none"});	});
    
    // mtpl5 gallery effect
    var galleryThumbs = new Array("public/_images/gallery-thumb-01.jpg","public/_images/gallery-thumb-02.jpg","public/_images/gallery-thumb-03.jpg","public/_images/gallery-thumb-04.jpg","public/_images/gallery-thumb-05.jpg","public/_images/gallery-thumb-06.jpg");
    var galleryBigImg = new Array("public/_images/gallery-big-01.jpg","public/_images/gallery-big-02.jpg","public/_images/gallery-big-03.jpg","public/_images/gallery-big-04.jpg","public/_images/gallery-big-05.jpg","public/_images/gallery-big-06.jpg");
	
	var galleryThumbLength = galleryThumbs.length;
	var galleryBigLength = galleryBigImg.length;
	jQuery(".mtpl5 .img_wrapper").append("<img class='big_image' src='"+galleryBigImg[0]+"' width='406' height='448' alt='' />");
	for(i=0; i<=(galleryThumbLength-1); i++){
		jQuery(".mtpl5 .thumbs").append("<img src='"+galleryThumbs[i]+"' width='129' height='136' alt='' />");
	}
	
	var clickedElement;
	jQuery(".mtpl5 .thumbs img").click(function(){
		var presentBigImg = jQuery(".mtpl5 .img_wrapper img").attr("src");
		var presentThumbImg = jQuery(this).attr("src");
		var thumbPath = presentThumbImg.split("_images/");
		for(i=0; i<=galleryThumbLength-1; i++){
				var thisSrc = galleryThumbs[i];
				if(thisSrc==("_images/"+thumbPath[1])||thisSrc==presentThumbImg){
					clickedElement = i;
					break;
				}
		}
		jQuery(".mtpl5 .img_wrapper img.big_image").css({"opacity":0});
		var imgSrc = galleryBigImg[clickedElement];
		jQuery(".mtpl5 .img_wrapper").append('<img class="loader" src="public/_images/trp-loader.gif" alt="loading" />');
		jQuery(".mtpl5 .img_wrapper img.big_image").attr("src",imgSrc).load(function(){
			//jQuery(".loader").animate({opacity:0}),300;
			jQuery(this).parent().find(".loader").remove();
			jQuery(".mtpl5 .img_wrapper img.big_image").animate({opacity:1}),500;
		});	
	});
	// mtpl10 form_submit effect
	var clickedElement;
	jQuery(".mtpl10 h6").not(".contact_submit").click(function(){
		jQuery(".form_submit").slideToggle("slow");
	});
//	jQuery(".form_submit h6").click(function(){
//		jQuery(".form_submit").slideUp("slow");
//		});
	
	// pretty photo code for video
	jQuery(".videobox a[rel^='prettyPhoto']").prettyPhoto({theme:'facebook'});
	//mtpl7 click effect
	jQuery(".mtpl7 a").click(function(){
	jQuery(".form_submit").slideDown("slow");
	});
});
