	var ns6 = (!document.all && document.getElementById);
	var wordLang = "";
	
	function writeFrame(frame,output)
	{
		if ( !top.frames[frame] )
		{
			setTimeout("writeFrame('" + frame + "','" + output + "')",10);
			return false;
		}
		top.frames[frame].document.location.replace(output);
	}

	function LinkTo(classto,entity_code)
	//the function replace the center page by param - classto
	{
		site_code = top.document.getElementById('site_code').value;
		document.location.href='index.asp?classto='+classto+'&entity_code='+entity_code+'&site_code='+site_code;
		setScroolUp();
	}

	function LinkToNoScroll(classto,entity_code)
	//the function replace the center page by param - classto
	{
		site_code = top.document.getElementById('site_code').value;
		document.location.href='index.asp?classto='+classto+'&entity_code='+entity_code+'&site_code='+site_code;
       
       window.parent.scrollTo(0,170);	
	}

	function frameLinkTo(whichFrame,classto,entity_code)
	//this function replaces a frame by param - classto
	{
		var pathFrame = '';

		if ( top.document.getElementById(whichFrame) )
		{
			pathFrame = top.document.getElementById(whichFrame);
		}

		else if ( document.getElementById(whichFrame) )
		{
			pathFrame = document.getElementById(whichFrame);
		}
		
		else
		{
			return;
		}

		pathFrame.src = 'index.asp?classto='+classto+'&entity_code='+entity_code;
		setScroolUp();
	}

	function frameLinkToNoScroll(whichFrame,classto,entity_code)
	//this function replaces a frame by param - classto
	{
		var pathFrame = '';

		if ( top.document.getElementById(whichFrame) )
		{
			pathFrame = top.document.getElementById(whichFrame);
		}

		else if ( document.getElementById(whichFrame) )
		{
			pathFrame = document.getElementById(whichFrame);
		}
		
		else
		{
			return;
		}

		pathFrame.src = 'index.asp?classto='+classto+'&entity_code='+entity_code;
		window.parent.scrollTo(0,170);
	}

	function frameLinkGeneralParam(whichFrame,classParam,paramStr)
	{	
		var pathFrame = '';

		if ( top.document.getElementById(whichFrame) )
		{
			pathFrame = top.document.getElementById(whichFrame);
		}

		else if ( document.getElementById(whichFrame) )
		{
			pathFrame = document.getElementById(whichFrame);
		}
		
		else
		{
			return;
		}

	    pathFrame.src = 'index.asp?classto=' + classParam + '&' + paramStr;
	}

	function LinkToFromSite(siteFrom, classto, entity_code)
	//this function opens a class the given site.
	{
	    var site_code;
		var pathFrame = '';

		site_code = siteFrom;

		if ( top.document.getElementById("mainIframe") )
		{
			pathFrame = top.frames["mainIframe"].document;
		}

		else if ( document.getElementById("mainIframe") )
		{
			pathFrame = window.frames["mainIframe"].document;
		}
		
		else
		{
			return;
		}

		pathFrame.location.replace('index.asp?classto='+classto+'&entity_code='+entity_code+'&site_code='+site_code);
		setScroolUp();
	}

	function LinkToInPopup(siteFrom, entity_code)
	//this function opens a popup window for the given site.
	{
		site_code = siteFrom;
		NewWindowScroll('index.asp?classto=PopUpEntity&entity_code='+entity_code+'&site_code='+site_code,650,400,'yes');
	}

	function site_LinkToPopUp(site_code_To,entity_code)
	{
	//	this function loads the maamarim articles in a popUp window.
		NewWindowScroll('index.asp?classto='+site_code_To+'&entity_code='+entity_code+'&maamar=true',650,400,'yes');
	}	

	function site_bydate_left( classto, set_date)
	{
		top.frames["leftIframe"].document.location.replace('index.asp?classto='+classto+'&set_date='+set_date);
	}	
	
	function site_bydate_center( classto, set_date)
	{
		top.frames["mainIframe"].document.location.replace('index.asp?classto='+classto+'&set_date='+set_date);
	}	

	function site_bydate_centerHREF( whichFrame, classto, set_date)
	{
		var pathFrame = '';

		if ( top.document.getElementById(whichFrame) )
		{
			pathFrame = top.document.getElementById(whichFrame);
		}

		else if ( document.getElementById(whichFrame) )
		{
			pathFrame = document.getElementById(whichFrame);
		}
		
		else
		{
			return;
		}

		pathFrame.src='index.asp?classto='+classto+'&set_date='+set_date;
	}	

	function site_bySpecialFrame(frame,classto,searchTxt)
	{
		var parameterString = classto;
		
		if ( searchTxt > '' )
		{
			parameterString = parameterString + '&searchTxt=' + escape(searchTxt);
		}
		
		top.frames[frame].document.location.replace('index.asp?classto='+parameterString);
	}
	
	function site_LinkTo(site_code_From,site_code_To,entity_code)
	{
	//	this function loads the maamarim articles.
	
	//	if the article's site is the same as the current site, only replace
	//	the center frame.  Otherwise reload the whole thing.
	
		if(site_code_From == site_code_To)
		{
			top.document.getElementById("mainIframe").src='index.asp?classto=ArticleInner&entity_code='+entity_code;
		}
		else
		{
			top.location.href='index.asp?classto='+site_code_To+'&entity_code='+entity_code+'&maamar=true';
		}	
	}	
	
	function Link_LeftToCenter(entity_code,entity_type_code)
	//the fuction replace the center page from the left
	{
		top.frames["mainIframe"].document.location.replace('index.asp?classto=WeekInner&entity_code='+entity_code+'&entity_type_code='+entity_type_code);
	}

	function openRSSWin() {
	    NewWinParamId('http://www.iba.org.il/rss/', '541', '450', 'rssWin', 'yes', 'yes');
	}

	function ReplacePic(entity_code,PicOperator,PicMax)
	{
		//the function replace the pic src (<>)
		//PicOperator - > Right(+) or left(-)	
		ImgName = document.getElementById('IMG' + entity_code)
		PicIndex = ImgName.PicIndex;
		if(PicOperator == 'right')
		{
			if (PicMax > PicIndex)
			{
				PicIndex++;
			}
		}
		else
		{
			if (PicIndex > 1)
			{
				PicIndex--;
			}	
		}	
	//------  alt  ----------------------
		ImgName.src = EntityPicArray[entity_code][PicIndex][0].src;
		ImgName.alt = Convert_Unicode(EntityPicArray[entity_code][PicIndex][2]);
	
	//--- if this is a vml picture then switch the title of the v:rect 
	
		try
		{
			document.getElementById('RECT' + entity_code).title = Convert_Unicode(EntityPicArray[entity_code][PicIndex][2]);
		}
		catch (exception)
		{
		}
		
	//------  PicIndex  ----------------	
		ImgName.PicIndex = PicIndex;
	
	//------  ImgDesc  ----------------
		
		ImgDesc = document.getElementById('TDdesc' + entity_code);
		ImgDesc.innerHTML = EntityPicArray[entity_code][PicIndex][1];
		
	//alert(EntityPicArray[entity_code][PicIndex][3]);
		if (document.getElementById('TDZoomPic' + entity_code) != undefined)
		{
		    ImgZoom = document.getElementById('TDZoomPic' + entity_code);
		    if (EntityPicArray[entity_code][PicIndex][3] == 'True') {
		        ImgZoom.style.display = '';
		    }else {ImgZoom.style.display = 'none';}
		}
	}


