

//======== Constants.js

try
{
var sEnvironment='';

var naIMAGES_DOMAIN = 'http://pics'+sEnvironment+'.nana10.co.il/' ;
}catch(e){}


//======== Nana.js

try
{
/************************************************************************/
/*							Constants and variables						*/
/************************************************************************/
var naPageTimeoutId = -1;
var naPageRefreshInterval = 1000*600;
var sFP = window.location.protocol + "//" + window.location.host;
try {var sNUI = (new Cookie("NUI")).getCookie().replace(/[+]/g,' ');}catch(ex){}

/************************************************************************/
/*							Prototipes and object functions				*/
/************************************************************************/
function trim(str){
   return str.replace(/^\s*|\s*$/g,"");
}

String.prototype.trim = function(){
	return trim(this);
}

function randOrd(a, b){
	return (Math.round(Math.random())-0.5); 
}

function UrlEncode(sStr)
{
	var sReturn='';
	for (var i=0;i<sStr.length;i++)
	{
		var iUni=sStr.charCodeAt(i);
		if(iUni>=1488 && iUni<=1514)
		{
			var iAsc=iUni-1264 ;
			sReturn+=escape(String.fromCharCode(iAsc));
		}else if(iUni==32) sReturn += escape('+');
		else if(iUni==43) sReturn += '%2b';
		else	sReturn+=escape(sStr.charAt(i));
	}
	return sReturn;
}

function suycDateDiff(start) {
	// This function need to recieve date in format = 20:06 25/12/2001
	// and return how many days it is from today
	var strMonthArray = new Array(12);
	strMonthArray[0]  = "Jan";
	strMonthArray[1]  = "Feb";
	strMonthArray[2]  = "Mar";
	strMonthArray[3]  = "Apr";
	strMonthArray[4]  = "May";
	strMonthArray[5]  = "Jun";
	strMonthArray[6]  = "Jul";
	strMonthArray[7]  = "Aug";
	strMonthArray[8]  = "Sep";
	strMonthArray[9]  = "Oct";
	strMonthArray[10] = "Nov";
	strMonthArray[11] = "Dec";
	
	var text = start.substring(5);	
	
	// the mounth
	var sMounth = text
		sMounth = text.substring(3);
		sMounth = sMounth.substring(1,3) ;
	    if(sMounth.indexOf(0)==0) sMounth = sMounth.substring(1,2);
	     sMounth = strMonthArray[sMounth-1];
	     
	// the day
	var sDay = text;
		sDay = sDay.substring(1,3) ;	
	
	// the year
	var sYear = text ;
	    sYear = sYear.substring(7,11) ;
	
	// all start string again
	start = sDay + " " + sMounth + " " + sYear ;	    	

	var now;
	now  = new Date() ;		
    var iOut = 0;
    var bufferA = Date.parse( start ) ;
    var bufferB = Date.parse( now ) ;    	
    if ( isNaN (bufferA) || isNaN (bufferB) )   return 0 ;            	                        
    var number = bufferB-bufferA ;       
    iOut = parseInt(number / 86400000) ;                  
    return iOut ;
}

/************************************************************************/
/*							Search functions							*/
/************************************************************************/

function defined(o) 
{
	return (typeof(o)!="undefined");
}

function SearchRedirectLocal(e)
{
 if (!defined(e) && defined(window.event)) {
      e = window.event;
  }
  return SearchRedirect(false, (e.target || e.srcElement));
}

function SearchRedirect(bReturnString, frm)
{
	var sParamName, sParamValue,arrSplit,sUrl='';
	var oSearchBar = (!defined(frm))?document.getElementById("SearchBar"):frm;
	var oDiv = new Div(oSearchBar);
	var oArrInput;
	var sArrIgnore = new Array ('q','serviceAction');
	var arrURL, sOptionId;
	var oQ = oSearchBar.q;
	
	oQ = CleanKeywords(oQ);
		
	if(oQ.value.length < 2 || oQ.value== 'çôùå àúø')
	{
		alert("îéìú çéôåù öøéëä ìäëéì ìôçåú 2 úååéí çå÷ééí"); 
		return false;
	}
	
	if(oSearchBar.serviceAction.value) {
		arrURL = oSearchBar.serviceAction.value.split("|");
	}
	else {
		var oSA = document.getElementsByName('serviceAction');
		for (var i=0;i<oSA.length;i++)
			if(oSA[i].checked)
			{
				sOptionId = oSA[i].id;
				arrURL=oSA[i].value.split("|");
				break;
			}
	}
	
	var nNumOfParam=arrURL.length;	
	// get extra parameters
	if(nNumOfParam>2)
		for(var i=1;i<nNumOfParam-1;i++)
		{
			arrSplit=arrURL[i].split("=");
			sParamName=arrSplit[0];
			sParamValue=arrSplit[1];
			
			sUrl+='&' + escape(sParamName) + '=' + UrlEncode(sParamValue) ;
		}
	
	if(arrURL[0].toLowerCase().indexOf("ftsearch")>=0)
	{
		if(!ValidateSearchString(oQ.value.trim()))
		{
			alert(".îéìú çéôåù éëåìä ìäëéì àåúéåú áàðâìéú, òáøéú åñôøåú");
			return false;
		}
	}
	
	oArrInput=oSearchBar.getAllChild('INPUT');
	for (var i=0;i<oArrInput.length;i++)
		if(sArrIgnore[0]!=oArrInput[i].name && sArrIgnore[1]!=oArrInput[i].name )
			if ((oArrInput[i].type=='radio' && oArrInput[i].checked)||oArrInput[i].type!='radio')
				sUrl+='&' + escape(oArrInput[i].name) + '=' + UrlEncode(oArrInput[i].value)
			
	oArrInput=oSearchBar.getAllChild('SELECT');
	for (var i=0;i<oArrInput.length;i++)
		if(sArrIgnore[0]!=oArrInput[i].name && sArrIgnore[1]!=oArrInput[i].name )
			sUrl+='&' + escape(oArrInput[i].name) + '=' + UrlEncode(oArrInput[i].value) ;

	var sKeywordParam=arrURL[nNumOfParam-1];
	sUrl += '&gr=' 
	sUrl += oSearchBar.g.checked ? '1' : '0' ;
	
	sUrl=sUrl+'&' + escape(sKeywordParam) + '=' + UrlEncode(oQ.value) ;	
	sUrl=arrURL[0] + '?' +sUrl.substring(1);
	if (sOptionId)
		sUrl += "&sbId=" + sOptionId.replace("serviceAction","");
	if (oQ.value!='')
		if (bReturnString)
			return sUrl;
		else {
			parent.location=sUrl ;
			return false;
		}
	else
		return false;		
}

function SelectSearchButton(){
	var sSrbId = RequestQueryString("sbId");
	if (sSrbId != "") {
		var oSrlOldId = document.getElementById("FontSelected1")
		var oSrlId = document.getElementById("FontSelected" + sSrbId)
		var oSrb = document.getElementById("serviceAction" + sSrbId);
		if (oSrb){
			oSrb.checked = true;
			oSrlOldId.style.fontWeight = "normal";
			oSrlId.style.fontWeight = "bold";
		}
	}
}

function ValidateSearchString(sStr)
{
    
    for (i=0;i<sStr.length;i++)
    {
        var iChar=sStr.charCodeAt(i);
        if  (  
                !(
					(iChar==32 ) ||
                    (iChar>=97 && iChar<=122) ||
                    (iChar>=65 && iChar<=90) ||
                    (iChar>=48 && iChar<=57) ||
                    (iChar>=1488 && iChar<=1514) 
                )
            )
            {
                return false;
            }
    }
    return true    
}

function CleanKeywords(oKeyword)
{
	var KeywordValue = oKeyword.value
	KeywordValue = KeywordValue.replace('http://', '');
	KeywordValue = KeywordValue.replace('www.', '');
    KeywordValue = KeywordValue.replace('.com', '');
    KeywordValue = KeywordValue.replace('.co', '');
    KeywordValue = KeywordValue.replace('.net', '');
    KeywordValue = KeywordValue.replace('.org', '');
    KeywordValue = KeywordValue.replace('.gov', '');
    KeywordValue = KeywordValue.replace('.net', '');
    KeywordValue = KeywordValue.replace('.il', '');
    KeywordValue = KeywordValue.replace('planet.nana', '');
    KeywordValue = KeywordValue.replace('members.nana', '');
    KeywordValue = KeywordValue.replace('.asp', '');
    KeywordValue = KeywordValue.replace('.htm', '');
    KeywordValue = KeywordValue.replace('.html', '');
    KeywordValue = KeywordValue.replace(/\?/g, ' ');
    KeywordValue = KeywordValue.replace(/!/g, ' ');
    KeywordValue = KeywordValue.replace(/;/g, ' ');
    KeywordValue = KeywordValue.replace(/\+/g, ' ');
    KeywordValue = KeywordValue.replace(/-/g, ' ');
    KeywordValue = KeywordValue.replace(/~/g, ' ');
    KeywordValue = KeywordValue.replace(/%/g, ' ');
    KeywordValue = KeywordValue.replace(/$/g, ' ');
    KeywordValue = KeywordValue.replace(/&/g, ' ');
    KeywordValue = KeywordValue.replace(/^/g, ' ');
    KeywordValue = KeywordValue.replace(/^/g, ' ');
    KeywordValue = KeywordValue.replace(/@/g, ' ');
    KeywordValue = KeywordValue.replace(/=/g, ' ');
    KeywordValue = KeywordValue.replace('/', ' ');
    KeywordValue = KeywordValue.replace(/\[/g, ' ');
    KeywordValue = KeywordValue.replace(/]/g, ' ');
    KeywordValue = KeywordValue.replace(/\(/g, ' ');
    KeywordValue = KeywordValue.replace(/\)/g, ' ');
    KeywordValue = KeywordValue.replace(/\*/g, ' ');
    KeywordValue = KeywordValue.replace(/#/g, ' ');
    KeywordValue = KeywordValue.replace(/}/g, ' ');
    KeywordValue = KeywordValue.replace(/{/g, ' ');
    KeywordValue = KeywordValue.replace(/,/g, ' ');
    KeywordValue = KeywordValue.replace(/</g, ' ');
    KeywordValue = KeywordValue.replace(/>/g, ' ');
	//alert(KeywordValue);
	oKeyword.value = trim(KeywordValue);
	return oKeyword;
}

function SearchNoValidateSubmit()
{
	return true;
}

/************************************************************************/
/*							Nana DOM and HTML functions					*/
/************************************************************************/
//Keep this function for backward compatibility
function NanaPopUp (sPopupWinArgs) 
{
	NanaPopUpReturn(sPopupWinArgs)
}

//This function return the refrence of the popup
//Usage:
//	NanaPopUpReturn ('TargetURL, width, height, scrollbars')
//Usage examples:
//	NanaPopUpReturn ('http://www.nana10.co.il, 400, 300, yes')
//	NanaPopUpReturn ('http://www.nana10.co.il, width=400, height=300, scrollbars=yes')
function NanaPopUpReturn (sPopupWinArgs) {					 
	if(sPopupWinArgs != '') {
		var sURL		= '';
		var sWidth		= '';
		var sHeight		= '';
		var sFeatures	= '';
		var sScrollBars	= '';
		
		var oNewWindow;					
		var sName = 'PopupWin';
		var sFeatures	= '';
		var arrArgs		= sPopupWinArgs.split(",");

		typeof(arrArgs[0]) == 'string' ? sURL = arrArgs[0] : {};
		if (typeof(arrArgs[1]) == 'string')
			sWidth = arrArgs[1].toLowerCase() 
		else {
			parent.location.href=sURL; 
			self.focus();
			return(null);
		}
		typeof(arrArgs[2]) == 'string' ? sHeight = arrArgs[2].toLowerCase() : {};
		typeof(arrArgs[3]) == 'string' ? sScrollBars = arrArgs[3].toLowerCase() : {};
		
		sFeatures = 'top=10, left=10';
		
		if (sWidth == "width=0") {
			sWidth = '';
		} else if (sWidth.indexOf('width')==-1) {
			sWidth = ', width=' + sWidth;
		} 
		
		if (sHeight == "height=0") {
			sHeight = '';
		} else if (sHeight.indexOf('height')==-1) {
			sHeight = ', height=' + sHeight;
		} 
		
		if (sScrollBars != '' && sScrollBars.indexOf('scrollbars')==-1) {
			sScrollBars = ', scrollbars=' + sScrollBars;
		} 

		sFeatures = sFeatures + sWidth + sHeight + sScrollBars
		
		oNewWindow = window.open (sURL,sName,sFeatures);
		return oNewWindow;
	}
}

// get query string paramter and return the value
function RequestQueryString(sParamName,sHref){
	var arrHref;
	var nParamStartPos=0, nParamEndPos=0;
	var sParamValue='';
	
	if (typeof(sHref) == "undefined")
		var sHref = document.location.href;
	
	arrHref = sHref.split("?");
	// return empty string if the query string not exsits
	if (arrHref.length <= 1) 
		return(sParamValue);
	sParamName += '=';
	nParamStartPos = arrHref[1].indexOf(sParamName);
	// return empty string if the requested parameter is not exsits
	if(nParamStartPos == -1)	
		return(sParamValue);
	nParamStartPos += sParamName.toString().length;
	nParamEndPos = arrHref[1].indexOf("&", nParamStartPos);
	if(nParamEndPos > -1 && nParamEndPos > nParamStartPos)
		sParamValue=arrHref[1].slice(nParamStartPos,nParamEndPos);
	else
		sParamValue=arrHref[1].slice(nParamStartPos);

	return(sParamValue);
}

function GetWindowWidth() {
	var myWidth = 0, myHeight = 0;
	if( typeof( window.innerWidth ) == 'number' ) {
		myWidth = window.innerWidth;
	} else if( document.documentElement &&
		( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
		myWidth = document.documentElement.clientWidth;
	} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		myWidth = document.body.clientWidth;
	}
	return myWidth;
}

function GetWindowHeight() {
	var myWidth = 0, myHeight = 0;
	if( typeof( window.innerWidth ) == 'number' ) {
		myHeight = window.innerHeight;
	} else if( document.documentElement &&
		( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
		myHeight = document.documentElement.clientHeight;
	} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		myHeight = document.body.clientHeight;
	}
	return myHeight;
}

function getScrollXY() {
  var scrOfX = 0, scrOfY = 0;
  if( typeof( window.pageYOffset ) == 'number' ) {
    scrOfY = window.pageYOffset;
    scrOfX = window.pageXOffset;
  } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
    scrOfY = document.body.scrollTop;
    scrOfX = document.body.scrollLeft;
  } else if( document.documentElement &&
      ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
    scrOfY = document.documentElement.scrollTop;
    scrOfX = document.documentElement.scrollLeft;
  }
  return [ scrOfX, scrOfY ];
}

// This function save cookie - deprecated, use class
function saveCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000))		
		var expires = "; expires="+date.toGMTString()
	}
	else expires = ""
		document.cookie = name+"="+value+expires+"; path=/"				
}

