﻿	function eOpenChatWindow (user_Uid) {
		wndAEDS = window.open('http://chat.cloob.com/chat.php?Uid='+user_Uid, 'wndAEDS'+user_Uid, 'fullscreen=0, channelmode=0, directories=0, status=no, location=0, toolbar=0, menubar=0, scrollbars=0, resizable=0, height=375, width=410');
		wndAEDS.focus() ;
	}
	function hideShow(id){
		if (document.getElementById(id).style.display=='none')
			document.getElementById(id).style.display='inline';
		else
			document.getElementById(id).style.display='none';
	}
	
	//////////////////////////////////////////////////////////////////////////////////////////////////      HighLight
		var highlightbehavior="TD"
	var ns6=document.getElementById&&!document.all
	var ie=document.all
	function TRchangeto(e,highlightcolor){
		highlightbehavior="TR";
		source=ie? event.srcElement : e.target
		if (source.tagName=="TABLE")
			return
		while(source.tagName!=highlightbehavior && source.tagName!="HTML")
			source=ns6? source.parentNode : source.parentElement
		if (source.style.backgroundColor!=highlightcolor&&source.id!="ignore")
			source.style.backgroundColor=highlightcolor
	}	
	function changeto(e,highlightcolor){
		source=ie? event.srcElement : e.target
		if (source.tagName=="TABLE")
			return
		while(source.tagName!=highlightbehavior && source.tagName!="HTML")
			source=ns6? source.parentNode : source.parentElement
		if (source.style.backgroundColor!=highlightcolor&&source.id!="ignore")
			source.style.backgroundColor=highlightcolor
	}
	function contains_ns6(master, slave) { //check if slave is contained by master
		while (slave.parentNode)
			if ((slave = slave.parentNode) == master)
				return true;
			return false;
	}
	function changeback(e,originalcolor){
		if (ie&&(event.fromElement.contains(event.toElement)||source.contains(event.toElement)||source.id=="ignore")||source.tagName=="TABLE")
			return
		else if (ns6&&(contains_ns6(source, e.relatedTarget)||source.id=="ignore"))
			return
		if (ie&&event.toElement!=source||ns6&&e.relatedTarget!=source)
			source.style.backgroundColor=originalcolor
	}
	
	function getscrollXY() {
  var scrOfX = 0, scrOfY = 0;
  if( typeof( window.pageYOffset ) == 'number' ) {
    //Netscape compliant
    scrOfY = window.pageYOffset;
    scrOfX = window.pageXOffset;
  } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
    //DOM compliant
    scrOfY = document.body.scrollTop;
    scrOfX = document.body.scrollLeft;
  } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
    //IE6 standards compliant mode
    scrOfY = document.documentElement.scrollTop;
    scrOfX = document.documentElement.scrollLeft;
  }
 return (scrOfY+5) ;
}
	
	function getscrollheight() {
  if( typeof( window.pageYOffset ) == 'number' ) {
    //Netscape compliant
	var windowheight=document.body.scrollHeight;
  }  else {
    //IE6 standards compliant mode
	var windowheight=document.body.scrollHeight;
  }
 return (windowheight) ;
}

	//////////////////////////////////////////////////////////////////////////////////////////////////   EO HighLight
	
	
	/////////////////////////////////////EDITOR LUNCH START///////////////////////////
	
	function edtitorlaunch(divname,rtetext,width,height,accesstype) {
		initRTE("rte/image/", "rte/", "");
		var mytext='<form name="myeditor">';
		mytext+='<div id="rteDiv3"></div>';
		document.getElementById(divname).innerHTML=mytext;
		
		writeRichText("rte1", rtetext, width, height, true, false, accesstype);
	}
	
		/////////////////////////////////////EDITOR LUNCH END///////////////////////////
		

	/////////////////////////////////////MAIN LAYER START///////////////////////////
		
		
		
	    var maincreate=0;
		function mainlayer(){
		try {
			document.getElementById('divclbadvertisements').style.display='none';
		} catch (e) {}
		try {
			if(maincreate==1){
				LayerCreate(1, 'lyrAll', correct_resolution(5), correct_resolution(5), correct_resolution(995), document.body.scrollHeight,true, 0, 0);
				ShowObj(1);
				document.getElementById('lyrmain').innerHTML ='';
				document.getElementById('lyrtop').innerHTML ='';	
				document.getElementById('lyrmain').style.display='inline';
				document.getElementById('lyrtop').style.display='none';
				ShowObj(2);
				ObjSlide(2, parseInt(document.getElementById('lyrM').style.left), getscrollXY(), 500);
			}
			else
			{
			maincreate=1;
			LayerCreate(1, 'lyrAll', correct_resolution(5), correct_resolution(5), correct_resolution(995), document.body.scrollHeight,true, 0, 0);
			ShowObj(1);
			LayerCreate(2, 'lyrM', correct_resolution(200), getscrollXY(),600, 0,true, 0, 0);
			var htm;
			htm = "<table border='0' cellspacing='0' cellpadding='0'  bgcolor="+TableHeaderBgColor+" style='border-collapse: collapse' width='100%' align='center' >";	
			htm += 	"<tr>";
			htm += 		"<td colspan='2' bgcolor="+TableBgColor+">";
			htm += 			"<table width=100%' bgcolor='' border='0' cellpadding='0' cellspacing='0'>";
			htm += 				"<tr>";
			htm += 					"<td width='18' align='left'><img src='image/close.jpg' border='0'  width='14' height='14' onclick='HideObj(2);HideObj(1);'></td>";
			htm += 					"<td align='left' valign='middle' style='padding-top:2;padding-bottom:1;padding-left:15'><b>";
			htm += 						"<div dir='rtl' id='lyrheader' style='vertical-align:middle ' align='left' onMouseOver='over[2]=true;'  onMouseOut='over[2]=false;'  style='cursor:move;width:100%;height:20;font-size:12px;color:000000;font-family:tahoma; '>";
			htm += 							"";
			htm += 						"</div>";
			htm += 					"</td>";
			htm += 				"</tr>";
			htm += 			"</table>";		
			htm += 		"</td>";		
			htm += 	"</tr>";
			htm += 	"<tr>";
			htm += 		"<td colspan='2' align='left'><hr style='width:100%;height:2;color:"+TableBgColor+"'></td>";
			htm += 	"</tr>";
			htm += 	"<tr>";
			htm += 		"<td width='' align='left' valign='bottom' >";
			htm += 			"<div dir='rtl' id='lyrtop' style='overflow:auto;'>";
			htm += 			"</div>";
			htm +=		"</td>";		
			htm += 	"</tr>";
			htm += 	"<tr>";
			htm += 		"<td width='' align='right'  valign='bottom' style='padding:5'>";
			htm += 			"<div dir='rtl' id='lyrmain' style='overflow:visible;'>";
			htm += 			"</div>";
			htm +=		"</td>";		
			htm += 	"</tr>";
			htm += 	"<tr>";
			htm += 		"<td colspan='2' align='left' style='padding-bottom:5'>";
			htm += 			"<hr style='width:100%;height:2;color:"+TableBgColor+"'>";
			htm += 			"<input type='button' value=' ÈÓÊä ' onclick='HideObj(2);HideObj(1);' class='form'>&nbsp;&nbsp;";
			htm += 		"</td>";
			htm += 	"</tr>";		
			htm += "</table>";	
			document.getElementById('lyrM').innerHTML=htm;
			ShowObj(2);
			}
	    } catch (e) {}
	}
	
	/////////////////////////////////////MAIN LAYER END///////////////////////////
	
	
	//////////////////////////////////RATING START//////////////////////////////////
	
	var onclick_ok=0;
	function rate_change(star_no,type_id){
	try{
		document.getElementById('li').style.width=(14 * star_no)+'px';
		document.getElementById('divrate').innerHTML='<a href="javascript:void(0)" onclick="send_ratefunc('+rate_id+','+type_id+');return false;" class="link"></a>';
		document.getElementById('HideRate').value = star_no ;
		alert('star_no'+star_no);
		onclick_ok=1;
		}
		 catch (e) {}
	}
	function put_rate_desc(status){
	try {
		if(onclick_ok!=1){
		switch (status)
			{
				case 1 :
					document.getElementById('divrate').innerHTML ='ضعیف';
				break;
				case 2 :
					document.getElementById('divrate').innerHTML ='متوسط';
				break;
				case 3 :
					document.getElementById('divrate').innerHTML ='خوب';
				break;
				case 4 :
				{
					document.getElementById('divrate').innerHTML ='بسیار خوب';
					//alert('very good');
				}
				break;
				case 5 :
					document.getElementById('divrate').innerHTML ='عالی';
				break;
				}
			}
			} catch (e) {}	
	}
	
	function strip_rate_desc(){
		if(onclick_ok!=1)
		document.getElementById('divrate').innerHTML ='';
	}
	
	//////////////////////////////////RATING END//////////////////////////////////
	//////////////////////////////////SR START//////////////////////////////////
	function sr(myfield,e)
	{
		var key;
		if (window.event)
		   key = window.event.keyCode;
		else if (e)
		   key = e.which;
		if(key==1740)
		  {
		  window.event.keyCode=1610;
		  }
		return true;
	}
	//////////////////////////////////SR END//////////////////////////////////