			var xmlSource;
			var xml = '';
			var search_page = 0;
			var page_size = 4;
			var result_page_size = 40;
			var message_size = 11;
			var search_result = 500;
			var sort = 'lastlogin';
			var order = 'descending';
			var year = 1989;
			var month = 1;
			var day = 1;

			function resetSearch() 
			{
				search_page = 0;
				page_size = 4;
				result_page_size = 40;
				message_size = 11;
				search_result = 500;
				sort = 'lastlogin';
				order = 'descending';
			}

			function doLoginCheck()
			{
				if ((document.getElementById('username').value == '') || (document.getElementById('password').value == ''))
				{
					document.getElementById('loginheader').innerHTML = 'אנא מלא' + ((document.getElementById('username').value == '') ? ' שם משתמש,' : '') + ((document.getElementById('password').value == '') ? ' סיסמא' : '');
					return false;
				}
				document.getElementById('loginheader').innerHTML = 'מבצע כניסה למערכת';
				return true;
			}

			function doLoginForm()
			{
				if ((document.getElementById('username').value == '') || (document.getElementById('password').value == ''))
				{
					document.getElementById('loginheader').innerHTML = '<font color="yellow">לא מילאת' + ((document.getElementById('username').value == '') ? ' שם משתמש,' : '') + ((document.getElementById('password').value == '') ? ' סיסמא' : '') + '</font>';
					return false;
				}
				document.getElementById('loginheader').innerHTML = 'מבצע כניסה למערכת';
				doPostForm('login', './login.php');
				showElement('loading');
				return true;
			}
			function doLogout()
			{
				alert("DoLogout!");
			}

			function doPostForm(formName, pageName){
				  var xmlHttp;
				  var formElements = '';
				  var response;
				  try
					{
					// Firefox, Opera 8.0+, Safari
					xmlHttp=new XMLHttpRequest();
					}
				  catch (e)
					{
					// Internet Explorer
					try
					  {
					  xmlHttp=new ActiveXObject('Msxml2.XMLHTTP');
					  }
					catch (e)
					  {
					  try
						{
						xmlHttp=new ActiveXObject('Microsoft.XMLHTTP');
						}
					  catch (e)
						{
						alert('Your browser does not support AJAX!');
						return false;
						}
					  }
					}
					xmlHttp.onreadystatechange=function()
					  {
					  if(xmlHttp.readyState==4)
						{
						  response = xmlHttp.responseText;
						  doPostFormAction(formName, response);
						}
					  }
				for (var i = 0; i < document.getElementById(formName).elements.length; i++)
				{
					if (i > 0)
					{
						formElements = formElements + '&';
					}
			        // Get the current field
			        formElements = formElements + document.getElementById(formName).elements[i].name + '=' + document.getElementById(formName).elements[i].value;
				}
				xmlHttp.open('POST',pageName);
				xmlHttp.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
				xmlHttp.send(formElements);
			}
			function reloadHtml(el, src)
			{
				  var xmlHttp;
				  var status;
				  try
					{
					// Firefox, Opera 8.0+, Safari
					xmlHttp=new XMLHttpRequest();
					}
				  catch (e)
					{
					// Internet Explorer
					try
					  {
					  xmlHttp=new ActiveXObject('Msxml2.XMLHTTP');
					  }
					catch (e)
					  {
					  try
						{
						xmlHttp=new ActiveXObject('Microsoft.XMLHTTP');
						}
					  catch (e)
						{
						alert('Your browser does not support AJAX!');
						return false;
						}
					  }
					}
					xmlHttp.onreadystatechange=function()
					  {
					  if(xmlHttp.readyState==4)
						{
						  var str = xmlHttp.responseText;
//						  alert(str);
						  if (document.getElementById(el)!=null)
						  {
							  document.getElementById(el).innerHTML=str;
						  }
						}
					  }
					xmlHttp.open('GET', src,true);
					xmlHttp.setRequestHeader('Content-Type', 'text/html; charset=windows-1255');
					xmlHttp.send(null);
				return true;
			}
		function runTransform(el, xmldoc, xsldoc){
			if ( el == 'online_messages')
			{
				xml1 = xml;
			}
			showElement("loading");
			if(document.implementation && document.implementation.createDocument){
				// Mozilla
		
				var xsltProcessor = new XSLTProcessor();
				
				// load the xslt file
				var myXMLHTTPRequest = new XMLHttpRequest();
				myXMLHTTPRequest.open('GET', xsldoc, false);
				myXMLHTTPRequest.send(null);
				
				// get the XML document
				xslStylesheet = myXMLHTTPRequest.responseXML;
				xsltProcessor.importStylesheet(xslStylesheet);
				
				// load the xml file
				myXMLHTTPRequest = new XMLHttpRequest();
				myXMLHTTPRequest.open('GET', xmldoc, false);
				myXMLHTTPRequest.send(null);
				
				xmlSource = myXMLHTTPRequest.responseXML;
				//transform
				 var resultDocument = xsltProcessor.transformToFragment(xmlSource, document);
				document.getElementById(el).innerHTML='';
				document.getElementById(el).appendChild(resultDocument);
				xml = xmlSource;
			}else if(window.ActiveXObject){
				// IE
				
				// Load XML
				xml = new ActiveXObject('MSXML2.DOMDocument');
				xml.async = false
				xml.load(xmldoc)
				// Load XSL
				xsl = new ActiveXObject('MSXML2.DOMDocument');
				xsl.async = false
				xsl.load(xsldoc)
				
			
				// Transform
				document.getElementById(el).innerHTML=xml.transformNode(xsl);
			}else{
				// Browser unknown
				alert('Browser unknown');
			}
			sort = 'lastlogin';
			order = 'descending';
			hideElement("loading");
			if ( el == 'online_messages')
			{
				xml = xml1;
			}
		}

		function runTransformXsl(el, xsldoc){
			if(document.implementation && document.implementation.createDocument){
				// Mozilla
				var xsltProcessor = new XSLTProcessor();

				// get the XML document
				try 
				{
					xsltProcessor.importStylesheet((new DOMParser()).parseFromString(xsldoc, "text/xml"));
				} catch (e)
				{
					alert("error catched: " + e);
				}
				
				// load the xml file
				
				//transform
				try
				{
					 var resultDocument = xsltProcessor.transformToFragment(xml, document);
					document.getElementById(el).innerHTML='';
					document.getElementById(el).appendChild(resultDocument);
				}
				catch (e)
				{
					alert("error catched: " + e);
				}
				return false;
			}else if(window.ActiveXObject){
				// IE

				// Load XSL
				var xsl = new ActiveXObject("Msxml2.DOMDocument")
				xsl.async = false
				xsl.loadXML(xsldoc)

				// Transform
				document.getElementById(el).innerHTML = xml.transformNode(xsl);
				return false;
			}else{
				// Browser unknown
				alert('Browser unknown');
			}
		}


			function setFocus(el)
			{
				var elem = document.getElementById(el);
				if (elem != null)
				{
					elem.focus();
					elem.select();
				}
			}

			function setSelect(el)
			{
				document.getElementById(el).select();
			}

			function setCookie(c_name,value,expiredays)
			{
				var exdate=new Date()
				exdate.setDate(exdate.getDate()+expiredays)
				document.cookie=c_name+ '=' +escape(value)+
				((expiredays==null) ? '' : ';expires='+exdate.toGMTString())
			}
			function getCookie(c_name)
			{
			if (document.cookie.length != null)
			{
				if (document.cookie.length>0)
				  {
				  c_start=document.cookie.indexOf(c_name + '=')
				  if (c_start!=-1)
					{ 
					c_start=c_start + c_name.length+1 
					c_end=document.cookie.indexOf(';',c_start)
					if (c_end==-1) c_end=document.cookie.length
					return unescape(document.cookie.substring(c_start,c_end))
					} 
				  }
			}
			return ''
			}
			/******************************************************************************
			* Version 2.0.0 (September 8 2006)
			* Author: Kobi Tyrkel
			* Email: See www.lovestory.co.il
			******************************************************************************/

			var onLineXmlHttp;
			var messageState;

			messageState = 0;
			
			function online()
			{
				reloadHtml("online_messages", "./online.php");
				if (document.getElementById("online_messages")!=null)
					if (document.getElementById("online_messages").innerHTML.length > 170) {
						if (document.getElementById("online_messages").style.visibility!="visible")
						{
							if (document.getElementById("online_messages").innerHTML.length < 1200)
							{
								if (document.getElementById("online_messages").innerHTML.indexOf("mysql")==-1)
								{
									document.getElementById("online_messages").style.visibility="visible";
									document.online_voice.play();
									opacity("online_messages", 0, 100, 3000);
								}
							}
						}
						if (document.getElementById("online_messages").innerHTML.length <= 170) 
							{
								if (document.getElementById("online_messages").style.visibility=="visible")
									{
										document.getElementById("online_messages").style.visibility="hidden";
									}
							}
					}
				setTimeout("online()", 20000);
			}

			setTimeout("online()", 20000);

			function deleteOnlineMessage(id)
			{
				prev_len = document.getElementById("online_messages").innerHTML.length;
				reloadHtml("online_messages", "./online.php?del=" + id);
						document.getElementById("online_messages").style.visibility="hidden";
			}

			<!-- START OF OPACITY CODE -->
			function opacity(id, opacStart, opacEnd, millisec) { 
				//speed for each frame 
				var speed = Math.round(millisec / 100); 
				var timer = 0; 

				//determine the direction for the blending, if start and end are the same nothing happens 
				if(opacStart > opacEnd) { 
					for(i = opacStart; i >= opacEnd; i--) { 
						setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed)); 
						timer++; 
					} 
				} else if(opacStart < opacEnd) { 
					for(i = opacStart; i <= opacEnd; i++) 
						{ 
						setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed)); 
						timer++; 
					} 
				} 
			} 

			//change the opacity for different browsers 
			function changeOpac(opacity, id) { 
				var object = document.getElementById(id).style; 
				object.opacity = (opacity / 100); 
				object.MozOpacity = (opacity / 100); 
				object.KhtmlOpacity = (opacity / 100); 
				object.filter = "alpha(opacity=" + opacity + ")"; 
			} 

			function heightOfElement(id, heightStart, heightEnd, millisec) { 
				//speed for each frame 
				var speed = Math.round(millisec / 100); 
				var timer = 0; 

				//determine the direction for the blending, if start and end are the same nothing happens 
				if(heightStart > heightEnd) { 
					for(i = heightStart; i >= heightEnd; i--) { 
						setTimeout("changeHeight(" + i + ",'" + id + "')",(timer * speed)); 
						timer++; 
					} 
				} else if(heightStart < heightEnd) { 
					for(i = heightStart; i <= heightEnd; i++) 
						{ 
						setTimeout("changeHeight(" + i + ",'" + id + "')",(timer * speed)); 
						timer++; 
					} 
				} 
			} 
			//change the height for different browsers 
			function changeHeight(height, id) { 
				var object = document.getElementById(id).style; 
				object.height = height; 
			} 

			function doAlert() {
				alert("Ha ha ha");
			}

