// JavaScript Document
function openurl(){
//alert("hello");
}
function changeOpac(opacity, id) {
    var object = document.getElementById(id).style;
	object.opacity = (opacity / 100);
    object.MozOpacity = (opacity / 100);
    object.KhtmlOpacity = (opacity / 100);
	object.filter = "alpha(opacity=" + opacity + ")";
}
function ch_text(){
	var frm=document.index;
	if(frm.spot_name.value=="")
	{
		frm.spot_name.value="Spot / Residents Name";
	}
}
function validate_guestbook(){
	var frm=document.guestbook;
	if(!isValidEntry(frm.name,"Name"))
	return false;
	if(!isValidEmail(frm.email,'yes'))
	return false;
	var choosen="";

	for(i=0;i<frm.vote.length;i++){
		if(frm.vote[i].checked)
		choosen=frm.vote[i].value;
		}
		
		if(choosen=="")
		{
			alert("select Vote");
		return false;
		}
		else
		{
		frm.choosen.value=choosen;
		}
	if(!isValidEntry(frm.comments,"Comments"))
	return false;
	frm.kw.value="add2guestbook";
	frm.action="Guestbook.php";
	frm.submit();
}
function validate_tribute(){
	
	var frm=document.tribute;
	if(!isValidEntry(frm.tri_name,"Name"))
	return false;
	if(!isValidEmail(frm.tri_email,'yes'))
	return false;
	if(!isValidTextarea(frm.tri_message,'Message',200))
	return false;
	frm.kw.value="add_tribute";
	frm.action="tributes.php";
	
}

function tellfriend_validate(site){
	var frm=document.tellfriend;
		path="../../popup_tellafriend.php";
		return GB_show(site, path,450,700);
}
function viewvideo(id){
	//var frm=document.tellfriend;
		path="../../viewvideo.php";
		return GB_show("View Video", path,450,700);
}
function popup_window(type){
		var frm=document.memorials;
		path="../../memorial_gifts_popup.php";
		return GB_show('Select '+type, path,450,500);
}
function popup_video(file,url){
		path="../../popup_video.php?file="+file+"&url="+url;
		
		return GB_show('Select ', path,450,500);
}
function handleResponse(path, w, h) {
 //alert('this function is called from photos.php');
  var img_pth=document.getElementById("images_slide");
  //alert(img_pth.src);
  img_pth.src=path;
  img_pth.width=w;
  img_pth.height=h;
 // setTimeout("handleResponse()",100);
}
function popup_slideshow(){
		
		path="../../view_slideshop.php";
		return GB_show('Slideshow', path,450,500);
}
function popup_timeline(){
		
		path="../../timeline.php";
		return GB_show('Timeline', path,450,750);
}
function pay_tribute(){
	var frm=document.memorials;
	if(!isValidEntry(frm.name,"Your name"))
	return false;
	if(!isValidEmail(frm.email,'yes'))
	return false;
	if(!isValidTextarea(frm.desc,"comments",100))
	return false;
	if(frm.gift_img){
	if(!isValidEntry(frm.gift_img,"Gift"))
	return false;
	}else{
		alert("Please Select a Gift");
		return false;
	}
	var selpack="";
	for(i=0;i<frm.sub_price.length;i++){
		if(frm.sub_price[i].checked){
			selpack=frm.sub_price[i].value;
		}
	}
	if(selpack==""){
		alert("Select timeperiod");
		return false;
	}
	
	frm.action="mem_paypal.php";
	
	frm.submit();

}

function getupdate(){
	var frm=document.gupdate;
	if(!isValidEmail(frm.getupdate_email, 'yes'))
	return false
	frm.gu_kw.value="update_gurecord";
	   
}