//SEND TO A FRIEND FUNCTION
var sendLinkPage='/custom_asp/sendlink.asp'
var strPageLink=parent.location.href

function fncWin(linkToSend) {
	sendLinkWin=window.open(sendLinkPage+'?sendLink='+linkToSend,'sendLinkWin','toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=yes,width=380,height=350')
	sendLinkWin.focus()
}
//<Trim spaces on the begging/end of a string>

function trimCint(str) {
	var tmpInt=parseInt(fncTrim(str));
	if (isNaN(tmpInt)) tmpInt=0;
	return tmpInt;
}

function fncOnlyNumbers(oElement) { 
	var sValue=fncFormatInput(oElement); 
	oElement.value=sValue.replace(/[^,\.\d-]*/g,''); 
}

function fncFormatInput(pObject) { 
	var oValue=pObject.value 
	var tmpStr=fncTrim(oValue); 
	pObject.value=tmpStr; 
	return tmpStr; 
} 
//like TRIM in VBscript 
function fncTrim(str) { 
var tmpStr=str.replace(/^\s+/gi,''); 
tmpStr=tmpStr.replace(/\s+$/gi,'') 
return tmpStr; 
}
function fncValidate(oElement,pRegEx) { 
	var tmpElement=fncTrim(oElement.value); 
	oElement.value=tmpElement; 
	if (tmpElement.search(pRegEx)<0) { 
		return false; 
	} else { 
		return true; 
	} 
}

//Checking functions
//<CHECK email>
function fncValidateEmail(pEmail) {
	var re=/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/gi
	var strMail=fncTrim(pEmail.toLowerCase());
	var bResult=strMail.search(re)
	if (bResult==-1) {
		return false;
	} else { return true;}
}
//</CHECK email>