﻿

function ClearTextBox()
{
    document.getElementById('searchTxt').value = "";
}


function ResetTextBox()
{

    if(document.getElementById('searchTxt').value == "")
    {
    
    document.getElementById('searchTxt').value = "جستجو"
    }
    
}



function ExpandAndCollapsHeaderLogin(IsFirstTime)
{
        
    document.getElementById('headerLoginContent').style.visibility = "visible";
    
    
    dvheaderNewsStyle = document.getElementById('headerNews').style;
    dvheaderNoticeStyle = document.getElementById('headerNotice').style;
    
    document.getElementById('headerNoticeArrow').style.background = "url('/SharifKishWebSite/SharifKish_WebUI/App_Themes/ImagesII/sidebar_header_arrowl.png') no-repeat left top";   
    document.getElementById('headerNewsArrow').style.background = "url('/SharifKishWebSite/SharifKish_WebUI/App_Themes/ImagesII/sidebar_header_arrowl.png') no-repeat left top";   
    
    
    if (IsFirstTime)
    {
        if(parseInt(dvheaderNewsStyle.marginTop) > -75)
        {
            ExpandAndCollapsheaderNotice(true);
            return;
        }
        else
        {
            document.getElementById('headerLoginArrow').style.background = "url('/SharifKishWebSite/SharifKish_WebUI/App_Themes/ImagesII/sidebar_header_arrowd.png') no-repeat left top";
            
            if(parseInt(dvheaderNoticeStyle.marginTop) == -37)
            {
                newsOpened = true;
            }else{
                newsOpened = false;
                dvheaderNoticeStyle.marginTop = -228 + "px";
            }
            
            EndTopPosition = -73;
        
            dvheaderNewsStyle.marginTop = -264 + "px";
        }
    }
    
    IsFirstTime = false;
    
    
    if(newsOpened == true)
    {
        curentPosition = dvheaderNoticeStyle.marginTop;
        curentPosition = parseInt(curentPosition) - 15;
        dvheaderNoticeStyle.marginTop = curentPosition + "px";
    }
    
    curentPosition = dvheaderNewsStyle.marginTop;
    curentPosition = parseInt(curentPosition) + 15;
    dvheaderNewsStyle.marginTop = curentPosition + "px"; 
   
    
    if(curentPosition <= EndTopPosition)
    {
       setTimeout('ExpandAndCollapsHeaderLogin(false)',1);       
    }else if(newsOpened == false){
        dvheaderNewsStyle.marginTop = -73 + "px";
    }else if(newsOpened == true){
        dvheaderNewsStyle.marginTop = -73 + "px";
        dvheaderNoticeStyle.marginTop = -228 + "px";
    }
    
    
}  // function ExpandAndCollapsHeaderLogin(IsFirstTime)






var bExpandheaderNewsStatus = true;

