function date(){
	var currentTime = new Date()
	var year = currentTime.getFullYear()
	document.write(year)
}

function setVisibility(visibility) {
	document.getElementById('hoverbox').style.display = visibility;
}

var divName = 'hoverbox';

var offX = 10;
var offY = 10;

var offXright = -200;
var offYright = 10;

function mouseX(evt) {if (!evt) evt = window.event; if (evt.pageX) return evt.pageX; else if (evt.clientX)return evt.clientX + (document.documentElement.scrollLeft ?  document.documentElement.scrollLeft : document.body.scrollLeft); else return 0;}
function mouseY(evt) {if (!evt) evt = window.event; if (evt.pageY) return evt.pageY; else if (evt.clientY)return evt.clientY + (document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop); else return 0;}

function updatebox(evt, path) {
	if (document.getElementById) {
		var obj = document.getElementById(divName).style; 
		obj.visibility = 'visible'; 
		document.getElementById('hoverimage').src = path;
		obj.left = (parseInt(mouseX(evt))+offX) + 'px';
		obj.top = (parseInt(mouseY(evt))+offY) + 'px';
	}
}

function updateboxright(evt, path) {
	if (document.getElementById) {
		var obj = document.getElementById(divName).style; 
		obj.visibility = 'visible'; 
		document.getElementById('hoverimage').src = path;
		obj.left = (parseInt(mouseX(evt))+offXright) + 'px';
		obj.top = (parseInt(mouseY(evt))+offYright) + 'px';
	}
}

