function show_bird_profile(id){
	
	document.getElementById('details').style.display = 'none';
	document.getElementById('showresult').style.display = 'none';
	document.getElementById('offspring').style.display = 'none';
	document.getElementById('siblings').style.display = 'none';
	document.getElementById('gallery').style.display = 'none';
	
	document.getElementById(id).style.display = '';
	
}
function image_view(url, width, height){
	img = window.open (url, "mywindow","menubar=1,resizable=1,screenX=100,screenY=100,width="+width+",height="+height);
	img.focus();	
}
function page_view(url, width, height){
	img = window.open (url, "mywindow","menubar=1,resizable=1,screenX=100,screenY=100, scrollbars=1, width="+width+",height="+height);
	img.focus();	
}

function site_support(frm){
	var fsub = true, err, ctr=0, fld_focus;
	var err = "The ff fields must not be empty/invalid: \n\n";

	if(frm.fname.value.length < 1){
		if(fsub == true) fld_focus = frm.fname;
		fsub = false;
		err += ++ctr+". First Name \n";
	}
	if(frm.lname.value.length < 1){
		if(fsub == true) fld_focus = frm.lname;
		fsub = false;
		err += ++ctr+". Last Name \n";
	}
//	alert(frm.email.value.indexOf('@'));
	if(frm.email.value.length < 1 || frm.email.value.indexOf('@') == -1 || frm.email.value.indexOf('.') == -1){
		if(fsub == true) fld_focus = frm.email;
		fsub = false;
		err += ++ctr+". Your Email Address \n";
	}
	if(frm.subject.value.length < 1){
		if(fsub == true) fld_focus = frm.subject;
		fsub = false;
		err += ++ctr+". Inquiry Subject \n";
	}
	if(frm.type.value.length < 1){
		if(fsub == true) fld_focus = frm.type;
		fsub = false;
		err += ++ctr+". Inquiry Type \n";
	}
	if(frm.inquiry.value.length < 1){
		if(fsub == true) fld_focus = frm.inquiry;
		fsub = false;
		err += ++ctr+". Inquiry \n";
	}

	if(fsub == false){
		alert(err);
		fld_focus.focus();
	}
	return(fsub);
}

function check_post_comment(frm){
	var fsub = true, err, ctr=0, fld_focus;
	var err = "The ff fields must not be empty/invalid: \n\n";

	if(frm.comment_name.value.length < 1){
		if(fsub == true) fld_focus = frm.comment_name;
		fsub = false;
		err += ++ctr+". Name \n";
	}
	if(frm.comment_email.value.length < 1 || frm.comment_email.value.indexOf('@') == -1){
		if(fsub == true) fld_focus = frm.comment_email;
		fsub = false;
		err += ++ctr+". Email \n";
	}
	if(frm.comment_comment.value.length < 1){
		if(fsub == true) fld_focus = frm.comment_comment;
		fsub = false;
		err += ++ctr+". Comment \n";
	}
	
	if(fsub == false){
		alert(err);
		fld_focus.focus();
	}
	return(fsub);
}

function check_forum_form(frm){
	var fsub = true, err, ctr=0, fld_focus;
	var err = "The ff fields must not be empty/invalid: \n\n";
	
	if(frm.forum_title.value.length < 1){
		if(fsub == true) fld_focus = frm.forum_title;
		fsub = false;
		err += ++ctr+". Forum Title \n";
	}
	if(frm.forum_description.value.length < 1){
		if(fsub == true) fld_focus = frm.forum_description;
		fsub = false;
		err += ++ctr+". Forum Description \n";
	}
	if(frm.forum.value.length < 1){
		if(fsub == true) fld_focus = frm.forum;
		fsub = false;
		err += ++ctr+". Forum Content \n";
	}
	
	if(fsub == false){
		alert(err);
		if(fsub == false) fld_focus.focus();
	}
	return(fsub);
}

function admin_show_certificate(id){
	img = window.open ("certificate.php?id="+id+"&action=view_certificate", "mywindow","menubar=1,resizable=1,screenX=100,screenY=10,width=600,height=700, scrollbars=1");
	img.focus();
//	
}
function user_show_certificate(id){
	img = window.open ("print_certificate.php?id="+id, "mywindow","menubar=1,resizable=1,screenX=100,screenY=10,width=600,height=700, scrollbars=1");
	img.focus();
//	
}

function opacity(id, opacStart, opacEnd, millisec) {
    //speed for each frame
    var speed = Math.round(millisec / 100);
    var timer = 0;

//	document.getElementById(id).style.display = '';
	
    //determine the direction for the blending, if start and end are the same nothing happens
    if(opacStart > opacEnd) {
        for(i = opacStart; i >= opacEnd; i--) {
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
            timer++;
        }
    } else if(opacStart < opacEnd) {
        for(i = opacStart; i <= opacEnd; i++)
            {
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
            timer++;
        }
    }
	
}

//change the opacity for different browsers
function changeOpac(opacity, id) {
	//alert(opacity);
    var object = document.getElementById(id).style;
    object.opacity = (opacity / 100);
    object.MozOpacity = (opacity / 100);
    object.KhtmlOpacity = (opacity / 100);
    object.filter = "alpha(opacity=" + opacity + ")";
	
	if(opacity == 0) document.getElementById(id).style.display = 'none';
	if(opacity > 0) document.getElementById(id).style.display = '';
}

