Вот так попробуй
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title> New Document </title>
<meta name="Generator" content="EditPlus">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
<body>
<script type = "text/javascript">
function showDiv1() {
alert(1)
var url = window.location.href;
if (/(PageName2)/i.test(url)) {
document.getElementById("dyvan").style.display="none";
}
else {
document.getElementById("dyvan").style.display="block";
}
}
function showDiv2() {
alert(2)
var url = window.location.href;
if (/(PageName1)/i.test(url)) {
document.getElementById("lijko").style.display="none";
}
else {
document.getElementById("lijko").style.display="block";
}
}
function showDiv(){
showDiv1();
showDiv2();
}
</script>
</head>
<body onload = "showDiv()" >
<div id="dyvan">
dyvan
</div>
<div id="lijko">
lijko
</div>
</body>
</html>