﻿// JScript File

// This script function is called when the user changes the zoom level (articles zoom level, 
// in a category page or a channel page).
//function ChangeZoom(zoomLevel, pathPrefix)
//{
//    // open the ajax dummy page with "action=5" (in order to update the session)
//    var xmlHTTP = new ActiveXObject("Microsoft.XMLHTTP");
//    
//    // pathPrefix should hold the absolut path of the website (e.g: "http://localhost/SmartContent").
//    var getCmd = pathPrefix + "/AjaxPages/AjaxDummySettingsPage.aspx?action=5&param=" + zoomLevel;     
//	
//	xmlHTTP.open("POST", getCmd, false);
//	xmlHTTP.send(null);	
//	
//	// don't return false, because the event that triggers this script function should
//	// also trigger a code-behind event handler. if 'false' will be returned, the code-behind
//	// event handler won't be executed.
//	
//	// return false;		
//}

// This script function is called when the user changes the articles view from "All news" view
// to "Keywords only" view (and vice versa) in a category page or a channel page 
// (using the "NavBarView" control).
function SwitchArticlesView(viewType)
{
  var url = "../AjaxPages/AjaxDummySettingsPage.aspx?action=7&param=" + viewType; 
  var http_request = false;

 // open the ajax dummy page with "action=7" (in order to update the session)
        if (window.XMLHttpRequest) { // Mozilla, Safari,...
            http_request = new XMLHttpRequest();
            if (http_request.overrideMimeType) {
                http_request.overrideMimeType('text/xml');
                // See note below about this line
            }
        } else if (window.ActiveXObject) { // IE
            try {
                http_request = new ActiveXObject("Msxml2.XMLHTTP");
            } catch (e) {
                try {
                    http_request = new ActiveXObject("Microsoft.XMLHTTP");
                } catch (e) {}
            }
        }
        http_request.open('POST', url, false);
        http_request.send('');
        // don't return false, because the event that triggers this script function should
	    // also trigger a code-behind event handler. if 'false' will be returned, the code-behind
	    // event handler won't be executed.
        
        return true;  
}




// This script function is called when the user changes the Quotes view from "All quotes" view
// to "marked only" or "unmarked only" view (and vice versa) in a portfolio page , a indices page 
//or in a currencies page   (using the "NavBarView" control).

function SwitchQuotesView(viewType)
{
    var url = "../../AjaxPages/AjaxDummySettingsPage.aspx?action=8&param=" + viewType; 
   
     var http_request = false;

 // open the ajax dummy page with "action=8" (in order to update the session)
        if (window.XMLHttpRequest) { // Mozilla, Safari,...
            http_request = new XMLHttpRequest();
            if (http_request.overrideMimeType) {
                http_request.overrideMimeType('text/xml');
                // See note below about this line
            }
        } else if (window.ActiveXObject) { // IE
            try {
                http_request = new ActiveXObject("Msxml2.XMLHTTP");
            } catch (e) {
                try {
                    http_request = new ActiveXObject("Microsoft.XMLHTTP");
                } catch (e) {}
            }
        }
              
        http_request.open('POST', url, false);
        http_request.send('');
        // don't return false, because the event that triggers this script function should
	    // also trigger a code-behind event handler. if 'false' will be returned, the code-behind
	    // event handler won't be executed.
	
        return true;
}