// This function read the cookie that was saved by saveCookie function - deprecated, use class
function readCookie(name) {
	var nameEQ = name + "="
	var ca = document.cookie.split(';')
	for(var i=0;i<ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length)
			if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length)
	}
	return 1;
}

/************************************************************************/
/*							Video related functions						*/
/************************************************************************/
function BuildASX(nAdClipMediaId, sMediaUrl){
	var sASX_URL = sASXGeneratorUrl;
	sASX_URL += "?ClipMediaUrl=" + escape(sMediaUrl);
	
	if (typeof(nAdClipMediaId) != "undefined")
		if (nAdClipMediaId)
			sASX_URL += "&AdClipMediaId=" + nAdClipMediaId;
		
	return sASX_URL;
}

function currentClip_isAdvertisement(oPlayer){
	var iMediaClipID = RequestQueryString('AdClipMediaId',oPlayer.URL);
	var CurrentClipID = oPlayer.currentMedia.getItemInfo('CastUP_Content_ClipMediaID');
	return (iMediaClipID != CurrentClipID)? false : true;
}

function PlayerMouseMove(oCurrPlayer){
	if (typeof(oCurrPlayer) != "object")
		oCurrPlayer = oPlayer;
		
	if (oCurrPlayer){
		oCurrPlayer.style.cursor = "";
		oCurrPlayer.parentNode.style.cursor = "";
		if (typeof(sAdClipURL) != "undefined"){
			if (sAdClipURL != "") {
				oCurrPlayer.style.cursor = "pointer";
				oCurrPlayer.parentNode.style.cursor = "pointer";
			}
		}
	}
}