function go(direction)
{
	switch(direction) {
		case 'next' :
//			if (search_page + page_size < search_result)
//			{
				search_page += page_size;
//			}
			break;
		case 'prev' :
			if (search_page >= page_size)
			{
				search_page -= page_size;
			}
			break;
		case 'lastlogin' :
			sort = 'lastlogin';
			order = 'descending';
			break;
		case 'agea' :
			sort = 'age';
			order = 'ascending';
			break;
		case 'aged' :
			sort = 'age';
			order = 'descending';
			break;
		case 'updatedate':
			sort = 'updatedate';
			order = 'descending';
			break;
		case 'first':
			search_page = 0;
			break;
		case 'last':
			search_page = search_result - (search_result % page_size);
			break;
		default:
			search_page = direction;
			break;
	}
	var xslStylesheet = "<?xml version='1.0' encoding='windows-1255'?><xsl:stylesheet version='1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>\n"
	+ "<xsl:param name='M' select='" + (search_page % result_page_size) + "'/>\n"
	+ "<xsl:param name='N' select='" + page_size + "'/>\n"
	+ "<xsl:template match='/'>\n"
	+ "	<html>\n"
	+ "	<body>\n"
	+ "	<table width='620'>\n"
	+ "		<tr><td class='navigationbar' colspan='3'><xsl:value-of select='/rootElement/general/search_type' /></td></tr>\n"
	+ "		<tr>\n"
	+ "			<td class='navigationbar'>\n"
	+ "				<xsl:choose>\n"
	+ "				<xsl:when test='" + ((search_page % result_page_size) - page_size + 1) + " &gt; 0 and " + (search_page - page_size + 1) + " &gt; 0'>\n"
	+ "					<a href='#' class='navigationbar' onclick='javascript:showElement(\"loading\");runTransform(\"main\", \"./search.php?echo=1&amp;go=first\", \"./search.xsl.php?xsl=1\");go(\"first\");' title='לדף הראשון'><img><xsl:attribute name='src'>./images/first.gif</xsl:attribute><xsl:attribute name='alt'>לדף הראשון</xsl:attribute></img></a>\n"
	+ "					<a href='#' class='navigationbar' onclick='javascript:go(\"prev\");' title='לדף הקודם'><img><xsl:attribute name='src'>./images/prev.gif</xsl:attribute><xsl:attribute name='alt'>לדף הקודם</xsl:attribute></img></a>\n"
	+ "				</xsl:when>\n"
	+ "				<xsl:when test='" + ((search_page % result_page_size) - page_size + 1) + " &lt; 0 and " + (search_page - page_size + 1) + " &gt; 0'>\n"
	+ "					<a href='#' class='navigationbar' onclick='javascript:showElement(\"loading\");runTransform(\"main\", \"./search.php?echo=1&amp;go=first\", \"./search.xsl.php?xsl=1\");go(\"first\");' title='לדף הראשון'><img><xsl:attribute name='src'>./images/first.gif</xsl:attribute><xsl:attribute name='alt'>לדף הראשון</xsl:attribute></img></a>\n"
	+ "					<a href='#' class='navigationbar' onclick='javascript:showElement(\"loading\");runTransform(\"main\", \"./search.php?echo=1&amp;go=prev\", \"./search.xsl.php?xsl=1\");go(\"prev\");' title='לדף הקודם'><img><xsl:attribute name='src'>./images/prev.gif</xsl:attribute><xsl:attribute name='alt'>לדף הקודם</xsl:attribute></img></a>\n"
	+ "				</xsl:when>\n"
	+ "				<xsl:otherwise>\n"
	+ "					<a href='#' class='navigationbar' title='זה הדף הראשון'><img><xsl:attribute name='src'>./images/firstbw.gif</xsl:attribute><xsl:attribute name='alt'>זה הדף הראשון</xsl:attribute></img></a>\n"
	+ "					<a href='#' class='navigationbar' title='זה הדף הראשון'><img><xsl:attribute name='src'>./images/prevbw.gif</xsl:attribute><xsl:attribute name='alt'>זה הדף הראשון</xsl:attribute></img></a>\n"
	+ "				</xsl:otherwise></xsl:choose>\n"
	+ "				<xsl:choose>\n"
	+ "					<xsl:when test='"+ ((search_page % result_page_size) + page_size + 1) +" &lt; " + result_page_size + " and " + (search_page + page_size) + " &lt; /rootElement/result_set_size'>\n"
	+ "						<a href='#' class='navigationbar' onclick='javascript:go(\"next\");' title='לדף הבא'><img><xsl:attribute name='src'>./images/next.gif</xsl:attribute><xsl:attribute name='alt'>לדף הבא</xsl:attribute></img></a>\n"
	+ "						<a href='#' class='navigationbar' title='לדף האחרון'>\n"
	+ "							<xsl:attribute name='onclick'>javascript:showElement(\"loading\");runTransform(\"main\", \"./search.php?echo=1&amp;go=last\", \"./search.xsl.php?xsl=1\");go(\"<xsl:value-of select='floor(/rootElement/result_set_size div /rootElement/page_size) * /rootElement/page_size + floor((/rootElement/result_set_size - floor(/rootElement/result_set_size div /rootElement/page_size) * /rootElement/page_size) div " + page_size + ") * "  + page_size + "' />\");</xsl:attribute>\n"
	+ "							<img><xsl:attribute name='src'>./images/last.gif</xsl:attribute><xsl:attribute name='alt'>לדף האחרון</xsl:attribute></img>\n"
	+ "						</a>\n"
	+ "					</xsl:when>\n"
	+ "					<xsl:when test='"+ ((search_page % result_page_size) + page_size + 1) +" &gt;= " + result_page_size + " and " + (search_page + page_size) + " &lt; /rootElement/result_set_size'>\n"
	+ "						<a href='#' class='navigationbar' onclick='javascript:showElement(\"loading\");runTransform(\"main\", \"./search.php?echo=1&amp;go=next\", \"./search.xsl.php?xsl=1\");go(\"next\");' title='לדף הבא'><img><xsl:attribute name='src'>./images/next.gif</xsl:attribute><xsl:attribute name='alt'>לדף הבא</xsl:attribute></img></a>\n"
	+ "						<a href='#' class='navigationbar' title='לדף האחרון'>\n"
	+ "							<xsl:attribute name='onclick'>javascript:showElement(\"loading\");runTransform(\"main\", \"./search.php?echo=1&amp;go=last\", \"./search.xsl.php?xsl=1\");go(\"<xsl:value-of select='floor(/rootElement/result_set_size div /rootElement/page_size) * /rootElement/page_size + floor((/rootElement/result_set_size - floor(/rootElement/result_set_size div /rootElement/page_size) * /rootElement/page_size) div " + page_size + ") * "  + page_size + "' />\");</xsl:attribute>\n"
	+ "							<img><xsl:attribute name='src'>./images/last.gif</xsl:attribute><xsl:attribute name='alt'>לדף האחרון</xsl:attribute></img>\n"
	+ "						</a>\n"
	+ "					</xsl:when>\n"
	+ "					<xsl:otherwise>\n"
	+ "						<a href='#' class='navigationbar' title='זה הדף האחרון'><img><xsl:attribute name='src'>./images/nextbw.gif</xsl:attribute><xsl:attribute name='alt'>זה הדף האחרון</xsl:attribute></img></a>\n"
	+ "						<a href='#' class='navigationbar' title='זה הדף האחרון'>\n"
	+ "							<img><xsl:attribute name='src'>./images/lastbw.gif</xsl:attribute><xsl:attribute name='alt'>זה הדף האחרון</xsl:attribute></img>\n"
	+ "						</a>\n"
	+ "					</xsl:otherwise>\n"
	+ "				</xsl:choose>\n"
	+ "			</td>\n"
	+ "			<td class='navigationbar' colspan='2'>מציג תוצאות " + (1 + parseInt(search_page) ) + " עד <xsl:choose><xsl:when test='" + (parseInt(search_page) + parseInt(page_size)) + " &lt; /rootElement/result_set_size'><xsl:value-of select='/rootElement/general/page_size + " + (search_page) + "' /></xsl:when><xsl:otherwise><xsl:value-of select='rootElement/result_set_size' /></xsl:otherwise></xsl:choose>" + " מתוך <xsl:value-of select='/rootElement/result_set_size' />\n"
	+ " ממויין לפי " + ((sort == "age") ? "גיל" : ((sort == "lastlogin") ? "כניסה אחרונה" : "תאריך עדכון")) 
	+ "</td></tr>\n"
	+ "		<xsl:for-each select='rootElement/dating_users'>\n"
	+ "			<xsl:sort select='" + sort + "' order='" + order + "'/>\n"
	+ "			<xsl:if test='position() &gt; " + (search_page % result_page_size) + " and position() &lt;= " + ((search_page % result_page_size) + page_size) + "'>\n"
	+ "				<tr>\n"
	+ "								<td width='90' class='member_search' rowspan='2'>\n"
	+ "									<table width='90'>\n"
	+ "										<tr>\n"
	+ "											<td>\n"
	+ "									<a target='_blank'>\n"
	+ "										<xsl:attribute name='id'>lhref</xsl:attribute>\n"
	+ "										<xsl:attribute name='name'>lhref</xsl:attribute>\n"
	+ "										<xsl:attribute name='href'>./showpicture.php?userid=<xsl:value-of select='id' /></xsl:attribute>\n"
	+ "										<xsl:attribute name='onclick'>return initImage(this.href);</xsl:attribute>\n"
	+ "										<img width='60' height='80' alt='לחץ להגדלת התמונה'>\n"
	+ "											<xsl:attribute name='id'>thumb<xsl:value-of select='id' /></xsl:attribute>\n"
	+ "											<xsl:attribute name='name'>thumb<xsl:value-of select='id' /></xsl:attribute>\n"
	+ "											<xsl:attribute name='src'>./showpicture.php?userid=<xsl:value-of select='id' />&amp;thumb=1</xsl:attribute>\n"
	+ "										</img>\n"
	+ "									</a>\n"
	+ "								</td>\n"
	+ "											<td>\n"
	+ "												<img><xsl:attribute name='title'>נכנסתי לאחרונה ב <xsl:value-of select='lastlogin' /></xsl:attribute><xsl:attribute name='src'>./images/lastvisit.gif</xsl:attribute></img><br />\n"
	+ "												<img><xsl:attribute name='title'>נרשמתי לאתר ב <xsl:value-of select='createdate' /></xsl:attribute><xsl:attribute name='src'>./images/createdate.gif</xsl:attribute></img>\n"
	+ "											</td>\n"
	+ "										</tr>\n"
	+ "									</table>\n"
	+ "								</td>\n"
	+ "											<td width='220' class='member_search'>\n"
	+ "												<a href='#' class='member_search'>\n"
	+ "													<xsl:attribute name='onclick'>\n"
	+ "														javascript:openMemberCard(<xsl:value-of select='id' />);\n"
	+ "													</xsl:attribute>\n"
	+ "													<xsl:value-of select='name' /> (<xsl:value-of select='id' />)</a>,<br /><br />\n"
	+ "											<xsl:choose>\n"
	+ "												<xsl:when test='status = 1'>\n"
	+ "													<xsl:text>רווק</xsl:text>\n"
	+ "												</xsl:when>\n"
	+ "												<xsl:when test='status = 2'>\n"
	+ "													<xsl:text>גרוש</xsl:text>\n"
	+ "												</xsl:when>\n"
	+ "												<xsl:when test='status = 3 and gender=1'>\n"
	+ "													<xsl:text>אלמן</xsl:text>\n"
	+ "												</xsl:when>\n"
	+ "												<xsl:when test='status = 3 and gender=2'>\n"
	+ "													<xsl:text>אלמנ</xsl:text>\n"
	+ "												</xsl:when>\n"
	+ "												<xsl:when test='status = 4 and gender=1'>\n"
	+ "													<xsl:text>נשוי</xsl:text>\n"
	+ "												</xsl:when>\n"
	+ "												<xsl:when test='status = 4 and gender=2'>\n"
	+ "													<xsl:text>נשוא</xsl:text>\n"
	+ "												</xsl:when>\n"
	+ "												<xsl:when test='status = 5'>\n"
	+ "													<xsl:text>פרוד</xsl:text>\n"
	+ "												</xsl:when>\n"
	+ "											</xsl:choose>\n"
	+ "											<xsl:choose>\n"
	+ "												<xsl:when test='gender=2'>\n"
	+ "														<xsl:text>ה</xsl:text>\n"
	+ "												</xsl:when>\n"
	+ "											</xsl:choose>\n"
	+ "											, <xsl:choose><xsl:when test='(substring(age, 5, 3) > substring(/rootElement/general/now, 5, 3)) or (substring(age, 5, 3) = substring(/rootElement/general/now, 5, 3) and substring(age, 8, 3) > substring(/rootElement/general/now, 8, 3))'><xsl:value-of select='substring(/rootElement/general/now, 0, 5) - substring(age, 0, 5)'/></xsl:when><xsl:otherwise><xsl:value-of select='substring(/rootElement/general/now, 0, 5) - substring(age, 0, 5) - 1'/></xsl:otherwise></xsl:choose>, <xsl:value-of select='city'/> (<xsl:value-of select='area'/>)\n"
	+ "											</td>\n"
	+ "											<td width='300' class='member_search'><br /><xsl:value-of select='substring(onme, 0, 40)' />...</td>\n"
	+ "							</tr>\n"
	+ "							<tr>\n"
	+ "								<td>\n"
	+ "									<table>\n"
	+ "										<tr>\n"
	+ "											<td width='20'>\n"
	+ "													<xsl:if test='viewme!=\"0000-00-00 00:00:00\" and viewme != \"\"'>\n"
	+ "														<img><xsl:attribute name='title'><xsl:value-of select='name' /><xsl:choose><xsl:when test='gender=1'> צפה</xsl:when><xsl:otherwise> צפתה</xsl:otherwise></xsl:choose> בי בתאריך <xsl:value-of select='viewme' /></xsl:attribute><xsl:attribute name='src'>./images/view.gif</xsl:attribute></img>\n"
	+ "													</xsl:if>\n"
	+ "													<xsl:if test='viewme=\"0000-00-00 00:00:00\" or viewme = \"\"'>\n"
	+ "														<img><xsl:attribute name='title'><xsl:value-of select='name' /><xsl:choose><xsl:when test='gender=1'> לא צפה</xsl:when><xsl:otherwise> לא צפתה</xsl:otherwise></xsl:choose> בי</xsl:attribute><xsl:attribute name='src'>./images/viewbw.gif</xsl:attribute></img>\n"
	+ "													</xsl:if>\n"
	+ "											</td>\n"
	+ "											<td width='20'>\n"
	+ "													<xsl:if test='favme!=\"0000-00-00 00:00:00\" and favme != \"\"'>\n"
	+ "														<img><xsl:attribute name='title'><xsl:value-of select='name' /><xsl:choose><xsl:when test='gender=1'> מעדיף</xsl:when><xsl:otherwise> מעדיפה</xsl:otherwise></xsl:choose> אותי מתאריך <xsl:value-of select='favme' /></xsl:attribute><xsl:attribute name='src'>./images/favorites.gif</xsl:attribute></img>\n"
	+ "													</xsl:if>\n"
	+ "													<xsl:if test='favme=\"0000-00-00 00:00:00\" or favme = \"\"'>\n"
	+ "														<img><xsl:attribute name='title'><xsl:value-of select='name' /><xsl:choose><xsl:when test='gender=1'> לא הוסיף</xsl:when><xsl:otherwise> לא הוסיפה</xsl:otherwise></xsl:choose> אותי למועדפים</xsl:attribute><xsl:attribute name='src'>./images/favoritesbw.gif</xsl:attribute></img>\n"
	+ "													</xsl:if>\n"
	+ "											</td>\n"
	+ "											<td width='20'>\n"
	+ "													<xsl:if test='chatme!=\"0000-00-00 00:00:00\" and chatme != \"\"'>\n"
	+ "														<img><xsl:attribute name='title'><xsl:value-of select='name' /><xsl:choose><xsl:when test='gender=1'> דיבר איתי בדיבור מקוון</xsl:when><xsl:otherwise> דיברה איתי בדיבור מקוון</xsl:otherwise></xsl:choose> איתי בתאריך <xsl:value-of select='chatme' /></xsl:attribute><xsl:attribute name='src'>./images/chat.gif</xsl:attribute></img>\n"
	+ "													</xsl:if>\n"
	+ "													<xsl:if test='chatme=\"0000-00-00 00:00:00\" or chatme = \"\"'>\n"
	+ "														<img><xsl:attribute name='title'><xsl:value-of select='name' /><xsl:choose><xsl:when test='gender=1'> לא דיבר איתי בדיבור מקוון</xsl:when><xsl:otherwise> לא דיברה איתי בדיבור מקוון</xsl:otherwise></xsl:choose> </xsl:attribute><xsl:attribute name='src'>./images/chatbw.gif</xsl:attribute></img>\n"
	+ "													</xsl:if>\n"
	+ "											</td>\n"
	+ "											<td width='20'>\n"
	+ "													<xsl:if test='mailme!=\"0000-00-00 00:00:00\" and mailme!=\"\"'>\n"
	+ "														<img><xsl:attribute name='title'><xsl:value-of select='name' /><xsl:choose><xsl:when test='gender=1'> כתב</xsl:when><xsl:otherwise> כתבה</xsl:otherwise></xsl:choose> לי בתאריך <xsl:value-of select='mailme' /></xsl:attribute><xsl:attribute name='src'>./images/wrote.gif</xsl:attribute></img>\n"
	+ "													</xsl:if>\n"
	+ "													<xsl:if test='mailme=\"0000-00-00 00:00:00\" or mailme=\"\"'>\n"
	+ "														<img><xsl:attribute name='title'><xsl:value-of select='name' /><xsl:choose><xsl:when test='gender=1'> לא כתב</xsl:when><xsl:otherwise> לא כתבה</xsl:otherwise></xsl:choose> לי </xsl:attribute><xsl:attribute name='src'>./images/wrotebw.gif</xsl:attribute></img>\n"
	+ "													</xsl:if>\n"
	+ "											</td>\n"
	+ "											<td width='20'>אני:\n"
	+ "											</td>\n"
	+ "											<td width='20'>\n"
	+ "													<xsl:if test='viewbyme!=\"0000-00-00 00:00:00\" and viewbyme != \"\"'>\n"
	+ "														<img><xsl:attribute name='title'>צפיתי בכרטיס של <xsl:value-of select='name' /> בתאריך <xsl:value-of select='viewbyme' /></xsl:attribute><xsl:attribute name='src'>./images/view.gif</xsl:attribute></img>\n"
	+ "													</xsl:if>\n"
	+ "													<xsl:if test='viewbyme=\"0000-00-00 00:00:00\" or viewbyme = \"\"'>\n"
	+ "														<img><xsl:attribute name='title'>לא צפיתי בכרטיס של <xsl:value-of select='name' /></xsl:attribute><xsl:attribute name='src'>./images/viewbw.gif</xsl:attribute></img>\n"
	+ "													</xsl:if>\n"
	+ "											</td>\n"
	+ "											<td width='20'>\n"
	+ "													<xsl:if test='favbyme!=\"0000-00-00 00:00:00\" and favbyme != \"\"'>\n"
	+ "														<img><xsl:attribute name='title'><xsl:value-of select='name' /> במועדפים שלי מתאריך <xsl:value-of select='favbyme' /></xsl:attribute><xsl:attribute name='src'>./images/favorites.gif</xsl:attribute></img>\n"
	+ "													</xsl:if>\n"
	+ "													<xsl:if test='favbyme=\"0000-00-00 00:00:00\" or favbyme = \"\"'>\n"
	+ "														<img><xsl:attribute name='title'><xsl:value-of select='name' /> לא במועדפים שלי </xsl:attribute><xsl:attribute name='src'>./images/favoritesbw.gif</xsl:attribute></img>\n"
	+ "													</xsl:if>\n"
	+ "											</td>\n"
	+ "											<td width='20'>\n"
	+ "													<xsl:if test='chatbyme!=\"0000-00-00 00:00:00\" and chatbyme != \"\"'>\n"
	+ "														<img><xsl:attribute name='title'>צוטטתי עם <xsl:value-of select='name' /> בתאריך <xsl:value-of select='chatbyme' /></xsl:attribute><xsl:attribute name='src'>./images/chat.gif</xsl:attribute></img>\n"
	+ "													</xsl:if>\n"
	+ "													<xsl:if test='chatbyme=\"0000-00-00 00:00:00\" or chatbyme = \"\"'>\n"
	+ "														<img><xsl:attribute name='title'>לא דיברתי בדיבור מכוון עם <xsl:value-of select='name' /> </xsl:attribute><xsl:attribute name='src'>./images/chatbw.gif</xsl:attribute></img>\n"
	+ "													</xsl:if>\n"
	+ "											</td>\n"
	+ "											<td width='20'>\n"
	+ "													<xsl:if test='mailbyme!=\"0000-00-00 00:00:00\" and mailbyme != \"\"'>\n"
	+ "														<img><xsl:attribute name='title'>כתבתי ל<xsl:value-of select='name' /> בתאריך <xsl:value-of select='mailbyme' /></xsl:attribute><xsl:attribute name='src'>./images/wrote.gif</xsl:attribute></img>\n"
	+ "													</xsl:if>\n"
	+ "													<xsl:if test='mailbyme=\"0000-00-00 00:00:00\" or mailbyme = \"\"'>\n"
	+ "														<img><xsl:attribute name='title'>לא כתבתי ל<xsl:value-of select='name' /> </xsl:attribute><xsl:attribute name='src'>./images/wrotebw.gif</xsl:attribute></img>\n"
	+ "													</xsl:if>\n"
	+ "											</td>\n"
	+ "											<td width='20'>\n"
	+ "											</td>\n"
	+ "										</tr>\n"
	+ "									</table>\n"
	+ "								</td>\n"
	+ "								<td>\n"
	+ "									<table width='300'>\n"
	+ "										<tr>\n"
	+ "											<td>\n"
	+ "												<a href='#' class='member_search' title='שליחת הודעה רגילה'>\n"
	+ "													<xsl:attribute name='onclick'>\n"
	+ "														javascript:newMessage(<xsl:value-of select='id' />, '<xsl:value-of select='name' />', '', 1);"
	+ "													</xsl:attribute>\n"
	+ "													<img><xsl:attribute name='src'>./images/newmessage.gif</xsl:attribute></img>\n"
	+ "													<xsl:text>כתוב </xsl:text>\n"
	+ "												</a>\n"
	+ "												<xsl:choose>\n"
	+ "													<xsl:when test='chat=1'>\n"
	+ "														<a href='#' class='member_search' title='הזמנה לדיבור מקוון (צאט)'>\n"
	+ "															<xsl:attribute name='onclick'>\n"
	+ "														javascript:newMessage(<xsl:value-of select='id' />, '<xsl:value-of select='name' />', '', 2);"
	+ "															</xsl:attribute>\n"
	+ "															<img><xsl:attribute name='src'>./images/chat.gif</xsl:attribute></img>\n"
	+ "															<xsl:text>צאט </xsl:text>\n"
	+ "														</a>\n"
	+ "													</xsl:when>\n"
	+ "													<xsl:otherwise>\n"
	+ "														<a href='#' class='member_search' title='החבר אינו זמין לדיבור מקוון (צאט)'>\n"
	+ "															<img><xsl:attribute name='src'>./images/chatbw.gif</xsl:attribute></img>\n"
	+ "															<xsl:text>צאט </xsl:text>\n"
	+ "														</a>\n"
	+ "													</xsl:otherwise>\n"
	+ "												</xsl:choose>\n"
	+ "												<a href='#' class='member_search' title='שליחת הודעה קולית (אפשר גם לשיר)'>\n"
	+ "													<xsl:attribute name='onclick'>\n"
	+ "														javascript:newMessage(<xsl:value-of select='id' />, '<xsl:value-of select='name' />', '', 3);"
	+ "													</xsl:attribute>\n"
	+ "													<img><xsl:attribute name='src'>./images/newmessage.gif</xsl:attribute></img>\n"
	+ "													<xsl:text> קולית</xsl:text>\n"
	+ "												</a>\n"
	+ "												<a href='#' class='member_search' title='שליחת חץ למשיכת תשומת הלב'>\n"
	+ "													<xsl:attribute name='onclick'>\n"
	+ "														javascript:newMessage(<xsl:value-of select='id' />, '<xsl:value-of select='name' />', '', 4);"
	+ "													</xsl:attribute>\n"
	+ "													<img><xsl:attribute name='src'>./images/newmessage.gif</xsl:attribute></img>\n"
	+ "													<xsl:text> חץ </xsl:text>\n"
	+ "												</a>\n"
	+ "												<xsl:choose>\n"
	+ "													<xsl:when test='/rootElement/general/skype = \"\"'>\n"
	+ "														<a href='#' class='member_search' title='לא הוגדר שם משתמש לסקייפ בפרופיל שלך'>\n"
	+ "															<xsl:attribute name='onclick'>\n"
	+ "																javascript:newTeaseMessage(<xsl:value-of select='id' />, '<xsl:value-of select='name' />', '');"
	+ "															</xsl:attribute>\n"
	+ "															<img><xsl:attribute name='src'>./images/skype.gif<xsl:value-of select='chr__2' /></xsl:attribute></img>\n"
	+ "															<xsl:text>סקייפ </xsl:text>\n"
	+ "														</a>\n"
	+ "													</xsl:when>\n"
	+ "													<xsl:when test='chr__02 = \"\"'>\n"
	+ "														<a href='#' class='member_search'>\n"
	+ "															<xsl:attribute name='title'>לא הוגדר שם משתמש לסקייפ בפרופיל של <xsl:value-of select='name' /></xsl:attribute>\n"
	+ "															<xsl:attribute name='onclick'>\n"
	+ "																javascript:newTeaseMessage(<xsl:value-of select='id' />, '<xsl:value-of select='name' />', '');"
	+ "															</xsl:attribute>\n"
	+ "															<img><xsl:attribute name='src'>./images/skype.gif<xsl:value-of select='chr__2' /></xsl:attribute></img>\n"
	+ "															<xsl:text>סקייפ </xsl:text>\n"
	+ "														</a>\n"
	+ "													</xsl:when>\n"
	+ "													<xsl:otherwise>\n"
	+ "														<a class='member_search'>\n"
	+ "															<xsl:attribute name='href'>skype:<xsl:value-of select='chr__02' />?call</xsl:attribute>\n"
	+ "															<xsl:attribute name='title'>מצב פרופיל הסקייפ של <xsl:value-of select='name' /></xsl:attribute>\n"
	+ "															<img><xsl:attribute name='src'>./images/skype.gif<xsl:value-of select='chr__2' /></xsl:attribute></img>\n"
	+ "															<xsl:text>סקייפ </xsl:text>\n"
	+ "														</a>\n"
	+ "													</xsl:otherwise>\n"
	+ "												</xsl:choose>\n"
	+ "											</td>\n"
	+ "										</tr>\n"
	+ "									</table>\n"
	+ "								</td>\n"
	+ "				</tr>\n"
	+ "			</xsl:if>\n"
	+ "		</xsl:for-each>\n"
	+ "		<tr>\n"
	+ "			<td class='navigationbar' colspan='3'>\n"
	+ "				<xsl:choose>\n"
	+ "				<xsl:when test='" + ((search_page % result_page_size) - page_size + 1) + " &gt; 0 and " + (search_page - page_size + 1) + " &gt; 0'>\n"
	+ "					<a href='#' class='navigationbar' onclick='javascript:showElement(\"loading\");runTransform(\"main\", \"./search.php?echo=1&amp;go=first\", \"./search.xsl.php?xsl=1\");go(\"first\");' title='לדף הראשון'><img><xsl:attribute name='src'>./images/first.gif</xsl:attribute><xsl:attribute name='alt'>לדף הראשון</xsl:attribute></img></a>\n"
	+ "					<a href='#' class='navigationbar' onclick='javascript:go(\"prev\");' title='לדף הקודם'><img><xsl:attribute name='src'>./images/prev.gif</xsl:attribute><xsl:attribute name='alt'>לדף הקודם</xsl:attribute></img></a>\n"
	+ "				</xsl:when>\n"
	+ "				<xsl:when test='" + ((search_page % result_page_size) - page_size + 1) + " &lt; 0 and " + (search_page - page_size + 1) + " &gt; 0'>\n"
	+ "					<a href='#' class='navigationbar' onclick='javascript:showElement(\"loading\");runTransform(\"main\", \"./search.php?echo=1&amp;go=first\", \"./search.xsl.php?xsl=1\");go(\"first\");' title='לדף הראשון'><img><xsl:attribute name='src'>./images/first.gif</xsl:attribute><xsl:attribute name='alt'>לדף הראשון</xsl:attribute></img></a>\n"
	+ "					<a href='#' class='navigationbar' onclick='javascript:showElement(\"loading\");runTransform(\"main\", \"./search.php?echo=1&amp;go=prev\", \"./search.xsl.php?xsl=1\");go(\"prev\");' title='לדף הקודם'><img><xsl:attribute name='src'>./images/prev.gif</xsl:attribute><xsl:attribute name='alt'>לדף הקודם</xsl:attribute></img></a>\n"
	+ "				</xsl:when>\n"
	+ "				<xsl:otherwise>\n"
	+ "					<a href='#' class='navigationbar' title='זה הדף הראשון'><img><xsl:attribute name='src'>./images/firstbw.gif</xsl:attribute><xsl:attribute name='alt'>זה הדף הראשון</xsl:attribute></img></a>\n"
	+ "					<a href='#' class='navigationbar' title='זה הדף הראשון'><img><xsl:attribute name='src'>./images/prevbw.gif</xsl:attribute><xsl:attribute name='alt'>זה הדף הראשון</xsl:attribute></img></a>\n"
	+ "				</xsl:otherwise></xsl:choose>\n"
	+ "				<xsl:choose>\n"
	+ "					<xsl:when test='"+ ((search_page % result_page_size) + page_size + 1) +" &lt; " + result_page_size + " and " + (search_page + page_size) + " &lt; /rootElement/result_set_size'>\n"
	+ "						<a href='#' class='navigationbar' onclick='javascript:go(\"next\");' title='לדף הבא'><img><xsl:attribute name='src'>./images/next.gif</xsl:attribute><xsl:attribute name='alt'>לדף הבא</xsl:attribute></img></a>\n"
	+ "						<a href='#' class='navigationbar' title='לדף האחרון'>\n"
	+ "							<xsl:attribute name='onclick'>javascript:showElement(\"loading\");runTransform(\"main\", \"./search.php?echo=1&amp;go=last\", \"./search.xsl.php?xsl=1\");go(\"<xsl:value-of select='floor(/rootElement/result_set_size div /rootElement/page_size) * /rootElement/page_size + floor((/rootElement/result_set_size - floor(/rootElement/result_set_size div /rootElement/page_size) * /rootElement/page_size) div " + page_size + ") * "  + page_size + "' />\");</xsl:attribute>\n"
	+ "							<img><xsl:attribute name='src'>./images/last.gif</xsl:attribute><xsl:attribute name='alt'>לדף האחרון</xsl:attribute></img>\n"
	+ "						</a>\n"
	+ "					</xsl:when>\n"
	+ "					<xsl:when test='"+ ((search_page % result_page_size) + page_size + 1) +" &gt;= " + result_page_size + " and " + (search_page + page_size) + " &lt; /rootElement/result_set_size'>\n"
	+ "						<a href='#' class='navigationbar' onclick='javascript:showElement(\"loading\");runTransform(\"main\", \"./search.php?echo=1&amp;go=next\", \"./search.xsl.php?xsl=1\");go(\"next\");' title='לדף הבא'><img><xsl:attribute name='src'>./images/next.gif</xsl:attribute><xsl:attribute name='alt'>לדף הבא</xsl:attribute></img></a> \n"
	+ "						<a href='#' class='navigationbar' title='לדף האחרון'>\n"
	+ "							<xsl:attribute name='onclick'>javascript:showElement(\"loading\");runTransform(\"main\", \"./search.php?echo=1&amp;go=last\", \"./search.xsl.php?xsl=1\");go(\"<xsl:value-of select='floor(/rootElement/result_set_size div /rootElement/page_size) * /rootElement/page_size + floor((/rootElement/result_set_size - floor(/rootElement/result_set_size div /rootElement/page_size) * /rootElement/page_size) div " + page_size + ") * "  + page_size + "' />\");</xsl:attribute>\n"
	+ "							<img><xsl:attribute name='src'>./images/last.gif</xsl:attribute><xsl:attribute name='alt'>לדף האחרון</xsl:attribute></img>\n"
	+ "						</a>\n"
	+ "					</xsl:when>\n"
	+ "					<xsl:otherwise>\n"
	+ "						<a href='#' class='navigationbar' title='זה הדף האחרון'><img><xsl:attribute name='src'>./images/nextbw.gif</xsl:attribute><xsl:attribute name='alt'>זה הדף האחרון</xsl:attribute></img></a> \n"
	+ "						<a href='#' class='navigationbar' title='זה הדף האחרון'>\n"
	+ "							<img><xsl:attribute name='src'>./images/lastbw.gif</xsl:attribute><xsl:attribute name='alt'>זה הדף האחרון</xsl:attribute></img>\n"
	+ "						</a>\n"
	+ "					</xsl:otherwise>\n"
	+ "				</xsl:choose>\n"
	+ "			</td>\n"
	+ "		</tr>\n"
	+ "	</table>\n"
	+ "	</body>\n"
	+ "	</html>\n"
	+ "</xsl:template></xsl:stylesheet>\n";

	runTransformXsl("main", xslStylesheet);
}