function ReplacePicUp(entity_code,PicOperator,PicMax)
	{
		//the function replace the pic src (<>)
		//PicOperator - > Right(+) or left(-)	
		ImgName = document.getElementById('IMGup' + entity_code)
		PicIndex = ImgName.PicIndex;
		if(PicOperator == 'right')
		{
			if (PicMax > PicIndex)
			{
				PicIndex++;
			}
		}
		else
		{
			if (PicIndex > 1)
			{
				PicIndex--;
			}	
		}	
	//------  alt  ----------------------
		ImgName.src = UpEntityPicArray[entity_code][PicIndex][0].src;
		ImgName.alt = Convert_Unicode(UpEntityPicArray[entity_code][PicIndex][2]);
	
	//--- if this is a vml picture then switch the title of the v:rect 
	
		try
		{
			document.getElementById('RECT' + entity_code).title = Convert_Unicode(UpEntityPicArray[entity_code][PicIndex][2]);
		}
		catch (exception)
		{
		}
		
	//------  PicIndex  ----------------	
		ImgName.PicIndex = PicIndex;
	
	//------  ImgDesc  ----------------
		
		ImgDesc = document.getElementById('TDdescUp' + entity_code);
		ImgDesc.innerHTML = UpEntityPicArray[entity_code][PicIndex][1];
		
		if (document.getElementById('TDZoomPicUp' + entity_code) != undefined)
		{
		    ImgZoom = document.getElementById('TDZoomPicUp' + entity_code);
		    if (UpEntityPicArray[entity_code][PicIndex][3] == 'True') {
		        ImgZoom.style.display = '';
		    }else {ImgZoom.style.display = 'none';}
		}
		
	}

	function linkPnimi(entity,lang)
	{
		NewWindowScroll("http://www.iba.org.il/iba.aspx?type=simple&entity=" + entity + "&lang=" + lang, 600, 400, 'yes');
	}


	function startBannerTimer(strBannerName)
	{
		var bannerObj = document.getElementsByName(strBannerName);
		if (bannerObj.length > 1)
		{
			bannerObj[0].style.display = '';
			setInterval("switchBanner('" + strBannerName + "')",7000);
		}
		else
		{
			document.getElementById(strBannerName).style.display = '';
		}
	}

	function switchBanner(strWhichOne) 
	{ 
		var bannerObj = document.getElementsByName(strWhichOne);

		var indx;
		for (indx=0; indx < bannerObj.length; indx++)
		{
			if (bannerObj[indx].style.display == '')
			{
				break;
			}
		}
		
		var newOne = indx+1;
		if (newOne >= bannerObj.length)
		{
			newOne = 0;
		}
		
		// if this is not the first time the loop is running, then hide the last banner.
		// otherwise, everything will be display:none, and the indx will be more than the length
		if (indx < bannerObj.length)  
		{
			bannerObj[indx].style.display = 'none';
		}
		bannerObj[newOne].style.display = '';
	}

	function unicodeDelimited(tempstr)
	{
		var chrIndx;
		var str = '';
		
		for (chrIndx=0; chrIndx < tempstr.length; chrIndx++)
		{
			str = str + "@" + tempstr.charCodeAt(chrIndx) + ";" ;
		}
		
		return str;
	}
	
	function Convert_Unicode(str)
	{
	tempStr = '';
	j=str.indexOf('&#');		
	if(j>=0)
		{
		while(j>=0)
			{
			tempStr = tempStr + str.substring(0,j) + String.fromCharCode(str.substring(j+2,j+6));
			str = str.substring(j+7,str.length);
			j=str.indexOf('&#');
			}
		str = tempStr;
		}
	if(str.indexOf('<br>')>0)	
		{
		str = del_br(str);
		}
	return str;	
	}

	//  <br>  פונקציה המעלימה
	function del_br(str)
	{
		
		j=str.indexOf('<br>');	
		if(j>0)
			{
			iLen = str.length;
			tempStr = '';
			while(j>0)
				{
				j=str.indexOf('<br>');
				str = str.replace("<br>","");
				if(j>0) 
					tempStr = tempStr + str.substring(0,j-4);
				str = str.substring(j-4,iLen);
				}
			str = tempStr + str;
			}
		return str;	
	}
	
	function setScroolUp()
	{
	  window.parent.scrollTo(0,0);
	} 	

	function slowScrollTo(speed,currentScreenY,elementHeight)
	{
		var screenHeight = ns6? top.innerHeight : top.document.body.clientHeight;

		if ( (screenHeight-currentScreenY) < elementHeight )
		{
		    performScroll(0,speed,elementHeight);
		}
	}           

	function performScroll(step,speed,limit)
	{
		var temp;
		if ( step <= limit )
		{
		    top.scrollBy(0,speed);
		    temp = (step + speed)*1;
		    setTimeout("performScroll("+temp+","+speed+","+limit+")",10);
		}
	}           

	function slowScrollUp(step,speed,limit)
	{
	//	this function scrolls BACKWARDS, the speed MUST be a negative number!
	
		var temp;
		if ( step >= limit )
		{
		    top.scrollBy(0,speed);
		    temp = (step + speed)*1;
		    setTimeout("slowScrollUp("+temp+","+speed+","+limit+")",10);
		}
	}           

	function showArchive()
	{
		NewWinParamId('general/html/archive.html',692,500,'archive','yes','yes');
	}

