<!--

	/* THE PURPOSE OF THIS FILE IS TO PROVIDE THE EXTERNAL JAVASCRIPTS */
	/* KYLE DE FRANCO 2009_10_05 */


	/* USED FOR THE TOP TABS */
		this_tab=-1;


	/* THE FUNCTION TO TRIM A FIELD */
		function trim(obj) {
			str=obj.value;
			while(str.substring(0,1)==" ") {
				str=str.substring(1);
			}
			while(str.substring(str.length-1)==" ") {
				str=str.substring(0,str.length-1);
			}
			obj.value=str;
		}


	/* THE FUNCTION TO VALIDATE AN EMAIL */
		function val_email(str) {
			if(
				str.length<6
				|| str.indexOf(",")>=0
				|| str.indexOf(";")>=0
				|| str.indexOf(":")>=0
				|| str.indexOf("/")>=0
				|| str.indexOf(" ")>=0
				|| str.indexOf("@")<=0
				|| (str.indexOf("@")!=str.lastIndexOf("@"))
				|| (str.lastIndexOf(".")<str.indexOf("@"))
			) {
				return false;
			} else {
				return true;
			}
		}


	/* FOR THE PRODUCT "POPUP" */
/*
		$(document).ready(
			function() {
				$("a.fb_prod").fancybox(
					{
						'frameWidth':	650, 
						'frameHeight':	500,
						'hideOnContentClick':	false
					}
				);
			}
		);
*/


	/* USED TO EMPLOY THIS WACKASS DESIGN */
		function alertSize() {
			//alert($(document).height);

			var myWidth = 0, myHeight = 0;
				if( typeof( window.innerWidth ) == 'number' ) {
					//Non-IE
					myWidth = window.innerWidth;
					myHeight = window.innerHeight;
				} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
					//IE 6+ in 'standards compliant mode'
					myWidth = document.documentElement.clientWidth;
					myHeight = document.documentElement.clientHeight;
				} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
					//IE 4 compatible
					myWidth = document.body.clientWidth;
					myHeight = document.body.clientHeight;
				}
			window.alert( 'Width = ' + myWidth);
			window.alert( 'Height = ' + myHeight);

		}


	/* THE FUNCTION TO OPEN THE "LANGUAGE WELCOME" */
		function open_wel_scr() {
			if(document.getElementById("div_index_left_flash01")) {
				document.getElementById("div_index_left_flash01").style.display="none";
				document.getElementById("div_index_container").style.display="none";
			}
			if(document.getElementById("div_new_left_flash01")) {
				document.getElementById("div_new_left_flash01").style.display="none";
			}
			document.getElementById("div_row_top").style.display="none";
			document.getElementById("div_border_top").style.display="none";
			document.getElementById("wel_scr_back").style.height=$(document).height();
			document.getElementById("wel_scr_back").style.display="block";
		}
	/* THE FUNCTION TO CLOSE THE "LANGUAGE WELCOME" */
		function close_wel_scr() {
			$("#wel_scr_back").hide();
			$("#div_index_left_flash01").show();
			$("#div_new_left_flash01").show();
			$("#div_index_container").show();
			$("#div_row_top").show();
			$("#div_border_top").show();
			/* document.location="index.php"; */
		}

	/* OPEN THE "LANGUAGE WELCOME" FROM ONE OF THE CONTACT ENTRIES */
		function open_wel_from_code(lang) {
			$.get(
				"_scripts/ajax_get_welcome_anchor.php?lang="+lang,
				function(data) {
					document.getElementById("a_wel_anch").innerHTML=data;
					document.getElementById("ifr_wel").src=lang+".htm";
					open_wel_scr();
				}
			);
		}

	/* THE "BUY" PAGE FUNCTIONS */
		function ajax_get_continent(continent_id) {
			document.getElementById("div_map_details").innerHTML="<img src=\"_images/loading_animations/8.gif\" />";
			$.get(
				"_scripts/ajax_get_continent.php",
				{
					continent_id: continent_id
				},
				function(data) {
					document.getElementById("div_map_continent").innerHTML="<h4>"+data+"</h4>";
					document.getElementById("div_map_details").innerHTML="";
				}
			);
		}
		function country_data(country_id) {
			document.getElementById("div_map_details").innerHTML="<img src=\"_images/loading_animations/8.gif\" />";
			$.get(
				"_scripts/ajax_get_country.php",
				{
					country_id: country_id
				},
				function(data) {
					document.getElementById("div_map_details").innerHTML=data;
				}
			);
		}
		function clear_continent() {
					document.getElementById("div_map_continent").innerHTML="";
					document.getElementById("div_map_details").innerHTML="";
		}

	/* HIDE LINKS TO SOME ARTICLES WHICH WERE NEVER TRANSLATED */
		$(document).ready(
			function() {
				loc=String(document.location);
				if(
					loc.indexOf("ggbearings.com.br")!=-1
				) {
					$("#casehistory10").hide();
				}
				if(
					loc.indexOf("ggbearings.es")!=-1
				) {
					$("#casehistory10").hide();
					$("#casehistory13").hide();
				}
				if(
					loc.indexOf("ggbearings.fr")!=-1
				) {
					$("#casehistory14").hide();
				}
				if(
					loc.indexOf("ggbearings.cn")!=-1
				) {
					$(".callout012").hide();
					$("#casehistory09").hide();
					$("#casehistory10").hide();
					$("#casehistory13").hide();
					$("#casehistory14").hide();
				}
				if(
					loc.indexOf("ggbearings.de")!=-1
					||
					loc.indexOf("ggbearings.at")!=-1
				) {
					$(".case_history_container_0113").hide();
				}
			}
		);

	/* HIDE ERRORS */
		function noerrors() {window.status=document.title; return true;}
		window.onerror=noerrors;

-->
