function removefromfavorite() {
	var answer = confirm("Are you sure you want to remove this listings from your favorites?");
	if (answer){
		
		var answer_confirem = confirm("Removing this listing will remove all your saved options and pricing information as well.\n\n Are you sure you want to remove this listing and all related records?");
		
		if(answer_confirem){
		
		return true;
		
		}else{
		
		return false;
		
		}
		
	}
	else{
		return false;
	}
}
function copyConfirmation() {
	var answer = confirm("Do you want to copy this record?");
	if (answer){

		return true;
	
	}
	else{
		return false;
	}
}
function removeOptionImage() {
	var answer = confirm("Do you want to remove this image?");
	if (answer){

		return true;
	
	}
	else{
		return false;
	}
}
function changetoPackageConfirmation() {
	var answer = confirm("Do you want to save it as package options? \n\n Single options for this custom home will be overwritten!");
	if (answer){

		return true;
	
	}
	else{
		return false;
	}
}
function changetoSingleOptionConfirmation() {
	var answer = confirm("Do you want to save it as single options? \n\n Package options for this custom home will be overwritten!");
	if (answer){

		return true;
	
	}
	else{
		return false;
	}
}
function copyConfirmationDefault() {
	var answer = confirm("Do you want to copy this record to Defaults?");
	if (answer){
	
		return true;
		
	}
	else{
		return false;
	}
}
function confirmation() {
	var answer = confirm("Do you want to delete this record?");
	if (answer){
		
		
		
		return true;
		
		
		
	}
	else{
		return false;
	}
}
function removeConfirmation() {
	var answer = confirm("Do you want to remove this record?");
	if (answer){
		
		
		
		return true;
		
		
		
	}
	else{
		return false;
	}
}
function duobleconfirmation() {
	var answer = confirm("Do you want to delete this record?");
	if (answer){
		
		var answer_confirem = confirm("You are attempting to delete a parent record with related child records connected to it.\n Deleting this record will delete all related child records also.\n\n Are you sure you want to delete this record and all related records?");
		
		if(answer_confirem){
		
		return true;
		
		}else{
		
		return false;
		
		}
		
	}
	else{
		return false;
	}
}

function saveConfirmation() {
	var answer = confirm("Do you want to Save this Option?");
	if (answer){
		
		return true;
	}
	else{
		return false;
	}
}
function saveListNameValidation(){
	
	if(listform.lstName.value == ""){
		
		alert("Please Enter List Name");
		
		return false;
		
	}
	
  return true;
	
}
function openhelp(sLink)
{
PicWin=window.open(sLink, "openhelp", "width=760,height=560,scrollbars=yes,toolbar=no,location=no,statusbar=yes,menubar=no,resizable=yes,left=25,top=25");
}
function OpenCalc(sLink){
   {
   w = screen.availWidth;
   h = screen.availHeight;
   }
var popW = 680, popH = 700;
var leftPos = (w-popW)/2, topPos = (h-popH-150)/2;

PicWin=window.open(sLink, "OpenCalc",'width=' + popW + ' height=' + popH + ' top=' + topPos + ' left=' + leftPos + 
'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1');
}
function OpenLargePhoto(sLink){
   {
   w = screen.availWidth;
   h = screen.availHeight;
   }
var popW = 960, popH = 700;
var leftPos = (w-popW)/2, topPos = (h-popH-150)/2;

PicWin=window.open(sLink, "LargePhoto",'width=' + popW + ' height=' + popH + ' top=' + topPos + ' left=' + leftPos + 
'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0');
}

function popUpEdit(URL, edit, width ,scroll){
    		if (scroll == "yes")
    		{
    			scrollvalue = 1;
    		}
    		else
    		{
    			scrollvalue = 0;
    		}

    		popid = window.open(URL, edit, 'toolbars=0, scrollbars=0, location=1, statusbars=1, menubars=0, resizable=1, width=550, height=540, left = 250, top = 200');
    		popid.focus();
 }
			
			
function popUp(URL, popup, width ,scroll){
		if (scroll == "yes")
			{
				scrollvalue = 1;
			}
			else
			{
				scrollvalue = 0;
			}

    		popid = window.open(URL, popup, 'toolbars=0, scrollbars=0, location=0, statusbars=0, menubars=0, resizable=1, width=600, height=560, left = 250, top = 10');
    		popid.focus();
 }
function goBack(){
  
  history.back()
  
}

function OpenPrintPage(URL){
  
  window.open(URL);
}

function PlatMapPopUp(URL, map, width ,scroll)
    	{
    		popid = window.open(URL, map, 'toolbars=0, scrollbars=1, location=0, statusbars=0, menubars=0, resizable=1, width=400, height=350, left = 50, top = 50');
    		popid.focus();
    	}

function ismaxlength(obj){
var mlength=obj.getAttribute? parseInt(obj.getAttribute("maxlength")) : ""
if (obj.getAttribute && obj.value.length>mlength)
obj.value=obj.value.substring(0,mlength)
}
function roundNumber(number,decimal_points) {
	if(!decimal_points) return Math.round(number);
	if(number == 0) {
		var decimals = "";
		for(var i=0;i<decimal_points;i++) decimals += "0";
		return "0."+decimals;
	}

	var exponent = Math.pow(10,decimal_points);
	var num = Math.round((number * exponent)).toString();
	return num.slice(0,-1*decimal_points) + "." + num.slice(-1*decimal_points)
}