//  FUNCTIONS FOR MEDIA WINDOW
//  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	function ShowMedia(entity_code,MediaKind)
	{
		var mediaUrl = MediasArray[entity_code][MediaKind][0];	
		CastupOnly(mediaUrl);
	}

	function MediaWithParams(type,site_code,entity_code,urlStr)
	{
		var strLink = '?';

		switch (type)
		{
			case 'radioLive':
				if (strLink.length > 1) strLink += '&';
				strLink += 'liveRadio=' + site_code;
				break;
			
			case 'radioRecorded':
				if (strLink.length > 1) strLink += '&';
				switch (site_code)
				{
					case 136: // 'מהדורות רשת ב
						strLink += 'mahadura=yes';
						break;
					
					case 131: // רק"ע foreign languages
						strLink += 'foreign=yes';
						break;
						
					case 151: // arabic
						strLink += 'arabic=yes';
						break;
					
					default:
						if (site_code != 0) strLink += ('recorded=' + site_code);
				}
				break;

			case 'tvRecorded':
				break;

			case 'tvLive':
				if (strLink.length > 1) strLink += '&';
				strLink += 'liveTv=yes';
				break;
			
			default:
				if ( site_code == 137 )
				{
				    if (strLink.length > 1) strLink += '&';
				    strLink += 'site=137&page=150';
				}
				else
				{
					if ( urlStr != '' )
					{
						CastupOnly(urlStr);
						return;
					}
				}
		}

		if ( urlStr != '' )
		{
		//	This function opens the media Window for a specific url.
		//	Open and play right away!
				
		//	The url must come as ONE parameter string.  An & would break it up.	
					
			//var mediaUrl = replaceStr(replaceStr(urlStr,"&amp;","91zA81"),"&","91zA81");
			if (strLink.length > 1) strLink += '&';
			//strLink += 'broadcastUrl=' + mediaUrl;
			strLink += 'broadcastUrl=' + createUrl(urlStr);
		}
	
		mediaWindow(strLink);
		
	}

	function createUrl(mUrl)
    {
        var tempUrl = replaceStr(mUrl,":","%3A");
        tempUrl = replaceStr(tempUrl,"/","%2F");
        tempUrl = replaceStr(tempUrl,".","%2E");
        tempUrl = replaceStr(tempUrl,"?","%3F");
        tempUrl = replaceStr(tempUrl,"&","91zA81");
        tempUrl = replaceStr(tempUrl,"&amp;","91zA81");
        tempUrl = replaceStr(tempUrl,"=","%3D");
        return tempUrl;
    }

	function MediaLiveRadioForSite(site_code)
	{
	//	This function calls the media Window for a specific site.
		
		strLink = '?liveRadio=' + site_code;  
				
		mediaWindow(strLink)
	       
	}

	function OpenWin_Media(entity_code)
	{  
	   // this function is called when there is more than 1 media attached
	   // to a specific entity.  It should never happen anymore.  Just in
	   // case - open the main Broadcasts center.
		mediaWindow('');	
	}

	function openMediaFromHtml()
	{
	//	This function opens the media Window from an html file.
		mediaWindow('')
	}
	
	/*
			function CastupOnly(strWindowAddrss)
			{
				//var  str = strWindowAddrss.slice(strWindowAddrss.indexOf('http:'));		 
				var  str = strWindowAddrss; 
				w = 320;
				h = ns6?376:286;
				
				LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;
				settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars=no,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
				
				win=open(strWindowAddrss,'castUp',settings);
				win.opener=self;
				
				if(win.focus){win.focus();}
			}
	*/

    // these styles must be the same in website!!!
    var cuWinTypes = { "regular": 0, "mondial": 1 };
    var cuWinStyles = new Array(); // (w,h,mediaLnkColor,mediaLnkBgColor)
    cuWinStyles[0] = new Array(320, 285, '#CB0001', '#F0F0F0');
    cuWinStyles[1] = new Array(502, 462, '#C1C0C0', '#303030');

    function CastupOnly(strWindowAddrss, titleStr, showLinkToMediaCenter, winType) 
    {
		var urlStr = replaceStr(strWindowAddrss,"&amp;","&"); 
        var linkHeight = 30;
        var title = ">iba - Israel Broadcasting Authority";  /* the > is here because otherwise .net forces a new row. */
        var linkToMediaCenter = "";

        //get the window type desired for this window.  If a specific type is sent
        //as a parameter then use that.  Otherwise check if a variable was set in the
        //specific site.  If yes, use that one, otherwise - default is 0.
        if (winType == undefined || winType == "")
        {
             //variable located in individual site javascript - if needed
            if (top.cuOnlyWinType != undefined) {
                winType = top.cuOnlyWinType;
            }
            else {
                winType = "regular";
            }
        }
        var winStyleIndex = cuWinTypes[winType];
        var w = cuWinStyles[winStyleIndex][0];
        var mediaH = cuWinStyles[winStyleIndex][1];
        var mediaLnkColor = cuWinStyles[winStyleIndex][2];
        var mediaLnkBgColor = cuWinStyles[winStyleIndex][3];
        
        var windowH = mediaH;
        
        if (titleStr != undefined && titleStr != "") {
            //  the > is here because otherwise .net forces a new row.
            title = ">" + titleStr;
        }

        if (showLinkToMediaCenter == undefined || showLinkToMediaCenter) {
            windowH += linkHeight;

            linkToMediaCenter = "<div style=padding-top:7px;padding-bottom:10px;text-align:center;" +
	                                        "text-decoration:underline;cursor:pointer;cursor:hand;" +
	                                        "font-size:12px;font-family:arial;" +
	                                        "color:" + mediaLnkColor + ";background-color:" + mediaLnkBgColor + ";" +
	                                        " onclick=\"var win2=open('http://www.iba.org.il/','','width='+screen.availWidth+',height='+screen.availHeight+',top=0,left=0,scrollbars=yes,location=yes,directories=yes,status=yes,menubar=yes,toolbar=yes,resizable=yes');win2.opener=self;\"" +
	                                        " dir=rtl>למרכז השידורים :: To the IBA Broadcasts Center</div>";
        }

        var LeftPosition = (screen.width) ? (screen.width - w) / 2 : 100;
        var TopPosition = (screen.height) ? (screen.height - windowH) / 2 : 100;

        var sMarkup = "<html><head><title" + title + "</title>" +
                      "<SCR" + "IPT langauge='javascript'>var cuSrc='" + urlStr + "';<\/SCR" + "IPT>" +
                      "</head><body style=background-color:#F0F0F0;margin:0px;>" +
                      "<iframe id='CastUpIframe' name='CastUpIframe' align='center'" +
                      " width=" + w + " height=" + mediaH +
                      " frameborder=0 scrolling=no>&#160;</iframe>" +
                      "<iframe id='cuTicketIFrame' name='cuTicketIFrame' width='0' height='0' src='http://www.iba.org.il/CUTicket.aspx'>&#160;</iframe>" +
                      linkToMediaCenter + "</body></html>";

        win = window.open("blank.htm", "castup", "width=" + w + ",height=" + windowH +
	                                    ",top=" + TopPosition + ",left=" + LeftPosition +
	                                    ",scrollbars=no,directories=no,menubar=no,toolbar=no,resizable=no");

        win.document.write(sMarkup);

        win.opener = self;
    }
	    		
	function mediaWindow(strWindowAddrss)
	{
		NewBrowserMax("http://www.iba.org.il/" + strWindowAddrss);
		//NewBrowserMax("http://devweb1/website/broadcasts.asp" + strWindowAddrss);
	}
	