function ExpandAndCollapsheaderNews(IsFirstTime)
{

    document.getElementById('headerNewsContent').style.visibility = "visible";
 
    document.getElementById('headerLoginArrow').style.background = "url('/SharifKishWebSite/SharifKish_WebUI/App_Themes/ImagesII/sidebar_header_arrowl.png') no-repeat left top";   
    document.getElementById('headerNewsArrow').style.background = "url('/SharifKishWebSite/SharifKish_WebUI/App_Themes/ImagesII/sidebar_header_arrowd.png') no-repeat left top";   
    document.getElementById('headerNoticeArrow').style.background = "url('/SharifKishWebSite/SharifKish_WebUI/App_Themes/ImagesII/sidebar_header_arrowl.png') no-repeat left top";  
    dvheaderNewsStyle = document.getElementById('headerNews').style;
    dvheaderNoticeStyle = document.getElementById('headerNotice').style;
    
    
    

    if (IsFirstTime)
    {
        if (parseInt(dvheaderNoticeStyle.marginTop) > -40 && parseInt(dvheaderNewsStyle.marginTop) < -250) 
        {
            ExpandAndCollapsheaderNotice(true);
            return;
        }
        if(dvheaderNewsStyle.marginTop == "" || parseInt(dvheaderNewsStyle.marginTop) < -250)
        {
            bExpandheaderNewsStatus = true;
            EndTopPosition = -37;
            dvheaderNewsStyle.marginTop = -264 + "px";
            dvheaderNoticeStyle.marginTop = -228 + "px";
            
            document.getElementById('headerNewsArrow').style.background = "url('/SharifKishWebSite/SharifKish_WebUI/App_Themes/ImagesII/sidebar_header_arrowd.png') no-repeat left top";   
            
        }
        else
        {
            bExpandheaderNewsStatus = false;
            
            EndTopPosition = -260;
            dvheaderNewsStyle.marginTop = -73 + "px";
            //dvheaderNoticeStyle.marginTop = -228;
            
            
            document.getElementById('headerNewsArrow').style.background = "url('/SharifKishWebSite/SharifKish_WebUI/App_Themes/ImagesII/sidebar_header_arrowd.png') no-repeat left top";   
        }
 
    }

    IsFirstTime = false;
    

    if(bExpandheaderNewsStatus == true)
    {
        curentPosition = dvheaderNoticeStyle.marginTop;
        curentPosition = parseInt(curentPosition) + 15;
        dvheaderNoticeStyle.marginTop = curentPosition + "px"
    }
    else
    {
        curentPosition = dvheaderNoticeStyle.marginTop;
        curentPosition = parseInt(curentPosition) + 15;
        dvheaderNoticeStyle.marginTop = curentPosition + "px"
    
        curentPosition = dvheaderNewsStyle.marginTop;
        curentPosition = parseInt(curentPosition) - 15;
        dvheaderNewsStyle.marginTop = curentPosition + "px"  
    }
    


    if(bExpandheaderNewsStatus == true && curentPosition <= EndTopPosition)
    {
       setTimeout('ExpandAndCollapsheaderNews(false)',1);       
    }
    else if(bExpandheaderNewsStatus == false && curentPosition >= EndTopPosition)
    {
        setTimeout('ExpandAndCollapsheaderNews(false)',1);       
    }
    else if (bExpandheaderNewsStatus == true)
    {
        dvheaderNoticeStyle.marginTop = -37 + "px";
    }
    else if (bExpandheaderNewsStatus == false)
    {
        dvheaderNewsStyle.marginTop = -264 + "px";
        dvheaderNoticeStyle.marginTop = -37 + "px";
    }
}  // function ExpandAndCollapsHeaderLogin(IsFirstTime)






