function opFM(mId){ 
	href='';
	switch(mId){
		
		case 1: href='?comp=travel&cmd=iran-one-day-tours'; break;
		case 2: href='?comp=travel&cmd=iran-tours'; break;
		case 9: href='?comp=travel&cmd=outgoing-tours'; break;
		case 3: href='?comp=travel&cmd=ordered-tours'; break;
		case 5: href='?comp=photo-gallery'; break; 
		case 11: href='?comp=wiki'; break;
		
		case 1: href='?comp=travel&cmd=iran-one-day-tours'; break;
		case 1: href='?comp=travel&cmd=iran-one-day-tours'; break;
		case 1: href='?comp=travel&cmd=iran-one-day-tours'; break;
	}
	window.open(href, '_self'); 
}

function varDateChngd(obj){
	if(obj.value==1){
		fObj("tourStCntr").style.display="none";
	}else{
		fObj("tourStCntr").style.display="block";
	}
}

function loginFrmChk(evt){
	if(fObj('uName').value && (fObj('uName').value!='Email') && fObj('pWord').value && (evt.keyCode==13)){
		fObj('mainSignInFrm').submit();
	}
}

function CreateBookmarkLink(){

 title = " سایت دید ایران، مرجع سفر، تور و تفریحات - DidIran.com Iran's tour & travel guide "; 
  
 url = "http://www.didiran.com";

	if (window.sidebar) { 
		window.sidebar.addPanel(title, url,"");
	} else if( window.external ) { 
		window.external.AddFavorite( url, title); }
	else if(window.opera && window.print) { 
		return true; }
 }

function tMOver(num){
	var i=1;
	while(i<11){
		if(fObj('topSubMenu_'+i)) fObj('topSubMenu_'+i).style.display = (i==num) ? 'block' : 'none';
		i++;
	}
}

var dMOut;
function tMOut(){
	clearTimeout(dMOut);
	dMOut=setTimeout(function(){tMOver(fObj('slctdTMTab').value);}, 5000);	
}

function fObjT($tagName, $srchId){
	var e; 
	e=document.getElementsByTagName($tagName); 
	if(e){
		if($srchId){
			var oArr = new Array();
			for(var i in e){
				if(e[i] && e[i].id && e[i].id.match($srchId)){
					oArr.push(e[i]);
				} 
			}
			return oArr;
		}else{return e;}
	}else{return(false);}
}
	
function dspHiImg(imgPath, title, shouldLogVisit){
	if(!imgPath) return;
	hEM.createScreenMask();
	// /di-images/logo_didiran.png
	var html = '<table class="hiPicCss" border="0"><tr><td colspan="3">&nbsp;</td></tr><tr><td width="20%">&nbsp;</td><td ><div><img class="hiImgTmp" src="'+imgPath+'" ></div><div>'+title+'</div></td><td width="20%">&nbsp;</td></tr><tr><td colspan="3">&nbsp;</td></tr></table>';
	fObj('genScreenMaskCntnr').innerHTML = html;
	fObj('genScreenMask').style.display = 'block';
	if(shouldLogVisit)AjTD.sIt('comp=main&cmd=logVst&visInfo='+shouldLogVisit, "dCBF($response)" );	
	
} 

function dCBF(){}//dummy callback function

function sugCall($response, uprId, cookieId){
	if($response){
		if(!ajResV.validate($response)){return false;}
		//alert(ajResV.m_res);
		
	}else{
		$value = 'comp=main&cmd=sugCall&uprId='+uprId+'&cookieId='+cookieId;
		AjTD.sIt($value, "sugCall($response)" );	
		
	}
};

function sndCallRqst($response){
	if($response){
		if(!ajResV.validate($response)){return false;}
		//alert(ajResV.m_res);
		
	}else{
		
		cNameChat = fObj('cNameChat').value;
		cMobChat = fObj('cMobChat').value;

		$value = 'comp=main&cmd=sndCallRqst&cMobChat='+cMobChat+'&cNameChat='+cNameChat;
		html_mask_mgmt.cancel();
		AjTD.sIt($value, "sndCallRqst($response)" );	
	}
};

