﻿//////////////////////Fade 
fadeColor = "#ff9900";  // Ñä ãæÑÏ äÙÑÊÇä ÑÇ ÇíäÌÇ æÇÑÏ ßäíÏ

stepIn = 20; // delay when fading in
stepOut = 20; // delay when fading out

/* set to true or false; true will
** cause all links to fade automatically
** (you won't need to add class="fade")
***/
autoFade = true;  

/* set to true or false; true will cause all CSS
** classes with "fade" in them to fade onmouseover
***/
sloppyClass = true;

/* set to true or false; true will make the script
** work for Macs (IE 5+), but you will have to give
** a name (name="blah") to each link that you want
** to fade.
***/
macCompat = false;

/** 
**** </config>
**************/

/*************
**** <install>
**

Now, once you have customized your fading colors,
you need to include your customized .js file on
every page that you want to use it in. You can
include javascript files using this syntax (in
the head of a document):

Now that you have the file included, you need to
setup your links a small bit.  Each link that you
want to fade needs to use the fade class.

Example:

<a href="blah.html" class="fade">click here</a>

Also, the link must be plain text.  This means
that you can't have <b>'s, <i>'s, <font>'s, etc.
inside of the link.

Example of what not to do:

<a href="blah.html" class="fade"><b>click</b> here</a>

Have fun!
-Anarchos-

** 
**** </install>
**************/

var selectedsubcat="-1";
var Selelctedmaincat="-1";
var AllTab = -1;



hexa = new makearray(16);
for(var i = 0; i < 10; i++)
    hexa[i] = i;
hexa[10]="a"; hexa[11]="b"; hexa[12]="c";
hexa[13]="d"; hexa[14]="e"; hexa[15]="f";

document.onmouseover = domouseover;
document.onmouseout = domouseout;

fadeColor = dehexize(fadeColor.toLowerCase());

var fadeId = new Array();

function dehexize(Color){
    if (Color=="black")
        Color = "#000000";
	var colorArr = new makearray(3);
	for (i=1; i<7; i++){
		for (j=0; j<16; j++){
			if (Color.charAt(i) == hexa[j]){
				if (i%2 !=0)
					colorArr[Math.floor((i-1)/2)]=eval(j)*16;
				else
					colorArr[Math.floor((i-1)/2)]+=eval(j);
			}
		}
	}
	return colorArr;
}

function domouseover() {
	if(document.all){
		var srcElement = event.srcElement;
		if ((srcElement.tagName == "A" && autoFade && srcElement.className != "nofade") || srcElement.className == "fade" || (sloppyClass && srcElement.className.indexOf("fade") != -1)) {
				if (!srcElement.startColor) {
					srcElement.startColor = (srcElement.style.color)? srcElement.style.color: srcElement.currentStyle.color;
					srcElement.startColor = dehexize(srcElement.startColor.toLowerCase());
				}
				var link = (macCompat? srcElement.name: srcElement.uniqueID);
				if (link) fade(srcElement.startColor,fadeColor,link,stepIn);				
				else if (macCompat) alert("Error: Mac Compatility mode enabled, but link has no name.");
		}
	}
}

function domouseout() {
	if (document.all){
		var srcElement = event.srcElement;
		if ((srcElement.tagName == "A" && autoFade && srcElement.className != "nofade") || srcElement.className == "fade" || (sloppyClass && srcElement.className.indexOf("fade") != -1)) {
			var link = (macCompat? srcElement.name: srcElement.uniqueID);
			if (link) fade(fadeColor,srcElement.startColor,link,stepIn);
		}
	}
}

function makearray(n) {
    this.length = n;
    for(var i = 1; i <= n; i++)
        this[i] = 0;
    return this;
}

function hex(i) {
    if (i < 0)
        return "00";
    else if (i > 255)
        return "ff";
    else
       return "" + hexa[Math.floor(i/16)] + hexa[i%16];
}

function setColor(r, g, b, element) {
      var hr = hex(r); var hg = hex(g); var hb = hex(b);
      element.style.color = "#"+hr+hg+hb;
}