function ExpandAndCollapsheaderNotice(IsFirstTime)
{
    
    
    document.getElementById('headerLoginArrow').style.background = "url('/SharifKishWebSite/SharifKish_WebUI/App_Themes/ImagesII/sidebar_header_arrowl.png') no-repeat left top";   
    document.getElementById('headerNewsArrow').style.background = "url('/SharifKishWebSite/SharifKish_WebUI/App_Themes/ImagesII/sidebar_header_arrowl.png') no-repeat left top";   
    document.getElementById('headerNoticeArrow').style.background = "url('/SharifKishWebSite/SharifKish_WebUI/App_Themes/ImagesII/sidebar_header_arrowd.png') no-repeat left top";   
    

    dvheaderNewsStyle = document.getElementById('headerNews').style;
    dvheaderNoticeStyle = document.getElementById('headerNotice').style;
    
   
    

    if (IsFirstTime)
    {
        if(dvheaderNoticeStyle.marginTop == ""  || (parseInt(dvheaderNewsStyle.marginTop) < -220 && parseInt(dvheaderNoticeStyle.marginTop) < -39))
        {
           return;
        }
        else if(parseInt(dvheaderNewsStyle.marginTop) == -264)
        {
            EndTopPosition = - 228;
            newsClosed = false; 
            //alert(dvheaderNewsStyle.marginTop);
            //alert(dvheaderNoticeStyle.marginTop);
            //dvheaderNewsStyle.marginTop = - 73;
            //dvheaderNoticeStyle.marginTop = - 229;
            
            
        }else{
            EndTopPosition = - 264;
            newsClosed = true; 
            //alert(dvheaderNewsStyle.marginTop);
            //alert(dvheaderNoticeStyle.marginTop);
            //dvheaderNewsStyle.marginTop = - 73;
            //dvheaderNoticeStyle.marginTop = - 228;
        }
        
    }
    
    IsFirstTime = false;
    
    if(newsClosed == true){
        curentPosition = dvheaderNewsStyle.marginTop;
        curentPosition = parseInt(curentPosition) - 15;
        dvheaderNewsStyle.marginTop = curentPosition + "px";
    }else{
        curentPosition = dvheaderNoticeStyle.marginTop;
        curentPosition = parseInt(curentPosition) - 15;
        dvheaderNoticeStyle.marginTop = curentPosition + "px";
    }
    
    
    
    
    if(curentPosition >= EndTopPosition)
    {   
        setTimeout('ExpandAndCollapsheaderNotice(false)',1);
    }
    else if(newsClosed == false)
    {
    
        dvheaderNoticeStyle.marginTop = -228 + "px";
    }
    else
    {
        dvheaderNewsStyle.marginTop = -264 + "px";
    }
    
    
}  // function ExpandAndCollapsHeaderLogin(IsFirstTime)




var bExpandBoxesStatus = true;

function DisplayMultiView(IsFirstTime , objDisplayedContent)
{

    objDisplayedContentStyle = objDisplayedContent.style;
    
    
    //  strats it sets the other div to hidden
    
   objdvMultiViewContent1Style = document.getElementById("dvMultiViewContent1").style;
   objdvMultiViewContent2Style = document.getElementById("dvMultiViewContent2").style;
   objdvMultiViewContent3Style = document.getElementById("dvMultiViewContent3").style;
    
    //  ends it sets the other div to hidden
    
    objBoxes = document.getElementById("boxes").style;
    
    
    if(IsFirstTime)
    {
    
        
        
        if(objDisplayedContentStyle.visibility == "visible" && parseInt(objBoxes.marginTop) > -20)
        {
            bExpandBoxesStatus = false;
            EndTopPosition = -315;
            objBoxes.marginTop = 10 + "px";
            //objDisplayedContentStyle.visibility = "hidden";
        }
        else if(parseInt(objBoxes.marginTop) > -20)
        {
            bExpandBoxesStatus = true;
            objBoxes.marginTop = -315 + "px";
            objdvMultiViewContent1Style.visibility = "hidden";
            objdvMultiViewContent2Style.visibility = "hidden";
            objdvMultiViewContent3Style.visibility = "hidden";
            objDisplayedContentStyle.visibility = "visible";
        }
        else
        {
            bExpandBoxesStatus = true;
            EndTopPosition = 0;
            objBoxes.marginTop = -320 + "px";
            objDisplayedContentStyle.visibility = "visible";
        }
    }    
    
    IsFirstTime = false;
    
    
    if(bExpandBoxesStatus == true)
    {
        curentPosition = objBoxes.marginTop;
        curentPosition = parseInt(curentPosition) + 40;
        objBoxes.marginTop = curentPosition + "px";   
    }
    else
    {
        curentPosition = objBoxes.marginTop;
        curentPosition = parseInt(curentPosition) - 40;
        objBoxes.marginTop = curentPosition + "px";
    }
            
    
    // document.getElementById("boxes").focus();
     if(bExpandBoxesStatus == true && curentPosition <= EndTopPosition)
     {
       setTimeout('DisplayMultiView(false ,' + objDisplayedContent.id + ')',1);       
      
     }
     else if(bExpandBoxesStatus == false && curentPosition >= EndTopPosition)
     {
       setTimeout('DisplayMultiView(false ,' + objDisplayedContent.id + ')',1);       
      
     }
     else if(bExpandBoxesStatus == true)
     {
        objBoxes.marginTop = 5 + "px";
     }
     else if(bExpandBoxesStatus == false)
     {
        objBoxes.marginTop = -320 + "px";
        objdvMultiViewContent1Style.visibility = "hidden";
        objdvMultiViewContent2Style.visibility = "hidden";
        objdvMultiViewContent3Style.visibility = "hidden";
     }
     
     
   
}