function gomessage(direction)
{
	switch(direction) {
		case 'next' :
			if (search_page + message_size < search_result)
			{
				search_page += message_size;
			}
			break;
		case 'prev' :
			if (search_page >= message_size)
			{
				search_page -= message_size;
			}
			break;
		case 'sent' :
			if (sort=='sent')
			{
				if (order=='ascending')
				{
					order='descending';
				} 
				else 
				{
					order='ascending';
				}
			}
			else
			{
				order = 'descending';
			}
			sort = 'sent';
			break;
		case 'fromname' :
			if (sort=='fromname')
			{
				if (order=='ascending')
				{
					order='descending';
				} 
				else 
				{
					order='ascending';
				}
			}
			else
			{
				order = 'descending';
			}
			sort = 'fromname';
			break;
		case 'toname' :
			if (sort=='toname')
			{
				if (order=='ascending')
				{
					order='descending';
				} 
				else 
				{
					order='ascending';
				}
			}
			else
			{
				order = 'descending';
			}
			sort = 'toname';
			break;
		case 'subject' :
			if (sort=='subject')
			{
				if (order=='ascending')
				{
					order='descending';
				} 
				else 
				{
					order='ascending';
				}
			}
			else
			{
				order = 'descending';
			}
			sort = 'subject';
			break;
		case 'first':
			search_page = 0;
			break;
		case 'last':
			search_page = search_result - (search_result % message_size) - message_size;
			break;
		case 'aaaa':
			alert("aaaa");
			break;
		default:
			search_page = direction - (direction % message_size);
			break;
	}
	var xslStylesheet = "<?xml version='1.0' encoding='windows-1255'?><xsl:stylesheet version='1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>"
	+ "<xsl:param name='M' select='" + search_page + "'/>"
	+ "<xsl:param name='N' select='" + message_size + "'/>"
	+ "<xsl:template match='/'>"
	+ "	<html>"
	+ "	<body>"
	+ "	<form method='post'>"
	+ "	<table width='620' height='318'>"
	+ "		<tr><td class='navigationbar' colspan='6'>הודעות "
	+ "			<xsl:choose>"
	+ "				<xsl:when test='/rootElement/general/type=\"deleted\"'><xsl:text>סל מחזור </xsl:text></xsl:when>"
	+ "				<xsl:when test='/rootElement/general/type=\"out\"'><xsl:text>יוצאות </xsl:text></xsl:when>"
	+ "				<xsl:when test='/rootElement/general/type=\"new\"'><xsl:text>חדשות </xsl:text></xsl:when>"
	+ "				<xsl:when test='/rootElement/general/type=\"in\"'><xsl:text>נכנסות </xsl:text></xsl:when>"
	+ "			</xsl:choose>"
	+ "</td></tr>"
	+ "		<tr>"
	+ "			<td class='navigationbar' colspan='6'>"
	+ "				<xsl:choose><xsl:when test='" + (search_page - message_size + 1) + " &gt; 0'>"
	+ "					<a href='#' class='navigationbar' onclick='javascript:gomessage(\"first\");' title='לדף הראשון'><img><xsl:attribute name='src'>./images/first.gif</xsl:attribute><xsl:attribute name='alt'>לדף הראשון</xsl:attribute></img></a> "
	+ "					<a href='#' class='navigationbar' onclick='javascript:gomessage(\"prev\");' title='לדף הקודם'><img><xsl:attribute name='src'>./images/prev.gif</xsl:attribute><xsl:attribute name='alt'>לדף הקודם</xsl:attribute></img></a> "
	+ "				</xsl:when>"
	+ "					<xsl:otherwise>"
	+ "					<a href='#' class='navigationbar' title='זה הדף הראשון'><img><xsl:attribute name='src'>./images/firstbw.gif</xsl:attribute><xsl:attribute name='alt'>זה הדף הראשון</xsl:attribute></img></a> "
	+ "					<a href='#' class='navigationbar' title='זה הדף הראשון'><img><xsl:attribute name='src'>./images/prevbw.gif</xsl:attribute><xsl:attribute name='alt'>זה הדף הראשון</xsl:attribute></img></a> "
	+ "					</xsl:otherwise>"
	+ "				</xsl:choose>"
	+ "				<xsl:choose><xsl:when test='" + (search_page + message_size) + " &lt; count(/rootElement/dating_messages)'>"
	+ "					<a href='#' class='navigationbar' onclick='javascript:gomessage(\"next\");' title='לדף הבא'><img><xsl:attribute name='src'>./images/next.gif</xsl:attribute><xsl:attribute name='alt'>לדף הבא</xsl:attribute></img></a> "
	+ "					<a href='#' class='navigationbar' title='לדף האחרון'>"
	+ "						<xsl:attribute name='onclick'>javascript:gomessage(\"<xsl:value-of select='/rootElement/general/count' />\");</xsl:attribute>"
	+ "						<img><xsl:attribute name='src'>./images/last.gif</xsl:attribute><xsl:attribute name='alt'>לדף האחרון</xsl:attribute></img>"
	+ "					</a>"
	+ "				</xsl:when>"
	+ "					<xsl:otherwise>"
	+ "					<a href='#' class='navigationbar' title='זה הדף האחרון'><img><xsl:attribute name='src'>./images/nextbw.gif</xsl:attribute><xsl:attribute name='alt'>זה הדף האחרון</xsl:attribute></img></a> "
	+ "					<a href='#' class='navigationbar' title='זה הדף האחרון'><img><xsl:attribute name='src'>./images/lastbw.gif</xsl:attribute><xsl:attribute name='alt'>זה הדף האחרון</xsl:attribute></img></a>"
	+ "					</xsl:otherwise>"
	+ "				</xsl:choose>"
	+ (search_page + 1) + " עד <xsl:choose><xsl:when test='" + (search_page + message_size) + " &lt; count(/rootElement/dating_messages)'><xsl:value-of select='" + (search_page + message_size) + "' /></xsl:when><xsl:otherwise><xsl:value-of select='count(/rootElement/dating_messages)'/></xsl:otherwise></xsl:choose> מתוך <xsl:value-of select='count(/rootElement/dating_messages)' />"
	+ " ממויין לפי " + ((sort == "toname") ? "נמען" : ((sort == "fromname") ? "שולח" : ((sort == "subject") ? "נושא" : "תאריך שליחה"))) 
	+ "			</td>"
	+ "		</tr>"
	+ "		<tr>"
	+ "			<td class='member_message_title' width='13'>"
	+ "				<xsl:choose>"
	+ "					<xsl:when test='/rootElement/general/type=\"deleted\"'><a href='#'><xsl:attribute name='onclick'>unDeleteMessages();</xsl:attribute><img title='לאחזור ההודעות המסומנות' alt='לאחזור ההודעות המסומנות'><xsl:attribute name='src'>./images/undelete.gif</xsl:attribute></img></a></xsl:when>"
	+ "					<xsl:otherwise><a href='#'><xsl:attribute name='onclick'>deleteMessages();</xsl:attribute><img title='למחיקת ההודעות המסומנות' alt='למחיקת ההודעות המסומנות'><xsl:attribute name='src'>./images/delete.gif</xsl:attribute></img></a></xsl:otherwise>"
	+ "				</xsl:choose>"
	+ "			</td>"
	+ "			<td class='member_message_title' width='100'>"
	+ "				<a href='#' class='member_message_title' title='מיון לפי תאריך'>"
	+ "					<xsl:attribute name='onclick'>javascript:gomessage(\"sent\");</xsl:attribute>"
	+ "					<xsl:text>נשלח בתאריך</xsl:text>"
	+ "				</a>"
	+ "			</td>"
	+ "				<xsl:choose>"
	+ "					<xsl:when test='/rootElement/general/type=\"out\"'></xsl:when>"
	+ "					<xsl:otherwise>"
	+ "						<td class='member_message_title'>"
	+ "							<a href='#' class='member_message_title' title='מיון לפי שולח'>"
	+ "								<xsl:attribute name='onclick'>javascript:gomessage(\"fromname\");</xsl:attribute>"
	+ "								<xsl:text>שולח</xsl:text>"
	+ "							</a>"
	+ "						</td>"
	+ "					</xsl:otherwise>"
	+ "				</xsl:choose>"
	+ "				<xsl:choose>"
	+ "					<xsl:when test='/rootElement/general/type=\"out\" or /rootElement/general/type=\"deleted\"'>"
	+ "						<td class='member_message_title'>"
	+ "							<a href='#' class='member_message_title' title='מיון לפי נמען'>"
	+ "								<xsl:attribute name='onclick'>javascript:gomessage(\"toname\");</xsl:attribute>"
	+ "								<xsl:text>נמען</xsl:text>"
	+ "							</a>"
	+ "						</td>"
	+ "					</xsl:when>"
	+ "					<xsl:otherwise>"
	+ "					</xsl:otherwise>"
	+ "				</xsl:choose>"
	+ "			<td class='member_message_title'>"
	+ "				<a href='#' class='member_message_title' title='מיון לפי נושא'>"
	+ "					<xsl:attribute name='onclick'>javascript:gomessage(\"subject\");</xsl:attribute>"
	+ "					<xsl:text>נושא</xsl:text>"
	+ "				</a>"
	+ "			</td>"
	+ "			<td class='member_message_title'><a href='#' title='תיאור מצב ההודעה' class='member_message_title'>סטטוס</a>"
	+ "			</td>"
	+ "		</tr>"
	+ "		<xsl:for-each select='rootElement/dating_messages'>"
	+ "			<xsl:sort select='" + sort + "' order='" + order + "'/>"
	+ "			<xsl:if test='position() &gt; " + search_page + " and position() &lt;= " + (search_page + message_size) + "'>"
	+ "				<tr>"
	+ "					<td class='member_message'><input type='checkbox'><xsl:attribute name='name'><xsl:value-of select='id' /></xsl:attribute></input></td>"
	+ "					<td width='80' class='member_message'>"
	+ "						<xsl:value-of select='substring(sent, 9, 2)' />/<xsl:value-of select='substring(sent, 6, 2)' />/<xsl:value-of select='substring(sent, 3, 2)' />"
	+ "						<xsl:attribute name='onmouseover'>showElement('div<xsl:value-of select='id' />');</xsl:attribute>"
	+ "						<xsl:attribute name='onmouseout'>hideElement('div<xsl:value-of select='id' />');</xsl:attribute>"
	+ "					</td>"
	+ "						<xsl:choose>"
	+ "							<xsl:when test='/rootElement/general/type=\"out\"'>"
	+ "							</xsl:when>"
	+ "							<xsl:otherwise>"
	+ "								<td class='member_message' width='120'>"
	+ "									<a href='#' class='member_message'>"
	+ "										<xsl:attribute name='onclick'>"
	+ "											javascript:openMemberCard(<xsl:value-of select='fromuser' />);"
	+ "										</xsl:attribute>"
	+ "										<xsl:attribute name='title'>לפתיחת הכרטיס של <xsl:value-of select='fromname' /></xsl:attribute>"
	+ "										<xsl:value-of select='fromname' />"
	+ "									</a>"
	+ "								</td>"
	+ "							</xsl:otherwise>"
	+ "						</xsl:choose>"
	+ "						<xsl:choose>"
	+ "							<xsl:when test='/rootElement/general/type=\"out\" or /rootElement/general/type=\"deleted\"'>"
	+ "								<td class='member_message'>"
	+ "									<xsl:attribute name='width'>120</xsl:attribute>"
	+ "									<a href='#' class='member_message'>"
	+ "										<xsl:attribute name='onclick'>"
	+ "											javascript:openMemberCard(<xsl:value-of select='touser' />);"
	+ "										</xsl:attribute>"
	+ "										<xsl:attribute name='title'>לפתיחת הכרטיס של <xsl:value-of select='toname' /></xsl:attribute>"
	+ "										<xsl:value-of select='toname' />"
	+ "									</a>"
	+ "								</td>"
	+ "							</xsl:when>"
	+ "							<xsl:otherwise>"
	+ "							</xsl:otherwise>"
	+ "						</xsl:choose>"
	+ "					<td class='member_message' width='200'>"
	+ "						<a href='#' class='member_message'>"
	+ "							<xsl:attribute name='onclick'>"
	+ "								javascript:viewMessage('<xsl:value-of select='id' />', '<xsl:value-of select='type' />');"
	+ "							</xsl:attribute>"
	+ "							<xsl:attribute name='title'>לצפייה בתוכן ההודעה</xsl:attribute>"
	+ "							<xsl:value-of select='subject' />"
	+ "						</a>"
	+ "					</td>"
	+ "					<td class='member_message' width='70'>"
	+ "						<xsl:choose>"
	+ "							<xsl:when test='readon=\"0000-00-00 00:00:00\"'>"
	+ "								<img title='הודעה זו לא נקראה'>"
	+ "									<xsl:attribute name='src'>./images/unread.gif</xsl:attribute>"
	+ "								</img>"
	+ "							</xsl:when>"
	+ "							<xsl:otherwise>"
	+ "								<img>"
	+ "									<xsl:attribute name='title'>ההודעה נקראה בתאריך <xsl:value-of select='readon' /></xsl:attribute>"
	+ "									<xsl:attribute name='src'>./images/read.gif</xsl:attribute>"
	+ "								</img>"
	+ "							</xsl:otherwise>"
	+ "						</xsl:choose>"
	+ "						<xsl:choose>"
	+ "							<xsl:when test='deletedto!=\"0000-00-00 00:00:00\"'>"
	+ "								<img>"
	+ "									<xsl:attribute name='title'>ההודעה נמחקה על ידי <xsl:value-of select='toname' /> בתאריך <xsl:value-of select='deletedto' /></xsl:attribute>"
	+ "									<xsl:attribute name='src'>./images/deleted.gif</xsl:attribute>"
	+ "								</img>"
	+ "							</xsl:when>"
	+ "							<xsl:otherwise>"
	+ "							</xsl:otherwise>"
	+ "						</xsl:choose>"
	+ "						<xsl:choose>"
	+ "							<xsl:when test='deletedfrom!=\"0000-00-00 00:00:00\"'>"
	+ "								<img>"
	+ "									<xsl:attribute name='title'>ההודעה נמחקה על ידי <xsl:value-of select='fromname' /> בתאריך <xsl:value-of select='deletedfrom' /></xsl:attribute>"
	+ "									<xsl:attribute name='src'>./images/deleted.gif</xsl:attribute>"
	+ "								</img>"
	+ "							</xsl:when>"
	+ "							<xsl:otherwise>"
	+ "							</xsl:otherwise>"
	+ "						</xsl:choose>"
	+ "					</td>"
	+ "				</tr>"
	+ "			</xsl:if>"
	+ "		</xsl:for-each>"
	+ "		<tr>"
	+ "				<xsl:choose><xsl:when test='" + (search_page + message_size) + " &lt; count(/rootElement/dating_messages)'></xsl:when>"
	+ "					<xsl:otherwise>"
	+ "						<tr><td colspan='6' height='100%'></td></tr>"
	+ "					</xsl:otherwise>"
	+ "				</xsl:choose>"
	+ "			<td class='navigationbar' colspan='6'>"
	+ "				<xsl:choose><xsl:when test='" + (search_page - message_size + 1) + " &gt; 0'>"
	+ "					<a href='#' class='navigationbar' onclick='javascript:gomessage(\"first\");' title='לדף הראשון'><img><xsl:attribute name='src'>./images/first.gif</xsl:attribute><xsl:attribute name='alt'>לדף הראשון</xsl:attribute></img></a> "
	+ "					<a href='#' class='navigationbar' onclick='javascript:gomessage(\"prev\");' title='לדף הקודם'><img><xsl:attribute name='src'>./images/prev.gif</xsl:attribute><xsl:attribute name='alt'>לדף הקודם</xsl:attribute></img></a> "
	+ "				</xsl:when>"
	+ "					<xsl:otherwise>"
	+ "					<a href='#' class='navigationbar' title='זה הדף הראשון'><img><xsl:attribute name='src'>./images/firstbw.gif</xsl:attribute><xsl:attribute name='alt'>זה הדף הראשון</xsl:attribute></img></a> "
	+ "					<a href='#' class='navigationbar' title='זה הדף הראשון'><img><xsl:attribute name='src'>./images/prevbw.gif</xsl:attribute><xsl:attribute name='alt'>זה הדף הראשון</xsl:attribute></img></a> "
	+ "					</xsl:otherwise>"
	+ "				</xsl:choose>"
	+ "				<xsl:choose><xsl:when test='" + (search_page + message_size) + " &lt; count(/rootElement/dating_messages)'>"
	+ "					<a href='#' class='navigationbar' onclick='javascript:gomessage(\"next\");' title='לדף הבא'><img><xsl:attribute name='src'>./images/next.gif</xsl:attribute><xsl:attribute name='alt'>לדף הבא</xsl:attribute></img></a> "
	+ "					<a href='#' class='navigationbar' title='לדף האחרון'>"
	+ "						<xsl:attribute name='onclick'>javascript:gomessage(\"<xsl:value-of select='/rootElement/general/count' />\");</xsl:attribute>"
	+ "						<img><xsl:attribute name='src'>./images/last.gif</xsl:attribute><xsl:attribute name='alt'>לדף האחרון</xsl:attribute></img>"
	+ "					</a>"
	+ "				</xsl:when>"
	+ "					<xsl:otherwise>"
	+ "					<a href='#' class='navigationbar' title='זה הדף האחרון'><img><xsl:attribute name='src'>./images/nextbw.gif</xsl:attribute><xsl:attribute name='alt'>זה הדף האחרון</xsl:attribute></img></a> "
	+ "					<a href='#' class='navigationbar' title='זה הדף האחרון'><img><xsl:attribute name='src'>./images/lastbw.gif</xsl:attribute><xsl:attribute name='alt'>זה הדף האחרון</xsl:attribute></img></a>"
	+ "					</xsl:otherwise>"
	+ "				</xsl:choose>"
	+ "			</td>"
	+ "		</tr>"
	+ "	</table>"
	+ "	</form>"
	+ "	</body>"
	+ "	</html>"
	+ "</xsl:template></xsl:stylesheet>";
	runTransformXsl("main", xslStylesheet);
}