function iCalled($response, cRId){
	if($response){
		if(!ajResV.validate($response)){return false;}
		//alert(ajResV.m_res);
		
	}else{
		$value = 'comp=main&cmd=iCalled&cRId='+cRId;
		AjTD.sIt($value, "iCalled($response)" );	
		
	}
};

function dspCallOffer(){
	html_mask_mgmt.inps = fObj('callOfferCntnr').innerHTML;
	fObj('callOfferSbjctCntnr').innerHTML = callOfferSbjct;
	html_mask_mgmt.showPanel();
	
};

function numFormat(nStr){
	nStr += '';
	x = nStr.split('.');
	x1 = x[0];
	x2 = x.length > 1 ? '.' + x[1] : '';
	var rgx = /(\d+)(\d{3})/;
	while (rgx.test(x1)) {
		x1 = x1.replace(rgx, '$1' + ',' + '$2');
	}
	return x1 + x2;
};

function unicIt(num,t){
	//if(!t)t='fa';
	if(t == 'fa'){
		var out = '';
		for(var e in num){
			var chr = parseInt(num[e]);
			if((chr=='0') || ((chr>0) && (chr<10))){
				out += fDArr[chr];
			}else{
				out += num[e];
			}
		}
		return out;
	}
	return num;
};

var canChngPrsntType; canChngPrsntType = 1;
function cLPTp($response, evt){
	//chngListPrsntType
	if($response){
		if(!ajResV.validate($response)){return false;}
		canChngPrsntType=0;
		setTimeout(function(){canChngPrsntType=1;}, 10000);
		//alert(ajResV.m_res);
	}else{
		evt.preventDefault(); 
		evt.stopPropagation();
		evt.returnValue=false;
		if(canChngPrsntType==0)return;
		$value = 'comp=main&cmd=cLPTp';
		AjTD.sIt($value, "cLPTp($response)" );	
	}
};

function gCFrm($response,cmntCat,cmntId){
	//get comment form
	if($response){
		hEM.introOff();
		if(!ajResV.validate($response)){return false;}
		var dtl = ajResV.m_res;//.split('[*[');
		html_mask_mgmt.inps = dtl; 
		html_mask_mgmt.showPanel();
		/*
			var rateBarId = dtl[0];
			var msg = dtl[1];
			eval('defRate_'+rateBarId+' = '+dtl[2]);
			//alert(eval('defRate_'+rateBarId));
			var title = dtl[3];
			var prvHtml = fObj(rateBarId+'_ratingCntnr').innerHTML;
			fObj(rateBarId+'_ratingCntnr').innerHTML = msg;
			fObj(rateBarId+'_ratingCntnr').title = title;
			eval('didRate_'+rateBarId+'=true;');
		*/
		
	}else{
		$value = 'comp=main&cmd=gCFrm&cmntCat='+cmntCat+'&cmntId='+cmntId;
		hEM.introOn(1);
		AjTD.sIt($value, "gCFrm($response)" );	
	}
};

var gdTt = false;
var gdTtShadow = false;
var dhtmlgoodies_shadowSize = 4;
var gdTtMaxWidth = 371;
var gdTtMinWidth = 100;
var gdIfrm = false;
var tooltip_is_msie = (navigator.userAgent.indexOf('MSIE')>=0 && navigator.userAgent.indexOf('opera')==-1 && document.all)?true:false;


function sOT(e,objId){
	//show object title 
	if(fObj(objId)) sTP(e,fObj(objId).innerHTML);
	return false;
};

var outT=0;
function hTD(){
	outT=setTimeout(function(){hideTooltip();},278);
}

