	$=jQuery;
	$.urlParam = function(name){
    var results = new RegExp('[\?&]' + name + '=([^&#]*)').exec(window.location.href);
	    if (results==null){
       return null;
    	}
	    else{
    	return results[1] || 0;
	    }
	}
	var bash_gPath='http://www.itla.org.il/';
function bashReadMore(divID){
	tmpTxt=jQuery('#'+divID).html();
txt='<div class="screenGray" style="z-index:99999" onclick="clearMe(\'mainNoteDiv\');" ></div><div class="afterPrceNote" id="afterPrceNote" style="z-index:100000"><br />'+ tmpTxt+'<input class="butUI" type="button" value="סגירה" id="closeButton" onclick="clearMe(\'mainNoteDiv\');" /></div>';
jQuery('#mainNoteDiv').html(txt);
jQuery('#mainNoteDiv').fadeIn(700);
//$('.butUI').button();

	}
function noteMe(divID, str){
txt='<div class="screenGray" style="z-index:103000" onclick="clearMe(\''+divID+'\');" ></div><div class="afterPrceNote" id="afterPrceNote" style="z-index:103001"><br />'+ str+'<input class="butUI" type="button" value="סגירה" id="closeButton" onclick="clearMe(\'mainNoteDiv\');" /></div>';
jQuery('#'+divID).html(txt);
jQuery('#'+divID).fadeIn(700);
//$('.butUI').button();
}

function dest_noteMe(divID, str){
txt='<div class="screenGray" style="z-index:103000" onclick="clearMe(\''+divID+'\');" ></div><div class="afterPrceNote dest_block10" id="afterPrceNote" style="z-index:103001"><br />'+ str+'<input class="butUI" type="button" value="סגירה" id="closeButton" onclick="clearMe(\'mainNoteDiv\');" /></div>';
jQuery('#'+divID).html(txt);
jQuery('#'+divID).fadeIn(700);

}
function clearMe(divID){
jQuery('#'+divID).fadeOut(700);
window.setTimeout(function() {$('#'+divID).html('');}, 771);
}
	

function autoCompBackArr(arr,val){
backM=false;
	jQuery.each(arr, function(i,v) {
		if(arr[i]==val && i!='source'){
		backM=i;
		}
	});
return backM;	
}
	
function	bs_changeDest(){
spanTxt='<input id="cSearch" bashro_sa="s" style="margin-bottom:0;width:120px;" class="fSearch" type="text" autocomplete="off" name="cSearch" value=""  onkeyup="bashSearchCity(this.id);" >';
$('#the_bashro_s_span').html(spanTxt);
$('#robash_s_id').val('');
$('#the_s_destName').val('');
$('#cSearch').focus();
}
function slctMyDest(myE){
$('#cSearch').val($(myE).html());
	if($("#file_version").length == 0) {}else{$('#file_version').val($(myE).attr('id'));		}
	if($("#robash_s_id").length == 0) {}else{$('#robash_s_id').val($(myE).attr('id'));		}
	if($("#bash_dest_father").length == 0) {}else{$('#bash_dest_father').val($(myE).attr('id'));		}
	if($("#bashro_sa").length == 0) {
	$('#cSearch').focus();
	}
	else{
		if($("#bashro_sa").val()=='s'){
		curDest= $(myE).html();
		$('#the_s_destName').val(curDest);
//		cleanDestName=curDest.replace(/-/g,'');
//		cleanDestName=replace(/ +$/, '');
		spanTxt=curDest+'&nbsp;&nbsp;&nbsp;&nbsp;<span id="bs_changeDestSpan" onclick="bs_changeDest();" class="redMust f10">X שנה יעד</span>';
		$('#the_bashro_s_span').html(spanTxt);
		}
	}
	$('#showMyLike').html('');
}
function clean_wRes(curID,divID,inptID){
$('#'+inptID).focus();
$('#'+curID).html('');
$('#'+divID).html('');
$('#'+inptID).val('');	
}
function bash_search_for(s_w,s_dest,s_fCats,s_s_date,s_f_date){
//$div_to_display	
//$array
}
function slctMy_globalWhere(dType,dEN,dFEN,wUS,dHE,sType,dID){
	if(sType=='goToDest' || sType=='goToDest2'){
	dest_noteMe('mainNoteDiv','<div class="loadingBG_div"><h1>הנכם מועברים לדף הראשי של '+dHE+'</h1><img src="'+bash_gPath+'bash-xtra/img/icon_loading.gif" /></div>');
	window.location.replace(bash_gPath+"destinations/"+dHE.split(' ').join('-'));
	}
	else{
	sName=dHE+'('+dEN+', '+dFEN+')';
	$('#cSearch_'+sType).val(sName);
	$('#cSearch_'+sType).focus();
	$('#showMyLike_'+sType).html('');
	
		if(sType=='weather_s'){
		$('#clean_w_res_'+sType).html('<span onclick="clean_wRes(\'clean_w_res_'+sType+'\',\'bash_side_w_res_'+sType+'\',\'cSearch_'+sType+'\')">חיפוש חדש</span>');
			$.post(bash_gPath+"bash-proce/destProce.php",
				{doW:'destComp_w_call',d_type:dType,d_EN:dEN,d_fEN:dFEN,d_us:wUS,d_he:dHE,d_sType:sType},
				function(data){
					if (data!=''){
					$('#bash_side_w_res_'+sType).html(data);						
					}
				},
				'text'
			);
	
		}
		else if(sType=='destToQ'){
		$('#hidden_'+sType).val(dID);
		}		
	
	}
	
	

}


