	$(document).ready(function() {
		
	
		
		$('.acc_container').hide(); //Hide/close all containers
		$('.acc_trigger:first').addClass('active').next().show(); //Add "active" class to first trigger, then show/open the immediate next container
	/*	if(getParameterByName('id') == '')
		{
		$('.acc_trigger:first').addClass('active').next().show(); //Add "active" class to first trigger, then show/open the immediate next container
		}else
		{
			alert(getParameterByName('id'));
			document.getElementById("acc"+getParameterByName('id')).addClass('active').next().show();
			
		}*/
			
		//On Click
		$('.acc_trigger').click(function(){
			if( $(this).next().is(':hidden') ) { //If immediate next container is closed...
				$('.acc_trigger').removeClass('active').next().slideUp(); //Remove all "active" state and slide up the immediate next container
				$(this).toggleClass('active').next().slideDown(); //Add "active" state to clicked trigger and slide down the immediate next container
			}
			return false; //Prevent the browser jump to the link anchor
		});
		
		
		$("a.lightview").fancybox({'overlayShow': true, overlayOpacity:0.9,frameWidth:600,frameHeight:280});
		
		$('#searchtext').Watermark('Search this website');
		$(function() { $(".lavaLamp").lavaLamp({ fx: "backout", speed: 700 })});
		$(function() { $(".lavaLamp2").lavaLamp({ fx: "backout", speed: 700 })});	
		
		$('.tabs .tab-active').show(); // show default content
		$('.tabs .header ul a').click(function(){
			$('.tabs .header ul li').removeClass('active');
			$(this).parent().addClass('active'); // make clicked tab active
			$('.tabs .tab').hide(); // hide all content
			$('.tabs').find('#' + $(this).attr('rel')).show(); // and show content related to clicked tab
			return false;
		});
		
	
		$("img.rollover").hover(function () {
			newsrc=$(this).attr('src').replace('.jpg','-over.jpg').replace('.png','-over.png');
	    	$(this).attr('src',newsrc);
		},function () {
			newsrc=$(this).attr('src').replace('-over.jpg','.jpg').replace('-over.png','.png');
	    	$(this).attr('src',newsrc);
		});
	
	
		$('.anythingSlider').anythingSlider({
			easing: "easeInOutQuad",
			stopAtEnd: true,
			autoPlay: true,
			delay: 5000,
			animationTime: 2000,
			hashTags: true,
			buildNavigation: true,
			pauseOnHover: false,
			startText: "Go",
			stopText: "Stop",
			navigationFormatter: null
				});
		
		$('.anythingSlider2').anythingSlider({
			easing: "easeInOutQuad",
			autoPlay: true,
			delay: 3000,
			startStopped: false,
			animationTime: 2000,
			hashTags: true,
			buildNavigation: true,
			pauseOnHover: false,
			startText: "Go",
			stopText: "Stop",
			navigationFormatter: null
				});
				
			});




function sendEmail() {
	$('.submitButton').val('Sending...');
	$('.submitButton').attr("disabled","true");
	$.post('form-contactus.php?r='+Math.random(),{
		visitor_title: $('#visitor_title').val(),
		visitor_name: $('#visitor_name').val(),
		visitor_lastname: $('#visitor_lastname').val(),
		visitor_address: $('#visitor_address').val(),
		visitor_email: $('#visitor_email').val(),
		visitor_tel: $('#visitor_tel').val(),
		visitor_mob: $('#visitor_mob').val(),
		visitor_comp: $('#visitor_company').val(),		
		visitor_test: $('#visitor_test').val(),			
		visitor_description: $('#visitor_description').val()
		},
		function (data) {
			$('#sendStatus').html("<br /><p>Your message has been sent, we will reply as soon as possible.<br /><br />Thank you,<br />IdeaCasa</p>");
			$('.submitButton').val('Send Message');
			$('.submitButton').attr("disabled",false);
			$('#contactUsForm').html("");
		}
	);
	return false;
}