function fade(s,e,element,step) {
	var sr = s[0]; var sg = s[1]; var sb = s[2];
	var er = e[0]; var eg = e[1]; var eb = e[2];
	
	if (fadeId[0] != null && fade[0] != element && eval(fadeId[0])) {
		var orig = eval(fadeId[0]);
		setColor(orig.startColor[0],orig.startColor[1],orig.startColor[2],orig);
		var i = 1;
		while(i < fadeId.length) {
			clearTimeout(fadeId[i]);
			i++;
		}
	}
		
	for(var i = 0; i <= step; i++) {
		fadeId[i+1] = setTimeout("setColor(Math.floor(" +sr+ " *(( " +step+ " - " +i+ " )/ " +step+ " ) + " +er+ " * (" +i+ "/" +
			step+ ")),Math.floor(" +sg+ " * (( " +step+ " - " +i+ " )/ " +step+ " ) + " +eg+ " * (" +i+ "/" +step+
			")),Math.floor(" +sb+ " * ((" +step+ "-" +i+ ")/" +step+ ") + " +eb+ " * (" +i+ "/" +step+ ")),"+element+");",i*step);
	}
	fadeId[0] = element;
}
//////////////////////////Ajax
function fillMainsDDL()
{
	var s = document.getElementById("maincats");
	for (i = 0;i<Mains.length; i++)
	{
		var ss = Mains[i].split('-');
		if (navigator.userAgent.indexOf("MSIE")==-1)
			if (ss[0]==Selelctedmaincat)
			    s.add(new Option(ss[1], ss[0], true, true), null);
			else
			    s.add(new Option(ss[1], ss[0]), null);
		else
		    if (ss[0]==Selelctedmaincat)
			    s.add(new Option(ss[1], ss[0], true, true));
			else
			    s.add(new Option(ss[1], ss[0]));
	}
}
function MakeMainCatsTab()
{
	var str = "<table cellpadding=\"0\" cellpadding=\"0\"  style=\"z-index:1000\"><tr>";
	for (i = 0;i<Mains.length; i++)
	{
		var ss = Mains[i].split('-');
		str+="<td>";
		str+='<div class="Tab_Cat" id="Tab'+(i+1)+'" onmouseover="Tab(\'Tab'+(i+1)+'\');ViewerMouseover(\'DiveSub\', '+ss[0]+',lLeft ,6,w,230, event);" onmouseout="CloseALL();Mouseout(\'DiveSub\', event)" >'
		str+="<a title='"+ss[1]+"'>"+ss[1]+"</a><div></td>";
	}
	str+="</tr></table>"
	AllTab = Mains.length;
	return str;
}
function fillddl(mainid)
{
	s = document.getElementById("subssel");
	tot = s.options.length;
	for (i = 2; i<= tot; i++)
	{
		s.remove(1);
	}
	if (mainid==-1)
		return;
	k = eval("Subs"+mainid);
	for (i = 0; i < k.length; i++)
	{
		var ss = k[i].split('-');
		if (navigator.userAgent.indexOf("MSIE")==-1)
			if (ss[0]==selectedsubcat)
			    s.add(new Option(ss[1], ss[0], true, true), null);
			else
			    s.add(new Option(ss[1], ss[0]), null);
		else
		    if (ss[0]==selectedsubcat)
			    s.add(new Option(ss[1], ss[0], true, true));
			else
			    s.add(new Option(ss[1], ss[0]));
	}
}

//////////////////////////////Farsi

window.document.onkeydown = OnKeyDown;
window.document.onkeypress = OnKeyPress;

var KeyboardLayout = 1; // 1: Farsi, 0: Latin
var ChangableKeyboardLayout = 0; // 1: Yes, 0: No

var BaseCodes =
[
	1570, 1574, 1575, 1576, 1662, 1578, 1579, 1580, 1670,
	1581, 1582, 1583, 1584, 1585, 1586, 1688, 1587, 1588,
	1589, 1590, 1591, 1592, 1593, 1594, 1601, 1602, 1705,
	1711, 1604, 1605, 1606, 1608, 1607, 1740, 1614, 1573,
	1616, 1613, 1617, 1618, 91  , 1600, 171 , 187 , 1569,
	1571, 93  , 92  , 1611, 1610, 1615, 1548, 44  , 1572,
	1612, 1563, 1577
]

var ConvertedCodes =
[
	72 , 109, 104, 102, 126, 106, 101, 123, 125,
	112, 111, 110, 98 , 118, 99 , 124, 115, 97 ,
	119, 113, 120, 122, 117, 121, 116, 114, 58 ,
	34 , 103, 108, 107, 60 , 105, 100, 65 , 66 ,
	68 , 69 , 70 , 71 , 73 , 74 , 75 , 76 , 77 ,
	78 , 79 , 80 , 81 , 82 , 83 , 84 , 85 , 86 ,
	87 , 89 , 90
]