function sTP(evt,tooltipTxt){
	clearTimeout(outT);
	var bodyWidth = Math.max(document.body.clientWidth,document.documentElement.clientWidth) - 20;

	if(!gdTt){
		gdTt = document.createElement('DIV');
		gdTt.id = 'gdTt';
		gdTt.onmouseover = function(){clearTimeout(outT);};
		gdTt.onmouseout = function(){hTD();};
		gdTtShadow = document.createElement('DIV');
		gdTtShadow.id = 'gdTtShadow';
			
		document.body.appendChild(gdTt);
		document.body.appendChild(gdTtShadow);	
		
		if(tooltip_is_msie){
			gdIfrm = document.createElement('IFRAME');
			gdIfrm.frameborder='5';
			gdIfrm.style.backgroundColor='#FFFFFF';
			gdIfrm.src = '#'; 	
			gdIfrm.style.zIndex = 100;
			gdIfrm.style.position = 'absolute';
			document.body.appendChild(gdIfrm);
		}
		
	}
	
	gdTt.style.display='block';
	gdTtShadow.style.display='block';
	if(tooltip_is_msie)gdIfrm.style.display='block';
	
	var st = Math.max(document.body.scrollTop,document.documentElement.scrollTop);
	//console.log('st: '+st);
	if(navigator.userAgent.toLowerCase().indexOf('safari')>=0)st=0; 
	var leftPos = evt.clientX + 10;
	//console.log('leftPos: '+leftPos);
	
	gdTt.style.width = null;	// Reset style width if it's set 
	gdTt.innerHTML = tooltipTxt;
	gdTt.style.left = leftPos + 'px';
	gdTt.style.top = evt.clientY + 10 + st + 'px';
	
	gdTtShadow.style.left =  leftPos + dhtmlgoodies_shadowSize + 'px';
	gdTtShadow.style.top = evt.clientY + 10 + st + dhtmlgoodies_shadowSize + 'px';
	
	if(gdTt.offsetWidth>gdTtMaxWidth){	/* Exceeding max width of tooltip ? */
		gdTt.style.width = gdTtMaxWidth + 'px';
	}
	
	var tooltipWidth = gdTt.offsetWidth;		
	if(tooltipWidth<gdTtMinWidth)tooltipWidth = gdTtMinWidth;
		
	gdTt.style.width = tooltipWidth + 'px';
	gdTtShadow.style.width = gdTt.offsetWidth + 'px';
	gdTtShadow.style.height = gdTt.offsetHeight + 'px';		
	
	if((leftPos + tooltipWidth)>bodyWidth){
		gdTt.style.left = (gdTtShadow.style.left.replace('px','') - ((leftPos + tooltipWidth)-bodyWidth)) + 'px';
		gdTtShadow.style.left = (gdTtShadow.style.left.replace('px','') - ((leftPos + tooltipWidth)-bodyWidth) + dhtmlgoodies_shadowSize) + 'px';
	}
	if(tooltip_is_msie){
		gdIfrm.style.left = gdTt.style.left;
		gdIfrm.style.top = gdTt.style.top;
		gdIfrm.style.width = gdTt.offsetWidth + 'px';
		gdIfrm.style.height = gdTt.offsetHeight + 'px';
	}
};

function hideTooltip(){
	gdTt.style.display='none';
	gdTtShadow.style.display='none';		
	if(tooltip_is_msie)gdIfrm.style.display='none';		
};

function quoter(str){
	//str = str.replace(/[\']/g, "\'");
	//str = str.replace(/[\"]/g, '\"');
	return str;
};

function liner(str){
	str = str.replace(/[\n]/g, " ");
	str = str.replace(/\r\n/g," ");
	return str;
};

function aL2RBs(){
	//add listeners to rate barS
	var rBars = document.getElementsByName('rIds2');//rate bar ids 2
	for(var e in rBars){
		//add listener to all rate bars
		if(rBars[e].id){
			aL2RB(rBars[e].id.replace('_rIds_',''));
		}
	}
};

function aL2RB(objId){
	//add listener to rate bar
	var prv = readCookie('dR_'+objId);
	if(prv=='yes') return;//did rated: it already rated
//	cLog('objId-->'+objId);
	var i=1;
	while(i<6){
		fObj(objId+'_rTd__'+i).onmouseover = rnkOver;
		fObj(objId+'_rTd__'+i).onclick = rnkClk;
		i++;
	}
};

function rnkClk(){
	var starArr = this.id.split('__');
	var idArr = this.id.split('_rTd__');
	var prv = readCookie('dR_'+idArr[0]);
	if(prv=='yes') return;//it already rated
	rateItAj('', idArr[0], starArr[1]);
};

function rnkOver(){
	var starArr = this.id.split('__');
	rnkOver2(starArr[0],starArr[1]);
};