function doPostFormAction(formName, response) {
	switch (formName){
		case 'login': 
			if (response=='success') {
				if (document.location.href.indexOf('logout') == -1)
				{
					window.location.reload();
				} else {
					window.location='./index.php';
				}
			}
			else {
				  document.getElementById('loginheader').innerHTML='<font color="yellow">שם משתמש או סיסמא שגויים, נסה שנית</font>';
			}
			break;
		case 'search': 
			if (response=='success') {
				runTransform('main', './search.xml.php', './search.xsl.php');
				search_page=0;
			}
			else {
				document.getElementById('main').innerHTML='לא נמצאו תוצאות';
			}
			break;
		case 'poll': 
			runTransform('poll_display', './blank.xml', './poll.php?xsl=1');
			hideElement('loading');
			break;
		case 'retrieve': 
			switch (response)
			{
				case "success": res="דואר אלקטרוני עם הסיסמא נשלח לכתובת שצויינה"; break;
				case "captcha": res="המחרוזת שהקשת אינה נכונה"; break;
				case "username" : res="שם משתמש לא נמצא"; break;
				case "mail" : res="שגיאה בשליחת דואר אלקטרוני"; break;
				default : res=response; break;
			}
			document.getElementById('ret_response').innerHTML=res;
			hideElement('loading');
			break;
		case 'newuser': 
			if (response=='success') {
				document.getElementById('title').innerHTML='ההרשמה הצליחה';
			}
			else {
				if (response=='captcha')
				{
					document.getElementById('title').innerHTML='הרשמה לא הצליחה ::: הקלד מחרוזת מחדש ונסה שנית';
					setSelect('number');
				}
				else {
					if (response=='exists')
					{
						document.getElementById('title').innerHTML='הרשמה לא הצליחה ::: קיים משתמש עם דוא"ל זה - באפשרותך לבצע שיחזור סיסמא או לבחור דואר אלקטרוני אחר' + response;
						setSelect('username');
					}
					else {
						document.getElementById('title').innerHTML=response;
					}
				}
			}
			break;
	}
	hideElement("loading");
}