var PersianCharacterSet =
[
	0x0020, 0x0021, 0x061B, 0x066B, 0x00A4, 0x066A, 0x060C, 0x06AF,
	0x0029, 0x0028, 0x002A, 0x002B, 0x0648, 0x002D, 0x002E, 0x002F,
	0x06F0, 0x06F1, 0x06F2, 0x06F3, 0x06F4, 0x06F5, 0x06F6, 0x06F7,
	0x06F8, 0x06F9, 0x003A, 0x06A9, 0x003E, 0x003D, 0x003C, 0x061F,
	0x066C, 0x0624, 0x200C, 0x0698, 0x064A, 0x064D, 0x0625, 0x0623,
	0x0622, 0x0651, 0x0629, 0x00BB, 0x00AB, 0x0621, 0x004E, 0x005D,
	0x005B, 0x0652, 0x064B, 0x0626, 0x064F, 0x064E, 0x0056, 0x064C,
	0x0058, 0x0650, 0x0643, 0x062C, 0x0698, 0x0686, 0x00D7, 0x0640,
	0x067E, 0x0634, 0x0630, 0x0632, 0x06CC, 0x062B, 0x0628, 0x0644,
	0x0627, 0x0647, 0x062A, 0x0646, 0x0645, 0x0626, 0x062F, 0x062E,
	0x062D, 0x0636, 0x0642, 0x0633, 0x0641, 0x0639, 0x0631, 0x0635,
	0x0637, 0x063A, 0x0638, 0x007D, 0x007C, 0x007B, 0x007E
];

function OnKeyDown()
{
	if(ChangableKeyboardLayout == 1)
		if((window.event.shiftKey) && (window.event.altKey))
			KeyboardLayout = (KeyboardLayout == 0)? 1: 0;
		else
			if((window.event.shiftKey) && (window.event.ctrlKey))
				KeyboardLayout = (KeyboardLayout == 0)? 1: 0;

	return(true);
}

