﻿
function showPopUp(url,w,h) {
	var feature = "width=" + w + ",height=" + h + ",status=0,scrollbars=1";
	window.open(url,"",feature);
}

function show_hide(id){ 
	var obj;
	if (document.getElementById(id)){ 
		obj = document.getElementById(id); 
		if (obj.style.display == "none"){ 					
			obj.style.display = ""; 
		} 
		else { 
			obj.style.display = "none"; 
		} 
	} 
} 	

function changeSideMenu(id) {
	var obj; 
	if (document.getElementById(id)){ 
		obj = document.getElementById(id); 
		if (obj.className == ""){ 			
			obj.className= "on";							
		}
		else { 
			obj.className= "";		
		} 
	}
}

function echeck(str) {
	var at="@"
	var dot="."
	var lat=str.indexOf(at)
	var lstr=str.length
	var ldot=str.indexOf(dot)
	if (str.indexOf(at)==-1){return false}
	if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==(lstr-1)){return false}
	if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==(lstr-1)){return false}
	if (str.indexOf(at,(lat+1))!=-1){return false}
	if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){return false}
	if (str.indexOf(dot,(lat+2))==-1){return false}
	if (str.indexOf(" ")!=-1){return false}
}

function menuFix() {
	var ieULs = document.getElementById("top_menu_content").getElementsByTagName('ul');
	for (j=0; j<ieULs.length; j++) {
	ieULs[j].innerHTML = ('<iframe src="about:blank" scrolling="no" frameborder="0"></iframe>' + ieULs[j].innerHTML);
		var ieMat = ieULs[j].firstChild;
			ieMat.style.width=ieULs[j].offsetWidth+"px";
			ieMat.style.height=ieULs[j].offsetHeight+"px";	
			ieULs[j].style.zIndex="99";
	}			
}