function openImg(winName, width, height) {
	var newwindow = ""; 
	if (winName != null && winName != '' && width != null && width != '' && height != null && height != '') {
		if (newwindow.location && !newwindow.closed) {
   			newwindow.location.href = url; 
   		 	newwindow.focus(); 
   		} else {
   			var nWidth = (parseInt(width));
   			var nHeight = (parseInt(height));
   			var iHtml = 'wins/win_' + winName + '.html';
   			var imgParams = 'width=' + nWidth + ',height='+ nHeight +', resizable=no, toolbar=no, scrollbars=no, statusbar=no, left=30, top=40';
   			newwindow = window.open(''+iHtml+'','dddental',''+imgParams+'');
   		} 
	}
}


function menuItemSelect(obj, isSelected) {
	if (obj != null) {
		if (isSelected != null && isSelected == 'true') {
			obj.className = 'menuBtnOn';
		} else {
			obj.className = 'menuBtnOff';
		}
	}
}

function menuItemSelect2(obj, isSelected) {
	if (obj != null) {
		if (isSelected != null && isSelected == 'true') {
			obj.className = 'menuBtnOn';
		} else {
			obj.className = 'menuBtnBlackOff';
		}
	}
}

function menuItemSelect3(obj, isSelected) {
	if (obj != null) {
		if (isSelected != null && isSelected == 'true') {
			obj.style.color = '#ffffff';
		} else {
			obj.style.color = '#000000';
		}
	}
}

function menuItemSelect4(obj, isSelected) {
	if (obj != null) {
		if (isSelected != null && isSelected == 'true') {
			obj.className = 'smallBtnOn';
		} else {
			obj.className = 'smallBtnOff';
		}
	}
}

function subMenuItemSelect(obj, isSelected) {
	if (obj != null) {
		if (isSelected != null && isSelected == 'true') {
			obj.className = 'submenuBtnOn';
		} else {
			obj.className = 'submenuBtnOff';
		}
	}
}

function gotoLink(obj) {
	if (obj != null) {
		if (obj == 'eng' || obj == 'svk' || obj == 'hu') {
			var docURL = window.top.location.href;
			var temp = docURL.lastIndexOf('/');
			var urlPart1 = docURL.substring(0,temp+1);
			var htmlFileName = docURL.substring(temp+1);
			if (obj == 'eng') {
				goToURL(urlPart1 + obj + '/' + htmlFileName);
			} else if (obj == 'hu') {
				goToURL(urlPart1 + obj + '/' + htmlFileName);
			} else if (obj == 'svk') {
				goToURL(urlPart1 + '' + htmlFileName);
			}
		} else {
			goToURL(obj + '.html');
		}
	}
}

function gotoLinkPhP(obj) {
	if (obj != null) {
		if (obj == 'eng' || obj == 'svk' || obj == 'hu') {
			var docURL = window.top.location.href;
			var temp = docURL.lastIndexOf('/');
			var urlPart1 = docURL.substring(0,temp+1);
			var htmlFileName = docURL.substring(temp+1);
			if (obj == 'eng' || obj == 'hu') {
				goToURL(urlPart1 + obj + '/' + htmlFileName);
			} else if (obj == 'svk') {
				goToURL(urlPart1 + '' + htmlFileName);
			}
		} else {
			goToURL(obj + '.php');
		}
	}
}

function goToURL(itemLink) {
	var nextURL = ""+itemLink;
	window.top.location.href = nextURL;
}

function fadeImage(newImg, opac, opac2) {
	window.clearTimeout(0);
	var cnt = 1;
	if (opac<=0) {
		newImg.style.filter = 'alpha(opacity=' + 60 + ')';
		
		// moz opt.
		newImg.style.opacity = "" + 0.6 + "";
	} else {
		newImg.style.filter = 'alpha(opacity=' + (opac2+cnt) + ')';
		
		// moz opt.
		newImg.style.opacity = "" + (opac2+cnt)/100.0 + "";
		window.setTimeout(function(){fadeImage(newImg, (opac-cnt), (opac2+cnt));}, 1/10); 
	}
}