function openMemberCard(id)
{
	return window.open('./member'+id+'.htm','', 'width=750, height=500, resizable=1, scrollbars'); 
}

function viewMessage(id, t)
{
	if (t==0)
	{
	window.open('./messageshow.php?id='+id,'', 'width=670, height=530, resizable=0, scrollbars');
	}
	else 
	window.open('./voicemessageshow.php?id='+id,'', 'width=670, height=530, resizable=0, scrollbars');
}

function newMessage(userid, uname, subject, type)
{
	window.open('./newmessage.php?userid='+userid+'&type='+type+((subject!='') ? '&subject='+subject : ''),'', 'width=430, height=290, resizable=0');
}

function textCounter(fieldName,el,maxlimit) {
	var field = document.getElementById(fieldName);
	var counter = document.getElementById(el);
	if (field.value.length > maxlimit)
		field.value = field.value.substring(0, maxlimit);
	else {
		counter.value = 'נותרו ' + (maxlimit - field.value.length) + ' תווים';
	}
}

var emailfilter=/^\w+[\+\.\w-]*@([\w-]+\.)*\w+[\w-]*\.([a-z]{2,4}|\d+)$/i
function checkmail(el){
var e = document.getElementById(el);
var returnval=emailfilter.test(e.value);
if (returnval==false){
}
return returnval
}

