function init(){
	var inp = document.getElementsByTagName('input');
	for(var i = 0; i < inp.length; i++) {
		if(inp[i].type == 'text') {
			inp[i].setAttribute('rel',inp[i].defaultValue)
			inp[i].onfocus = function() {
				if(this.value == this.getAttribute('rel')) {
					this.value = '';
				} else {
					return false;
				}
			}
			inp[i].onblur = function() {
				if(this.value == '') {
					this.value = this.getAttribute('rel');
				} else {
					return false;
				}
			}
			inp[i].ondblclick = function() {
				this.value = this.getAttribute('rel')
			}
		}
	}
}
if(document.childNodes) {
	window.onload = init
}


$().ready(function() {

$("#callback").validate({
  rules: {
    name: {
      required: true
    },
    number: {
      required: true,
      digits: true
    },
    timetocall: {
      required: true
    }
  }
});

});

		$(document).ready(function() {
			$("a.zoom").fancybox();

		var loadGlass = 1;
 
$('a.zoom img').hover(function(){
 
	if(loadGlass == 1) {
 
		$('body').prepend('<img id="magnify" style="position: absolute;" src="/images/mag_glass.png" alt="" width="34" height="34" />');
 
	}
 
	var p = $(this);
 
	var position = p.position();
 
	$('img#magnify').css({'top' : position.top+20, 'left' : position.left+20});
 
	$('img#magnify').show();
 
},function(){
 
	$('img#magnify').hide();
 
	loadGlass = 2;
 
});


		});
		
		