function rnkOver2(id,rate){
	//if(readCookie('dR_'+rateBarId)=='yes') return;//it alredy rated
	var prv = readCookie('dR_'+id.replace('_rTd',''));
	if(prv=='yes') return;//did rated: it already rated  
	id = id+'__';
	
	fObj(id+"1").style.backgroundPosition = ((rate>0) ? 'bottom':'top');
	fObj(id+"2").style.backgroundPosition = ((rate>1) ? 'bottom':'top');
	fObj(id+"3").style.backgroundPosition = ((rate>2) ? 'bottom':'top');
	fObj(id+"4").style.backgroundPosition = ((rate>3) ? 'bottom':'top');
	fObj(id+"5").style.backgroundPosition = ((rate>4) ? 'bottom':'top');
};

function setRnkX(rateBarId,obj){
	rate = fObj(obj).value;
	rnkOver2(rateBarId+'_rTd',rate);
};

function rateItAj($response, rateBarId, rate){
	if($response){
		hEM.introOff();
		if(!ajResV.validate($response)){return false;}
		var dtl = ajResV.m_res.split('[*[');
		var rateBarId = dtl[0];
		var msg = dtl[1];
		fObj('defRate_'+rateBarId).value = dtl[2];
		var title = dtl[3];
		var prvHtml = fObj(rateBarId+'_ratingCntnr').innerHTML;
		fObj(rateBarId+'_ratingCntnr').innerHTML = msg;
		fObj(rateBarId+'_ratingCntnr').title = title;
		createCookie('dR_'+rateBarId, 'yes', 2);
		setTimeout(function(){fObj(rateBarId+'_ratingCntnr').innerHTML = prvHtml;}, 800);
		
	}else{
		if(readCookie('dR_'+rateBarId)=='yes') return;//it alredy rated
		$value = 'comp=main&cmd=rateItAj&rateBarId='+rateBarId+'&rate='+rate;
		hEM.introOn(1);
		AjTD.sIt($value, "rateItAj($response)" );	
	}	
};

function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
};

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 false;
};

function eraseCookie(name) {
	createCookie(name,"",-1);
};

var ajResV = { //ajax response validator

	m_mainSplitor 	: '[*]',
	
	m_garbage 		: '',
	
	m_stus 			: '',// it could be err/ok
	
	m_isCoded 		: '',// no / b64 / r13
	
	m_res 			: ' ',
	
	m_value 		: '',
	
	m_errNum 		: 0,
	
	m_errMsg 		: '',
	
	dump : function (){
		var $str = "m_garbage: " +this.m_garbage +"\n\n" +"m_stus: " +this.m_stus +"\n\n" +"m_isCoded: " +this.m_isCoded +"\n\n" +"m_res: " +this.m_res.substring(0,200) +" ...";
		alert($str);
	},
	
	errCleaner : function (){
		this.m_errNum = 0;
		this.m_errMsg = '';
	},
	
	validate : function ($value){//analize ajax response and validate it
		
		this.errCleaner();
		this.m_value = $value;
		
		if(this.isEmpty($value)){
			trObj.trAlert('Ajax response is empty!');
			return false;
		}
				
		var $det = this.m_value.split('[*]');
		this.m_garbage 	= $det[0];
		this.m_stus 	= $det[1];
		this.m_isCoded 	= $det[2];
		
		if		(this.m_isCoded == 'no'){
			this.m_res = $det[3];
		
		}else if(this.m_isCoded == 'b64'){
			this.m_res = Base64.decode($det[3]);
			
		}else{
			trObj.trAlert('it seems you are using old version of ajax validate');
			this.dump();
			
		}//end if
		
		if(this.m_stus == 'ok'){
			return true;
		}else{
			return false;
		}	
	},
	
	isNull : function(){
		if(typeof(this.m_value) == 'object'){return(false);}
		return (this.m_value===null || this.m_value==='null' || this.m_value==="");
	},
	
	isUnd : function(){
		if (typeof(this.m_value)=='undefined') {return (true);}
		return (false);
	},
	
	isEmpty : function(val){

		this.m_value = val;
		if ( this.isUnd() || this.isNull() ){
			this.m_stus = 'err';
			this.m_errNum = 1;
			this.m_errMsg = 'value is empty or null';
			return true; 
		}
		this.m_stus = 'ok';
		this.m_errMsgNum = 0;
		this.m_errMsg = 'value is not empty or null';
		return false;
	}
	
};


