/* Vendor to add their own javascript here */

function trim(stringToTrim) {
        return stringToTrim.replace(/^\s+|\s+$/g,"");
}
function ltrim(stringToTrim) {
        return stringToTrim.replace(/^\s+/,"");
}
function rtrim(stringToTrim) {
        return stringToTrim.replace(/\s+$/,"");
}

function trimAndClean(value) {
   var temp = trim(value);

   var obj = /^(\s*)([\W\w]*)(\b\s*$)/;
   if (obj.test(temp)) { temp = temp.replace(obj, '$2'); }
   var obj = / +/g;
   temp = temp.replace(obj, " ");
   if (temp == " ") { temp = ""; }

   return temp;
}

function window_popup(file) {
window.open(file,'_blank', 'width=500, height=600, left=50, top=50, scrollbars=1');
}

function coupon_popup(file) {
window.open(file,'_blank', 'width=700, height=600, left=50, top=50, scrollbars=1');
}

function ofk_popup(file) {
window.open(file,'_blank', 'width=970, height=700, left=50, top=50, scrollbars=1');
}

function calculator_popup(file) {
window.open(file,'_blank', 'width=810, height=610, left=50, top=50, scrollbars=1');
}

function print_page(page_url) {
window.open(page_url,'_blank', 'width=540, height=600, left=10, top=10, scrollbars=1');
}

function imgMouseOver( imgId ) {
	document.getElementById(imgId).src="/images/rollover/" + imgId + "_hover.gif";
}
function imgMouseOff( imgId ) {
	document.getElementById(imgId).src="/images/rollover/" + imgId + ".gif";
}

function openOverlay(hiddenDiv) {
	document.getElementById(hiddenDiv).style.display='';
}

function closeOverlay(hiddenDiv) {
	document.getElementById(hiddenDiv).style.display='none';
}