function OnKeyPress()
{
	var KeyCode;

	if(event.srcElement.name) // Checking Existance of Source Element.
	{
		KeyCode = window.event.keyCode;

		if(KeyboardLayout == 1)
		{
			if((KeyCode < 0x0020) || (KeyCode >= 0x00FF)) // If keyboard layout is in persian mode.
				return(true);

			var MySourceElement = event.srcElement;
			var MyRegularExperesion = new RegExp("[A-Za-z\x27\x2C\x3B\x5B\x5C\x5D\x7C]");
			var KeyCodeValidation = MyRegularExperesion.test(String.fromCharCode(KeyCode));

			if((KeyCode != 0x200C) &&
				(MySourceElement.value.length > 0) &&
				((KeyCodeValidation) || (KeyCode == 92)) &&
				(MySourceElement.value.lastIndexOf(String.fromCharCode(1740)) == MySourceElement.value.length - 1))
			{
				MySourceElement.value = MySourceElement.value.slice(0 ,-1);
				MySourceElement.value += String.fromCharCode(1610);
			}

			if((window.event.shiftKey) && (KeyCode == 0x0020))
				window.event.keyCode = 0x200C;
			else
				window.event.keyCode = PersianCharacterSet[KeyCode - 0x0020];

			return(true);
		}
		else
		{
			var intIndex = 0;
			var blnFoundKeyCode = false;
			
			while((intIndex <= BaseCodes.length - 1) && (!(blnFoundKeyCode)))
			{
				if(BaseCodes[intIndex] == KeyCode)
				{
					blnFoundKeyCode = true;
					KeyCode = ConvertedCodes[intIndex];
				}

				intIndex++;
			}

			window.event.keyCode = KeyCode;

			return(true);
		}
	}
}
////////////////////////////////////Menu
var miw = 0; mih = 0, mir = 0, cs = 0, ts = 20, del = 10;
var div;
var showtimeout=null, hidetimeout=null, fadeintimeout=null, fadeouttimeout=null;
function fillMainsMenu()
{
	var str = '<table class="Menu_List" cellspacing="0" border="0" style="border-collapse:collapse;">';
	for (i = 0;i<Mains.length; i++)
		{
			var ss = Mains[i].split('-');
			str+="<tr><td>";
			str+='<a href="../Advertisement.aspx?MainCategoryID='+ss[0]+'">';
			str+='<div>'+ss[1]+'</div>';
			str+="</a></td></tr>";
		}
		str+="</table>"
		return str;	
}
function RegisterDivForMenu(divid)
{
	div = document.getElementById(divid);
	miw = div.offsetWidth;
	mih = div.offsetHeight;
	SetRightDiv();
}
function SetRightDiv()
{
	var gheb = (document.body.offsetWidth - 1024) /2;
	if (gheb<0)
		gheb = 0;
	mir = gheb + 712 + miw;
	mir = document.body.offsetWidth - mir;
	div.style.right = mir;
}
function LinkMouseIn()
{
	if (hidetimeout != null)
	{
		clearTimeout(hidetimeout);
		hidetimeout = null;
		return;
	}
	if (fadeintimeout!=null)
		return;
	showtimeout = setTimeout('StartShowMenu()', 50);
}
function LinkMouseOut()
{
	if (showtimeout != null)
	{
		clearTimeout(showtimeout);
		showtimeout = null;
		return;
	}
	if (fadeouttimeout!=null)
		return;
	hidetimeout = setTimeout('StartHideMenu()', 50);
}
function StartShowMenu()
{
	SetRightDiv();
	showtimeout = null;
	if (fadeouttimeout!=null)
	{
		clearTimeout(fadeouttimeout);
		fadeouttimeout = null;
	}
	FadeInMenu();
    div.style.visibility = "visible";
}
function StartHideMenu()
{
	hidetimeout = null;
	if (fadeintimeout!=null)
	{
		clearTimeout(fadeintimeout);
		fadeintimeout = null;
	}
	FadeOutMenu();
}
function FadeInMenu()
{
	if (fadeouttimeout!=null)
	{
		clearTimeout(fadeouttimeout);
		fadeouttimeout = null;
	}
	cs++;
	if (cs>ts)
		cs = ts;
	div.style.width = miw * cs / ts;
	div.style.height = mih * cs / ts;
	if (cs < ts)
		fadeintimeout = setTimeout('FadeInMenu()', del);
	else
		fadeintimeout = null;
}
function FadeOutMenu()
{
	if (fadeintimeout!=null)
	{
		clearTimeout(fadeintimeout);
		fadeintimeout = null;
	}
	cs--;
	if (cs < 0)
		cs = 0;
	div.style.width = miw * cs / ts;
	div.style.height = mih * cs / ts;
	if (cs > 0)
		fadeouttimeout = setTimeout('FadeOutMenu()', del);	
	else
	{
		div.style.visibility = "hidden";
		fadeouttimeout = null;
	}
}
//////////////////////////////////////Pupap
////////////////////tooltip

// Extended Tooltip Javascript
// copyright 9th August 2002, 3rd July 2005
// by Stephen Chapman, Felgall Pty Ltd
// permission is granted to use this javascript provided that the below code is not altered
var rowcount = 10; //The number of subcategories in each row
var showdelay = 200, hidedelay=300;

var DH = 0;var an = 0;var al = 0;var ai = 0;
if (document.getElementById)
{
	ai = 1;
	DH = 1;
}
else
{
	if (document.all)
	{
		al = 1;
		DH = 1;
	}
	else
	{
		browserVersion = parseInt(navigator.appVersion);
		if ((navigator.appName.indexOf('Netscape') != -1) && (browserVersion == 4))
		{
			an = 1;
			DH = 1;
		}
	}
}
function fd(oi, wS)
{
	if (ai)
		return wS ? document.getElementById(oi).style:document.getElementById(oi);
	if (al)
		return wS ? document.all[oi].style: document.all[oi];
	if (an)
		return document.layers[oi];
}

function pw()
{
	return window.innerWidth != null? window.innerWidth: document.body.clientWidth != null? document.body.clientWidth:null;
}
function mouseX(evt)
{
	if (evt.pageX)
		return evt.pageX;
	else if (evt.clientX)
		return evt.clientX + (document.documentElement.scrollLeft ?  document.documentElement.scrollLeft : document.body.scrollLeft);
	else 
		return null;
}
function mouseY(evt)
{
	if (evt.pageY)
		return evt.pageY;
	else if (evt.clientY)
		return evt.clientY + (document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop);
	else 
		return null;
}

