/*-------------------------
Cibavision Global JS
-------------------------*/

var baseUrl = window.location.href.split("/")[0]+"/"+window.location.href.split("/")[1]+"/"+window.location.href.split("/")[2]+"/";

var baseUrlcet= baseUrl + "professional/cet/downloads/";

var baseUrldanda= baseUrl + "education/downloads/";

/* Generic Popup function */
	function openPopupCustom( url, windowname, height, width, scroll ) {
	  var popup = window.open( url , windowname, "toolbar=no,status=yes,scrollbars="+scroll+",menubar=no,locationbar=no,top=35,left=20,width="+width+",height="+height+",resizable=yes");
	  popup.focus();
	}


// Grabs a parameter from the URL.  Returns an empty
// string if parameter does not exist.
function getParameter(param) {
        var val = "";
        var qs = window.location.search;
        var start = qs.indexOf(param);

        if (start != -1) {
                start += param.length + 1;
                var end = qs.indexOf("&", start);
                if (end == -1) {
                        end = qs.length
                }
                val = qs.substring(start,end);
        }
        return val;
}
// Call it like this: var contextstrform = getParameter("contextForm");


function set_cookie ( name, value, exp_y, exp_m, exp_d, path, domain, secure )
{
  var cookie_string = name + "=" + escape ( value );

  if ( exp_y )
  {
    var expires = new Date ( exp_y, exp_m, exp_d );
    cookie_string += "; expires=" + expires.toGMTString();
  }

  if ( path )
        cookie_string += "; path=" + escape ( path );

  if ( domain )
        cookie_string += "; domain=" + escape ( domain );
  
  if ( secure )
        cookie_string += "; secure";
    
  document.cookie = cookie_string;

}

function get_cookie ( cookie_name )
{
  var results = document.cookie.match ( cookie_name + '=(.*?)(;|$)' );

  if ( results )
    return ( unescape ( results[1] ) );
  else
    return null;
}