 #/* 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.


  #****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 (OPT_REMOTE)
      #Check for absolute urls
      JSONP.get(OPT_REMOTE+myurl.replace(/http:\/\/[^\/]+/,''), {embedding:'true', category_id: window.opt_category_id}, (data) ->
        $(element_name).html(data)
        if (fn) 
          fn()

    if (/localhost/.test(myurl) or /192\.168/.test(myurl))
      val_timeout = 100000
    lis.socket_error_timer = setTimeout("optemo_module.ajaxerror()", val_timeout)
    if (window.OPT_REMOTE)
      #Embedded Layout
      myurl = if myurl? then myurl.replace(/http:\/\/[^\/]+/,'') else "/compare"
      # There is a bug in the JSONP implementation. If there is a "?" in the URL, with parameters already on it,
      # this JSONP implementation will add another "?" for the second set of parameters (specified in mydata).
      # For now, just check for a "?" and take those parameters into mydata, 