function popUp(evt,oi, action)
{
    if (DH)
    {
        var wp = pw();
        ds = fd(oi,1);
		dm = fd(oi,0);
		st = ds.visibility;
        if (dm.offsetWidth)
            ew = dm.offsetWidth;
        else 
			if (dm.clip.width)
				ew = dm.clip.width;
		if (action == 0)
		{
			ds.visibility = "hidden";
		}
		else
		{
		
			tv = mouseY(evt) + 20;
			lv = mouseX(evt) - (ew/4);
			if (lv < 2)
				lv = 2;
			else
				if (lv + ew > wp)
					lv -= ew/2;
			if (!an)
			{
				lv += 'px';
				tv += 'px';
			}
			
			ds.top = ytoload;//tv;
			
			if (window.navigator.appName == "Netscape")
			{
			    ds.left = xtoload + 1;//lv;
			    ds.width = wtoload - 22;
			}else{
			    ds.left = xtoload
			    ds.width = wtoload;
			}
			
			ds.height = htoload;
			ds.visibility = "visible";
		}
	}
}
//---------------------------------------------------     
myDivID="";
eventcache = 1, eventcache2 = 1;
showtimeoutcache = "";
cleartimeoutcache = "";
oldurl = "";
xtoload = 1;
ytoloay = 1;
wtoload = 1;
htoload = 1;
function clearDiv(evt,divid)
{
    popUp(evt,divid, 0);
    cleartimeoutcache="";
}

function showAnotherDiv(evt, divid, url)
{
	clearDiv(evt, divid);
	fillDIV(url, divid, evt);
}

function clone(myObj)
{
    if(typeof(myObj) != 'object') return myObj;
    if(myObj == null) return myObj;

    var myNewObj = new Object();

    for(var i in myObj)
        myNewObj[i] = myObj[i];

    return myNewObj;
}

var xmlhttp

function fillDIV(mainid, divid, evt)
{
	s = document.getElementById(divid);
	var str = "";
	if (mainid==-1)
		return;
	k = eval("Subs"+mainid);
	str +="<table class='Table_All_Sub'><tr><td>";
	var cnt = 0;
	var first = 1;
	for (i = 0; i < k.length; i++)
	{
		cnt++;
		var ss = k[i].split('-');
		str+="<p><img id='BTN" + i + "' src='images/FirstPage/Ballet.gif'>&nbsp;<a href='Advertisement.aspx?MainCategoryID="+mainid+"&SubcategoryID="+ss[0]+"&ShowType=List'  onmouseover=Show('BTN" + i + "') onmouseout=Hide('BTN" + i + "') >"+ss[1]+"</a></p>";
		if (cnt == rowcount)
		{
			cnt = 0;
			if (first == 1)
				str += "</td>";
			first = 0;
			if (i<k.length-1)
				str += "<td>";
		}
	}
	if (cnt!=0)
		str += "<td>";
	str +="</tr></table>";
	s.innerHTML = str;
	popUp(evt, divid, 1);
	showtimeoutcache = "";
}
		
function ViewerMouseover(divID,url, xx, yy, ww, hh, evt)
{
	xtoload = xx;
	ytoload = yy;
	wtoload = ww;
	htoload = hh;
	if (cleartimeoutcache=="")
	{
		if (window.event)
			eventcache=clone(window.event);
		else
			eventcache=clone(evt);
		myDivID=divID;
		oldurl = url;
		showtimeoutcache = setTimeout("fillDIV("+url+",'"+divID+"',eventcache)", showdelay);
	}
	else if (oldurl == url)
	{
		clearTimeout(cleartimeoutcache);
		cleartimeoutcache = "";
	}
	else
	{
		clearTimeout(cleartimeoutcache);
		cleartimeoutcache = "";
		myDivID=divID;
		oldurl = url;
		eventcache2 = null;
		eventcache2 = clone(eventcache);
		eventcache = null;
		if (window.event)
			eventcache=clone(window.event);
		else
			eventcache=clone(evt);
		cleartimeoutcache=setTimeout("showAnotherDiv('"+eventcache2+"','"+divID+"','"+url+"')",showdelay);
	}
}
function clearDiv(evt,divid)
{
    popUp(evt,divid, 0);
    cleartimeoutcache="";
}