function OnPlayerClick(nButton, nShiftState, fX, fY){
	if (nButton == 1){
		if (typeof(sAdClipURL) != "undefined"){
			if (typeof(sErateToolId) != "undefined")
				ReportErate(2, sErateToolId)	
			if (sAdClipURL != "") try { window.open(sAdClipURL, "videoaddwindow");}catch(ex){}
		}
	}
}

function OnPlayerDblClick(){
	//do nothing
}

function MakeClickable(oPlayer){
	oPlayer.attachEvent("Click",OnPlayerClick);
	oPlayer.attachEvent("DoubleClick",OnPlayerDblClick);
	oPlayer.attachEvent("MouseMove", PlayerMouseMove);
}

function GetCastupClipID(sClipURL){
	var nCastupClipID = "-1";
	sClipURL = sClipURL.toLowerCase();
	var sCastupURL = RequestQueryString('clipmediaurl',sClipURL);
	
	try {
		nCastupClipID = RequestQueryString('clipmediaid', unescape(sCastupURL));
	}
	catch (e){}
	
	try {
		if (nCastupClipID == '-1' || nCastupClipID == '')
			nCastupClipID = RequestQueryString('ar', unescape(sCastupURL));
	}
	catch (e){}
	
	if (nCastupClipID == "") nCastupClipID = "-1";
	
	return nCastupClipID;
}

/************************************************************************/
/*							Nana functionality							*/
/************************************************************************/
function Channel10MouseOver(action,sNormalPic,sOverPic)
{
	var oImg = document.getElementById("imgChnl10")
	switch(action)
	{
		case "over":
			oImg.src = sOverPic;
		break;
		case "out":
			oImg.src = sNormalPic;
		break;
	}
}

function SetGirafaCheckbox(flag, Formobject){
	if(flag)
		Formobject.gr.value=1;
	else
		Formobject.gr.value=0;
}

function SetPageRefresh(iTimeoutInterval){
	if (naPageTimeoutId == -1) {
		naPageTimeoutId = window.setTimeout("window.location.reload()",naPageRefreshInterval);
	}
}

function CancelPageRefresh(){
	if (naPageTimeoutId != -1) {
		window.clearTimeout(naPageTimeoutId);
		naPageTimeoutId = -1;
	}
}


/************************************************************************/
/*							Ajax functions								*/
/************************************************************************/
function AppendScript(sScriptId, sScriptUrl, fnCallback) {
	var bBrowser_Is_IE = document.all && window.ActiveXObject && navigator.userAgent.toLowerCase().indexOf("msie") > -1  && navigator.userAgent.toLowerCase().indexOf("opera") == -1;
    var oScript  = document.getElementById(sScriptId);
    var oHead = document.getElementsByTagName("head").item(0);

    if (oScript) {
		oHead.removeChild(oScript);
    }

    oScript = document.createElement("script");
    
    oScript.setAttribute("src", sScriptUrl);
    oScript.setAttribute("type", "text/javascript");
    oScript.setAttribute("id",sScriptId);

    oHead.appendChild(oScript);
    if (fnCallback){
		if (bBrowser_Is_IE) {
			if  (oScript.readyState == "loaded" || oScript.readyState == "complete") {
				fnCallback();
				oScript.onreadystatechange = null;
			} 
			else {
				oScript.onreadystatechange = function() {
					if (oScript.readyState == "loaded" || oScript.readyState == "complete") {
						fnCallback();
						oScript.onreadystatechange = null;
					} 				
				};
			}
		} 
		else {
			fnCallback();
		}
	}
}

/************************************************************************/
/*									END									*/
/************************************************************************/

}catch(e){}


//======== Array.js

try
{
/*
	This class will handle all array method
	Its extend the java script build-in Array object
	15/04/03 Guy Glass
*/
function CArray(oArr){
	onerror=function (sError,sURL,iLine){	return ClassException('CArray',sError,sURL,iLine); }
	// Add the methods address to the current class to be recognize outside the class scope
	oArr.Add=Add;
	this.Add=Add;
	oArr.Remove=Remove;
	this.Remove=Remove;
	oArr.IsExists=IsExists;
	this.IsExists=IsExists;
	oArr.isExists=IsExists;
	this.isExists=IsExists;
	this.length=getLength;
	oArr.isDuplicate=isDuplicate;
	this.isDuplicate=isDuplicate;

	function getLength()
	{
		return oArr.length;
	}
	
	function isDuplicate()
	{
		var arrTmp=new Array();
		for (var i=0;i<getLength();i++)
			if(arrTmp[oArr[i]])
			{
				return oArr[i];
			}
			else
				arrTmp[oArr[i]]=1;
		return null;
	}
	
	// Add object to the last array elements
	function Add(oValues){
		oArr[getLength()] = oValues;
		return oArr.length;
	}

	// Remove object from the array (Just place empty string insted of the object)	
	function Remove(oValues){
		var i;
		// The new array 
		var arrNewArray = new Array(oArr.length-1);

		for(i=0;i<oArr.length;i++){
			// check if the element is array
			if(oArr[i].length>0){
				if(oArr[i].join(",")==oValues){
					var tmp = new Array()
					oArr[i]=tmp;

					var j=0, nRemovedIndex=i;
					i=0;
					/*
					for(j=0;j<oArr[i].length;j++)
						oArr[i][j]='';
					*/
					/*
					for(j=0;j<oArr.length;j++){
						if(j!=nRemovedIndex)
							arrNewArray[j-i]=oArr[j];
						else
							i++;
					
					}
					*/
					// Replace between the two arrays
					/*
					oArr=null;
					oArr=new Array();
					for(j=0;j<arrNewArray.length;j++)
						oArr[j]=arrNewArray[j];
					*/
					return true;
				}
			}
			else{
				if(oArr[i]==oValues){
					oArr[i] = '';
					return true;
				}
			}
		}
		return false;			
	}	
	// Check if given object exists in the global array
	function IsExists(oValues){
	
		for(var i=0;i<oArr.length;i++)
		{
			if(oArr[i].join)
			{
				if(oArr[i].join(",")==oValues) return true;
			}
			else
			{
				if(oArr[i]==oValues) return true;
			}
		}
		return false;
	}
	
}

}catch(e){}


//======== Div.js

try
{
/*
	script take care of the arr of HTML object such as div,span and etc
	01/04/03 Shay Lapid
*/
function DivCollection(oArrDiv)
{
	this.onerror=function (sError,sURL,iLine){	return ClassException('DivCollection',sError,sURL,iLine); }
	this.Toogle=Toogle;
	oArrDiv.Toogle=Toogle;
	this.ToogleStyle=ToogleStyle;
	oArrDiv.ToogleStyle=ToogleStyle;
	this.ToogleHref=ToogleHref;
	oArrDiv.ToogleHref=ToogleHref;

	var iLen=oArrDiv.length;
	
	function Toogle(iPosition)
	{
	for (var i=0 ; i < iLen ; i++)
	{
		new Div(oArrDiv[i])
		oArrDiv[i].Close();
	}
	oArrDiv[iPosition-1].Open();
	location='#ContentBegin';
	}

	function ToogleStyle(iPosition,sChooseClass,sOtherClass)
	{
	for (var i=0 ; i < oArrDiv.length ; i++)
		oArrDiv[i].className=sOtherClass;
	oArrDiv[iPosition-1].className=sChooseClass;
	}
	function ToogleHref(iPosition,sDefaultHref)
	{
	for (var i=0 ; i < oArrDiv.length ; i++)
		oArrDiv[i].href=sDefaultHref + (i+1) + ');';
	oArrDiv[iPosition-1].removeAttribute('href',0);
	}

}

}catch(e){}


//======== DivCollection.js