var bExpandFooterStatus = true;
var closeIt = true;
var tabMenuScrollPosition = 0;
function DisplayMultiView7(IsFirstTime , objDisplayedContent , tdtblTabMenu)
{
    
    objAllContent = document.getElementById("allContent").style;
    
    objDisplayedContentStyle = document.getElementById(objDisplayedContent).style;  // For Firefox we must send object ids in string format and then get element by id !!!
    objtdtblTabMenuStyle = document.getElementById(tdtblTabMenu).style;  // For Firefox we must send object ids in string format and then get element by id !!!
    objFooter = document.getElementById("footer").style;
    
      
    //  strats it sets the other div to hidden

   objdvMultiViewContent1Style = document.getElementById("dvMultiViewContent1").style;
   objdvMultiViewContent2Style = document.getElementById("dvMultiViewContent2").style;
   objdvMultiViewContent3Style = document.getElementById("dvMultiViewContent3").style;
   objdvMultiViewContent4Style = document.getElementById("dvMultiViewContent4").style;
   objdvMultiViewContent5Style = document.getElementById("dvMultiViewContent5").style;
   objdvMultiViewContent6Style = document.getElementById("dvMultiViewContent6").style;
   
       
   
    //  ends it sets the other div to hidden
    
    
    
   // HideAllSelectedColumn , ShowSelectedColumn HideSelectedColumn
    
    
    
    if(IsFirstTime)
    {

        if (objDisplayedContentStyle.visibility == "visible" && parseInt(objAllContent.height) > 300) 
        {
            bExpandFooterStatus = false;
            closeIt = true;
            EndTopPosition = 10;
            objAllContent.height = 320 + "px";
            SetMarginTop(-320 + "px");  
            HideAllSelectedColumn();
        }
        else if (parseInt(objAllContent.height) > 300) 
        {
            //bExpandFooterStatus = true;
            //objAllContent.height = 0 + "px";
            //SetMarginTop(0 + "px");

            closeIt = false;
            objdvMultiViewContent1Style.visibility = "hidden";
            objdvMultiViewContent2Style.visibility = "hidden";
            objdvMultiViewContent3Style.visibility = "hidden";
            objdvMultiViewContent4Style.visibility = "hidden";
            objdvMultiViewContent5Style.visibility = "hidden";
            objdvMultiViewContent6Style.visibility = "hidden";
            objDisplayedContentStyle.visibility = "visible";
            HideAllSelectedColumn();
            ShowSelectedColumn(tdtblTabMenu);
        }
        else 
        {
            bExpandFooterStatus = true;
            closeIt = true;
            EndTopPosition = 310;
            objFooter.marginTop = 0 + "px";
            objAllContent.height = 0 + "px";
            SetMarginTop(0 + "px");  
            objDisplayedContentStyle.visibility = "visible";
            HideAllSelectedColumn();
            ShowSelectedColumn(tdtblTabMenu); 
           
        }
    }    
    
    IsFirstTime = false;

    if (closeIt == true) {
        if (bExpandFooterStatus == true) {
            //curentPosition = objFooter.marginTop;
            //curentPosition = parseInt(curentPosition) + 40;
            //objFooter.marginTop = curentPosition + "px"; 
            CurrentHeight = parseInt(objAllContent.height) + 40;
            objAllContent.height = CurrentHeight + "px";
            SetMarginTop(-CurrentHeight + "px");

            // Scroll page down
            tabMenuScrollPosition += 20;
            window.scroll(0, tabMenuScrollPosition);
        }
        else {
            //curentPosition = objFooter.marginTop;
            //curentPosition = parseInt(curentPosition) - 40;
            //objFooter.marginTop = curentPosition + "px";
            CurrentHeight = parseInt(objAllContent.height) - 40;

            if (CurrentHeight >= 0) {
                objAllContent.height = CurrentHeight + "px";
                SetMarginTop(-CurrentHeight + "px");
            }
        }
    }
            
    
    // document.getElementById("boxes").focus();
     if(bExpandFooterStatus == true && CurrentHeight <= EndTopPosition)
     {
         setTimeout("DisplayMultiView7(false ,'" + objDisplayedContent + "','" + tdtblTabMenu + "')", 1);
     }
     else if(bExpandFooterStatus == false && CurrentHeight >= EndTopPosition)
     {
         setTimeout("DisplayMultiView7(false ,'" + objDisplayedContent + "','" + tdtblTabMenu + "')", 1);   
     }
     else if(bExpandFooterStatus == true)
     {
        //objFooter.marginTop = 5 + "px";
        objAllContent.height = 320 + "px";
        SetMarginTop(-320 + "px");  
     }
     else if(bExpandFooterStatus == false)
     {
        //objFooter.marginTop = 0 + "px";
        objAllContent.height = 0 + "px";
        SetMarginTop(0 + "px");  
        objDisplayedContent.visibility = "hidden";
        
        objdvMultiViewContent1Style.visibility = "hidden";
        objdvMultiViewContent2Style.visibility = "hidden";
        objdvMultiViewContent3Style.visibility = "hidden";
        objdvMultiViewContent4Style.visibility = "hidden";
        objdvMultiViewContent5Style.visibility = "hidden";
        objdvMultiViewContent6Style.visibility = "hidden";
        
        //objDisplayedContentStyle.height = 320 + "px";
        
     }
     
     
}  