//  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

	
	function NewWindowScroll(mypage,w,h,scroll)
	{
		//mypage - URL (-Link)
		//w - width
		//h - height
		//scroll - yes/no
		LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;
		settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=yes';
		win=open(mypage,'',settings);
		win.opener=self;
		if(win.focus){win.focus();}
	}
	
	var WindowIsOpen = 0;
	
	function NewWindowId(mypage,w,h,resize,scroll)
	{
		//mypage - URL (-Link)
		//w - width
		//h - height
		//resize - yes/no
		//scroll - yes/no
		
		if ( WindowIsOpen )
		{
			WindowIsOpen.close();
		}
		LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;
		settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable='+ resize;
		WindowIsOpen = open(mypage,'WindowPopUp',settings);
		if(WindowIsOpen.focus){WindowIsOpen.focus();}
	}
	
	function PopUpElections()
	{
		//This function creates a window that stands alone --> not connected to parent
		//   it is created with a unique id.  Any time the function is called with 
		//   the same id, it will switch the contents 
		//	 of the window ===>  NOT CREATING A NEW WINDOW
			
		//mypage - URL (-Link)
		//w - width
		//h - height
		//winId - popup window id
		//resize - yes/no
		//scroll - yes/no
			
		try
		{
			if ( win )
			{
				win.close();
			}
		}
		catch(exception)
		{
		}

	    w = 526;
	    
	    if (screen.height > 600)
	    {
	        h = 700;
	    }
	    else
	    {
	        h = 470;
	    }		
		LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;
		settings='width=' + w + ',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars=yes,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
		win = open("http://www.iba.org.il/media/Seker/SekerElection.aspx","Elections",settings);
		if(win.focus){win.focus();}
	}
	
	function NewWinParamId(mypage,w,h,winId,resize,scroll)
	{
		//mypage - URL (-Link)
		//w - width
		//h - height
		//winId - popup window id
		//resize - yes/no
		//scroll - yes/no
		
		try
		{
			if ( win )
			{
				win.close();
			}
		}
		catch(exception)
		{
		}
		
		LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;
		settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable='+ resize;
		win = open(mypage,winId,settings);
		if(win.focus){win.focus();}
	}

    function NewWindowNoresizable(mypage,w,h,scroll)
	{
		//mypage - URL (-Link)
		//w - width
		//h - height
		//scroll - yes/no
		LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;
		settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
		win=open(mypage,'',settings);
		win.opener=self;
		if(win.focus){win.focus();}
	}
	function NewBrowserWindow(mypage,w,h)
	{
		//mypage - URL (-Link)
		//w - width
		//h - height
		//scroll - yes/no
		LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;
		settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars=yes,location=yes,directories=yes,status=yes,menubar=yes,toolbar=yes,resizable=yes';
		win=open(mypage,'',settings);
		win.opener=self;
		if(win.focus){win.focus();}
	}
    
	function NewBrowserMax(mypage)
	{
		// this function does not set the focus to itself
		// like the other ones.
		// it opens in a max sized window
		// the id for the window is '' and not null, so that
		// each page will open a new window, not replace the 
		// one opened before.
		
		settings='width='+screen.availWidth+',height='+screen.availHeight+',top=0,left=0,scrollbars=yes,location=yes,directories=yes,status=yes,menubar=yes,toolbar=yes,resizable=yes';
		win=open(mypage,'',settings);
		win.opener=self;
	}

    function NewWin(sPath)
    {
        win=window.open(sPath ,null,'height=' + screen.availHeight   + ',width=' + screen.availWidth  + ',status=yes,toolbar=yes,menubar=yes,directories=yes,location=yes,resizable=yes,scrollbars=yes,top=0,left=0');
		win.opener=self;
		if(win.focus){win.focus();}
    
    }
	function setHeight(whichFrame,whichTable,checkMenu)
	{
//		this function will set the frame height in a page
//		whichFrame - the frame that's getting it's height set.
//		whichTable - the id of the main table 

		var frameHeight;
		var pathFrame = '';

		try
		{
			if ( top.document.getElementById(whichFrame) )
			{
				pathFrame = top.document;
			}

			else if ( window.parent.document.getElementById(whichFrame) )
			{
				pathFrame = window.parent.document;
			}
			
			else
			{
				return;
			}
	        
			frameHeight = document.getElementById(whichTable).offsetHeight;
			pathFrame.getElementById(whichFrame).height = frameHeight;   
	    //  Check if this frame is a childframe.  If it is, then enlarge 
	    //	the parent frame as well (if it is not big enough already.
	    
	        try
	        {
				if (frameHeight > window.frames.parent.frameElement.height)
				{
					window.frames.parent.frameElement.height = frameHeight;
				
			    }
			}
			catch (exception)
			{
			}
			
	//		Set the length of the table of the menu on the side of the
	//		page to reach the bottom of the whole page

			if ( checkMenu == 'true' ) 
			{
				setMenuHeight();
			}
		}
		catch(exception)
		{
		}
	}

	function setHeightMinParent(whichFrame,whichTable,checkMenu,parentHeight)
	{
//		this function will set the frame height in a page
//		whichFrame - the frame that's getting it's height set.
//		whichTable - the id of the main table 

		var frameHeight;
		var pathFrame = '';

		try
		{
			if ( top.document.getElementById(whichFrame) )
			{
				pathFrame = top.document;
			}

			else if ( window.parent.document.getElementById(whichFrame) )
			{
				pathFrame = window.parent.document;
			}
			
			else
			{
				return;
			}
	        
			frameHeight = document.getElementById(whichTable).offsetHeight;
			pathFrame.getElementById(whichFrame).height = frameHeight;   
	    //  Check if this frame is a childframe.  If it is, then enlarge 
	    //	the parent frame as well (if it is not big enough already.
	    
	        try
	        {
				if (frameHeight > window.frames.parent.frameElement.height)
				{
					window.frames.parent.frameElement.height = frameHeight;
				
			    }
			    else
			      if (window.frames.parent.frameElement.height > parentHeight) 
			      {
			         window.frames.parent.frameElement.height = parentHeight
			      }
			}
			catch (exception)
			{
			}
			
	//		Set the length of the table of the menu on the side of the
	//		page to reach the bottom of the whole page

			if ( checkMenu == 'true' ) 
			{
				setMenuHeight();
			}
		}
		catch(exception)
		{
		}
	}

	function maximizeWin() 
	{
//		if the window is not full screen then maximize it.

		var screenWidth = ns6? top.innerWidth : top.document.body.clientWidth;
		var screenHeight = ns6? top.innerHeight : top.document.body.clientHeight;

//		21 is for the scrollbar on the right
		if ( screenWidth+21 < screen.availWidth ) 
		{
			var forHScrolling = ns6? 2 : 8;
			var forVScrolling = ns6? 3 : 5;
		
			if (window.screen) 
			{
				var aw = screen.availWidth + forHScrolling ;
				var ah = screen.availHeight + forVScrolling;

				try
				{
					window.moveTo(0, 0);
					window.resizeTo(aw, ah);
				}
				catch(exception)
				{
				}
			}
		}
	}

	function setMenuHeight()
	{
	//	Do once the whole page is loaded.  
	//	    Netscape does not recognize 'readystate'

		if ( top.document.getElementById("tblMainMenu") == null ||
			 (!ns6 && top.document.readyState != 'complete') )
		{
			setTimeout("setMenuHeight()",500);
		}

		var menuHeight;
		var menuBottom;
		var documentHeight;

		if ( top.document.getElementById("tblMainMenu") != null )
		{
//			the variable menuBottom contains the height of the 
//			bottommost td. Initialize it to zero before starting.

			if ( top.document.getElementById("menuBottom") != null )
			{
				top.document.getElementById("menuBottom").style.height = 0;
				documentHeight = (ns6)? top.document.firstChild.offsetHeight : top.document.getElementById("mainBody").scrollHeight;
				menuHeight = top.document.getElementById("tblMainMenu").offsetHeight;

				if ( documentHeight > menuHeight )
				{
					top.document.getElementById("menuBottom").style.height = documentHeight - menuHeight + 16;
				}
			}
			var pageWidth = top.screen.availWidth;
			top.document.getElementById("mainBody").style.paddingLeft = (pageWidth-800)/2;
		}
	}

	function setDivHeight(whichDiv,whichTable,max)
	{

//		this function will set the height of a scrolling div in a page

//		Parameters:
//		whichDiv - the div that's getting it's height set.
//		whichTable - the id of the main table in the div
//		max - the maximum height allowed for the div before scrolling starts.

		var divHeight;

		if ( document.getElementById(whichDiv)== null )
		{
			return;
		}

		divHeight = document.getElementById(whichTable).offsetHeight;

		if ( divHeight < max )
		{
			document.getElementById(whichDiv).style.height = divHeight;   
		}
		
	}   