var Gen_Def = {

	SELECT_NOT_SELECTED		: -1,
	
	SELECT_ADD_NEW_OPTION	: -111
	
};

_event = {
	onload:[],
	
	onresize:[],
	
	onscroll:[],
	
	onmousedown:[],
	
	onmouseup:[],
	
	onmousemove:[],
	
	onselectstart:[],
	
	onclick:[]
};

_event_return = {
	onload:true,
	onresize:true,
	onscroll:true,
	onmousedown:true,
	onmouseup:true,
	onmousemove:true,
	onselectstart:true,
	onclick:true
};

//window.onscroll = Function("run_event('onscroll');return(_event_return.onscroll)");
//window.onload= Function("run_event('onload');return(_event_return.onload)");

function run_event(mode){
	//alert(mode)
	var func_list = eval("_event."+ mode);
	var i = 0;
	for(i in func_list){
		func_list[i] != 'none' ? eval(func_list[i]) : "";
	}//end for
};

function add_event(mode,func){
	//alert(mode+"-"+func)
	var func_list = eval("_event."+ mode);
	func_list[func_list.length] = func;
	//alert(func_list)
};

function und(val){
	return (typeof(val)=='undefined');
};

function fObjN($name,$parent) {
	//alert("fObj :"+id)
	var e;
	if( typeof($parent) == 'object'){
		e = $parent.document.getElementsByName($name)[0];
	}else{
		e = document.getElementsByName($name)[0];
	}//end if
	if(e){
		return(e);
	}else{
		return(false);
	}//end if
};

var trObj = {
	
	m_isDeveloper   : 'yes', // yes / no
	
	isDeveloper : function(){
		if(userInfo){ this.m_isDeveloper = userInfo.isDeveloper;}
		if (this.m_isDeveloper == 'yes') {return true;}
		return false;
	},
	
	trAlert : function ($msg){
		if(this.isDeveloper()) {alert ($msg);}
	},
	
	trAlertR : function ($mixed_var,$obj_name){//$mixed_var is an obj or multy dimensional
		if(!this.isDeveloper()) {return;}
		var $str = "";
		for(var x in $mixed_var){
			$str += String(x) +" : "+ String($mixed_var[x]) +"\n";
		}//end for
		alert($str);
	},
	
	trPrint_r : function ($mixed_var,$obj_name){//$mixed_var is an obj or multy dimensional
		var $str = "";
		for(var x in $mixed_var){
			$str += String(x) +" : "+ String($mixed_var[x]) +"\n";
		}//end for
		window.document.write('<pre>'+$str+'</pre>');
	}
};


/*
var ajaxDisabler = {

	m_img : 'images/main/pre_load_3.gif'
	,
	m_div : 'ajaxDisablerDiv'
	,
	dis : function (e){
	
		fObj(this.m_div).style.display = 'block';
	}
	,
	en : function (){
	alert(1);
		fObj(this.m_div).style.display = 'none';
	}
	
}//end obj
*/