try
{
/*
	script take care of the HTML object such as div,span and etc
	01/04/03 Shay Lapid
*/

function Div(Div1)
{
//this.onerror=function (sError,sURL,iLine){	return ClassException('Div',sError,sURL,iLine); }
var oIframePrint;
var oDiv=Div1;
var iStartPos;
var iStartPosLeft;
var iStartPosLeftWidth;
var bSameLocation;
var iSizeStep;
var iMaxSize;
var iStartHeight=0;
var iOpacityLevel;
var bNetScape = false;

try
{
	var bNetScape = navigator.appName.toLowerCase()=='netscape' ;
	iStartHeight=oDiv.nodeName=='IFRAME'?oDiv.height:iStartHeight=oDiv.offsetHeight;
}catch(e){}

this.getAllChild=getAllChild;
oDiv.getAllChild=getAllChild;
oDiv.iStartPos=iStartPos;
this.iStartPos=iStartPos;
oDiv.Print=Print;
this.Print=Print;
oDiv.ChangeState=ChangeState;
this.ChangeState=ChangeState;
oDiv.Open=StateOpen;
this.Open=StateOpen;
oDiv.Close=StateClose;
this.Close=StateClose;
oDiv.Clear=Clear;
this.Clear=Clear;
oDiv.reLocate=LocateInit;
this.reLocate=LocateInit;
oDiv.ChangeSize=ChangeSizeInit;
this.ChangeSize=ChangeSizeInit;
oDiv.ChangeSizeClose=ChangeSizeCloseInit;
this.ChangeSizeClose=ChangeSizeCloseInit;
oDiv.RemoveHTMLNode=RemoveNode;
this.RemoveHTMLNode=RemoveNode;
oDiv.ObjectResize=ObjectResize;
this.ObjectResize=ObjectResize;
oDiv.ObjectResizeHeight=ObjectResizeHeight;
this.ObjectResizeHeight=ObjectResizeHeight;
oDiv.ObjectResizeWidth=ObjectResizeWidth;
this.ObjectResizeWidth=ObjectResizeWidth;
oDiv.Opacity=Opacity;
this.Opacity=Opacity;
oDiv.FadeIn=FadeInInit;
this.FadeIn=FadeInInit;
oDiv.FadeOut=FadeOutInit;
this.FadeOut=FadeOutInit;
oDiv.ShowAndFade=ShowAndFade;
this.ShowAndFade=ShowAndFade;
oDiv.getWidth=getWidth;
this.getWidth=getWidth;
oDiv.getHeight=getHeight;
this.getHeight=getHeight;
oDiv.PositionBest=PositionBest;
this.PositionBest=PositionBest;
oDiv.LocationBest=LocationBest;
this.LocationBest=LocationBest;
oDiv.getElementX=getElementX;
this.getElementX=getElementX;
oDiv.getElementY=getElementY;
this.getElementY=getElementY;
oDiv.PlaceOver=PlaceOverInit;
this.PlaceOver=PlaceOverInit;
oDiv.isOpen=isOpen;
this.isOpen=isOpen;
	function getAllChildRecurse(sTag,oPtr,oArr)
	{
		for (var i=0;i<oPtr.length;i++)
		{
			if(sTag==oPtr[i].tagName)
				oArr[oArr.length]=oPtr[i];
			getAllChildRecurse(sTag,oPtr[i],oArr);
		}
	}
	function getAllChild(sTag)
	{
		var oArr=new Array();
		var oPtr=oDiv.parentNode.childNodes;
		getAllChildRecurse(sTag, oPtr,oArr);		
		return oArr;
	}
	function LocationBest(oInput)
	{
		var iTop=0;
		var iLeft=60;
		var oParent=oInput;

		for (var oPtr=oParent;oPtr;oPtr=oPtr.parentNode)
		{
			if(oPtr.tagName!='TR')
			{
				if( oPtr.offsetLeft )	iLeft += oPtr.offsetLeft;
				if( oPtr.offsetTop  )	iTop  += oPtr.offsetTop;
			}
		}
		oDiv.style.left=iLeft - oInput.getWidth()/2;
		oDiv.style.top=iTop + new Div(oParent).getHeight();
	}

	function getScreenWidth()
	{
		return document.body.offsetWidth;	
	}
	function PlaceOver(oDivToPlace,iTableWidth)
	{
		oDivToPlace.style.top=getElementY();
		var iX = getElementX();
		var iExtra = getScreenWidth() - iX >0 ? (getScreenWidth()-iTableWidth)/2 : 0 ;
		oDivToPlace.style.left = iX + iExtra;
		var fnResize=window.onresize;
	}

	function PlaceOverInit(oDivToPlace,iTableWidth)
	{
		PlaceOver(oDivToPlace,iTableWidth);
		var fnResize=window.onresize;
		window.onresize=function (){
			if (fnResize)
				fnResize();
			PlaceOver(oDivToPlace,iTableWidth);
		}
	}
	
	function getElementX()
	{	
		return oDiv.scrollLeft + oDiv.offsetLeft;
	}
	
	function getElementY()
	{	
		return oDiv.scrollTop + oDiv.offsetTop;
	}
	
	function PositionBest(e)
	{
			var x=getX(e);
			var y=getY(e);
			var iHeight=getHeight();
			var iWidth=getWidth();
			var iWidth2=iWidth / 2;
			var iPageWidth=getPageWidth() ;
			var iLeftScroll=document.body.scrollLeft;
			var	iLeftArrow=0;
			var oTDTop		= document.getElementById('tdToolTipTop');
			var oTDBottom	= document.getElementById('tdToolTipBottom');
			var iImgWidth	= 25
			if( y > document.body.scrollTop + iHeight )
			{
				y += -1 * iHeight - 20 
				if (oTDTop && oTDBottom)
				{
					new Div(oTDTop).Close()
					new Div(oTDBottom).Open()
				}
			}else{
				y += 20;
				if (oTDTop && oTDBottom)
				{
					new Div(oTDTop).Open()
					new Div(oTDBottom).Close()
				}
			}
			oDiv.style.top=y;
				
			if (bNetScape)
				oDiv.style.right=iPageWidth-x;
			else
			{
				if (x + iWidth2 > iPageWidth + iLeftScroll )
				{
					x= iPageWidth  - iWidth;
					iLeftArrow =  getX()-iLeftScroll- x - iImgWidth;
				}else if( x - iWidth2  < iLeftScroll)
				{
					x= 0; 
					
					iLeftArrow = getX()-iLeftScroll- x - iImgWidth;
				}else{
						x -= iLeftScroll + iWidth2 ;
						iLeftArrow=iWidth2 - iImgWidth;
				}
				
				if (iLeftArrow>0 && oTDTop && oTDBottom)
				{
					oTDTop.style.paddingLeft=iLeftArrow;
					oTDBottom.style.paddingLeft=iLeftArrow;
				}
				oDiv.style.left=x;
			}

	}
	
	function ShowAndFade(oDiv1)
	{
		StateOpen()
		oDiv1?oDiv1.onmouseout=FadeOutInit:oDiv.onmouseout=FadeOutInit;
	}
	
	function FadeInInit()
	{
		iOpacityLevel=0;
		FadeIn()
	}
	
	function FadeIn()
	{
		iOpacityLevel++;
		Opacity(iOpacityLevel);
		if (iOpacityLevel<=100)
			setTimeout(FadeIn,20);
	}

	function FadeOutInit()
	{
		iOpacityLevel=100;
		FadeOut()
	}

	function FadeOut()
	{
		iOpacityLevel-=5;
		Opacity(iOpacityLevel)
		if(iOpacityLevel>=0)
			setTimeout(FadeOut,20)
		else{
			StateClose(); 
			Opacity(100);
		}
		
	}

	function Opacity(iOpacity)
	{
		oDiv.style.filter='alpha(opacity=' + iOpacity + ', style=0)';
	}

	function getPageWidth()
	{
		return document.body.clientWidth;
	}
	
	function getPageHeight()
	{
		return document.body.clientHeight;
	}

	function getX(e)
	{
		var x;
		x=!bNetScape ? window.event.x :e.pageX;
		x+=document.body.scrollLeft;
		return x;
	}
	
	function getY(e)
	{
		return bNetScape ? e.pageY : window.event.y + document.body.scrollTop ;
	}

	function getWidth()
	{
	
	//alert(parseInt(document.defaultView.getComputedStyle(oDiv,'').getPropertyValue('width')));
		return oDiv.offsetWidth;
	}

	function getHeight()
	{
		return oDiv.offsetHeight;
	}

	function ObjectResizeHeight(oHTML)
	{
		oDiv.style.height	=oHTML.offsetHeight;
	}

	function ObjectResizeWidth(oHTML)
	{
		oDiv.style.width	=oHTML.offsetWidth;
	}

	function ObjectResize(oHTML,iOpacity)
	{
		ObjectResizeHeight(oHTML);
		ObjectResizeWidth(oHTML);

		if (iOpacity)
			Opacity(iOpacity);
	}
	
	function RemoveNode()
	{
		oDiv.parentNode.removeChild(oDiv);
	}

	function ChangeSizeInit(Step,MaxSize)
	{
		iSizeStep	= Step;
		iMaxSize	= MaxSize;
		clearInterval (oDiv.Interval);
		oDiv.Interval=setInterval(ChangeSize,10);
	}
	
	function Clear()
	{
		oDiv.innerHTML='';
	}
	
	function ChangeSize()
	{
		var iHeight=oDiv.offsetHeight;
		iHeight < iMaxSize?	oDiv.style.height = iHeight + iSizeStep : clearInterval (oDiv.Interval);
	}
	
	function ChangeSizeCloseInit(Step)
	{
		iSizeStep	= Step;
		clearInterval (oDiv.Interval);
		oDiv.Interval=setInterval(ChangeSizeClose,10);
	}

	function ChangeSizeClose()
	{
		var iHeight=oDiv.offsetHeight;
		iHeight > iStartHeight?	oDiv.style.height = iHeight - iSizeStep : clearInterval (oDiv.Interval);
	}
	
	function Print(sTitle)
	{
		var oArr=document.getElementsByTagName('link')
		if(!sTitle) sTitle='Print Frame';
		oIframePrint=document.createElement('<IFRAME id="ifrmPrint" src="about:blank" height="0" width="0">');
		var sHTML = 
		'<html dir=rtl>'+
			'<head>'+
				'<title>'+sTitle+'</title>';

		for (var i=0;i<oArr.length;i++)
			if(oArr[i].rel=='stylesheet')
				sHTML+=
				'<LINK REL="stylesheet" TYPE="text/css" HREF="' + oArr[i].href + '">';
		sHTML+=
			'</head>'+
			'<body>' + 
				oDiv.innerHTML+
			'<body>'+
		'</html>';
		
		document.body.appendChild(oIframePrint);
		var oIFr=document.frames['ifrmPrint']
		
		oIFr.document.writeln(sHTML);
		oIFr.focus();
		setTimeout(PrintFin,200);
	}
	
	function PrintFin()
	{
		print();
		document.body.removeChild(oIframePrint);
	}
	
	function StateOpen()
	{
		if (!isOpen())
		{
			if (bNetScape)
			{
				oDiv.style.display='inline';
			}
			oDiv.style.display='';
		}
	}
	
	function StateClose()
	{
		oDiv.style.display='none';
	}
	
	function isOpen()
	{
		return oDiv.style.display!='none';
	}
	
	function ChangeState()
	{
		isOpen() ? StateClose() : StateOpen();
	}
	
	function LocateInit(iY,bSamePlace)
	{
		!iY? iStartPos=oDiv.offsetTop : iStartPos=iY;
		var fnOnScroll=window.onscroll;
		window.onscroll=function (){
			if (fnOnScroll) fnOnScroll();
			reLocate();
		}
		bSameLocation=bSamePlace;
		iStartPosLeft=oDiv.offsetLeft;
		iStartPosLeftWidth	= oDiv.offsetWidth;
		reLocate ();
	}
	
	function reLocate()
	{
		var oDivStyle = oDiv.style
		var iDestPos
		if (bSameLocation)
			iDestPos = document.body.scrollTop + iStartPos;
		else if (iStartPos > document.body.scrollTop )
			iDestPos = iStartPos;
		else
			iDestPos = document.body.scrollTop;

		oDivStyle.left		= iStartPosLeftWidth + iStartPosLeft;
		oDivStyle.top		= iDestPos;
		
	}
		
	if (bNetScape)
	{
	/*
		oDiv.insertAdjacentHTML=function(stam,str)
		{	
			var r = document.createRange();
			r.setStartBefore(document.body);
			var oNode = r.createContextualFragment(str);
			
			if(stam=='afterBegin')
			{
				oDiv.insertBefore(oNode,oDiv.firstChild);
			}else{
				oDiv.appendChild(oNode);
			}
			

		}
	*/
		
		oDiv.insertAdjacentHTML = function (sWhere, sHTML) 
		 {
			
		 
			var oFragment;   
			var oRange = oDiv.ownerDocument.createRange();
			sWhere=String(sWhere).toLowerCase();

			switch (sWhere) 
			{  
				case "beforebegin":
					oRange.setStartBefore(oDiv);
					oFragment = oRange.createContextualFragment(sHTML);
					oDiv.parentNode.insertBefore(oFragment, oDiv);
					break;
				case "afterbegin":
					oRange.selectNodeContents(oDiv);
					oRange.collapse(true);
					oFragment = oRange.createContextualFragment(sHTML);
					oDiv.insertBefore(oFragment, oDiv.firstChild);
					break;
				case "beforeend":
					oRange.selectNodeContents(oDiv);
					oRange.collapse(false);
					oFragment = oRange.createContextualFragment(sHTML);
					oDiv.appendChild(oFragment);
					break;
				case "afterend":
					
					oRange.setStartAfter(oDiv);
					oFragment = oRange.createContextualFragment(sHTML);
					oDiv.parentNode.insertBefore(oFragment, oDiv.nextSibling);
					break;
				default:
					oDiv.appendChild(oNode);
					break;
			}
			
			
		}
		this.insertAdjacentHTML=oDiv.insertAdjacentHTML;
		
		oDiv.insertAdjacentElement = function(sWhere,oNode)
		{
			switch (sWhere)
			{
			case 'beforeBegin':
				oDiv.parentNode.insertBefore(oNode,oDiv)
				break;
			case 'afterBegin':
				oDiv.insertBefore(oNode,oDiv.firstChild);
				break;
			case 'beforeEnd':
				oDiv.appendChild(oNode);
				break;
			case 'afterEnd':
				if (this.nextSibling) 
					oDiv.parentNode.insertBefore(parsedNode,oDiv.nextSibling);
				else 
					oDiv.parentNode.appendChild(parsedNode);
				break;
			}
		}
		this.insertAdjacentElement=oDiv.insertAdjacentElement;
		
		function allIn(sID,oCurrNode)
		{
			for(var i=0;i<oCurrNode.length;i++)
			{
				if(oCurrNode[i].id==sID)
					return oCurrNode[i];
				else
				{
					var returned=allIn(sID,oCurrNode[i].childNodes);
					if (returned!=null)
						return returned;
				}
			}
		}

		function allFirst(sID)
		{
			var oCurrNode=oDiv.childNodes;
			return allIn(sID,oCurrNode);
		}
		
		this.all=allFirst;
		oDiv.all=allFirst;
		/*
		this.all=layer;
		oDiv.all=layer;
		*/

	}
}		

}catch(e){}


