 #/* AJAX Functionality */
 
 @module "optemo_module", ->
-  #This variable is used to determine wether the code is embedded or not
-  if (typeof OPT_REMOTE is "undefined")
-    OPT_REMOTE = false
+
   #Set up the AJAX send function for use with the back button
-  $(document).ready( ->
+  $(document).ready ->
     $.history.init(optemo_module.ajaxsend,{unescape: true})
-  )
 
   #****Public Functions****
   # Submit a categorical filter, e.g. brand.

          if(not mydata.hasOwnProperty(i)) # Do not merge properties that already exist.
            mydata[i] = content
        myurl = myurl.slice(0, myurl.indexOf('?'))                   
      JSONP.get(OPT_REMOTE+myurl,mydata,ajaxhandler)
    else
      $.ajax(
        #type: (mydata==null)?"GET":"POST",


  #****Private Functions****
  quickajaxcall = (element_name, myurl, fn) -> # The purpose of this is to do an ajax load without having to go through the relatively heavy ajaxcall().
    if (window.OPT_REMOTE)
      #Check for absolute urls
      JSONP.get(window.OPT_REMOTE+myurl.replace(/http:\/\/[^\/]+/,''), {embedding:'true', category_id: window.opt_category_id}, (data) ->
        $(element_name).html(data)
        if (fn) 
          fn()