function loadServices()
{
	if (document.images)
	{
	  ser1 = new Image();	
	  ser2 = new Image();	
	  ser3 = new Image();	
	  ser4 = new Image();
	  ser5 = new Image();
	  ser6 = new Image();
	  ser7 = new Image();
	  ser8 = new Image();
	  ser9 = new Image();
	  ser10 = new Image();
	  ser11 = new Image();
	  ser12 = new Image();	
	  ser13 = new Image();	
	  ser14 = new Image();	
	  ser15 = new Image();	
	  ser16 = new Image();	
	  ser17 = new Image();		
		
	  ser1.src="images/services/services_consulting_main_1.jpg";
	  ser2.src="images/services/services_consulting_main_2.jpg";
	  ser3.src="images/services/services_design_main_1.jpg";
	  ser4.src="images/services/services_design_main_2.jpg";
	  ser5.src="images/services/services_design_main_3.jpg";
	  ser6.src="images/services/services_design_main_4.jpg";
	  ser7.src="images/services/services_installation_main_1.jpg";
	  ser8.src="images/services/services_manufacturing_main_1.jpg";
	  ser9.src="images/services/services_manufacturing_main_2.jpg";
	  ser10.src="images/services/services_manufacturing_main_3.jpg";
	  ser11.src="images/services/services_projectmanagement_main_1.jpg";
	  ser12.src="images/services/services_projectmanagement_main_2.jpg";
	  ser13.src="images/services/services_systemsintegration_main_1.jpg";
	  ser14.src="images/services/services_systemsintegration_main_2.jpg";
	  ser15.src="images/services/services_systemsintegration_main_3.jpg";
	  ser16.src="images/services/services_training_main_1.jpg";
	  ser17.src="images/services/services_training_main_2.jpg";
	}
	
}
function loadExpertise()
{
	if (document.images)
	{
	  exp1 = new Image();
	  exp2 = new Image();
	  exp3 = new Image();
	  exp4 = new Image();
	  exp5 = new Image();
	  exp6 = new Image();
	  exp7 = new Image();
	  exp8 = new Image();
	  exp9 = new Image();
	  exp10 = new Image();
	  exp11 = new Image();
	  exp12 = new Image();	
	  exp13 = new Image();	
	  exp14 = new Image();
	  exp15 = new Image();
	  exp16 = new Image();
	  exp17 = new Image();	
	  exp18 = new Image();	
	  exp19 = new Image();	
	  exp20 = new Image();	
	  exp21 = new Image();	
	  exp22 = new Image();	
	  exp23 = new Image();	
	  exp24 = new Image();	
	  exp25 = new Image();	
	  exp26 = new Image();	
	  exp27 = new Image();	
	  exp28 = new Image();	
	  exp29 = new Image();	
	  exp30 = new Image();	
	  exp31 = new Image();	
	  exp32 = new Image();	
	  exp33 = new Image();	
	  exp34 = new Image();	
	  exp35 = new Image();	
	  exp36 = new Image();
	  exp37 = new Image();
	  exp38 = new Image();		
	  exp39 = new Image();		
	  exp40 = new Image();		
	  exp41 = new Image();		
	  exp42 = new Image();		
	  
	  exp1.src="images/expertise/expertise_contractmanufacturing_main_1.jpg";
	  exp2.src="images/expertise/expertise_contractmanufacturing_main_2.jpg";
	  exp3.src="images/expertise/expertise_contractmanufacturing_main_3.jpg";
	  exp4.src="images/expertise/expertise_conveyor_main_1.jpg";
	  exp5.src="images/expertise/expertise_conveyor_main_2.jpg";
	  exp6.src="images/expertise/expertise_conveyor_main_3.jpg";
	  exp7.src="images/expertise/expertise_flexiblemanufacturing_main_1.jpg";
	  exp8.src="images/expertise/expertise_flexiblemanufacturing_main_2.jpg";
	  exp9.src="images/expertise/expertise_flexiblemanufacturing_main_3.jpg";
	  exp10.src="images/expertise/expertise_highvacuum_main_1.jpg";
	  exp11.src="images/expertise/expertise_highvacuum_main_2.jpg";
	  exp12.src="images/expertise/expertise_highvacuum_main_3.jpg";
	  exp13.src="images/expertise/expertise_highvacuum_main_4.jpg";
	  exp14.src="images/expertise/expertise_pharmaceutical_main_1.jpg";
	  exp15.src="images/expertise/expertise_pharmaceutical_main_2.jpg";
	  exp16.src="images/expertise/expertise_pharmaceutical_main_3.jpg";
	  exp17.src="images/expertise/expertise_pharmaceutical_main_4.jpg";
	  exp18.src="images/expertise/expertise_processequipment_main_1.jpg";
	  exp19.src="images/expertise/expertise_processequipment_main_2.jpg";
	  exp20.src="images/expertise/expertise_processequipment_main_3.jpg";
	  exp21.src="images/expertise/expertise_processequipment_main_4.jpg";
	  exp22.src="images/expertise/expertise_processequipment_main_5.jpg";
	  exp23.src="images/expertise/expertise_roboticcells_main_1.jpg";
	  exp24.src="images/expertise/expertise_roboticcells_main_2.jpg";
	  exp25.src="images/expertise/expertise_roboticcells_main_3.jpg";
	  exp26.src="images/expertise/expertise_semiconductor_main_1.jpg";
	  exp27.src="images/expertise/expertise_semiconductor_main_2.jpg";
	  exp28.src="images/expertise/expertise_semiconductor_main_3.jpg";
	  exp29.src="images/expertise/expertise_specialmachinery_main_1.jpg";
	  exp30.src="images/expertise/expertise_specialmachinery_main_2.jpg";
	  exp31.src="images/expertise/expertise_specialmachinery_main_3.jpg";
	  exp32.src="images/expertise/expertise_specialmachinery_main_4.jpg";
	  exp33.src="images/expertise/expertise_specialmachinery_main_5.jpg";
	  exp34.src="images/expertise/expertise_visioninspection_main_1.jpg";
	  exp35.src="images/expertise/expertise_visioninspection_main_2.jpg";
	  exp36.src="images/expertise/expertise_visioninspection_main_3.jpg";
	  exp37.src="images/expertise/expertise_webhandling_main_1.jpg";
	  exp38.src="images/expertise/expertise_webhandling_main_2.jpg";
	  exp39.src="images/expertise/expertise_webhandling_main_3.jpg";
	  exp40.src="images/expertise/expertise_webhandling_main_4.jpg";
	  exp41.src="images/expertise/expertise_precision_fabrication_main_1.jpg";
	  exp42.src="images/expertise/expertise_precision_fabrication_main_2.jpg";
	}
	
}
function loadIndustries()
{
	if (document.images)
	{
	  ind1 = new Image();	
	  ind2 = new Image();	
	  ind3 = new Image();	
	  ind4 = new Image();	
	  ind5 = new Image();	
	  ind6 = new Image();	
	  ind7 = new Image();	
	  ind8 = new Image();	
	  ind9 = new Image();	
	  ind10 = new Image();	
	  ind11 = new Image();	
	  ind12 = new Image();	
	  ind13 = new Image();	
	  ind14 = new Image();	
	  ind15 = new Image();	
	  ind16 = new Image();	
	  ind17 = new Image();	
	  ind18 = new Image();	
	  ind19 = new Image();	
	  ind20 = new Image();	
	  ind21 = new Image();	
	  ind22 = new Image();	
	  ind23 = new Image();	
	  ind24 = new Image();	
	  ind25 = new Image();	
	  ind26 = new Image();	
	  ind27 = new Image();	
	  ind28 = new Image();	
	  ind29 = new Image();	
	  ind30 = new Image();	
	  ind31 = new Image();	
	  ind32 = new Image();	
	  ind33 = new Image();	
	  ind34 = new Image();	
	  ind35 = new Image();	
	  ind36 = new Image();	
	  ind37 = new Image();	
	  ind38 = new Image();	
	  ind39 = new Image();	
	  ind40 = new Image();	
	  ind41 = new Image();	
	  ind42 = new Image();		
		
	  ind1.src="images/industries/industries_automotive_main_1.jpg";
	  ind2.src="images/industries/industries_automotive_main_2.jpg";
	  ind3.src="images/industries/industries_buildingproducts_main_1.jpg";
	  ind4.src="images/industries/industries_buildingproducts_main_2.jpg";
	  ind5.src="images/industries/industries_chemical_main_1.jpg";
	  ind6.src="images/industries/industries_chemical_main_2.jpg";
	  ind7.src="images/industries/industries_chemical_main_3.jpg";
	  ind8.src="images/industries/industries_chemical_main_4.jpg";
	  ind9.src="images/industries/industries_consumerproducts_main_1.jpg";
	  ind10.src="images/industries/industries_consumerproducts_main_2.jpg";
	  ind11.src="images/industries/industries_consumerproducts_main_3.jpg";
	  ind12.src="images/industries/industries_electronics_main_1.jpg";
	  ind13.src="images/industries/industries_electronics_main_2.jpg";
	  ind14.src="images/industries/industries_electronics_main_3.jpg";
	  ind15.src="images/industries/industries_energy_main_1.jpg";
	  ind16.src="images/industries/industries_energy_main_2.jpg";
	  ind17.src="images/industries/industries_energy_main_3.jpg";
	  ind18.src="images/industries/industries_engineeredmaterials_main_1.jpg";
	  ind19.src="images/industries/industries_engineeredmaterials_main_2.jpg";
	  ind20.src="images/industries/industries_engineeredmaterials_main_3.jpg";
	  ind21.src="images/industries/industries_fibers_main_1.jpg";
	  ind22.src="images/industries/industries_fibers_main_2.jpg";
	  ind23.src="images/industries/industries_fibers_main_3.jpg";
	  ind24.src="images/industries/industries_food_main_1.jpg";
	  ind25.src="images/industries/industries_food_main_2.jpg";
	  ind26.src="images/industries/industries_food_main_3.jpg";
	  ind27.src="images/industries/industries_food_main_4.jpg";
	  ind28.src="images/industries/industries_glass_main_1.jpg";
	  ind29.src="images/industries/industries_glass_main_2.jpg";
	  ind30.src="images/industries/industries_glass_main_3.jpg";
	  ind31.src="images/industries/industries_medical_main_1.jpg";
	  ind32.src="images/industries/industries_medical_main_2.jpg";
	  ind33.src="images/industries/industries_medical_main_3.jpg";
	  ind34.src="images/industries/industries_medical_main_4.jpg";
	  ind35.src="images/industries/industries_nanotechnology_main_1.jpg";
	  ind36.src="images/industries/industries_nanotechnology_main_2.jpg";
	  ind37.src="images/industries/industries_pharmaceuticals_main_1.jpg";
	  ind38.src="images/industries/industries_pharmaceuticals_main_2.jpg";
	  ind39.src="images/industries/industries_pharmaceuticals_main_3.jpg";
	  ind40.src="images/industries/industries_pharmaceuticals_main_4.jpg";
	  ind41.src="images/industries/industries_semiconductor_main_1.jpg";
	  ind42.src="images/industries/industries_semiconductor_main_2.jpg";
	}
	
}