//======== Input.js

try
{
/*
	script take care of Input fields
	01/04/03 Shay Lapid
*/
function isNetScapeNavigator()
{
	return navigator.appName.toLowerCase()=='netscape' ;
}

function Input(oInput)
{
//onerror=function (sError,sURL,iLine){	return ClassException('Input',sError,sURL,iLine); }
var iMaxSize;
this.iMaxSize=iMaxSize;
oInput.iMaxSize=iMaxSize;
oInput.AddToPosition=AddToPosition;
this.AddToPosition=AddToPosition;

oInput.BlockHebChar=BlockHebChar;
this.BlockNonHebChar=BlockNonHebChar;
oInput.BlockNonHebChar=BlockNonHebChar;
this.BlockHebChar=BlockHebChar;
oInput.BlockNonEnglishChar=BlockNonEnglishChar;
this.BlockNonEnglishChar=BlockNonEnglishChar;
oInput.BlockNonNumericChar=BlockNonNumericChar;
this.BlockNonNumericChar=BlockNonNumericChar;
this.BlockNonFloatChar=BlockNonFloatChar;
oInput.BlockNonFloatChar=BlockNonFloatChar;	
oInput.BlockCR=BlockCR;
this.BlockCR=BlockCR;
oInput.BlockNonPriceChar=BlockNonPriceChar;
this.BlockNonPriceChar=BlockNonPriceChar;
this.BlockNonEnglishNumericChar=BlockNonEnglishNumericChar;
oInput.BlockNonEnglishNumericChar=BlockNonEnglishNumericChar;	

this.Sort = Sort;
oInput.Sort = Sort;
this.FixUrl=FixUrl;
oInput.FixUrl=FixUrl;	
this.CheckEmail=CheckEmail;
oInput.CheckEmail=CheckEmail;	
this.getContentSize=getContentSize;
oInput.getContentSize=getContentSize;	
this.MaxLength=MaxLength;
oInput.MaxLength=MaxLength;	
this.CheckLength=CheckLength;
oInput.CheckLength=CheckLength;	
this.getObjectIndex=getObjectIndex;
oInput.getObjectIndex=getObjectIndex;	
this.Rename=Rename;
oInput.Rename=Rename;	
this.getDoubleItem=getDoubleItem;
oInput.getDoubleItem=getDoubleItem;	
this.Replace=Replace;
oInput.Replace=Replace;	
this.isEmpty=isEmpty;
oInput.isEmpty=isEmpty;	
this.DisableIsValid=DisableIsValid;
oInput.DisableIsValid=DisableIsValid;	

	function DisableIsValid(oArrEnable,oArrDisable,sClassEnable,sClassDisable)
	{
		var bState = oInput.checked;

		for (var i=0;i<oArrEnable.length;i++)
		{
			oArrEnable[i].disabled=bState;
			oArrEnable[i].className=!bState?sClassEnable:sClassDisable;
		}

		for (var i=0;i<oArrDisable.length;i++)
		{
			oArrDisable[i].disabled=!bState;
			oArrDisable[i].className=bState?sClassEnable:sClassDisable;
		}						
	}


	function isEmpty()
	{
		for (var i=0;i<oInput.value.length;i++)
			if(oInput.value.charAt(i)!=' ')
				return false;
		return true;
	}
	function getDoubleItem()
	{
		var arrMyList = new Array() ;
		var counter ;
		for (counter = 0; counter < oInput.length-1 ; counter++)
			if (!arrMyList[oInput[counter].value])
				arrMyList[oInput[counter].value] = 1 ; 
			else
				return counter ;
		return null ;
	}

	function getObjectIndex(oArr)
	{
		var i=0;
		for (i=0;i<oArr.length;i++)
		{ 
			if (oInput==oArr[i])
				return i;
		}    
		return null;

	}

	function MaxLength(iMaxLength)
	{
		oInput.iMaxSize=iMaxLength-1;
		oInput.onkeypress=ConCat;
	}
	
	function ConCat()
	{
		if (oInput.iMaxSize<getContentSize())
		{
				oInput.innerText=oInput.innerText.substring(0,oInput.iMaxSize);
				//alert('less then' + (oInput.iMaxSize + 1) + ' chars')
		}
	}
	
	function CheckLength(iSize)
	{
		var arr=oInput.value.split(' ');
		
		for (i=0;i<arr.length;i++)
			if (arr[i].length>iSize)
				return false;
		return true;
	}	

	function Rename(sNewRadioName)
	{
		var oParent=oInput.parentNode;
		var oClone=document.createElement('<INPUT name="' + sNewRadioName + '">');
		oClone.type=oInput.type;
		oClone.onclick=oInput.onclick;
		oClone.value=oInput.value;
		var bChecked=oInput.checked;
		oParent.removeChild(oInput);
		oParent.appendChild(oClone);
		oClone.checked=bChecked;
	}

	function getContentSize()
	{
	return getContent().length;
	}
	
	function getContent()
	{
	if (!oInput.value)
		return oInput.innerText;
	else
		return oInput.value;
	}
	
	function CheckEmail()
	{
		return (oInput.value.indexOf("@")> 1 && oInput.value.lastIndexOf(".") > oInput.value.indexOf("@") + 2 );
	}

	function FixUrl()
	{
		if (oInput.value.indexOf("mailto:")!=-1 || oInput.value.indexOf("http://")!=-1) return ;
		if (oInput.value.indexOf("@")!=-1)
			oInput.value = "mailto:" + oInput.value
		else
			if (oInput.value.indexOf("www")!=-1)
				if (oInput.value.indexOf("http")==-1)
					oInput.value = "http://" + oInput.value
	}	
	
	function AddToPosition(sText)
	{
		oInput.focus();
		document.selection.createRange().text=sText;
	}
	
	function BlockCR(e) 
	{
		var PressedKey = getKeyCode(e);	
		
		if (PressedKey==13) 
			if (!isNetScapeNavigator()) window.event.returnValue = 0;
	}

	function BlockNonHebChar(e) 
	{
		var PressedKey = getKeyCode(e);			
		if (!((PressedKey>=1488) && (PressedKey<=1514)) || !PressedKey==39) 
			if (!isNetScapeNavigator()) window.event.returnValue = 0;
	}
	function BlockNonEnglishNumericChar(e) 
	{
		var PressedKey = getKeyCode(e);			
		if (!(
			(PressedKey>=97 && PressedKey<=122) || 
			(PressedKey>=48 && PressedKey<=57) || 
			(PressedKey==45 ) || 
			(PressedKey==95) || 
			(PressedKey>=65 && PressedKey<=90)) 
			)
			if (!isNetScapeNavigator()) window.event.returnValue = 0;
	}
	function BlockHebChar(e) 
	{
		var PressedKey = getKeyCode(e);		
		if ((PressedKey>=1488) && (PressedKey<=1514) ) 
			if (!isNetScapeNavigator()) window.event.returnValue = 0;

	}
	function getKeyCode(e)
	{
		return isNetScapeNavigator()?  e.which : window.event.keyCode;
	}
	function BlockNonNumericChar(e) 
	{
		var PressedKey = getKeyCode(e);		
		if (!(PressedKey>=48 && PressedKey<=57))
			if (!isNetScapeNavigator())  window.event.returnValue = 0;
	}
	function BlockNonFloatChar(e) 
	{
		var PressedKey = getKeyCode(e);		
		if (!(PressedKey>=46 && PressedKey<=57))
			if (!isNetScapeNavigator())  window.event.returnValue = 0;
	}
	function BlockNonPriceChar(e) 
	{
		var PressedKey = getKeyCode(e);		
		if (!(
			   (PressedKey>=48 && PressedKey<=57) || 
			    PressedKey==46)
			  )
			if (!isNetScapeNavigator())  window.event.returnValue = 0;
	}
	
	function BlockNonEnglishChar(e) 
	{
		var PressedKey = getKeyCode(e);						
		if (!(
			(PressedKey>=97 && PressedKey<=122) || 
			(PressedKey>=65 && PressedKey<=90)) 
			)
			if (!isNetScapeNavigator()) window.event.returnValue = 0;
	}
	
	function Replace(sBefore,sAfter)
	{
		var oRE			= new RegExp(sBefore,'g');
		oInput.value	= oInput.value.replace(oRE,sAfter);
	}
	
	function Sort(ArrInput, IsCaseSensitive)
	{
		var arrSort = new Array(ArrInput.length);
		var sInput
		for (i = 0; i < arrSort.length; ++i)
		{
			sInput = ArrInput[i].value
			if (IsCaseSensitive)
				arrSort[i] = sInput;
			else
				arrSort[i] = sInput.toLowerCase();

		}

		arrSort = arrSort.sort();

		var index = 0;
		for (i = 0; i < arrSort.length; ++i)
			for (j = 0; j < arrSort.length; ++j)
			{
				sInput = ArrInput[j].value;
				if (!IsCaseSensitive)
					sInput = sInput.toLowerCase();
				if (arrSort[i] == sInput)
					oInput[j].value = ++index;
			}
	}	
	
}

function ChangeSecurityQuestion(type)
				{
					switch(type)
					{
						case 'nanaList':						
							document.getElementById('containerNanaSecurityQuestion').style.display = '';
							document.getElementById('containerUserSecurityQuestion').style.display = 'none';
							document.getElementById('SecurityQuestionType').value = 1;
							break;
						case 'userQ':						
							document.getElementById('containerNanaSecurityQuestion').style.display = 'none';
							document.getElementById('containerUserSecurityQuestion').style.display = '';
							document.getElementById('SecurityQuestionType').value = 2;
							break;
					}
				}
				
				function CheckUserName(name)
				{		
				    					
					switch(name)
					{
						case 'UserName':
							if(document.getElementById('UserName').value=='')
							{
								alert('×™×© ×œ×”×–×™×Ÿ ×©× ×ž×©×ª×ž×©')
								return;
							}
							document.getElementById('ifrAlternateUserNames').src='Form.asp?s=100&pid=48&UserName='+document.getElementById('UserName').value;	
							document.getElementById("takenNick").style.display="inline-block";
							break;
						case 'NickName':
							if(document.getElementById('NickName').value=='')
							{
								alert('×™×© ×œ×”×–×™×Ÿ ×›×™× ×•×™')
								return;
							}
							
							document.getElementById('ifrAlternateUserNames').src='Form.asp?s=101&pid=48&UserName='+document.getElementById('NickName').value;	
							break;
						case 'ChatName':
							if(document.getElementById('ChatName').value=='')
							{
								alert('×™×© ×œ×”×–×™×Ÿ ×›×™× ×•×™')
								return;
							}
							
							document.getElementById('ifrAlternateUserNames').src='Form.asp?s=101&pid=48&UserName='+document.getElementById('ChatName').value;	
							break;	
					}					
				}	
				

function RevealUserOptions()
{
	var nome = document.getElementById("userOptions");
	
	if (nome.style.display=="block")
	{	
		document.getElementById("userOptions").style.display="none";
	}
	else
	nome.style.display="block";
}	
				
				
				
	function fCheckFields()
		{																
			var sError = '';
			var oInput=new Input(document.S2.Email);												 
			if((document.S2.Password.value.length) < 6)
			{
				sError='*×”×¡×™×¡×ž×” ×—×™×™×‘×ª ×œ×”×™×•×ª ×‘×¢×œ×ª 6 ×ª×•×•×™× ×œ×›×œ ×”×¤×—×•×ª.<br/>'
			}
			
			if (oInput.CheckEmail()!=true && document.S2.Email.value!=''){sError= sError + '*×“×•××¨ ××œ×§×˜×¨×•× ×™ ×œ× ×ª×§×™×Ÿ.<br/>'}
			if(document.S2.UserName.value==''){sError= sError + '*×™×© ×œ×ž×œ× ×©× ×ž×©×ª×ž×©.<br/>'}
			if(!document.S2.chbTermsOfUse.checked){sError= sError + '*×™×© ×œ××©×¨ ××ª ×”×ª× ××™× ×œ×—×‘×¨×•×ª ×‘×ž×•×¢×“×•×Ÿ.<br/>'}						
			if(sError!='')
			{
				alert("×× × ×‘×“×•×§ ××ª ×”×¤×¨×˜×™× ×©×•×‘")
				sError='<b>×× × ×ª×§×Ÿ ××ª ×”×“×‘×¨×™× ×”×‘××™×:</b><br/>' + sError ;
				return false;
			}
			
		}
		
			function TwistNShow()
				{
					var takanon = document.getElementById('rulesOfUsage');
					var secBlock = document.getElementById('securityBlock');
					var isCheckBox = document.getElementById('chbTermsOfUse');
					
					if (takanon.style.display == 'block' && isCheckBox.checked==true)
					{
						takanon.style.display = 'none';
						secBlock.style.display = 'block';
					}

				}
				
			function ShowTakanon()
			{
				var takanon = document.getElementById('rulesOfUsage');
				var secBlock = document.getElementById('securityBlock');
				
				if (takanon.style.display == 'none')
				{
						takanon.style.display = 'block';
						secBlock.style.display = 'none';
				}
				else
					takanon.style.display = 'none';
			}
			
			function RevealPass()
			{
				var passBox = document.getElementById('newUserPass');
				passBox.setAttribute('type','text');
				
			}
				
}catch(e){}