function SetMarginTop(iMarginTop)
{
   document.getElementById("dvMultiViewContent2").style.marginTop = iMarginTop;
   document.getElementById("dvMultiViewContent3").style.marginTop = iMarginTop;
   document.getElementById("dvMultiViewContent4").style.marginTop = iMarginTop;
   document.getElementById("dvMultiViewContent5").style.marginTop = iMarginTop;
   document.getElementById("dvMultiViewContent6").style.marginTop = iMarginTop;
}

var tdSelectedColumn;
function SetMouseOverColunm(tdtblTabMenu)
{
    var objtdtblTabMenuStyle =  document.getElementById(tdtblTabMenu).style;
    objtdtblTabMenuStyle.background = "url('/SharifKishWebSite/SharifKish_WebUI/App_Themes/ImagesII/tab_menu_arrow.png') center bottom no-repeat"; 
    objtdtblTabMenuStyle.backgroundColor = "#ebf0f0";
    objtdtblTabMenuStyle.top = 1 + "px";
    objtdtblTabMenuStyle.cursor = "pointer";
}


function SetMouseOutColunm(tdtblTabMenu)
{
    if(tdSelectedColumn == null || tdSelectedColumn.id != tdtblTabMenu)
    {
        objtdtblTabMenuStyle =  document.getElementById(tdtblTabMenu).style;
        objtdtblTabMenuStyle.background = "none"; 
        objtdtblTabMenuStyle.top = 0 + "px";
    }
}




function HideAllSelectedColumn()
{
    tdSelectedColumn = null;
    HideSelectedColumn("tdtblTabMenu1");
    HideSelectedColumn("tdtblTabMenu2");
    HideSelectedColumn("tdtblTabMenu3");
    HideSelectedColumn("tdtblTabMenu4");
    HideSelectedColumn("tdtblTabMenu5");
    HideSelectedColumn("tdtblTabMenu6");
}