function galleryZoom(mypic,title)
{
	NewWindowScroll('general/html/PictureZoom.htm?picture=' + mypic + '&title=' + title,450,400,'yes')
}

function NewWindowScroll(mypage,w,h,scroll)
{
	//This function creates a window that stands alone --> not connected to parent
	//	each time the function is called it CREATES A NEW WINDOW
		
	//mypage - URL (-Link)
	//w - width
	//h - height
	//scroll - yes/no
	LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;
	settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=yes';
	win=open(mypage,'',settings);
	win.opener=self;
	if(win.focus){win.focus();}
}
	


//	This function opens a popup window for the purposes of sending
//	a yedia to someone.

	function sendToFriend(linkStr)
	{
		var siteName = top.document.getElementById("englishSiteName").value;
		
		var directory = top.document.location.href;
		var lastSlash = directory.lastIndexOf("/");
			
		if (lastSlash != -1)
		{
			linkStr = directory.substring(0,(lastSlash+1)) + linkStr;
		}
		else
		{
			linkStr = directory + linkStr;
		}
		var parameters = '?site=' + siteName + '&linkStr=' + linkStr;
		NewWindowScroll('general/asp/SendToFriend.asp'+parameters,'320','380','no')
	}

	function sendToFriendEnglish(linkStr)
	{
		var siteName = window.parent.document.getElementById("englishSiteName").value;
		var parameters = '?site=' + siteName + '&linkStr=' + linkStr;
		NewWindowScroll('general/asp/SendToFriendEnglish.asp'+parameters,'320','380','no')
	}

	function imgOn(imgName) // Function to 'activate' images
	{
	    if (document.images) 
	    {
            document[imgName].src = eval(imgName + "on.src");
        }
	}

	function imgOff(imgName) // Function to 'deactivate' images.
	{
        if (document.images) 
        {
            document[imgName].src = eval(imgName + "off.src");
        }
	}

	function SetDate(sDate)
	{
	//	this function receives a string date with the format dd/mm/yyyy
	//	and changes it to a format that date functions will recognize.
	
		if( sDate.substring(0,1) == 0) 
		{     
			day = sDate.substring(1,2);
		}
		else
		{
			day = sDate.substring(0,2);
		}
		month = sDate.substring(5,3) - 1;
		year  = "20" + sDate.substring(6,8)
   
		return new Date(year, month, day );
	}

	function openDivLive()
	{
	//	if a div was already opened, close the old one

		if (document.getElementById("divLive").style.display=="block")
		{
			closeDivLive();
			return(false);
		}

		document.getElementById("divLive").style.display="block";

		setHeight('leftIframe','tblMain','true');
	}
		
	function closeDivLive()
	{
		document.getElementById("divLive").style.display="none";

		setHeight('leftIframe','tblMain','true');
	}
	
	function printPage(id)
	{
		document.getElementById(id).style.visibility = 'hidden';
		window.print();
		document.getElementById(id).style.visibility = 'visible';
	}

	function checkDates(date1,date2)
	{
//		check the date interval - 
//		returns 1 : if date1 is > than date2 
//		returns 2 : if date2 is > than date1 
//		returns 0 : if date1 is = than date2 

		var tempDate1 = new Date( date1 ); 
		var tempDate2 = new Date( date2 ); 

		if ( tempDate1 > tempDate2 )
		{
			return 1;
		}
		if ( tempDate2 > tempDate1 )
		{
			return 2;
		}
		return 0;
			
	}	

	function GetParam(name)
	{
//		this function checks if a parameter exists.	  	
		
		var start=top.location.search.indexOf("?"+name+"=");
	
		if (start<0) start=top.location.search.indexOf("&"+name+"=");
	
		if (start<0) return '';
		
		start += name.length+2;
	  
		var end = top.location.search.indexOf("&",start)-1;
	   
		try
		{	
			if (end < 0)
			{
				end = top.location.search.length;
			} 
		}
		catch( exception )
		{ 
			return '' 
		}
	     
		var result=top.location.search.substring(start,end);
		var result='';
	
		for(var i=start;i<=end;i++) 
		{
			var c = top.location.search.charAt(i);
			result = result+(c=='+'?' ':c);
		}
	 
		return unescape(result);
	}

	function GetParamIframe(name)
	{
//		this function checks if a parameter exists.	  	
		
		var start=document.location.search.indexOf("?"+name+"=");
	
		if (start<0) start=document.location.search.indexOf("&"+name+"=");
	
		if (start<0) return '';
		
		start += name.length+2;
	  
		var end = document.location.search.indexOf("&",start)-1;
	   
		try
		{	
			if (end < 0)
			{
				end = document.location.search.length;
			} 
		}
		catch( exception )
		{ 
			return '' 
		}
	     
		var result=document.location.search.substring(start,end);
		var result='';
	
		for(var i=start;i<=end;i++) 
		{
			var c = document.location.search.charAt(i);
			result = result+(c=='+'?' ':c);
		}
	 
		return unescape(result);
	}

	function textCounter(whichField,  maxLimit) 
	{   
	//  Check the length of an input box.  If too long...trim it!
		
		var field = document.getElementById(whichField)
		if (field.value.length > maxLimit-1)
		{
			field.value = field.value.substring(0, maxLimit-1);
		}
	}	
	
	function removeBR(whichStr)
	{
		while ( whichStr.search("<br>") != -1 )
		{
			whichStr = whichStr.replace("<br>"," ");
		}
		return whichStr;
	}	
	
	function startBlink(speedBlink) 
	{
		setInterval("doBlink()",speedBlink);
	}

	function doBlink() 
	{
		var blink = document.all.tags("blink")
		for (var i=0; i<blink.length; i++)
		{
			blink[i].style.visibility = blink[i].style.visibility == "" ? "hidden" : "";
		} 
	}

	function checkEmail(emailAddr)
	{
   		var strudel  = emailAddr.indexOf("@")
   		var comma   = emailAddr.indexOf(",")
   		var space  = emailAddr.indexOf(" ")
   		var period  = emailAddr.lastIndexOf(".") + 1
   		var emailLen = emailAddr.length
				 			 
   		if (    (strudel > 0) 
   		     && (comma == -1) 
   		     && (space == -1) 
   		     && (emailLen - period >= 2) 
   		     && (emailLen - period <= 4)
   		     && (emailLen!=0)  )
   		{
			return true;
   		}
   		else
   		{
			return false;
   		}			
	}	

    function replaceStr(string,text,by) 
    {
      var stringLength = string.length
      var textLength = text.length;
      if ((stringLength == 0) || (textLength == 0)) return string;

      var i = string.indexOf(text);
      if ((!i) && (text != string.substring(0,textLength))) return string;
      if (i == -1) return string;

      var newstr = string.substring(0,i) + by;

      if ( (i+textLength) < stringLength)
        newstr += replaceStr(string.substring(i+textLength,stringLength),text,by);

      return newstr;
    }       

	function hinuhit()
	{ 
		var use800 = 0; 

		if (screen.height == 600)
		{	
			if (screen.width == 800)
			{
				use800 = 1;
			}
		}
		if (screen.height == 480)
		{
			if (screen.width == 640)
			{
				use800 = 1;
			}
		}
					
		if (use800 == 1)
		{
			NewBrowserMax('http://www.iba.org.il/eduradio/hinuhit_800.htm');
		}
		else
		{
			NewBrowserMax('http://www.iba.org.il/eduradio/');
		}
	} 

	var currentColor;

	function changeColor(whichOne,color1,color2,speed)
	{
		currentColor = color1;
		setInterval("doChangeColor('" + whichOne + "','" + color1 + "','" + color2 + "')",speed);
	}

	function doChangeColor(whichOne,color1,color2) 
	{
		if ( currentColor == color1 )
		{
			document.getElementById(whichOne).style.color = color2;
			currentColor = color2;
		}
		else
		{
			document.getElementById(whichOne).style.color = color1;
			currentColor = color1;
		}	
	}

	var oldContent;
	var blinkInterval;
	
	function blinkTxt(whichOne,speed)
	{
		oldContent = document.getElementById(whichOne).innerHTML;
		blinkInterval = setInterval("doBlinkTxt('" + whichOne + "')",speed);
	}
	
	function stopBlinkTxt(whichOne)
	{
		clearInterval(blinkInterval);

		if ( document.getElementById(whichOne).innerHTML == '&nbsp;' )
		{
			document.getElementById(whichOne).innerHTML = oldContent;
		}
	}
	
	function doBlinkTxt(whichOne) 
	{ 
		if ( document.getElementById(whichOne).innerHTML == '&nbsp;' )
		{
			document.getElementById(whichOne).innerHTML = oldContent;
		}
		else
		{
			document.getElementById(whichOne).innerHTML = '&#160;';
		}	
	}

	function checkForRtl(firstWord)
	{
		var boolRtl = false;
		var tempWord;
		
		tempWord = ConvertUnicodeStr(firstWord);

		for( i = 0 ; i < tempWord.length ; i++ )
		{
			if ((tempWord.charCodeAt(i) > 1487 ) && ( tempWord.charCodeAt(i) < 1515))
			{  
				boolRtl = true;
				wordLang = "hebrew";
				break;
			}

			if ((tempWord.charCodeAt(i) > 1536 ) && ( tempWord.charCodeAt(i) < 1791))
			{  
				boolRtl = true;
				wordLang = "arabic";
				break;
			}
		}
		return boolRtl;
	}	

	function ConvertUnicodeStr(str)
	{
		var tempStr = '';
		var resultStr = str;
	    var j = resultStr.indexOf('&#');		
		
		if(j>=0)
		{
			while(j>=0)
			{
				tempStr = tempStr + resultStr.substring(0,j) + String.fromCharCode(resultStr.substring(j+2, j+6));
				resultStr = resultStr.substring(j+7, resultStr.length);
				j = resultStr.indexOf('&#');
			}
			resultStr = tempStr;
		}
		
		return resultStr;	
	}

	var divIndx;

	function startSwitchItems(numSeconds)
	{
		divIndx = 0;
		
		setInterval("switchItem()",(1000*numSeconds));
	}
	function switchItem(indx,divObj)
	{
		var divObj = document.getElementsByName("divSwitchItem");
		
		divIndx++;
		
		if ( divIndx == divObj.length ) 
		{
			divIndx = 0;
		}
		document.getElementById("tdSwitchItemContainer").innerHTML = divObj[divIndx].innerHTML;
	}
	
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//THE NEXT LINES OF CODE ARE FOR AN EXPANDING WINDOW:

