var cssmenuids=['cssmenu1'] //Enter id(s) of CSS Horizontal UL menus, separated by commas
var csssubmenuoffset=-1 //Offset of submenus from main menu. Default is 0 pixels.

function createcssmenu2(){
for (var i=0; i<cssmenuids.length; i++){
  var ultags=document.getElementById(cssmenuids[i]).getElementsByTagName('ul')
    for (var t=0; t<ultags.length; t++){
			ultags[t].style.top=ultags[t].parentNode.offsetHeight+csssubmenuoffset+'px'
    	var spanref=document.createElement('span')
			spanref.className='arrowdiv'
			spanref.innerHTML='&nbsp;&nbsp;&nbsp;&nbsp;'
			ultags[t].parentNode.getElementsByTagName('a')[0].appendChild(spanref)
    	ultags[t].parentNode.onmouseover=function(){
    	this.getElementsByTagName('ul')[0].style.visibility='visible'
    	}
    	ultags[t].parentNode.onmouseout=function(){
			this.getElementsByTagName('ul')[0].style.visibility='hidden'
    }
    }
  }
}

dropdown = function()
{
	document.getElementById("con").style.display = '';
}

releasedropdown = function()
{
	document.getElementById("con").style.display = 'none';
}

gioithieudropdown = function()
{
	document.getElementById("congioithieu").style.display = '';
}

gioithieureleasedropdown = function()
{
	document.getElementById("congioithieu").style.display = 'none';
}

dichvudropdown = function()
{
	document.getElementById("condichvuTTLK").style.display = '';
}

dichvureleasedropdown = function()
{
	document.getElementById("condichvuTTLK").style.display = 'none';
}

openwindow = function(link,name,attribute)
{
	window.open(link,name,attribute);
}

getURLfromURL = function(nameURL)
{
	var abc = nameURL.toString();
	var xyz = abc.substr(0,7);
	var newtest = abc.substr(7,abc.length);
	var newURL = xyz + newtest.substr(0,newtest.indexOf("/",0));
	return newURL;
	
}

haha = function(imagelink,namepopup)
{
    var newURL = getURLfromURL(document.URL) + imagelink;
    openwindow(newURL,namepopup,"scrollbars=yes,menubars=no,toolbars=no");
}

/*
if (window.addEventListener)
window.addEventListener('load', createcssmenu2, false)
else if (window.attachEvent)
window.attachEvent('onload', createcssmenu2)
*/