//======== InputCollection.js

try
{
/*
	script take care of Array Input fields
	01/04/03 Shay Lapid
*/
function InputCollection(oArr)
{
//onerror=function (sError,sURL,iLine){	return ClassException('InputCollection',sError,sURL,iLine); }
oArr.Replace=Replace;
this.Replace=Replace;
oArr.isRadioChecked=isRadioChecked;
this.isRadioChecked=isRadioChecked;
oArr.Toggle=Toggle;
this.Toggle=Toggle;
	function Replace(sBefore,sAfter)
	{
		for (var i=0;i<oArr.length;i++)
			new Input(oArr[i]).Replace(sBefore,sAfter);
	}
	
	function isRadioChecked()
	{
		for(var i=0;i<oArr.length;i++)
			if(oArr[i].checked)
				return true;
		return false;
	}
	function Toggle()
	{
		for(var i=0;i<oArr.length;i++)
			oArr[i].checked=!oArr[i].checked;
	}
	
}
}catch(e){}


//======== AutoComplete.js

try
{

function AutoComplete ( oInput,sWebserviceURLBase ,iSize,sDefaultValue,iDefaultID){ 
	var oArrGlobal=new Array();
	var oDivAbs;
	var oSelect;
	var bSafe=true;
	var sParam='';
	new Div(oInput)
	this.AddElements=AddElements;
	this.getValue=getValue;
	this.setValue=setSelectInit;
	this.setParam=setParam;
	oInput.onkeyup=keyAction;
	if (!iSize) iSize=3;
	Init();
	
	function getParam4Arr(){ return 'Param' + sParam;}
	function setParam(sValue){		sParam=sValue; }
	function getName(sPrefix){		return sPrefix + '_' + oInput.name;	}
	function getLetter(){			return oInput.value.substring(0,1);	}
	function getId(sPrefix)	{		return sPrefix + '_' + oInput.id	}
	function getKeyCode(e){			return isNetScapeNavigator()?  e.which : window.event.keyCode;	}
	function selectChanged (e){		oInput.value=oSelect[oSelect.selectedIndex].text;	}
	function getValue(){			return oSelect.value==''?-1:oSelect.value;		}
	
	function Init( ){
		oDivAbs=document.getElementById(getId('div'));
		
		if (oDivAbs) 
		{
			new Div( oDivAbs ).RemoveNode(); 
		}
		var sHTML=
			'<div id="' + getId('div') + '" style="display:none;Position:absolute;padding-Right:5px;">'+
				'<iframe name="' + getName('iframe') + '" id="' + getId('iframe') + '" height="0" width="0" marginwidth="0" marginheight="0" hspace="0" vspace="0" scrolling="no" frameborder="0"></iframe>'+
				'<select z-index=900 name="' + getName('sel') + '" id="' + getId('sel') + '" size="' + iSize + '">'+
				'</select>' +
			'</div>'

		var oAddDiv=oInput.parentNode;
		new Div(oAddDiv)

		oAddDiv.insertAdjacentHTML("beforeEnd", sHTML)
		oDivAbs=document.getElementById(getId('div'));
		new Div(oDivAbs)
		oDivAbs.Close();
		oSelect=document.getElementById(getName('sel'));
		
		oSelect.onchange=selectChanged;
		oSelect.onclick=function()
		{
			oDivAbs.Close();
			bSafe=false;
		}
		
		oInput.onblur=function()
		{
			if (oSelect.length>0)
			{
				if (bSafe)
				{
					if (oSelect.selectedIndex==-1 && oSelect.length>0)
						oSelect.selectedIndex=0; 
					oDivAbs.Close(); 
				}
				bSafe=true;
				selectChanged();
			}
		}
		
		if (sDefaultValue)
		{
			setSelectInit(sDefaultValue,iDefaultID);
		}
	}
	function setSelectInit(sText,iId)
	{
		oSelect.length=0;
		oInput.value = sText;
		var iIdx=++oSelect.length-1;
		oSelect.options[iIdx].text=sText;
		oSelect.options[iIdx].value=iId;
		oSelect.selectedIndex=iIdx;
	}
	function setLocation()
	{
		var sLetter=getLetter();
		frames[getName('iframe')].location = sWebserviceURLBase + sLetter + '&' + sParam;
	}
	function selectChange(iAdd)
	{
		if (oSelect.length<=0) return;
		
		if (iAdd>0 )
			oSelect.selectedIndex+=oSelect.selectedIndex + iAdd > oSelect.length-1 ? 0 : iAdd;
		else
			oSelect.selectedIndex + iAdd < 0 ? oSelect.selectedIndex=oSelect.length-1 : oSelect.selectedIndex+=iAdd;
		
		selectChanged ();
	}
	function keyAction(e)
	{
		var sLetter=getLetter();
		if (sLetter=='' ||sLetter==' ') 
		{
			oSelect.length=0;
			oDivAbs.Close();
			return;
		}
		var sKeyCode=getKeyCode(e);
		if (getKeyCode(e)==13) 
		{
			oDivAbs.Close();
			if (oSelect.selectedIndex==-1)oSelect.selectedIndex=0;
			selectChanged();
		}
		else if (sKeyCode==40 || sKeyCode==37) 
			selectChange(+1);
		else if (sKeyCode==38 || sKeyCode==39) 
			selectChange(-1);
		else if ((!oArrGlobal[getLetter()]||!oArrGlobal[getLetter()][getParam4Arr()]) && sWebserviceURLBase)
		{
			setLocation();
		}else
			fillSelect();
	}
	function fillSelect()
	{
		var oArrLocal=oArrGlobal[getLetter()][getParam4Arr()];
		var iIdx=0;
		oSelect.length=0;
		for (var i=0;i<oArrLocal.length;i++)
			if (oArrLocal[i]['Name'].indexOf(oInput.value)>=0)
			{
				iIdx=++oSelect.length-1;
				oSelect.options[iIdx].text=oArrLocal[i]['Name'];
				oSelect.options[iIdx].value=oArrLocal[i]['Value'];
			}

		oSelect.length>0?oDivAbs.Open():oDivAbs.Close();
		
		oDivAbs.LocationBest(oInput);				
	}
	function AddElements(oArrSrc)
	{
		if (!oArrSrc.length ) 
		{
			var sLetter=getLetter();
			oArrGlobal[sLetter]=new Array();
			oArrGlobal[sLetter][getParam4Arr()]=new Array();;
			oDivAbs.Close();
			
			return;
		}
		var sKey=oArrSrc[0]['Name'].substring(0,1);
		oArrGlobal[sKey] = new Array();
		oArrGlobal[sKey][getParam4Arr()] = oArrSrc;
		fillSelect();
	}
}

}catch(e){}