var hEM = { //html element management
	
	getSelItem : function ($id){//$id is a id of an object.
		var e = fObj($id);
		if((e.tagName == 'SELECT') || (e.tagName == 'select')){
			var $index = e.selectedIndex;
			return({val:e.options[$index].value,cap:e.options[$index].text});
		}else{
			return(false);
		}
	},

	introOn : function(sw){
		fObj('generalScreen').style.display = 'block';
		if(sw == 1){
			//turn on intro animation
			fObj('introAnimation').style.display = 'block';
			
		}else if(sw == 2){
			//turn on notification box
			fObj('generalNotifications').style.display = 'block';
			
		}else{
			//do nothing
						
		}
		setTimeout("hEM.introOff()",5000);
	},
	
	introOff : function(){
		fObj('generalNotifications').style.display = 'none';
		fObj('introAnimation').style.display = 'none';
		fObj('generalScreen').style.display = 'none';
	},
	
	altrDisp : function (elementId,disp){
		var obj = fObj(elementId);
		if(!obj) {return false;}
		
		if(und(disp)){
			if (obj.style.display == 'block'){
				obj.style.display = 'none';
			}else{
				obj.style.display = 'block';
			}
		}else{
			obj.style.display = disp;
		}
	},
	
	getDsp : function (id){
		if(fObj(id)) {return fObj(id).style.display;}
		return false;
	},
	
	isOn : function (id){
		if(fObj(id)){
			if(fObj(id).style.display == 'block') {return true;}
			return false;
		}
		return false;
	},
	
	bgClr : function(elmId,bgClr){
		var obj = fObj(elmId);
		if (obj) {obj.style.backgroundColor = bgClr;}
	},
	
	getAbsPos : function (e){
		//alert("in absolute_pos function");
		var obsolute_x = 0;
		var obsolute_y = 0;
		if (e.offsetParent) {
			obsolute_x = e.offsetLeft;
			obsolute_y = e.offsetTop;
			var $scrollTop;
			var $scrollLeft;
			while (e = e.offsetParent) {
				if(e.offsetParent){
					$scrollTop = e.scrollTop;
					$scrollLeft = e.scrollLeft;
				}else{
					$scrollTop = 0;
					$scrollLeft = 0;
				}//end if
				obsolute_x += e.offsetLeft - $scrollLeft;
				obsolute_y += e.offsetTop - $scrollTop;
			}//end while
		}//end if
		return{
			x:obsolute_x,
			y:obsolute_y
		};
	},
	
	getMousePos : function (evt){
		alert("it does not work properly");
		var b = document.body;
		evt = (evt) ? evt : ((window.event) ? window.event : "");
		alertR(evt);
		var $xPos = parseInt(evt.clientX)+ b.scrollLeft - b.clientLeft;
		var $yPos = parseInt(evt.clientY)+ b.scrollTop - b.clientTop;
		return{
			x:$xPos,
			y:$yPos
		};
	},
	
	addElement : function (pid,htmlStr,elmId,index){
		var e = fObj(pid);
		fObj('tempAppendingContainer').innerHTML = htmlStr;
		var e_child = fObj(elmId);
		if(!index){
			e.appendChild(e_child);
		}else{
		}
	},
	
	removeElement : function(id){
			var e = fObj(id);
			if(!e) {return false;}
			var pe = e.parentElement;
			pe.parentNode.removeChild(e);
	},
	
	overFlag:0,
	
	showTitle : function(elm,evt){
		var obj=fObj(elm);
		if(evt){
			if(hEM.overFlag){return;}
			setTimeout((function(){hEM.overFlag=0;}),10);
			hEM.overFlag=1;
			obj.style.display='block';
			//cLog('event '+evt.clientX+','+evt.clientY);
			//cLog('object size '+obj.clientWidth+','+obj.clientHeight);
			//cLog('window size '+window.screen.width+','+window.screen.height);
			var elmTop;
			var elmLeft;
			var winHeight;
			var winWidth;
			if(isIe()){
				winHeight = window.screen.availHeight;
				winWidth = window.screen.availWidth;
			}else{
				winHeight = window.innerHeight;
				winWidth = window.innerWidth;
			}
			
			if(evt.clientY<winHeight/2){
				elmTop =(winHeight > evt.clientY+obj.clientHeight+25) ? evt.clientY+25 : winHeight-(obj.clientHeight+25);
			}else{
				elmTop =(winHeight > evt.clientY+obj.clientHeight+25) ? evt.clientY+25 : winHeight-(obj.clientHeight+25);
			}
			if(evt.clientX<winWidth/2){
				elmLeft=(winWidth > evt.clientX+obj.clientWidth+25) ? evt.clientX+25 : winWidth-(obj.clientWidth+25);
			}else{
				elmLeft=(winWidth > evt.clientX+obj.clientWidth+25) ? evt.clientX+25 : winWidth-(obj.clientWidth+25);
			}
			obj.style.top=elmTop+'px';
			obj.style.left=elmLeft+'px';
		}else{
			obj.style.display='none';
		}
	},
	
	createScreenMask : function(){
		if(!fObj('genScreenMask')){
			var divCntnr = document.createElement("div");
			divCntnr.setAttribute("id","genScreenMask");
			divCntnr.setAttribute("style","display:block; width:100%; height:100%; position:fixed; top:0px; left:0px; background-color:#1f1f5f; filter:progid:DXImageTransform.Microsoft.alpha(opacity=92); -moz-opacity:0.92; opacity:0.92; ");
			document.body.appendChild(divCntnr);
		}
	},
	
	op:0,
	opStep:1,
	opTime:0,
	isDispOned:0,
	
	notiAnim : function(obj){
		/*	filter:progid:DXImageTransform.Microsoft.alpha(opacity=92); -moz-opacity:0.92; opacity:0.92; ">	*/
		if(hEM.isDispOned==0){
			hEM.isDispOned=1;
			obj.style.display='block';
		}
		hEM.op = hEM.op+hEM.opStep;
		var objSt = obj.style;
		objSt.opacity = (hEM.op / 100);//for opera,between 0.00 and 1.00
		objSt.MozOpacity = (hEM.op / 100);//for mozila,between 0.00 and 1.00
		objSt.KhtmlOpacity = (hEM.op / 100);//for Konqueror,between 0.00 and 1.00
		objSt.filter = "alpha(opacity=" + hEM.op + ")";//for ie,between 1 and 100

		obj.style.MozOpacity = (hEM.op/10);
		//cLog(hEM.op);
		if(hEM.op>10 && hEM.opStep>0){hEM.opStep +=3;}
		if(hEM.op>35 && hEM.opStep>0){hEM.opStep +=8;}
		if(hEM.op>95 && hEM.opStep>0){hEM.opStep =-29;}
		if(hEM.op<50 && hEM.opStep<0){hEM.opStep +=3;}
		if(hEM.op<1){
			objSt.opacity = 0;//for opera,between 0.00 and 1.00
			objSt.MozOpacity = 0;//for mozila,between 0.00 and 1.00
			objSt.KhtmlOpacity = 0;//for Konqueror,between 0.00 and 1.00
			objSt.filter = "alpha(opacity=" + 0 + ")";//for ie,between 1 and 100
			hEM.op = 0;
			hEM.opStep = 1;
			clearTimeout(hEM.opTime);
			obj.style.display = 'none';
			hEM.isDispOned=0;
		}else{
			hEM.opTime = setTimeout((function(){hEM.notiAnim(obj);}), 200);
		}
	}
};
	
