function showHiddenTextInput(tid, selid){
	_sel = document.getElementById(selid);
	_inp = document.getElementById(tid);
	_inp.className = "hiddenTextInput";
	_inp.value = "";
	if ( _sel.options[_sel.selectedIndex].value == 'y' ){
		_inp.className = "visibleTextInput";
	}
}

function deleteImage(pid, imid, obj){
	res = confirm('Are you sure to delete this image?');
	if ( res ){
		obj.href = 'filemanager.php?pid=' + pid + '&delimage_form_sent=1&images_id=' + imid + '&confirmation=1';
	}
	return (res);
}

function deleteDocument(pid, imid, obj){
	res = confirm('Are you sure to delete this document?');
	if ( res ){
		obj.href = 'filemanager.php?pid=' + pid + '&deldocument_form_sent=1&documents_id=' + imid + '&confirmation=1';
	}
	return (res);
}

function deleteProperty(pid, obj){
	res = confirm('Are you sure to delete this property?');
	if ( res ){
		obj.href = 'roll.php?pid=' + pid + '&delproperty_form_sent=1&confirmation=1';
	}
	return (res);
}

function deleteUser(aid, obj){
	res = confirm('Are you sure to delete this user?');
	if ( res ){
		obj.href = 'agents.php?delagent_form_sent=1&confirmation=1&aid=' + aid;
	}
	return (res);
}

function deleteAgentImage(aid, obj){
	res = confirm('Are you sure to delete this photo?');
	if ( res ){
		obj.href = 'agents.php?del_agent_photo=1&confirmation=1&aid=' + aid;
	}
	return (res);
}

function deleteAgentImageSelf(obj){
	res = confirm('Are you sure to delete this photo?');
	if ( res ){
		obj.href = 'users.php?del_agent_photo_self=1&confirmation=1';
	}
	return (res);
}

function changeMain(imsrc, width, height){
	mimg = document.getElementById('mainImg');
	mimg.src = imsrc;
	mimg.width = width;
	mimg.height = height;
}

function GetLoginWindow(mypage,myname,w,h,scroll)
{
	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
	settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll
	newwin = window.open(mypage,myname,settings)
	if(newwin.window.focus){
		newwin.window.focus();
	}
	return (false);
}

function showContactForm(pID){
	wWidth = "400px";
	wHeight = "250px";
	window.open("contact-agent.php?pID=" + pID, "mywin", "status=0, toolbar=0, width=" + wWidth + ", height=" + wHeight + "");
	return (false);
}

function showFriendForm(pID){
	wWidth = "400px";
	wHeight = "250px";
	window.open("email-friend.php?pID=" + pID, "mywin", "status=0, toolbar=0, width=" + wWidth + ", height=" + wHeight + "");
	return (false);
}