// =============================== //
// Animated Window                 //

// INITIALIZATION:

animatedWindow = new Object();

// CONFIGURATION:

animatedWindow.startWidth = 100;
animatedWindow.startHeight = 100;

animatedWindow.endWidth = 640;
animatedWindow.endHeight = 480;

animatedWindow.bgColor = '#FFFFFF';

animatedWindow.increment = 50;

animatedWindow.frameRate = 50;

animatedWindow.location = false;
animatedWindow.menubar = false;
animatedWindow.resizable = false;
animatedWindow.scrollbars = false;
animatedWindow.status = false;
animatedWindow.toolbar = false;

// MAIN:

animatedWindow.winIndex = 0;
animatedWindow.windows = new Array();

/* ----- EXPLANATIONS OF THE OPENING FIELDS  --------------

   EXAMPLE: openAnimatedWindow('myfile.html',200,200,640,480,'red')
	
  openAnimatedWindow(URL,STARTWIDTH,STARTHEIGHT,ENDWIDTH,ENDHEIGHT,BGCOLOR,
    INCREMENT,FRAMERATE,POSX,POSY,LOCATION,MENUBAR,RESIZABLE,SCROLLBARS,STATUS,TOOLBAR)

  URL		= An optional string that specifies the URL. A blank window will be
	  	  displayed if this argument is left blank.
  STARTWIDTH	= An optional number that specifies the starting width.
  STARTHEIGHT	= An optional number that specifies the starting height.
  ENDWIDTH	= An optional number that specifies the ending width.
  ENDHEIGHT	= An optional number that specifies the ending height.
  BGCOLOR	= An optional string that specifies the initial background color of the
		  window before the window has finished resizing and the URL has loaded.
  INCREMENT	= An optional number that specifies the growth distance per frame.
  FRAMERATE 	= An optional number that specifies the number of frames per second.
  POSX		= An optional number that specifies the X position.
  POSY		= An optional number that specifies the Y position.
  LOCATION	= An optional boolean that specifies the location feature.
  MENUBAR	= An optional boolean that specifies the menubar feature.
  RESIZABLE	= An optional boolean that specifies the resizable feature.
  SCROLLBARS	= An optional boolean that specifies the scrollbars feature.
  STATUS	= An optional boolean that specifies the status feature.
  TOOLBARS	= An optional boolean that specifies the toolbars feature.
  
-------------------------- */