function ShowSelectedColumn(tdtblTabMenu)
{
    
    tdSelectedColumn = document.getElementById(tdtblTabMenu);
    objtdtblTabMenuStyle =  document.getElementById(tdtblTabMenu).style;
    objtdtblTabMenuStyle.background = "url('/SharifKishWebSite/SharifKish_WebUI/App_Themes/ImagesII/tab_menu_arrow.png') center bottom no-repeat"; 
    objtdtblTabMenuStyle.backgroundColor = "#ebf0f0";
    objtdtblTabMenuStyle.top = 1 + "px";
}

function HideSelectedColumn(tdtblTabMenu)
{
    objtdtblTabMenuStyle =  document.getElementById(tdtblTabMenu).style;
    objtdtblTabMenuStyle.background = "none"; 
    objtdtblTabMenuStyle.top = 0 + "px";
}


var bMouseOver = false;
var bIsTextSearchClick = false;
var bIsMouseOut = true;

function ShowSearch()
{
   var searchBoxStyle = document.getElementById("searchBox").style;
   var searchButtonStyle = document.getElementById("searchButton").style;
   
   if(searchBoxStyle.visibility == "hidden" || searchBoxStyle.visibility == "")
    {
        searchBoxStyle.visibility = "visible";
        searchButtonStyle.backgroundImage = "url(/SharifKishWebSite/SharifKish_WebUI/App_Themes/ImagesII/search_icon_2.png)";
        searchButtonStyle.backgroundPosition = "83% 50%";
        searchButtonStyle.backgroundRepeat = "no-repeat";
        searchButtonStyle.backgroundColor = "#2e4c6f";
        searchButtonStyle.top = "1px";
    }
    bMouseOver = false;
    bIsMouseOut = false;
}

function HiddenSearch()
{
    var searchBoxStyle = document.getElementById("searchBox").style;
    var searchButtonStyle = document.getElementById("searchButton").style;
    
    if(searchBoxStyle.visibility == "visible" && bMouseOver == false && bIsTextSearchClick == false)
    {
        searchBoxStyle.visibility = "hidden";
        searchButtonStyle.backgroundImage = "none";
        searchButtonStyle.backgroundColor = "transparent";
        searchButtonStyle.top = "auto";
    }
    bMouseOver = false;
    bIsMouseOut = true;
}

function MainMasterPage_OnClick()
{
    var searchBoxStyle = document.getElementById("searchBox").style;
    var searchButtonStyle = document.getElementById("searchButton").style;

    if (searchBoxStyle.visibility == "visible" && bIsTextSearchClick == true && bIsMouseOut == true)
    {
       bIsTextSearchClick = false;
       searchBoxStyle.visibility = "hidden";
       searchButtonStyle.backgroundImage = "none";
       searchButtonStyle.backgroundColor = "transparent";
       searchButtonStyle.top = "auto";
    }
}

function submitEnter(item, e) 
{
        var key;
        if (window.event) {
            key = window.event.keyCode;     //IE
        }else {
            key = e.which;     //firefox
        }

        if (key == 13) {
            document.getElementById(item).click();
            return false;
        } else {
            return true;
        }
}

function txtSearchTitle_onclick(imgbtnSearch)
{
    bIsTextSearchClick = true;
    
}


function mouseOverOutCheck()
{
    bMouseOver = true;
}




function setDivToBottomOfTd()
{   
    var iCount = 1;
    var divSeparator = WebForm_GetElementById("dataListSeparatorDown");
    while(divSeparator != null){
       
       parentOfDivSeparator = divSeparator.parentNode;
       var parentHeight = parentOfDivSeparator.offsetHeight;
       divSeparator.style.marginTop = (parentHeight - (divSeparator.offsetHeight*2)) + "px";
       divSeparator.id += iCount;
       iCount++;
       
       divSeparator = WebForm_GetElementById("dataListSeparatorDown");
    }
    
    // Scroll page down

    scrollPage("tblSecondTitle");
    
    return;

}

