function navitem1over (divObject, switchValue) {
	if(switchValue == 0) {
		divObject.style.backgroundImage = "url(http://www.yourleverage.com/imgmain/navitem1pat.gif)";
	} else if (switchValue == 1) {
		divObject.style.backgroundImage = "url(http://www.yourleverage.com/imgmain/navitem1patover.gif)";
	}
}

function navitem2over (divObject, switchValue) {
	if(switchValue == 0) {
		divObject.style.backgroundImage = "url(http://www.yourleverage.com/imgmain/navitem2line.gif)";
	} else if (switchValue == 1) {
		divObject.style.backgroundImage = "url(http://www.yourleverage.com/imgmain/navitem2lineover.gif)";
	}
}

function goToLink (url) {
	window.location = url;
}

function newWindow(a) {
      a.target = "_blank";
}

function NewWindow(mypage,myname,w,h,scroll){
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings =
'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
win = window.open(mypage,myname,settings)
}

function object_support_detect () {
	// <object> tag support check for the browser
	// Write an object to the browser
	// then test if it exists
	// Return value can be used to choose <object> or <embed> support
	var testName = "blank";
	document.write("<object id=\"" + testName + "\"></object>");
	var testObject;
	if ( window.mmIsOpera ) testObject = (document.getElementById(item));
	if (document.all) testObject = (document.all[item]);
	if (document.getElementById) testObject = (document.getElementById(item));
	if (testObject == null) {
		return false;
	} else {
		return true;
	}
}


function isnotint(a) {
	if ( (navigator.appName != "Netscape") && (parseInt(navigator.appVersion)<=3) ) {
		for (k=0 ; k<a.length ; k++) {
			if (a.substring(k,k+1) < "0" | a.substring(k,k+1) > "9") {
				if (a.substring(k,k+1) != "," & a.substring(k,k+1) != "$" & a.substring(k,k+1) != "%")
				return true;
	}	}	}
	return false;
}

function verifycommission(checkstring) {
        var newvalue = parseFloat(checkstring);
        if (isNaN(newvalue) || newvalue<0){
            newvalue = 0;
        }
        document.addproduct.commission.value=newvalue;
}

function verifyreferralfee(checkstring) {
        var newvalue = parseFloat(checkstring);
        if (isNaN(newvalue) || newvalue<0){
            newvalue = 0;
        }
	document.addproduct.supplierreferralfee.value=newvalue;
}

function verifyfloat(field) {
        var newvalue = parseFloat(field.value);
        if (isNaN(newvalue) || newvalue<0) {
            newvalue = 0;
        }
        field.value = newvalue;
}
