// CHECKBOX SCRIPT
eval(function(p,a,c,k,e,r){e=function(c){return c.toString(a)};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('2.g.q=1(b,c){b=b||"*";c=c||7;4 d=2([]);0.5(1(){4 a=2("9[@8=f]",0).6(b).5(1(){0.3=!0.3}).6(":3");d=a});e(!c){d=0}i d};2.g.p=1(b,c){b=b||"*";c=c||7;4 d=2([]);0.5(1(){4 a=2("9[@8=f]",0).6(b).5(1(){0.3=o}).6(":3");d=a});e(!c){d=0}i d};2.g.n=1(b,c){b=b||"*";c=c||7;4 d=2([]);0.5(1(){4 a=2("9[@8=f]",0).6(b).5(1(){0.3=7}).6(":j(:3)");d=a});e(!c){d=0}i d};2.m=1(a,b){b=b||"*";4 c="9[@8=f]";e(a){c+="[@l="+a+"]"}4 h=2(c).6(b);h.k(1(){h.j(0).5(1(){0.3=7}).r()})};',28,28,'this|function|jQuery|checked|var|each|filter|false|type|input|||||if|checkbox|fn|x|return|not|click|name|radioCheckboxGroup|unCheckCheckboxes|true|checkCheckboxes|toggleCheckboxes|end'.split('|'),0,{}))

$(document).ready(function() {
	 
   /*$("input.text, textarea.text").focusFields("#d40000", 1, "#f3e784", );
	  $.ImageBox.init(
			{
				loaderSRC: './_ui/images/loading.gif',
				closeHTML: '<img src="./_ui/images/close.jpg" />'            
			}
		);                           */
	$('.content_page').hide();
	$('.view_page').click(function()
	{
		$('.content_page').slideDown('normal');
		$('.view_page').hide();
	}
	)      

	$("input:text, textarea, input:password").each(function(){
		if(this.value == '')
			this.value = this.title;
	});
	$("input:text, textarea, input:password").click(function(){
		if(this.value == this.title)
			this.value = '';
	});
	$("input:text, textarea, input:password").blur(function(){
		if(this.value == '')
			this.value = this.title;
	});
	$("input:image, input:button, button:submit").click(function(){
		$(this.form.elements).each(function(){
			if(this.type =='text' || this.type =='textarea' || this.type =='password'){
				if(this.value == this.title && this.title != ''){
					this.value='';
				}
			}
		});
	});
	
	theObjects = document.getElementsByTagName("object");
	for (var i = 0; i < theObjects.length; i++) {
	theObjects[i].outerHTML = theObjects[i].outerHTML;
	}         
	
	$(".select_all").click(function() 
	{ 
		$("#documents_form").checkCheckboxes();  
	});       
	
	$(".unselect_all").click(function() 
	{ 
		$("#documents_form").unCheckCheckboxes();  
	}); 	
	
 });

function swap_image(path, title)
{
	document.getElementById('main_photo').innerHTML = '<a href="./bp/upload/galleries/photo/'+path+'" title="'+title+'" rel="lightbox"><img src="./resize2.php?img=./bp/upload/galleries/photo/'+path+'&w=327&h=135&bg=gallery_bg.jpg" border="0"/></a>';
	$('a[@rel*=lightbox]').lightBox({

	overlayBgColor: '#2f0015',
	overlayOpacity: 0.6,
	imageLoading: '/_ui/images/loading.gif',
	imageBtnClose: '/_ui/images/close.gif',
	imageBtnPrev: '/_ui/images/prev.gif',
	imageBtnNext: '/_ui/images/next.gif',
	
	
	});
	return false;
}
			  
 function checkfields()
 {
	if (document.getElementById('name').value == '')
	{
		alert('You must enter your name');
		return false;
	}
	else
	{
		if (document.getElementById('phone').value == '' && document.getElementById('email').value == '')
		{
			alert('You must enter either your phone number or e-mail address');
			return false;
		}
	}
 }

 $(function() {
	$('a[@rel*=lightbox]').lightBox({

	overlayBgColor: '#2f0015',
	overlayOpacity: 0.6,    
	imageLoading: '/_ui/images/loading.gif',
	imageBtnClose: '/_ui/images/close.gif',
	imageBtnPrev: '/_ui/images/prev.gif',
	imageBtnNext: '/_ui/images/next.gif',
	
	
	}); // Select all links that contains lightbox in the attribute rel
});
