
var imgname ;
// function to get the radio/checkbox value
function getCheckedValue(radioObj) {
	if(!radioObj)
		return "";
	var radioLength = radioObj.length;
	if(radioLength == undefined)
		if(radioObj.checked)
			return radioObj.value;
		else
			return "";
	for(var i = 0; i < radioLength; i++) {
		if(radioObj[i].checked) {
			return radioObj[i].value;
		}
	}
	return "";
}


function cNum(e)
{
	var strCheck = '0123456789\b\t ';
	var whichCode = (window.event)? e.keyCode : e.which;
	if(whichCode == 0 || whichCode == 13)
	{
		return true;
	}
	key = String.fromCharCode(whichCode);
	if(strCheck.indexOf(key) == -1) return false;
}

function cAlpha(e)
{
	var strCheck = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\b\t ';
	var whichCode = (window.event)? e.keyCode : e.which;
	if(whichCode == 65 || whichCode == 90)
	{
		return true;
	}
	
	key = String.fromCharCode(whichCode);
	if(strCheck.indexOf(key) == -1) return false;
}


//To open a popup window for the print preview.
function pageprint(pgtitle)
{
	var winURL = "printer.php?pgtitle=" + pgtitle ;
	var winName = "PrinterFriendly";
	var winOptions = "width=630,height=562,toolbar=no,location=no,menu=no,status=no,scrollbars=yes";
	
	window.open(winURL, winName, winOptions);
	
}


function wopen()
{
	var winURL = 'email_to_fax_faq.php';
	var winName = "FAQ";	
	var winOptions = "width=570,height=550,toolbar=no,location=no,menu=no,status=no,scrollbars=yes";
	
	window.open(winURL, winName, winOptions);
}

function wopen1(file,winname)
{
	var winURL = 'file';
	var winName = "winname";	
	var winOptions = "width=570,height=470,toolbar=no,location=no,menu=no,status=no,scrollbars=yes";
	
	window.open(winURL, winName, winOptions);
}

function open_win(file,winname)
{
	var winURL = file;
	var winName = winname;	
	var winOptions = "width=570,height=470,toolbar=no,location=no,menu=no,status=no,scrollbars=yes";
	
	window.open(winURL, winName, winOptions);
}

//To access the printable content from the main window.
function generatePrinterFriendly(dest_div)
{
	
	var s = opener.document.getElementById(dest_div);
	var t = document.getElementById("PrinterBody");
	t.innerHTML = s.innerHTML;
	hideImages();
	imgname = t.innerHTML;
}

//To hide images for print 
function hideImages()
{
	var img_arr = new Array();
	img_arr = document.getElementsByTagName("img");
	var i;
	
	for(i=2;i<img_arr.length-1;i++)
	{
		img_arr[i].style.display = "none";
		
	}
	
	
}


function check_email(value)
{
value = value.replace(/\n\r/g, '');
value = value.replace(/\r/g, '');

	if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(value))
	{	
		return true;
	}else{
		return false;
	}
}
function trim_spaces(sString) 
{
	while (sString.substring(0,1) == ' ')
	{
		sString = sString.substring(1, sString.length);
	}
	while (sString.substring(sString.length-1, sString.length) == ' ')
	{
		sString = sString.substring(0,sString.length-1);
	}
	return sString;
}