//======== Exception.js

try
{
/*
	script take care of exception (use in development only)
	01/04/03 Shay Lapid
*/
function DiplayException(sMsg)
{
	sEnvironment!=''?alert(sMsg):status=sMsg;
}
function getExceptionDelimiter()
{
	return sEnvironment!=''?'\n':'; ';
}
function ClassException(sClassName , sDescription , sURL , iLine)
{
	var sDelimiter	= getExceptionDelimiter();
	var sError		=	'Class:'+ sClassName + sDelimiter +
						'Err:' + sDescription + sDelimiter +
						'Line:' + iLine ;
	DiplayException(sError);
	return true;
}

function NanaException(sErrorMessage,sUrl,iLine) 
{
	var sDelimiter	= getExceptionDelimiter();
	var sError=
		'Err: ' + sErrorMessage  + sDelimiter +
		'Url : ' + sUrl + sDelimiter +
		'Line: ' + iLine ;
	DiplayException(sError);

return true;	
}
onerror = NanaException;


}catch(e){}


//======== ImagePopup.js

try
{
/*
	script take open window by image size to display
	13/09/04 Shay Lapid
*/
function ImagePopup(sImg)
{
	var oImg = new Image(); 
	oImg.src = sImg;
	
	if (oImg.complete ) OpenPopup();
	oImg.onload=OpenPopup;
	
	function OpenPopup()
	{	
		var iScrollSize=20;
		var iWidth=oImg.width;
		var iHeight=oImg.height;
		myWindow = window.open(sImg, "tinyWindow", 'width=' + (iWidth + iScrollSize) + ',height=' + (iHeight + iScrollSize) ); 
	}
}


}catch(e){}