function isBlank(OBJ) {
   if (OBJ == null) OBJ = '';
   OBJ += '';
   var trimList = ' \f\n\r';
   while (OBJ.length > 0 && trimList.indexOf(OBJ.charAt(0)) != -1) OBJ = OBJ.substring(1);
   while (OBJ.length > 0 && trimList.indexOf(OBJ.charAt(OBJ.length - 1)) != -1) OBJ = OBJ.substring(0,OBJ.length - 1);
   return (OBJ == '') ? true : false;
   }

function isBoolean(STR) {
   return (STR == true || STR == false) ? true : false;
   }

function openAnimatedWindow(URL,STARTWIDTH,STARTHEIGHT,ENDWIDTH,ENDHEIGHT,BGCOLOR,INCREMENT,FRAMERATE,POSX,POSY,LOCATION,MENUBAR,RESIZABLE,SCROLLBARS,STATUS,TOOLBAR) {
   if (isBlank(STARTWIDTH)) STARTWIDTH = animatedWindow.startWidth;
   if (isBlank(STARTHEIGHT)) STARTHEIGHT = animatedWindow.startHeight;
   if (isBlank(ENDWIDTH)) ENDWIDTH = animatedWindow.endWidth;
   if (isBlank(ENDHEIGHT)) ENDHEIGHT = animatedWindow.endHeight;
   if (isBlank(BGCOLOR)) BGCOLOR = animatedWindow.bgColor;
   if (isBlank(INCREMENT)) INCREMENT = animatedWindow.increment;
   if (isBlank(FRAMERATE)) FRAMERATE = animatedWindow.frameRate;
   if (isBlank(POSX)) POSX = (screen.width)?(screen.width-ENDWIDTH)/2:100;
   if (isBlank(POSY)) POSY = (screen.height)?(screen.height-ENDHEIGHT)/2:100;;
   if (isBlank(LOCATION)) LOCATION = animatedWindow.location;
   if (isBlank(MENUBAR)) MENUBAR = animatedWindow.menubar;
   if (isBlank(RESIZABLE)) RESIZABLE = animatedWindow.resizable;
   if (isBlank(SCROLLBARS)) SCROLLBARS = animatedWindow.scrollbars;
   if (isBlank(STATUS)) STATUS = animatedWindow.status;
   if (isBlank(TOOLBAR)) TOOLBAR = animatedWindow.toolbar;
   var winFeaturesStr = 'width=' + STARTWIDTH + ',height=' + STARTHEIGHT;
   winFeaturesStr += ',left=' + POSX + ',screenX=' + POSX + ',top=' + POSY + ',screenY=' + POSY;
   if (isBoolean(LOCATION)) winFeaturesStr += (LOCATION) ? ',location=yes' : ',location=no';
   if (isBoolean(MENUBAR)) winFeaturesStr += (MENUBAR) ? ',menubar=yes' : ',menubar=no';
   if (isBoolean(RESIZABLE)) winFeaturesStr += (RESIZABLE) ? ',resizable=yes' : ',resizable=no';
   if (isBoolean(SCROLLBARS)) winFeaturesStr += (SCROLLBARS) ? ',scrollbars=yes' : ',scrollbars=no';
   if (isBoolean(STATUS)) winFeaturesStr += (STATUS) ? ',status=yes' : ',status=no';
   if (isBoolean(TOOLBAR)) winFeaturesStr += (TOOLBAR) ? ',toolbar=yes' : ',toolbar=no';
   var thisWinIndex = animatedWindow.winIndex;
   animatedWindow.winIndex++;
   animatedWindow.windows[thisWinIndex] = new Object();
   animatedWindow.windows[thisWinIndex].winObj = window.open('','',winFeaturesStr);
   animatedWindow.windows[thisWinIndex].winObj.document.bgColor = BGCOLOR;
   animatedWindow.windows[thisWinIndex].winObj.focus();
   animatedWindow.windows[thisWinIndex].frameRate = FRAMERATE;
   animatedWindow.windows[thisWinIndex].url = URL;
   animatedWindow.windows[thisWinIndex].endWidth = ENDWIDTH;
   animatedWindow.windows[thisWinIndex].endHeight = ENDHEIGHT;
   animatedWindow.windows[thisWinIndex].angle = Math.atan2(ENDHEIGHT - STARTHEIGHT,ENDWIDTH - STARTWIDTH);
   animatedWindow.windows[thisWinIndex].distZ = Math.sqrt(Math.pow(ENDHEIGHT - STARTHEIGHT,2) + Math.pow(ENDWIDTH - STARTWIDTH,2));
   animatedWindow.windows[thisWinIndex].incX = Math.cos(animatedWindow.windows[thisWinIndex].angle) * INCREMENT;
   animatedWindow.windows[thisWinIndex].incY = Math.sin(animatedWindow.windows[thisWinIndex].angle) * INCREMENT;
   animatedWindow.windows[thisWinIndex].incZ = INCREMENT;
   animatedWindow.windows[thisWinIndex].roundedX = STARTWIDTH;
   animatedWindow.windows[thisWinIndex].roundedY = STARTHEIGHT;
   animatedWindow.windows[thisWinIndex].currentX = STARTWIDTH;
   animatedWindow.windows[thisWinIndex].currentY = STARTHEIGHT;
   animatedWindow.windows[thisWinIndex].currentZ = 0;
   resizeAnimatedWindow(thisWinIndex);
   }