function validateAlert(el, flag)
{
	if (flag==true)
	{
		document.getElementById(el).src='./images/ok_on.gif';
	}
	else
	{
		document.getElementById(el).src='./images/not_ok_on.gif';
	}
	if (true)
	{
		document.getElementById(el.substr(0, el.length-3)+'_tooltip').innerHTML='';
	}
	if (true)
	{
		document.getElementById('cap_img').src='./captcha.php?id=' + Math.random(100);
	}
}

function getoffsetLeft(element){
/* Calculate the offsetLeft sum of all offsetParents.
	The result is element.style.left
*/
if(!element) return 0;
return element.offsetLeft + getoffsetLeft(element.offsetParent);
}

function validateTooltip(el)
{
	document.getElementById(el+'_tooltip').innerHTML='<div id='+el+'tt class=tooltip>'+document.getElementById(el+'val').title+'</div><div id='+el+'tta class=tooltip_arrow></div>';
	document.getElementById(el+'tt').style.left=getoffsetLeft(document.getElementById(el)) - 136;
	document.getElementById(el+'tta').style.left=getoffsetLeft(document.getElementById(el)) - 26;
}
function validatePasswordCharacters(keyCode, str, el) {
	if (keyCode==13) 
		event.keyCode=9; 
	if (str.length>0)
	{
		keyCode = str.charCodeAt(str.length-1);
	}
	if (((keyCode>31) && (keyCode<48)) || ((keyCode>57) && (keyCode<65)) || ((keyCode>90) && (keyCode<97)) || (keyCode>122)) {
		el.value=str.substr(0, str.length-1);
		alert("סיסמא יכולה להכיל רק אותיות a-z, A-Z או 0-9 ");
	}
}