//======== ClickReport.js

try
{
function ClickReport(sObjectName,sInstanceID,sSecInstanceID,iLocationID,Optional1,Optional2,Optional3)
{
	var oDate		= new Date();
	var sFullURL	= naSTATISTICS_COLLECT_URL + 'ObjectName=' + sObjectName + '&InstanceID=' + sInstanceID;
	var bStatsReported = false;
	
	try
	{
		if (PartnerID) sFullURL+='&PartnerID=' + PartnerID;		
	}catch(e){}
	
	try
	{		
		if (ServiceID) sFullURL += '&ServiceID=' + ServiceID;
	}
	catch(e){}
	
	if (typeof(iLocationID) != "undefined" && iLocationID != null) sFullURL += '&LocationID=' + iLocationID;
	if (typeof(sSecInstanceID) != "undefined" && sSecInstanceID != null) sFullURL += '&SecInstanceID=' + sSecInstanceID;
	if (typeof(Optional1) != "undefined" && Optional1 != null) sFullURL += '&Optional1=' + Optional1;
	if (typeof(Optional2) != "undefined" && Optional2 != null) sFullURL += '&Optional2=' + Optional2;
	if (typeof(Optional3) != "undefined" && Optional3 != null) sFullURL += '&Optional3=' + Optional3;

	sFullURL += '&d=' + oDate.toString();
	
	var oImage = new Image();
	oImage.src = sFullURL;
	
	return true;
}
}catch(e){}


//======== Cookies.js

try
{

function Cookie(sCookieName)
{
	//onerror=function (sError,sURL,iLine){	return ClassException('Cookie',sError,sURL,iLine); }
	// This function save cookie
	this.setCookie=setCookie;
	this.getCookie=getCookie;
	this.sCookieName=sCookieName;
	
	function setCookie(sValue,iMinutes,sDomain) {
		if (iMinutes) {
			var date = new Date();
			date.setTime(date.getTime()+(iMinutes*60*1000))
			var expires = "; expires="+date.toGMTString()
		} else expires = ""
		var sCookieCont=sCookieName+"="+sValue+expires+"; path=/"
		sCookieCont += sDomain!="" && sDomain ?	" ; domain="+sDomain : " ; domain="+location.host;
		document.cookie = sCookieCont
	}
	// This function read the cookie that was saved by saveCookie function
	function getCookie() {
		var nameEQ = sCookieName + "="
		var ca = unescape( document.cookie).split(';')
		var sCookie
		for(var i=0;i<ca.length;i++) 
		{
			sCookie = ca[i];
			while (sCookie.charAt(0)==' ') sCookie = sCookie.substring(1,sCookie.length)
				if (sCookie.indexOf(nameEQ) == 0) return sCookie.substring(nameEQ.length,sCookie.length)
		}
	}
}
}catch(e){}


//======== ToolTip.js

try
{
/*
	script take care of the tooltip object open the div and design it
	20/04/03 Shay Lapid
*/
var oToolTipLastAccess
var arrToolTip=new Array();

function ToolTipDisplay(oHref,iType,sTitle,sSubTitle)
{
	var oInterVal;	
	if(!arrToolTip[iType])
	{
		var sToolTipName='divToolTip' + iType;
		arrToolTip[iType]=new Array();
		arrToolTip[iType]['ToolTip']=document.getElementById(sToolTipName);
		new Div(arrToolTip[iType]['ToolTip']);
		arrToolTip[iType]['Title']=arrToolTip[iType]['ToolTip'].all('Title');
		arrToolTip[iType]['SubTitle']=arrToolTip[iType]['ToolTip'].all('SubTitle');
	}

	if ( arrToolTip[iType]['ToolTip']  )
	{
		arrToolTip[iType]['ToolTip'].Open();
		if (oToolTipLastAccess != oHref)
		{
			arrToolTip[iType]['Title'].innerHTML=sTitle;
			arrToolTip[iType]['SubTitle'].innerHTML=sSubTitle;
			oHref.onmousemove	= function (e)
			{
				arrToolTip[iType]['ToolTip'].PositionBest(e);
				/*
				clearTimeout(this.oInterVal);
				this.oInterVal=setTimeout(arrToolTip[iType]['ToolTip'].FadeOut,15000);
				*/
			}
			oHref.onmouseout	= function (){arrToolTip[iType]['ToolTip'].Close();}
			oToolTipLastAccess=oHref
		}
	}
	
}



}catch(e){}
