// JavaScript Document
$(document).ready(function() {
	$(".fancyBoxEWOGswf").fancybox({
		'padding'				: 0,
		'autoScale'			: false,
		'width'					: 500,
		'height'				: 415,
		'transitionIn'	: 'elastic',
		'transitionOut'	: 'elastic',
		'easingIn'			: 'swing',
		'easingOut'			: 'swing',
		'speedIn'				: 850,
		'swf'						: {wmode: 'transparent'},
		'overlayOpacity': 0.7,
		'overlayColor'	: '#988aad'
	});
	$(".fancyCommendation").fancybox({
		'padding'				: 0,
		'autoScale'			: false,
		'width'					: 720,
		'height'				: 923,
		'transitionIn'	: 'elastic',
		'transitionOut'	: 'elastic',
		'easingIn'			: 'swing',
		'easingOut'			: 'swing',
		'speedIn'				: 850,
		'swf'						: {wmode: 'transparent'},
		'overlayOpacity': 0.7,
		'overlayColor'	: '#988aad'
	});
	$(".fancyVolunteerOP").fancybox({
		'padding'				: 0,
		'autoScale'			: false,
		'width'					: 650,
		'height'				: 400,
		'transitionIn'	: 'elastic',
		'transitionOut'	: 'elastic',
		'easingIn'			: 'swing',
		'easingOut'			: 'swing',
		'speedIn'				: 850,
		'overlayOpacity': 0.7,
		'overlayColor'	: '#988aad',
		'type'					: 'iframe'
	});
});

function getClassedElements(className) {
	var divs = document.getElementsByTagName('div'),classed=new Array();
	for(i=0,j=0;i<divs.length;i++) {
		if(divs[i].className == className) {
			classed[j] = divs[i];
			j++;
		}
	}
	return classed;
}


if(window.addEventListener) {
	window.addEventListener("load",function() {
		hoverBoxes = getClassedElements("over");
		for(i=0;i<hoverBoxes.length;i++) {
			hoverBoxes[i].style.height = "48px";
		}
		for(i=0;i<hoverBoxes.length;i++) {
			hoverBoxes[i].addEventListener("mouseover",function() {
				this.style.height = "150px";
				this.style.background = "#3c2062";
				var inputs = this.getElementsByTagName('input');
				for(j=0,k=0;j<inputs.length;j++) {
					if(inputs[j].getAttribute('type') == "text") {
						inputs[j].addEventListener("focus",function() {
							if(this.value == "Amount" || this.value == "Enter Name" || this.value == "Enter Email") {
								this.value = "";
								this.style.color = "#000";
								this.addEventListener("blur",function() {
									if(this.value == null || this.value == "") {
										this.style.color = "#999";
										this.value = this.title;
									}
								},false);
							}
						},false);
					}
				}
			},false);
		}
	},false);
}
else if(window.attachEvent) {
	window.attachEvent("onload",function() {
		hoverBoxes = getClassedElements("over");
		for(i=0;i<hoverBoxes.length;i++) {
			hoverBoxes[i].style.height = "48px";
		}
		for(i=0;i<hoverBoxes.length;i++) {
			hoverBoxes[i].onmouseover = function() {
/**/
				this.style.height = "150px";
				this.style.background = "#3c2062";
				var inputs = this.getElementsByTagName('input');
				for(j=0,k=0;j<inputs.length;j++) {
					if(inputs[j].getAttribute('type') == "text") {
						inputs[j].onfocus = function() {
							if(this.value == "Amount" || this.value == "Enter Name" || this.value == "Enter Email") {
								this.value = "";
								this.style.color = "#000";
								this.onblur = function() {
									if(this.value == null || this.value == "") {
										this.style.color = "#999";
										this.value = this.title;
									}
								}
							}
						}
					}
				}
			/*	*/
			}
		}
	});
}