function validateForm(txtName,txtPhone,txtEmail,txtCaptcha) {
	
	var error=true;
	var errorMsg="";
        
    //validate txtName	  
	var trimmed = txtName.value.replace(/^\s+|\s+$/g, '') ;
    if (trimmed == "") {
        txtName.focus();
        errorMsg="Name field is empty.\n";
        error=false;
    }
    
    //validate txtPhone
	var trimmed = txtPhone.value.replace(/^\s+|\s+$/g, '') ;
    if (trimmed == "") {
        if(error==true){
           txtPhone.focus();
        }
        errorMsg=errorMsg+"Phone field is empty.\n";
        error=false;
    }
    
	//validate email
	var str = txtEmail.value; // email string
    
	var reg1 = /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/; // not valid
	var reg2 = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$/; // valid
	if (!reg1.test(str) && reg2.test(str)) { // if syntax is valid
		
	}
	else{
        if(error==true){
           txtEmail.focus();
        }
	errorMsg=errorMsg+"Incorrect email.\n";
	error= false;
	}
	
    //validate txtCaptcha	  
	var trimmed = txtCaptcha.value.replace(/^\s+|\s+$/g, '') ;
    if (trimmed == "") {
        txtName.focus();
        errorMsg+="Captcha field is empty.\n";
        error=false;
    }
  
	if(error==false)
	{
	   alert(errorMsg);
	   return error;
	}
	else
	{
	  return error;
	}
}

function txtCheck(txt) {
    var trimmed = txt.value.replace(/^\s+|\s+$/g, '') ;
    if (trimmed == "") {
        alert("Please provide all required fields.");
        txt.focus();
        return false;
    }
    return true;
}

var message="Function Disabled!";

///////////////////////////////////
function clickIE4(){
if (event.button==2){
alert(message);
return false;
}
}

function clickNS4(e){
if (document.layers||document.getElementById&&!document.all){
if (e.which==2||e.which==3){
alert(message);
return false;
}
}
}

if (document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=clickNS4;
}
else if (document.all&&!document.getElementById){
document.onmousedown=clickIE4;
}

document.oncontextmenu=new Function("alert(message);return false")