//this function search in an array of objects and return an object with certain id
function fObjInx(objArray,objId){
	for(var i in objArray){if(objArray[i].id==objId){return objArray[i];}}
	return false; 
};

//this function search in an array of objects and return an object's index with certain id
function fInx(objArray,objId){
	for(var i in objArray){if(objArray[i].id==objId){return i;}}
	return false; 
};

function nl($val){
	if(typeof($val) == 'object'){return (false);}
	return ($val===null || $val==='null' || $val==="");
};


function alertR($mixed_var,$obj_name){//$mixed_var is an obj or multy dimensional
	var $str = "";
	for(var x in $mixed_var){
		$str += String(x) +" : "+ String($mixed_var[x]) +"\n";
	}//end for
	alert($str);
};

function showAjPopUp(popObj){
	console.log(popObj);
};

function sweepAdvSrchConf(){ 
	var qStr="";
	qStr += "&tInOut="+hEM.getSelItem("srchBx_inOut").val+"&tDur="+hEM.getSelItem("srchBx_tDur").val+"&tPrice="+hEM.getSelItem("srchBx_tCost").val+"&stLoc="+hEM.getSelItem("srchBx_stLoc").val+"&targetLoc="+hEM.getSelItem("srchBx_targetLoc").val+"&varDate="+hEM.getSelItem("srchBx_varDate").val+"&stDay="+hEM.getSelItem("srchBx_stDay").val+"&stMonth="+hEM.getSelItem("srchBx_stMonth").val;
	return qStr;
};

//alert("GENERAL JS included");

//lib/js/general.js, lib/js/jquary.js, lib/js/html-slide-show.js,

//lib/js/base64.js, lib/js/srch_mgmt.js, lib/js/commenter.js, lib/js/htmler.js, lib/js/uploader.js, wiki/js/auther_mgmt.jsXXX