function sendEmailtoFriend() {
	$('.submitButton').val('Sending...');
	$('.submitButton').attr("disabled","true");
	$.post('form-sendtofriend.php?r='+Math.random(),{
		visitor_email: $('#txt_to').val(),
		visitor_name: $('#txt_from').val(),
		visitor_message: $('#txt_message').val(),
		visitor_url: $('#txt_url').val()
		},
		function (data) {
			$('#sendStatus').html("<br /><p>Your message has been sent to your friend.<br /><br />Thank you,<br />IdeaCasa</p>");
			$('.submitButton').val('Send Message');
			$('.submitButton').attr("disabled",false);
			$('#sendtoFriendForm').html("");
		}
	);
	return false;
}


		
function show()
{		
		if(document.getElementById("bar2").style.display=='none') 
		{
		document.getElementById("bar2").style.display='block';
		}
		else
		{
		document.getElementById("bar2").style.display='none';
		}
}	

		
function showbar(thediv,class1,selectedid)
{
		$('.'+class1).hide();
		$.each($('.selectedbar1'),function(){
			if($('#'+selectedid).hasClass('selectedbar1'))
			{
				if(navigator.appName == "Microsoft Internet Explorer")
				{
						if(this.id==selectedid) 
						{
						
									if((this).style.color =='#8a9510') {
										 (this).style.color = "#f1ff5e";
									}else{
										
									}
						}
						else
						{
							 (this).style.color = "#8a9510";
						}
				}else
				{
						if(this.id==selectedid) 
						{
						
								if($(this).css("color")=='rgb(138, 149, 16)') {
									 $(this).css("color","#f1ff5e");
								}else{
									
								}
						}
						else
						{
							 $(this).css("color","rgb(138, 149, 16)");
						}
				}
			}
		})
		$.each($('.selectedbar2'),function(){
			if($('#'+selectedid).hasClass('selectedbar2'))
			{
				if(navigator.appName == "Microsoft Internet Explorer")
				{
						if(this.id==selectedid) 
						{
						
									if((this).style.color =='#999999') {
										 (this).style.color = "#ffffff";
									}else{
										
									}
		
						}
						else
						{
							 (this).style.color = "#999999";
						}
				}else
				{

						if(this.id==selectedid) 
						{
						
								if($(this).css("color")=='rgb(153, 153, 153)') {
									 $(this).css("color","#ffffff");
								}else{
									
								}
		
						}
						else
						{
							 $(this).css("color","rgb(153, 153, 153)");
						}
				}
			}
		})
		
		if(document.getElementById(thediv).style.display=='none') 
		{
		document.getElementById(thediv).style.display='block';
		}
		else
		{
		document.getElementById(thediv).style.display='none';
		}
};

function clickSub(thediv,image){
    $.each($('.subs'),function(){
        if(this.id==thediv){
            if(this.style.display=='none')
            {
                $('#'+this.id).slideDown(700);
                $('#'+image).show(700);
                $('#'+'plus-'+this.id).hide(700)
            }
            else
            {
                $('#'+this.id).slideUp(700);
                $('#'+image).show(700);
                $('#'+'minus-'+this.id).hide(700)
            }
        }else
        {
            $('#'+this.id).slideUp(700);
            $('#'+'minus-'+this.id).hide(700);
            $('#'+'plus-'+this.id).show(700);
        }

    });
};
 

function clickSub2(thediv,image){
    $.each($('.subcat'),function(){
        if(this.id==thediv){
            if(this.style.display=='none')
            {
                $('#'+this.id).slideDown(700);
                $('#'+image).show(700);
                $('#'+'plus-'+this.id).hide(700)
            }
            else
            {
                $('#'+this.id).slideUp(700);
                $('#'+image).show(700);
                $('#'+'minus-'+this.id).hide(700)
            }
        }else
        {
            $('#'+this.id).slideUp(700);
            $('#'+'minus-'+this.id).hide(700);
            $('#'+'plus-'+this.id).show(700);
        }

    });
};

function clickSub3(thediv,image){
    $.each($('.subsFAQ'),function(){
        if(this.id==thediv){
            if(this.style.display=='none')
            {
                $('#'+this.id).slideDown(700);
                $('#'+image).show(700);
                $('#'+'plus-'+this.id).hide(700)
            }
            else
            {
                $('#'+this.id).slideUp(700);
                $('#'+image).show(700);
                $('#'+'minus-'+this.id).hide(700)
            }
        }else
        {
            $('#'+this.id).slideUp(700);
            $('#'+'minus-'+this.id).hide(700);
            $('#'+'plus-'+this.id).show(700);
        }

    });
};

    




	
