/***********************************************/
/*** EPPENDORF 2005                          ***/
/*** LOGIN JAVA SCRIPT FUNCTIONS             ***/
/*** CREATED BY SSM / TURBO D3 GMBH          ***/
/***********************************************/

/***********************************************/
/*** CHECK LOGIN BOX                         ***/
/***********************************************/

	function checkLogin (msgid) {

		if (self.document.loginform.login.value == '' || self.document.loginform.password.value == '') {

			show(msgid);
			return false;

		} else {

			self.document.loginform.submit();
			return (true);

		}  // END ELSE

	} // END FUNCTION

/***********************************************/
/*** CHECK BOX SEARCH                        ***/
/***********************************************/

	function checkBoxSearch (msgid,btnobj) {

		var searchobj1 = self.document.boxcsearchform.simplesearch;
	//	var searchobj2 = self.document.boxosearchform.ordernosearch;
		var searchobj3 = self.document.boxcsearchform.searchaction;
	//	var searchobj4 = self.document.boxosearchform.searchaction;

		if (btnobj.name == 'submitsimpleboxsearch' || btnobj.name == 'boxcsearchform') {

			if ((searchobj1.value == '') || (searchobj1.value == 'Search STARLAB')) {

				// show(msgid);
				alert ("Please enter search term");
				return (false);

			} else {

				searchobj3.value = 'search';
				self.document.boxcsearchform.submit();
				return (true);

			}  // END ELSE

		}
		/*
		 else if (btnobj.name == 'submitorderboxsearch' || btnobj.name == 'boxosearchform') {

			if (searchobj2.value == '') {

				show(msgid);
				return (false);

			} else {

				searchobj4.value = 'search';
				self.document.boxosearchform.submit();
				return (true);

			}  // END ELSE

		} else if (btnobj.name == 'resetboxsearch') {

			searchobj1.value = '';
			searchobj2.value = '';
			searchobj3.value = 'reset';
			self.document.boxcsearchform.submit();

			return (true);

		} // END ELSE

		*/

	} // END FUNCTION

/***********************************************/
/*** PRINT PAGE OPENER                       ***/
/***********************************************/

	function openPrintPage (url) {

		if (url) {

			var agt = navigator.userAgent.toLowerCase();

			if (agt.indexOf("opera")!= -1) {

				newWindow = window.open(url);
				newWindow.focus();

			} else {

				var sh = screen.height;
				var sw = screen.width;

				var wx = (sw / 2) - 320;
				var wy = (sh / 2) - 250;

				newWindow = window.open(url,'eagprintpage','scrollbars=yes,resizable=yes,menubar=yes,toolbar=no,width=640,height=500,left='+wx+',top='+wy);
				newWindow.focus();

			} // END ELSE

		} // END IF

	} // END FUCNTION

/***********************************************/
/*** CHECK TELL A FRIEND FORM                ***/
/***********************************************/

	function checkTAF (msgidemail,msgidtext) {

		obj1 = self.document.tafform.tafsenderemail;
		obj2 = self.document.tafform.tafrcptemail;

		// CHECK TEXT
		if (obj1.value == '' || obj2.value == '') {

			show(msgidtext);
			return (false);

		} else {

			if (checkEmail(obj1.value) == true && checkEmail(obj2.value) == true) {

				return (true);

			} else {

				show(msgidemail);
				return (false);

			} // END ELSE

		} // END ELSE

	} // END FUNCTION

/***********************************************/
/*** WORLD WIDE OPENER                       ***/
/***********************************************/

	function jumpSite(obj,mode) {

		if (obj.options[obj.selectedIndex].value == "0") {

			// DO NOTHING

		} else {

			var jumptarget = obj.options[obj.selectedIndex].value;

			jump(jumptarget,mode);

		} // END ELSE

	} // END FUNCTION

/***********************************************/
/*** CHANGE MENU BOX                         ***/
/***********************************************/



	function changeBox (boxid,headid) {

		headobj = document.getElementById(headid);
		boxobj = document.getElementById(boxid);

		if (headobj && boxobj) {

			if (boxobj.style.display == 'none') {

				showDisplay(boxid);
				changecss(headid,'boxmenuitemlinkon');

			} else {

				hideDisplay(boxid);
				changecss(headid,'boxmenuitemlinkoff');

			} // END ELSE

		} // END IF

	} // END FUNCTION

	function changeBoxEx (boxid,headid,prefix) {

		headobj = document.getElementById(headid);
		boxobj = document.getElementById(boxid);

		if (headobj && boxobj) {

			if (boxobj.style.display == 'none') {

				showDisplay(boxid);
				changecss(headid,prefix + 'boxmenuitemlinkon');

			} else {

				hideDisplay(boxid);
				changecss(headid,prefix + 'boxmenuitemlinkoff');

			} // END ELSE

		} // END IF

	} // END FUNCTION

/***********************************************/
/*** SEND DISTRIBUTOR FORM                   ***/
/***********************************************/

	function changeBoxDistributor(obj) {

		if (obj.options[obj.selectedIndex].value != "0") {

			self.document.distributorboxform.submit();

		} // END IF

	} // END FUNCTION

/***********************************************/
/*** CHECK BOX SALES LOCATOR                 ***/
/***********************************************/

	function checkBoxSalesLocator (msgid,btnobj) {

		var searchobj1 = self.document.salesrepboxform.boxsaleszipcode;

		if (btnobj.name == 'submitsaleslocatorbox') {

			if (searchobj1.value == '') {

				show(msgid);
				return (false);

			} else {

				self.document.salesrepboxform.submit();
				return (true);

			} // END ELSE

		} // END IF

	} // END FUNCTION