function validateNewUser()
{
	if (checkmail("username") != true)
	{
		alert("נא למלא כתובת דואר אלקטרוני חוקית");
		setSelect("username");
		return false;
	}
	if (document.getElementById("password").value.length < 6)
	{
		alert("הסיסמא צריכה להיות לפחות 6 תווים ולא יותר מעשרים תווים");
		setSelect("password");
		return false;
	}
	if (document.getElementById("password").value!=document.getElementById("repass").value)
	{
		alert("השדה 'חזרה על סיסמא' אינו מכיל את אותה הסיסמא כמו בשדה שמעליו... נא לתקן");
		setSelect("repass");
		return false;
	}
/*	if (document.getElementById("answer").value.length<3)
	{
		alert("התשובה לשחזור סיסמא צריכה להיות מורכבת לפחות משלושה תווים");
		setSelect("answer");
		return false;
	}
*/	if (document.getElementById("name").value.length<3)
	{
		alert("הכינוי צריך להיות מורכב משלושה תווים לפחות");
		setSelect("name");
		return false;
	}
	if (!valButton(document.forms[1].gender))
	{
		alert("אנא מלא את המין שלך");
		return false;
	}
	if (!valButton(document.forms[1].lookforgender))
	{
		alert("נא לציין את המין שברצונך לפגוש");
		return false;
	}
	if (document.getElementById("number").value.length<5)
	{
		alert("נא להקליד את המספר שבתמונה");
		setSelect("number");
		return false;
	}
	if ((document.getElementById("year").value == 0) || (document.getElementById("month").value == 0) || (document.getElementById("day").value == 0))
	{
		alert("נא לבחור תאריך לידה");
		setFocus("year");
		return false;
	}
	else 
	{
		document.getElementById("age").value=document.getElementById("year").value+"-"+((document.getElementById("month").value < 10) ? "0" : "")+document.getElementById("month").value+"-"+((document.getElementById("day").value < 10) ? "0" : "")+document.getElementById("day").value;
	}
	if (document.getElementById("agree").checked==false)
	{
		alert("על מנת להרשם יש לסמן את התיבה שמציינת הסכמה עם תקנון האתר");
		return false;
	}
	document.newuser.submit();
	return true;
}

