// JavaScript Document
function resetMyForm(formName) {
	fName = (formName == null) ? 0 : formName;
	if (document.forms[fName] == null) {
		alert('Error while trying to reset the FORM.\n\nPlease contact website administrator.\nThank you!');
	}
	else if(confirm('Are you sure that you want to RESET form?'))
	{
	  document.forms[fName].reset();
	} 
}

function comm_window_open(open_page, page_name, pg_height, pg_width, pg_scroll, pg_top, pg_left)
{
	var d = new Date();
	d = Date.parse(d);
	window.open(open_page,page_name+d, "height="+pg_height+",width="+pg_width+",scrollbars="+pg_scroll+",top="+pg_top+",left="+pg_left);
}
	

function rename(pmName)
{
	var vLocalServer		=	"http://bi1new/mytone/web/"+pmName+".htm";
	var vTemp				=	location.href;
	
	if(vLocalServer	!=	vTemp)
	{
		vTemp		=	"https://www.mytonecreator.com/web/buy.php?rand('1233')";
	}
	else
	{
		vTemp		=	"http://bi1new/mytone/web/buy.php";
	}
			
	window.location.href = vTemp;
			// getURL("javascript:window.open('buy.php','wname')"); 
}

function isPhoneNo(pmPhNo,pmintMinLen,pmintMaxLen)
	{   var i;
		var returnString = "";
		var phoneNumberDelimiters = "0123456789()-,  ext.";
		// Search through string's characters one by one.
		// If character is not in bag, append to returnString.
		for (i = 0; i < pmPhNo.length; i++)
		{   
			// Check that current character isn't whitespace.
			var c = pmPhNo.charAt(i);
			if(c == "-")
				pmintMinLen++;
			if (phoneNumberDelimiters.indexOf(c) == -1) 
				return false;
		}
		if(pmPhNo.length>pmintMaxLen || pmPhNo.length<pmintMinLen)
			return false;
		else	
			return true;
	}
