function loadMenuTopFunc()
{
    if(document.getElementById && window.navigator.appName=="Microsoft Internet Explorer")
    {
        var myCellLi = document.getElementById('tableTopMenu').getElementsByTagName("li");
        
	    for(var i=0; i<myCellLi.length; i++)
	    {	        
		    //alert(myCellLi[i].className);
		    myCellLi[i].onmouseover=function(){ this.className+=" over";/*='liHover';*/ };
		    myCellLi[i].onmouseout=function(){ this.className=this.className.replace(" over", ""); /*this.className='liOut';*/ };
		}
    }    
}


function hideMenuSelect()
{
    if(document.getElementById)
    {
        var myTableCell = document.getElementById('menuTopBlueStar').getElementsByTagName("td");;

	    for(var i=0;i<myTableCell.length;i++)
	    {            
            if(myTableCell[i].className!="tempBar" && myTableCell[i].className!="separator")
		    {
		        myTableCell[i].className="cellRegular";
		    }	    
		}
	} 
}


//********************
function href(paraLink)
{
	window.location.href=paraLink;
}

function winjadid(linkref,wh,ht)
{
    var myVal=Math.floor(100000*Math.random());
    newwin=window.open(linkref,'newWin'+myVal,'menubar=no,toolbar=no,status=no,width='+wh+',height='+ht);
}

function winjadid2(linkref,wh,ht)
{
    var myVal=Math.floor(100000*Math.random());
    newwin2=window.open(linkref,'newWin'+myVal,'menubar=no,toolbar=no,scrollbars=yes,status=no,resizable=yes,width='+wh+',height='+ht);
}

function winDialog(urlText,ww,hh)
{
    var browser = navigator.appName;
	var neww;
	if(browser == "Microsoft Internet Explorer")
	{
		neww=window.showModalDialog(urlText,"","dialogWidth:" + ww + "px; dialogHeight:" + hh + "px; Center:yes; resizable:no; scroll:no; status:no; help:no;");
	}else
	{
	    neww=window.open(urlText,'newWin','menubar=no,scrollbars=no,toolbar=no,sizable=no,status=no,width='+ww+',height='+hh);
	}
}
//**********************

function showHideItem(obj)
{
    if(document.getElementById)
    {
	    var el = document.getElementById(obj);
	    
	    if(el.style.display == "none")
	    {
            var browser = navigator.appName;
            if(browser == "Microsoft Internet Explorer"){
	            el.style.display = "block";   
            }else{
	            el.style.display = 'table-row';
            }
	    }
	    else
	    {
	        el.style.display = "none";
	    }
    }
}

function changeStyle(objStyle,objSH)
{
    if(document.getElementById)
    {
	    var el = document.getElementById(objSH);//objStyle
	    var myRow = document.getElementById(objStyle);
	    //alert(el.style.backgroundColor);
	    if(el.style.display == "none")
	    {
	        //el.style.backgroundColor = '#CCFFCC';
	        //alert(el.style.backgroundColor);
	        myRow.style.backgroundColor = '#CCFFCC';
	    }
	    else
	    {
	        myRow.style.backgroundColor = '';
	        //el.style.backgroundColor = '';
	        //alert(el.style.backgroundColor);
	    }
	    
	    showHideItem(objSH);
    }
}

//***********************
//******** AJAX *********
//***********************

function makeRequest(urlID,targetID1,targetID2)
{
    var httpRequest;
    if (window.XMLHttpRequest)
    { // Mozilla, Safari, ...
        httpRequest = new XMLHttpRequest();
        if (httpRequest.overrideMimeType) {
            httpRequest.overrideMimeType('text/xml');
            // See note below about this line
        }
    } 
    else if (window.ActiveXObject)
    { // IE
        try {
            httpRequest = new ActiveXObject("Msxml2.XMLHTTP");
        } 
        catch (e) {
            try {
                httpRequest = new ActiveXObject("Microsoft.XMLHTTP");
            } 
            catch (e) {}
        }
    }

    if (!httpRequest) {
        alert('Giving up :( Cannot create an XMLHTTP instance');
        return false;
    }
    httpRequest.onreadystatechange = function() { alertContents(httpRequest,targetID1,targetID2); };
    httpRequest.open('GET', urlID, true);
    httpRequest.send('');
}

function alertContents(httpRequest,targetID1,targetID2)
{
    if(httpRequest.readyState == 1)
    {
        var strHTML="<p dir='rtl' align='center' style='font-size:9pt; font-family:tahoma; color:#0c0c0c;'>&#1604;&#1591;&#1601;&#1575;&#1611; &#1670;&#1606;&#1583; &#1604;&#1581;&#1592;&#1607; &#1605;&#1606;&#1578;&#1592;&#1585; &#1576;&#1605;&#1575;&#1606;&#1610;&#1583;...<br />";
        strHTML +="<img style='border:0px;' src='require_files/loading.gif' /></p>";	    
        document.getElementById(targetID1).innerHTML=strHTML;
    }
    else if (httpRequest.readyState == 4)
    {
        if (httpRequest.status == 200)
        {
            //alert(httpRequest.responseText);
            document.getElementById(targetID2).innerHTML=httpRequest.responseText;
        } else {
            alert('There was a problem with the request.');
        }
    }
}

//******************* Right Menu
function menuRightShow(para)
{
    if(document.getElementById)
    {
	    var obj = document.getElementById(para);	    
	    if(obj.style.display != "block")
	    {
		    obj.style.display = "block";
		}
		else
		{
		    obj.style.display = "none";
		}
    }
}

//**********************

function galleryImageShow(imageID)
{
    if(document.getElementById)
    {
	    var myFrame = document.getElementById('framePicShow');
	    myFrame.src='imageViewGallery.aspx?galleryID='+imageID;    
    }
}

function showPicBig(pathImg,titleImg)
{
    if(document.getElementById)
    {
	    var myBigImg = document.getElementById('bigImageHome');
	    myBigImg.src=pathImg;
	    myBigImg.title=titleImg;
	    	    //*******************
	    var myDivTitle = document.getElementById('bigImageHomeTitle');
	    myDivTitle.innerText=titleImg;
	    myDivTitle.innerHTML=titleImg;
    }
}

function showMenuTopManager(para)
{
    try
    {
        var Obj=document.getElementById("sMenu_"+para);
        Obj.style.display='block';
    }
    catch(e)
    {
        alert("Error event");
    }
}

//**********************

function galleryImageShow(imageID)
{
    if(document.getElementById)
    {
	    var myFrame = document.getElementById('framePicShow');
	    myFrame.src='imageViewGallery.aspx?galleryID='+imageID;    
    }
}

function showPicBig(pathImg,titleImg)
{
    if(document.getElementById)
    {
	    var myBigImg = document.getElementById('bigImageHome');
	    myBigImg.src=pathImg;
	    myBigImg.title=titleImg;
	    	    //*******************
	    var myDivTitle = document.getElementById('bigImageHomeTitle');
	    myDivTitle.innerText=titleImg;
	    myDivTitle.innerHTML=titleImg;
    }
}