$(function() {	
	$('.gallery a').lightBox(); 
	$("a.detail").fancybox({ 'hideOnContentClick': false, 'padding':18, 'frameWidth': 480, 'frameHeight': 480}); 
});

function subscribe_newsletter() {
	
	var email=$("#subscribe_email").attr('value');
	
	var fail=0; error="";
	
	if (email=="") { error+='Please enter your email address'; fail=1; }
	//if ((!isValidEmail(email)) && (email!="")) { error+='Please enter a correct email address'; fail=1; }

	if (fail==0) {
		var dataString="pg=subscribe&&email=" + email;
		
		$.ajax({  
		   type: "GET",  
		   url: "index.php",  
		   data: dataString,  
		   success: function(msg) {  
				document.getElementById('box').innerHTML='<span class="message-text">' + msg + '</span>';
		   }  
		});  
	} else {
		alert(error);
	}
     
}

function keywords(flag,obj) {
	
	if (flag=='on') {
		obj.style.background="url(images/text-bg.gif)";
	} else {
		if (obj.value=='') {
			obj.style.background="url(images/search-bg.gif)";
		} else {
			obj.style.background="url(images/text-bg.gif)";
		}
	}
	
}

function removebtn() {
	$("#prevBtn a").css("background","none");	
	$("#nextBtn a").css("background","none");	
}

function restorebtn() {
	$("#prevBtn a").css("background","url('images/btn-left.png')");	
	$("#nextBtn a").css("background","url('images/btn-right.png')");	
}

function show_thumb(total,id) {
	for (i=1; i<=total; i++) {
		document.getElementById('page' + i).style.display='none';
		//document.getElementById('p' + i).style.color='#96979A';
	}
	
	document.getElementById('page' + id).style.display='';
		//document.getElementById('p' + id).style.color='#000';
	
}