function DivMouseover()
{
	clearTimeout(cleartimeoutcache);
	cleartimeoutcache = "";
	CloseALL();
	Tab(tabtobeshown);
}

function Mouseout(divID, evt)
{
	if (showtimeoutcache=="")
	{
		if (window.event)
			eventcache=clone(window.event);
		else
			eventcache=clone(evt);
		cleartimeoutcache=setTimeout("clearDiv('"+eventcache+"','"+divID+"')",hidedelay);
	}
	else
	{
		clearTimeout(showtimeoutcache);
		showtimeoutcache = "";
	}
	CloseALL();
}
/////////////////////////////////////////////////menu right
function FillSubcatsRightMenu(mainid, SubcatsToShow, showType)
{
	var str = '<table cellspacing="0" border="0" style="border-collapse:collapse;">';
	if (mainid==-1)
		return "";
	var k = eval("Subs"+mainid);
	for (i = 0; i < k.length; i++)
	{
		var ss = k[i].split('-');
		if (SubcatsToShow.length!=0)
		{
			var found = false;
			for (j = 0; j<SubcatsToShow.length; j++)
				if (SubcatsToShow[j]==ss[0])
					found = true;
			if (!found)
				continue;
		}
		if (ss[0]==selectedsubcat)
		{
			str+='<tr><td><img id="Menu'+(i+1)+'" src="images/InsidePage/Ballet-Selected.gif" style="vertical-align: baseline" alt="" width="9" height="6" />&nbsp;<span>';
			str+='<b>'+ss[1]+'</b></span></td></tr>';	
		}
		else
		{
			str+='<tr><td><img id="Menu'+(i+1)+'" src="images/InsidePage/Ballet.gif" style="vertical-align: baseline" alt="" width="9" height="6" />&nbsp;<span>';
			if (found)
				str+='<a href="Advertisement.aspx?MainCategoryID='+mainid+'&SubcategoryID='+ss[0]+'&ShowType='+showType+'&IsToday=1" onmouseover="Show(\'Menu'+(i+1)+'\');SetHelpStatus(this.innerText,\'نمایش لیست آگهی های\')" onmousemove="SetHelpStatus(this.innerText,\'نمایش لیست آگهی های\')" onmouseout="Hide(\'Menu'+(i+1)+'\');ClaerStatus()">'+ss[1]+'</a></span></td></tr>';			
			else
				str+='<a href="Advertisement.aspx?MainCategoryID='+mainid+'&SubcategoryID='+ss[0]+'&ShowType='+showType+'" onmouseover="Show(\'Menu'+(i+1)+'\');SetHelpStatus(this.innerText,\'نمایش لیست آگهی های\')" onmousemove="SetHelpStatus(this.innerText,\'نمایش لیست آگهی های\')" onmouseout="Hide(\'Menu'+(i+1)+'\');ClaerStatus()">'+ss[1]+'</a></span></td></tr>';			
		}
	}
	return str+="</table>"
}
//////////////////////////////////////////////////////////////////

function SetTitle(serched,My,Item)
{
	var title = " نیاز اول ";
	var titln = " نیاز من ";
	var sp = " :: ";
	if (Selelctedmaincat != "-1")
	{
		
		for (i = 0;i<Mains.length; i++)
		{
			var ss = Mains[i].split('-');
				if (ss[0]==Selelctedmaincat)
				   title = ss[1] + sp + title;
		}
		var k = eval("Subs"+Selelctedmaincat);
		for (i = 0; i < k.length; i++)
		{
			var ss = k[i].split('-');
				if (ss[0]==selectedsubcat)
					title = ss[1] + sp + title ;
		}
	}
	if(serched == 'Ok')
		title = "نتایج جستجو" + sp + title;
	if(My != "No")
	{
		if (My == "Login")
			title = "ورود" + sp + titln + sp + title
		if (My == "Register")
			title = "ثبت نام" + sp + titln + sp + title
		if (My == "MN")
			title =  titln + sp + title
		if (My == "Logout")
			title = "خروج از سیستم" + sp + titln + sp + title	
	}	
	if(Item != "No")
	{
		if (Item == 1)
			title = "تماس با ما" + sp + title;;
		if (Item == 2)
			title = "تعرفه آگهی ها" + sp + title;;
		if (Item == "" || Item > 2)
			title = "آیتم مورد نظر یافت نشد" + sp + title;;
	}	
	document.title = title;
}