/*
	HITACHI CONSTRUCTION MACHINERY (ZA)
	JS FILE [hcm_basic.js]

Update history ---------------------------------------------------
09/06/11 supported IE8.
------------------------------------------------------------------
*/

var agent = navigator.userAgent.toLowerCase();
var w3c = document.getElementById;
var opera = agent.indexOf("opera",0) != -1;
var ie = ('\v'=='v')? true : false;// IE 8.
var modernIe = ie && agent.indexOf("trident") != -1;// IE 8.
var legacyIe = ie && !modernIe;// IE 8.
var gecko = agent.indexOf("gecko") != -1 && !opera;
var version = navigator.appVersion;
var fileName = new String(location.pathname);
var domainName = new String(location.host);
var cdnPath = (location.protocol == 'http:')? 'http://hcm.vo.llnwd.net/e1' : '';

/*	fixed 06/05 */
function checkregionpulldown(form){
    if (form.url.value != "-"){
        if(form.action){
            return true;
        }else{
            location.href = form.url.value;
            return false;
        }
    }else{
            return false;
    }
}


/*
original file is "CSS Browser Selector"
(http://rafael.adm.br/css_browser_selector) 
*/
var sethtmlCls = function(){
	var is = function(t){ return agent.indexOf(t) != -1; },
		hs = document.getElementsByTagName('html')[0],
		brw = (/msie (\d)/i.test(agent))? ("ie" + RegExp.$1) : is('opera')? "opera" : "gecko",
		os = is('mac') ? 'mac' : '';
	hs.className += (os + brw);
}();


function setCss(){
	var path = '/za/css/adj/';
	var cssName = (gecko) ? "gecko" : ((opera) ? "opera" : false);
	
	if(!!cssName){
		document.open();
		document.write('<link rel=\"stylesheet\" type=\"text/css\" media=\"screen,print\" href=\"' + path + cssName + '.css\">');
		document.close();
	}
}
var setupCss = new setCss;


/*	world wide page(/global/worldwide/)	*/
function roll(img) {
	if (loaded) {
		tabOn = eval("map" + img + ".src");
		document ['map'].src = tabOn;
	}
}