function ShowSelectedPhoto(path,title,width,height,p_id) 
{
	w = 576;
	h = 381;
	h1 = height;
	w1 = width;
	if (width>w) {
	h1 = Math.round(height*w/width);
	w1 = w;
	}
	if (h1>h) {
	w1 = Math.round(w1*h/h1);
	h1 = h;
	}
	

	f = document.delete_photo;
	f.dp_id.value = p_id;
	//f.edit_p_id.value = p_id;
	
	x = document.set_default_photo;
	x.def_p_id.value =p_id;
	
	e = document.upload_photo;
	e.edit_p_id.value =p_id;
	
	
	
	document.getElementById('ph_pic').innerHTML = '<img src="' + path + '"  alt="" align="top" 	id="ph_source" style="border:1px #575757 solid" width="' + w1 + '" height="' + h1 + '" />';	
	document.getElementById('ph_title').innerHTML=title;
	
	
}

function ShowSelectedPhotoFitness(path,title,width,height,p_id) 
{
	w = 576;
	h = 381;
	h1 = height;
	w1 = width;
	if (width>w) {
	h1 = Math.round(height*w/width);
	w1 = w;
	}
	if (h1>h) {
	w1 = Math.round(w1*h/h1);
	h1 = h;
	}
	

	f = document.delete_photo;
	f.dp_id.value = p_id;
	//f.edit_p_id.value = p_id;
	
	x = document.set_default_photo;
	x.def_p_id.value =p_id;
	
	e = document.upload_photo;
	e.edit_p_id.value =p_id;
	
	
	
	document.getElementById('ph_pic').innerHTML = '<img src="' + path + '"  alt="" align="top" 	id="ph_source" style="border:1px #575757 solid" width="' + w1 + '" height="' + h1 + '" />';	
	document.getElementById('ph_title').innerHTML=title;
}


function ShowClientSelectedPhoto(path,title,title2,width,height,p_id,pt) 
{
	w = 576;
	h = 381;
	h1 = height;
	w1 = width;
	if (pt==1) {
	document.getElementById('ph_title').innerHTML=title;
	} else {
	document.getElementById('ph_title').innerHTML=title2;
	}
	document.getElementById('ph_title1').innerHTML=title;
	document.getElementById('ph_title2').innerHTML=title2;
	if (width>w) {
	h1 = Math.round(height*w/width);
	w1 = w;
	}
	if (h1>h) {
	w1 = Math.round(w1*h/h1);
	h1 = h;
	}
	document.getElementById('ph_pic').innerHTML = '<img src="' + path + '"  alt="" align="top" id="ph_source" style="border:1px #575757 solid" width="' + w1 + '" height="' + h1 + '" />';
	document.getElementById('p_id').value = p_id;
	document.getElementById('def_p_id').value = p_id;
	document.getElementById('edit_p_id').value = p_id;
}

function popupUp(img) 
{
	window.open('popup_pic.php?i='+img,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,screenX=150,screenY=150,top=150,left=150');
}
function popupUp1(img) 
{
	window.open('popup_pic.php?i='+img,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,screenX=150,screenY=150,top=150,left=150');
}
function SetPhotoEdit()
{
	document.getElementById('what_do').value = 'edit';
	document.getElementById('p_title').value = document.getElementById('ph_title').innerHTML;
	document.getElementById('msg').innerHTML = '&nbsp;If you want to change photo, select file';
}

function SetClientPhotoEdit()
{
	document.getElementById('what_do').value = 'edit';
	document.getElementById('p_title').value = document.getElementById('ph_title1').innerHTML;
	document.getElementById('p_title2').value = document.getElementById('ph_title2').innerHTML;
	document.getElementById('msg').innerHTML = '&nbsp;If you want to change photo, select file';
}

function SearchMemberRequest(m_id, page)
{
	document.browse_members_form.page.value = page;
	document.getElementById('request_id').value = m_id;	
	document.browse_members_form.submit();
}
