var fol = "";
var path = parent.location.pathname;

if(path.indexOf('\\') != -1){
	div = "\\";
}else{
	div = "/";	
}

html = new Array("user", "tech", "forms", "offices", "cert", "disclaimer", "privacy", "login", "forget", "memreg","modify_comp_info","application","app_status","app_new","print_app","app_modify","app_error");
hd_alt = new Array("User Guide", "Technical Guide and Support", "Download Forms", "Office Address and Contact", "Other Certification Services", "Disclaimer", "Privacy Policy", "Login", "Forget Password", "User Registration", "Modify Company Information","Application for CR/CT", "Application Status","Application for CR/CT","Application for CR/CT","Application for CR/CT","Application for CR/CT");
hd = new Array("hd_user.gif", "hd_tech.gif", "hd_forms.gif", "hd_offices.gif", "hd_cert.gif", "hd_disclaimer.gif", "hd_privacy.gif", "hd_login.gif", "hd_forget.gif", "hd_memreg.gif", "hd_modify.gif","hd_application.gif","hd_appstatus.gif","hd_application.gif","hd_application.gif","hd_application.gif","hd_application.gif");

for(i=0; i<html.length; i++){	
	if(path.indexOf(div + html[i]) != -1){				
		fol = i;
		break;
	}	
}

function genhead(){
	document.write('<img src="images/hd/'+hd[fol]+'" alt="'+hd_alt[fol]+'">');	
}

function chgpath(from, to){
  var path = parent.location.pathname;
  var newpath = path.replace(from, to);
  //alert (newpath);
  document.location = newpath + parent.location.search;
}