function bashSearch_global(tID,sType){
sVal=$('#'+tID).val();
inWidth=$('#'+tID).width();
	if (sVal.length>0){
		$.post(bash_gPath+"bash-proce/destProce.php",
		{doW:'destComp_w',dVal:sVal,d_sType:sType},
		function(data){
			if (data!=''){
			var suggestions = [];
	        var dList='';    
				$.each(data, function(i, val) {
    	        suggestions.push(val); 
				tmp_R=val.split(',');
				nameCheck=tmp_R[4]+' ('+tmp_R[1]+', '+tmp_R[2]+')';
				if 	( nameCheck.indexOf('undefined') > -1){
					dList+='<div class="auto_dest_list" style="display:block;width:'+inWidth+'px" id="'+i+'">לא נמצאו יעדים מתאימים</div>';
				}
				else{
				dList+='<div class="auto_dest_list" style="display:block;width:'+inWidth+'px" id="'+i+'" onclick="slctMy_globalWhere(\''+tmp_R[0]+'\',\''+tmp_R[1]+'\',\''+tmp_R[2]+'\',\''+tmp_R[3]+'\',\''+tmp_R[4]+'\',\''+sType+'\',\''+i+'\')">'+nameCheck+'</div>';
				}
				});
				$('#showMyLike_'+sType).html(dList);
			
			}
		},
		'json'
		);
	}
	else {}
}

function displayZone(lat, lng){
	tKey=$('#bash_clock_Key').val();
	var tz = new TimeZoneDB;
	tz.getJSON({
		key:tKey,
		lat: lat,
		lng: lng
	}, function(data){
		tmpTS=(data.timestamp-(60*60*3)	)*1000;
		dt=new Date(tmpTS);
		dt_h = dt.getHours();
		dt_m= dt.getMinutes();
		dt_s= dt.getSeconds();
		if (dt_h<10){dt_h='0' + dt_h;}
		if (dt_m<10){dt_m='0' + dt_m;}
		if (dt_s<10){dt_s='0'+dt_s;}
		$('#time_space').html('<img src="'+bash_gPath+'bash-xtra/img/icon_clock2.png"/>'+dt_h+':'+dt_m+':'+dt_s);
	});
}


function bashSearchCity(tID){
sVal=$('#'+tID).val();
inWidth=$('#'+tID).width();
	if (sVal.length>0){
		$.post(bash_gPath+"bash-proce/destProce.php",
		{doW:'destComp',dVal:sVal},
		function(data){
			if (data!=''){
			var suggestions = [];
	        var dList='';    
				$.each(data, function(i, val) {
    	        suggestions.push(val); 
				dList+='<div class="auto_dest_list" style="display:block;width:'+inWidth+'px" id="'+i+'" onclick="slctMyDest(this)">'+val+'</div>';
				});
				$('#showMyLike').html(dList);
			}
		},
		'json'
		);
	}
	else {}
}




/*function rollingWhat(){
if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) {
return '1';
}
else{return '0';}
}*/