

function centreWorkAreaDiv(){

	Calculate_X_Centre('logo');
	Calculate_X_Centre('banner');	
	Calculate_X_Centre('MainMenubar');
	Calculate_X_Centre('MainContant');
	Calculate_X_Centre('divFooter');
				
}

function Calculate_X_Centre(divId){
	var msgbox = document.getElementById(divId);
	if (msgbox) {
	
	    var winH=0;
	    var winW=0;

	    if (parseInt(navigator.appVersion)>3) {
		    if (navigator.appName.indexOf("Netscape")!=-1) {
			    winW = window.innerWidth-16;
			    winH = window.innerHeight;
		    }
		    if (navigator.appName.indexOf("Microsoft")!=-1) {
			    winW = document.body.offsetWidth-20;
			    winH = document.body.offsetHeight - 20;
		    }
	    }
 		
	    var x = (winW/2) - (msgbox.offsetWidth/2);
	    
	    if(winW > 800){
		    msgbox.style.left = x + 'px';
	    }

	    msgbox.style.display = "block";
    }
}

function gotoPage1(pg, h){
	
    
	window.parent.document.getElementById('iframeContent').src = pg;
	window.parent.document.getElementById('iframeContent').style.height=h+'px';
	window.parent.document.getElementById('MainContant').style.height = h + 'px';
	
	window.parent.document.getElementById('divFooter').style.top = parseInt(window.parent.document.getElementById('MainContant').style.top) + h + 1 + 'px';

}

function gotoPage(pg, h) {
    
	document.getElementById('iframeContent').src = pg;
	document.getElementById('iframeContent').style.height=h+'px';
	document.getElementById('MainContant').style.height = h + 'px';
	
	document.getElementById('divFooter').style.top = parseInt(document.getElementById('MainContant').style.top) + h + 1 + 'px';
}

function setBackGroundImage(m){
	if(m==1){
		document.getElementById('img_CurrentOffer').src="images_new/currentoffersonmouseover.png";
	}
	if(m==2){
		document.getElementById('img_CurrentOffer').src="images_new/currentoffersonmouseout.png";
	}
}

// This is the section for sub menu

function showServicesSubMenu(v, item) {

    if (v) {
        item.style.cursor = 'pointer';
    } else {
        item.style.cursor = 'default';
    }

    var menuItemAboutUs = document.getElementById('menuItemAboutus');	
    var menuItemService = document.getElementById('menuItemProduct');
	
    var subMenuAboutUs = document.getElementById('divAboutUsSubMenu');
    var subMenuService = document.getElementById('divServicesSubMenu');
    
    var subMenuHolder = document.getElementById('subMenuHolder');

    subMenuAboutUs.style.visibility = 'hidden';
    subMenuService.style.visibility = 'hidden';

    if (menuItemAboutUs && subMenuAboutUs && item.id == 'menuItemAboutus') {
        if (v) {
            item.style.cursor = 'pointer';
            subMenuHolder.style.visibility = 'visible';
            subMenuAboutUs.style.visibility = 'visible';
        } else {
            item.style.cursor = 'default';
            subMenuHolder.style.visibility = 'hidden';
            subMenuAboutUs.style.visibility = 'hidden';

        }
    } else {
        //remain silent about unavailability
    }    

    if (menuItemService && subMenuService && item.id == 'menuItemProduct') {
        if (v) {
            item.style.cursor = 'pointer';
            subMenuHolder.style.visibility = 'visible';
            subMenuService.style.visibility = 'visible';
        } else {
            item.style.cursor = 'default';
            subMenuHolder.style.visibility = 'hidden';
            subMenuService.style.visibility = 'hidden';

        }
    } else {
        //remain silent about unavailability
    }

    
}

function toggleColourServicesSubMenu(v, item) {
    if (v) {
        item.style.cursor = 'pointer';
    } else {
        item.style.cursor = 'default';
    }
}

function mouseOnSubMenu(v, item) {

    if (v) {
        item.style.visibility = 'visible';
    } else {
        item.style.visibility = 'hidden';
    }

}

