
var imgPathOver = "/_images/mouseover/";
var imgPath = "/_images/";

var Quote_Over=new Image();
var Quote_=new Image();
Quote_Over.src=imgPathOver+"QuoteReq_3d.jpg";		
Quote_.src=imgPath+"QuoteReq_3d.jpg";	

var MyBTC_Over=new Image();
var MyBTC_=new Image();
MyBTC_Over.src=imgPathOver+"MyBtc_3d.jpg";		
MyBTC_.src=imgPath+"MyBtc_3d.jpg";	

var Facility_Over=new Image();
var Facility_=new Image();
Facility_Over.src=imgPathOver+"Facilities_3d.jpg";		
Facility_.src=imgPath+"Facilities_3d.jpg";	


// function to show "out" images on main menu 
function ShowOut (name,imgPath)
{    
	var image = document.getElementById(name);
	image.src = eval(imgPath+'.src');  
}

// function to show "over" images on menu

function ShowOver(name,imgPath)
{    
	var image = document.getElementById(name);
	image.src = eval(imgPath+'.src');  
}

function SelectCheck(){
	if(document.FormCheck.CheckSkipGeneral.checked){
		document.Form1.CheckSkip.value = "on";
		document.Form2.CheckSkip.value = "on";
		document.Form3.CheckSkip.value = "on";
	}
	else{
		document.Form1.CheckSkip.value = "off";
		document.Form2.CheckSkip.value = "off";
		document.Form3.CheckSkip.value = "off";
	}
}

function init(){

}

function CheckSpace(obj){
	if(obj.value == ''){
		alert('"Part Number" field cannot be empty.')
		//obj.focus();
		};
}
function CheckType(obj, sType){
	var err=0;
	var m;
	var mo = new Array(2);
	a = obj.value;
	if(sType == 'date'){
		if (a.length != 10) err=1
		b = a.substring(0, 4) 
		c = a.substring(4, 5)
		d = a.substring(5, 7)
		e = a.substring(7, 8)
		f = a.substring(8, 10)

		if(isNaN(b)==true || isNaN(d)==true || isNaN(f)==true) err = 1

		if (b<1900 || b>2099) err = 1
		if (c=='-' || c=='/' || c=='\\') ; else err = 1
		if (d<1 || d>12) err = 1
		if (e=='-' || e=='/' || e=='\\') ; else err = 1
		if (f<1 || f>31) err = 1
	
		if (d==4 || d==6 || d==9 || d==11){
			if (f==31) err=1
			}

		if (d==2){
			var g=parseInt(b/4)
			if (isNaN(g)) {
				err=1
			}
	
			if (f>29) err=1
			if (f==29 && ((b/4)!=parseInt(b/4))) err=1
			}
		if (a.length>0 && err==1){
			alert('Invalid date entry.');
			//obj.focus();
			}            
	}
	else {
	if(sType == 'number'){
		ex = /^\d+$/;
		m = a.match(ex);
		if(a.length>0 && m==null) err=1
		if (err==1){
			alert('Number expected.');
			//obj.focus();
			}            
	}
	else {
	if(sType == 'money'){
		if(a.indexOf('.')>-1){
			mo = a.split('.');
			ll = 1;
		}
		else 
		if(a.indexOf(',')>-1){
			mo = a.split(',');
			ll = 1;
			}
		else { 
			if(isNaN(a) == true){
				err = 1;
				}
			ll = 0;
			}

		if(ll == 1){
			if(mo.length>2) err = 1
			if(isNaN(mo[0]) == true){
				err = 1;
				}
			if(isNaN(mo[1]) == true || mo[1].length>2){
				err = 1;
				}
			}
		if (err==1){
			alert('Invalid money entry.');
			//obj.focus();
			}            
		}
	else{
		if(sType == 'email'){
			ex = /\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/;
			m = a.match(ex);
			if(m==null) err=1
			if (err==1){
				alert('Incorrect e-mail.');
				//obj.focus();
				}
		}
		else{
			alert('Unknown data type.');
		};
	};
	};
        };
}