function validateForm(f) 
{
	if (f=='login' || f=='')
	{
		if (document.getElementById("password").value.length < 6)
		{
			alert("הסיסמא צריכה להיות לפחות 6 תווים ולא יותר מעשרים תווים");
			setSelect("password");
			return false;
		}
		if (document.getElementById("repassval").src!=document.getElementById("passwordval").src)
		{
			alert("השדה 'חזרה על סיסמא' אינו מכיל את אותה הסיסמא כמו בשדה שמעליו... נא לתקן");
			return false;
		}
		if (document.getElementById("name").value.length<3)
		{
			alert("הכינוי צריך להיות מורכב משלושה תווים לפחות");
			setSelect("name");
			return false;
		}
	}
	if (f=='details')
	{
		var str = document.getElementById("city").options[document.getElementById("city").selectedIndex].text;
		var i = str.indexOf("(");
		var l = str.length;
		document.getElementById("area").value = str.substring(i+1, l-1);
		return true;
	}
	return true;
}

function valButton(btn) 
{
	var cnt = -1;
	for (var i=0; i < btn.length; i++) {
		if (btn[i].checked) {cnt = i; i = btn.length;}
	}
	if (cnt > -1) return btn[cnt].value;
	else return null;
}

function deleteMessages(t)
{
	var cnt = -1;
	var messages = "0";
	var n = 0;
	var btn = document.forms[1];
	for (var i=0; i < btn.length; i++) {
		if (btn.elements[i].checked==true) {cnt = i; messages += "," + btn.elements[i].name; n++;}
	}
	if (cnt > -1) {
		if (confirm("האם למחוק " + n + " ההודעות המסומנות?"))
		{
			runTransform("main", "./messages.xml.php?delete=" + messages + "&amp;t=" + t, "./messages.xsl.php");
			alert(n + " הודעות הועברו לסל המחזור");
		}
	}
	else 
		alert("לא נבחרו הודעות למחיקה");
}

function unDeleteMessages(t)
{
	var cnt = -1;
	var messages = "0";
	var n = 0;
	var btn = document.forms[1];
	for (var i=0; i < btn.length; i++) {
		if (btn.elements[i].checked==true) {cnt = i; messages += "," + btn.elements[i].name; n++;}
	}
	if (cnt > -1) {
		if (confirm("האם לאחזר " + n + " ההודעות המסומנות?"))
		{
			runTransform("main", "./messages.xml.php?undelete=" + messages + "&amp;t=deleted", "./messages.xsl.php");
			alert(n + " הודעות אוחזרו");
		}
	}
	else
		alert("לא נבחרו הודעות לאחזור");
}

// IMAGE OPACITY FEATURES

function setOpacity(obj, opacity) {
  opacity = (opacity == 100)?99.999:opacity;
  
  // IE/Win
  obj.style.filter = "alpha(opacity:"+opacity+")";
  
  // Safari<1.2, Konqueror
  obj.style.KHTMLOpacity = opacity/100;
  
  // Older Mozilla and Firefox
  obj.style.MozOpacity = opacity/100;
  
  // Safari 1.2, newer Firefox and Mozilla, CSS3
  obj.style.opacity = opacity/100;
}
function fadeIn(objId,opacity) {
  if (document.getElementById) {
    obj = document.getElementById(objId);
    if (opacity <= 100) {
      setOpacity(obj, opacity);
      opacity += 10;
      window.setTimeout("fadeIn('"+objId+"',"+opacity+")", 100);
    }
  }
}

function initImage(imagename) {
  image_src = new Image();
  image_src.src = imagename;
  imageId = 'thephoto';
  image = document.getElementById(imageId);
  image.src = image_src.src;
  setOpacity(image, 0);
  image.style.visibility = 'visible';
  fadeIn(imageId,0);
  return false;
}

function closeImage() {
  image_src = new Image();
  image_src.src = './images/loading-l.gif';
  imageId = 'thephoto';
  image = document.getElementById(imageId);
  image.src = image_src.src;
  setOpacity(image, 0);
  image.style.visibility = 'hidden';
}

function pleaseLogin() {
	message = 'רק משתמשים רשומים יכולים לבצע חיפוש מפורט!\nאם הנך רשום במערכת בצע כניסה\nאינך רשום? ההרשמה חינם וגם השימוש באתר חינם! הרשם עכשיו!';
	alert(message);
}

function IsNumeric(sText)
{
   var ValidChars = "0123456789";
   var IsNumber=true;
   var Char;

 
   for (i = 0; i < sText.length && IsNumber == true; i++) 
      { 
      Char = sText.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
         {
         IsNumber = false;
         }
      }
   return IsNumber;
   
   }

function autoIframe(frameId){
try{
frame = document.getElementById(frameId);
innerDoc = (frame.contentDocument) ? frame.contentDocument : frame.contentWindow.document;
objToResize = (frame.style) ? frame.style : frame;
objToResize.height = innerDoc.body.scrollHeight + 10;
}
catch(err){
window.status = err.message;
}
}

function addBookmarkForBrowser() {
	var title="LoveStory.co.il הכרויות";
	var furl="http://www.lovestory.co.il";
	if (document.all)
	{
		window.external.AddFavorite(furl, title);
	} else {
		if (window.sidebar) { // Mozilla Firefox Bookmark
			window.sidebar.addPanel(title,furl,"");
		} else if(window.opera && window.print) { // Opera Hotlist
			return true; }
	}
}