//------------------------ Scroll down when update panel shown ----------------------
function scrollPage(strDestinationID)
{
    var destinationY = WebForm_GetElementById(strDestinationID).offsetTop + 157;
    for (var i = document.documentElement.scrollTop; i < destinationY; i += 10) {
        window.scroll(0, i);
    }
    window.scroll(0, destinationY);
    window.scrollTo = null;
}
//---------------------------- Shahin Ghayouri 1388/05/26 ---------------------------


function ShowNewPage(strURL , strProperties)
{	
 	if (strProperties == null) 
 	{
		strProperties= "center=yes,height=600,width=800,status=no,scrollbars=yes";
	}
	window.open(strURL , '' , strProperties );
   	
}

function NavigateURLPage(strURL, strTarget)
{
    if(strTarget == null)
    {
        strTarget = "_self";
    }
    window.open(strURL, strTarget);
   	
}


function popImage(imageURL, imageTitle) 
{
    var PositionX = 100;
    var PositionY = 100;

    var AutoClose = false;

    if (parseInt(navigator.appVersion.charAt(0)) >= 4) {
        var isNN = (navigator.appName == "Netscape") ? 1 : 0;
        var isIE = (navigator.appName.indexOf("Microsoft") != -1) ? 1 : 0;
    }
    var optNN = 'scrollbars=no,width=200,height=200,left=' + PositionX + ',top=' + PositionY;
    var optIE = 'scrollbars=no,width=200,height=200,left=' + PositionX + ',top=' + PositionY;


    

    if (isNN) { imgWin = window.open('about:blank', '', optNN); }
    if (isIE) { imgWin = window.open('about:blank', '', optIE); }
    with (imgWin.document) {
        writeln('<html><head><title>Loading...</title><style>body{margin:0px;}</style>'); writeln('<sc' + 'ript>');
        writeln('var isNN,isIE;'); writeln('if (parseInt(navigator.appVersion.charAt(0))>=4){');
        writeln('isNN=(navigator.appName=="Netscape")?1:0;'); writeln('isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}');
        writeln('function reSizeToImage(){'); writeln('if (isIE){'); writeln('window.resizeTo(300,300);');
        writeln('width=300-(document.body.clientWidth-document.images[0].width);');
        writeln('height=300-(document.body.clientHeight-document.images[0].height);');
        writeln('window.resizeTo(width,height);}'); writeln('if (isNN){');
        writeln('window.innerWidth=document.images["George"].width;'); writeln('window.innerHeight=document.images["George"].height;}}');
        writeln('function doTitle(){document.title="' + imageTitle + '";}'); writeln('</sc' + 'ript>');
        if (!AutoClose) writeln('</head><body bgcolor=ffffff scroll="no" onload="reSizeToImage();doTitle();self.focus()">')
        else writeln('</head><body bgcolor=ffffff scroll="no" onload="reSizeToImage();doTitle();self.focus()" onblur="self.close()">');
        writeln('<img name="George" src=' + imageURL + ' style="display:block"></body></html>');
        close();
    } 
}


//----------------------------- Button effect on images -----------------------------
function btnPress(item) {
    var imageButton = WebForm_GetElementById(item.id);
    imageButton.style.marginTop = 3 + "px";
}

function btnRelease(item) {
    var imageButton = WebForm_GetElementById(item.id);
    imageButton.style.marginTop = 0 + "px";
}
//---------------------------- Shahin Ghayouri 1388/05/18 ---------------------------

//------------------------------- Search button effect ------------------------------
function UpButton(item) {

    var imageButton = WebForm_GetElementById(item.id);
    imageButton.src = "/SharifKishWebSite/SharifKish_WebUI/App_Themes/ImagesII/search_up_btn.png";   
}

function DownButton(item) {

    var imageButton = WebForm_GetElementById(item.id);
    imageButton.src = "/SharifKishWebSite/SharifKish_WebUI/App_Themes/ImagesII/search_down_btn.png"; 
}
//---------------------------- Shahin Ghayouri 1388/06/25 ---------------------------

