﻿/// <summary>
///     Product:        Enewspaper
///     Classname:    	Common script
///     Version:        02.02 |	12 February, 2009 - 10 March, 2009
///     Programmer:     Soren [sunrise.freedom@gamil.com]
///     Purpose: 
///         The class common java script programming tasks.
/// 
///     Copyright 2009 by Digital Secure Co. All Rights Reserved. 
/// </summary>
/// <remark>
///     For Implement NewsCut mechanism do these task :
///
///     In Page.xslt put this line at Generating Image Map block.
///     <!-- .....hold news image [news cut] per news ID - only the text news has news cut !............... -->
///     NewsCutItems.put('<xsl:value-of select ="nws_Id"/>', '<xsl:value-of select ="NewsPhoto/prp_ImageURL"/>');
///
///     In Common.js put this lint at showContentForArea(divId) function
///      // hold current active news id.
///     SetCurrentNewsID(divId);
///
/// </remark>
/// <IsMultiEdition>True</IsMultiEdition>
/// <classVersion>005</classVersion>

var NewsCutItems = new Hashtable();
var CurrentNewsID = '0';

/// Hold current NewsId.
function SetCurrentNewsID(newsID) {
    CurrentNewsID = newsID;
}


// Submit the search
// the type should be "LastNewspaper" OR "CurrentNewspaper";
function SubmitQuickSearch(type) {
    var txt = document.getElementById("txtSearch").value

    if (txt.length < 3) {
        alert('برای انجام عمل جستجو باید یک کلمه با حداقل 3 حرف در مکان مورد نظر وارد کنید');
        return;
    }
    else {
        document.getElementById("limitation").value = type.toString();

        // Get Newspaper Number From Parent HTML Page
        document.getElementById("newspaperNumber").value = document.getElementById("nsn_Number").getAttribute("value");

        document.searchForm.submit();
    }
}
