﻿// JavaScript Document

/*  
*******************************************
* VERY IMPORTANT - MUST IN EVERY SITE !!! *
*******************************************

Correctly handle PNG transparency in Win IE 5.5 & 6.
http://homepage.ntlworld.com/bobosola. Updated 18-Jan-2006.

Use in <HEAD> with DEFER keyword wrapped in conditional comments:
<!--[if lt IE 7]>
<script defer type="text/javascript" src="pngfix.js"></script>
<![endif]-->
*/
function fixPNG()
{
//	alert('hello');
	var arVersion = navigator.appVersion.split("MSIE")
	var version = parseFloat(arVersion[1])
//	alert('start fixing png files');	
	if ((version >= 5.5) && (document.body.filters)) 
	{
	   for(var i=0; i<document.images.length; i++)
	   {
	      var img = document.images[i]
	      var imgName = img.src.toUpperCase()
	      if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
	      {
	         var imgID = (img.id) ? "id='" + img.id + "' " : ""
	         var imgClass = (img.className) ? "class='" + img.className + "' " : ""
	         var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
    	     var imgStyle = "display:inline-block;" + img.style.cssText 
	         if (img.align == "left") imgStyle = "float:left;" + imgStyle
	         if (img.align == "right") imgStyle = "float:right;" + imgStyle
	         if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
	         var strNewHTML = "<span " + imgID + imgClass + imgTitle
	         + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
	         + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
	         + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>" 
	         img.outerHTML = strNewHTML
	         i = i-1
	      }
	   }
	}
	alert('done fixing png files');
//	startMoving();
}


// THE FUNCTION WILL OPEN THE WANTED FILE (PAGE).
function showDetails(wantedPage)
{
//	alert (wantedPage);
//	if (wantedSite != '#')
		document.location.href = (wantedPage+'.php');
}


// when the mouse will be on the wanted side cell - it will turn on to yellow
function changeYellow(wantedDiv)
{
	switch(wantedDiv) 
	{
		case 1 :
	document.getElementById('sideMenu1').src= 'images/sideMenu/up/tadmit.jpg';
//					document.all.sideMenu1.style.backgroundColor= '#D8E8FF';
					break; 
		case 2 :
	document.getElementById('sideMenu2').src= 'images/sideMenu/up/logo.jpg';
//		document.all.sideMenu2.style.backgroundColor= '#D8E8FF';
					break;
		case 3 :	
	document.getElementById('sideMenu3').src= 'images/sideMenu/up/books.jpg';
//		document.all.sideMenu3.style.backgroundColor= '#D8E8FF';
					break; 
		case 4 : 	
	document.getElementById('sideMenu4').src= 'images/sideMenu/up/catalog.jpg';
//		document.all.sideMenu4.style.backgroundColor= '#D8E8FF';
					break;
		case 5 :	
	document.getElementById('sideMenu5').src= 'images/sideMenu/up/arizot.jpg';
//		document.all.sideMenu5.style.backgroundColor= '#D8E8FF';
					break; 
		case 6 : 	
	document.getElementById('sideMenu6').src= 'images/sideMenu/up/notes.jpg';
//		document.all.sideMenu6.style.backgroundColor= '#D8E8FF';
					break;					
		case 7 : 	
	document.getElementById('sideMenu7').src= 'images/sideMenu/up/invitation.jpg';
//		document.all.sideMenu7.style.backgroundColor= '#D8E8FF';
					break;
		case 8 :	
	document.getElementById('sideMenu8').src= 'images/sideMenu/up/sites.jpg';
//		document.all.sideMenu8.style.backgroundColor= '#D8E8FF';
break; 
				
		default: 
		document.getElementById('sideMenu8').src= 'images/sideMenu/up/sites.jpg';
} ;


//	document.all.wantedDiv.style.backgroundColor = '#F1FBB6';
//	document.getElementById('wantedDiv').style.backgroundColor = '#F1FBB6';	
//	alert(wantedDiv + " - the wanted parameter");
}

// when the mouse will be off the wanted side cell - it will turn back to blue
function changeBlue(wantedDiv)
{

	switch(wantedDiv) 
	{// the color will be equal to nothing, so the background will be 'none' again
		case 1 :
	document.getElementById('sideMenu1').src= 'images/sideMenu/down/tadmit.jpg';
//					document.all.sideMenu1.style.backgroundColor= '#D8E8FF';
					break; 
		case 2 :
	document.getElementById('sideMenu2').src= 'images/sideMenu/down/logo.jpg';
//		document.all.sideMenu2.style.backgroundColor= '#D8E8FF';
					break;
		case 3 :	
	document.getElementById('sideMenu3').src= 'images/sideMenu/down/books.jpg';
//		document.all.sideMenu3.style.backgroundColor= '#D8E8FF';
					break; 
		case 4 : 	
	document.getElementById('sideMenu4').src= 'images/sideMenu/down/catalog.jpg';
//		document.all.sideMenu4.style.backgroundColor= '#D8E8FF';
					break;
		case 5 :	
	document.getElementById('sideMenu5').src= 'images/sideMenu/down/arizot.jpg';
//		document.all.sideMenu5.style.backgroundColor= '#D8E8FF';
					break; 
		case 6 : 	
	document.getElementById('sideMenu6').src= 'images/sideMenu/down/notes.jpg';
//		document.all.sideMenu6.style.backgroundColor= '#D8E8FF';
					break;					
		case 7 : 	
	document.getElementById('sideMenu7').src= 'images/sideMenu/down/invitation.jpg';
//		document.all.sideMenu7.style.backgroundColor= '#D8E8FF';
					break;
		case 8 :	
	document.getElementById('sideMenu8').src= 'images/sideMenu/down/sites.jpg';
//		document.all.sideMenu8.style.backgroundColor= '#D8E8FF';
					break; 
		default: document.getElementById('sideMenu8').src= 'images/sideMenu/down/sites.jpg';
	} ;

//	document.all.sideMenu6.style.backgroundColor= '#F1FBB6';
//	document.all.wantedDiv.style.backgroundColor = '#F1FBB6';
//	document.getElementById('wantedDiv').style.backgroundColor = '#FFF';	
//	alert(wantedDiv + " - the wanted parameter");
}





function changePic(wantedPic, wantedText, wantedButton)
{// the function will show the wanted picture.
// WANTED PIC = the picture's path to be shown.
// WANTED TEXT = the text above to be shown.
// WANTED BUTTON = the bottom's button that will have a different color.

	document.center_image.src="images/"+wantedPic; // for the picture.
	document.getElementById('divText').innerHTML = wantedText
	changeButton(wantedButton); // sets the wanted button to have another color
}

/*
function resetSmallButtons(endNum)
{
	var i = 1; 
	for (i=1; i<=endNum; i++)
		document.bottom_image.src="images/"+wantedPic; // for the picture.		
}
*/






// REMOVE THE RIGHT CLICK OPTION, SO THE USER WILL NOT BE ABLE TO COPY / SAVE THE IMAGE
function disableselect(e)
{ 
	return false; 
} 

function reEnable()
{ 
	return true;
} 

//if IE4+ 
document.onselectstart=new Function ("return false");
document.oncontextmenu=new Function ("return false");
//if NS6 
if (window.sidebar)
{ 
	document.onmousedown=disableselect;
	document.onclick=reEnable;
} 