function resizeAnimatedWindow(WININDEX) {
   var animateWinObj = animatedWindow.windows[WININDEX];
   if (animateWinObj.currentZ + animateWinObj.incZ < animateWinObj.distZ) {
      animateWinObj.currentX += animateWinObj.incX;
      animateWinObj.currentY += animateWinObj.incY;
      animateWinObj.currentZ += animateWinObj.incZ;
      var incX = Math.round(animateWinObj.currentX) - animateWinObj.roundedX;
      animateWinObj.roundedX += incX;
      var incY = Math.round(animateWinObj.currentY) - animateWinObj.roundedY;
      animateWinObj.roundedY += incY;
      animateWinObj.winObj.resizeBy(incX,incY);
      window.setTimeout('resizeAnimatedWindow(' + WININDEX + ')',animateWinObj.frameRate);
      }
   else {
      var incX = animateWinObj.endWidth - animateWinObj.roundedX;
      var incY = animateWinObj.endHeight - animateWinObj.roundedY;
      animateWinObj.winObj.resizeBy(incX,incY);
      if (!isBlank(animateWinObj.url)) animateWinObj.winObj.location.href = animateWinObj.url;
      }
   }

//						END OF THE CODE FOR AN EXPANDING WINDOW
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

   function loadjscssfile(filename, filetype) {
       if (filetype == "js") { //if filename is a external JavaScript file
           var fileref = document.createElement('script')
           fileref.setAttribute("type", "text/javascript")
           fileref.setAttribute("src", filename)
       }
       else if (filetype == "css") { //if filename is an external CSS file
           var fileref = document.createElement("link")
           fileref.setAttribute("rel", "stylesheet")
           fileref.setAttribute("type", "text/css")
           fileref.setAttribute("href", filename)
       }
       if (typeof fileref != "undefined")
           document.getElementsByTagName("head")[0].appendChild(fileref)
   }
