if(typeof adclip=="undefined" && !adclip) {

        
        var adclip = {'tmp':{}, 'client': {}, 'url': {}, 'clips': {}, 'element': {}, 'events': {}, 'vars': {}, 'ajax':{}, 'utils':{}, 'fajax':{}, 'time':{}, 'asset':{}, 'array':{}, 'color':{}, 'string':{}};
        adclip.defLang = '';
        
        // goPage
        adclip.vars.goPage = {
                
                'search':'004.aspx',
                'advancedsearch':'102.aspx',
                'detail':'005.aspx',
                'login':'UserArea/006.aspx',
                'addad':'Ads/002.aspx',
                'addclip':'Clips/064.aspx',
                'adclipresult':'core2.aspx',
                'highlightcredits':'116.aspx',
                
                'goto': 'Clips/goto.aspx',
                
                'clipchannel': 'scripts/clips/pages/channel/c@tlp_channel@/Default.aspx',
                'cliphome': 'scripts/clips/pages/home/h@tlp_home@/Default.aspx'
                
        };
        
        //define vars
        adclip.vars.baseURL = 'http://www.adclip.com/';
        adclip.vars.baseClipsScripts = adclip.vars.baseURL + 'scripts/clips/base.ashx';
        adclip.vars.baseImagePath = adclip.vars.baseURL + 'scripts/clips/img/';
        adclip.vars.hitSource = {
                    'SEARCH_PAGE' : '1',
                    'HIGHLIGHT': '2',
                    'EXTERNAL_LINK' : '3'
        };
        
        

        
        (function() {

            //initialization, browser, os detection
            var d, n, nav, dom, nu='', brow='', ie, ie4, ie5, ie5x, ie6, ie7;
            var ns4, moz, moz_rv_sub, release_date='', moz_brow, moz_brow_nu='', moz_brow_nu_sub='', rv_full=''; 
            var mac, win, old, lin, ie5mac, ie5xwin, konq, saf, op, op4, op5, op6, op7;

            d=document;
            n=navigator;
            nav=n.appVersion;
            
            nan=n.appName;
            nua=n.userAgent;
            old=(nav.substring(0,1)<4);
            mac=(nav.indexOf('Mac')!=-1);
            win=( ( (nav.indexOf('Win')!=-1) || (nav.indexOf('NT')!=-1) ) && !mac)?true:false;
            lin=(nua.indexOf('Linux')!=-1);
            // begin primary dom/ns4 test
            // this is the most important test on the page
            if ( !document.layers )
            {
                dom = ( d.getElementById ) ? d.getElementById : false;
            }
            else { 
                dom = false; 
                ns4 = true;// only netscape 4 supports document layers
            }
            // end main dom/ns4 test

            op=(nua.indexOf('Opera')!=-1);
            saf=(nua.indexOf('Safari')!=-1);
            konq=(!saf && (nua.indexOf('Konqueror')!=-1) ) ? true : false;
            moz=( (!saf && !konq ) && ( nua.indexOf('Gecko')!=-1 ) ) ? true : false;
            ie=((nua.indexOf('MSIE')!=-1)&&!op);
            if (op)
            {
                str_pos=nua.indexOf('Opera');
                nu=nua.substr((str_pos+6),4);
                brow = 'Opera';
            }
            else if (saf)
            {
                str_pos=nua.indexOf('Safari');
                nu=nua.substr((str_pos+7),5);
                brow = 'Safari';
            }
            else if (konq)
            {
                str_pos=nua.indexOf('Konqueror');
                nu=nua.substr((str_pos+10),3);
                brow = 'Konqueror';
            }
            // this part is complicated a bit, don't mess with it unless you understand regular expressions
            // note, for most comparisons that are practical, compare the 3 digit rv nubmer, that is the output
            // placed into 'nu'.
            else if (moz)
            {
                // regular expression pattern that will be used to extract main version/rv numbers
                pattern = /[(); \n]/;
                // moz type array, add to this if you need to
                moz_types = new Array( 'Firebird', 'Phoenix', 'Firefox', 'Iceweasel', 'Galeon', 'K-Meleon', 'Camino', 'Epiphany', 'Netscape6', 'Netscape', 'MultiZilla', 'Gecko Debian', 'rv' );
                rv_pos = nua.indexOf( 'rv' );// find 'rv' position in nua string
                rv_full = nua.substr( rv_pos + 3, 6 );// cut out maximum size it can be, eg: 1.8a2, 1.0.0 etc
                // search for occurance of any of characters in pattern, if found get position of that character
                rv_slice = ( rv_full.search( pattern ) != -1 ) ? rv_full.search( pattern ) : '';
                //check to make sure there was a result, if not do  nothing
                // otherwise slice out the part that you want if there is a slice position
                ( rv_slice ) ? rv_full = rv_full.substr( 0, rv_slice ) : '';
                // this is the working id number, 3 digits, you'd use this for 
                // number comparison, like if nu >= 1.3 do something
                nu = rv_full.substr( 0, 3 );
                for (i=0; i < moz_types.length; i++)
                {
                    if ( nua.indexOf( moz_types[i]) !=-1 )
                    {
                        moz_brow = moz_types[i];
                        break;
                    }
                }
                if ( moz_brow )// if it was found in the array
                {
                    str_pos=nua.indexOf(moz_brow);// extract string position
                    moz_brow_nu = nua.substr( (str_pos + moz_brow.length + 1 ) ,3);// slice out working number, 3 digit
                    // if you got it, use it, else use nu
                    moz_brow_nu = ( isNaN( moz_brow_nu ) ) ? moz_brow_nu = nu: moz_brow_nu;
                    moz_brow_nu_sub = nua.substr( (str_pos + moz_brow.length + 1 ), 8);
                    // this makes sure that it's only the id number
                    sub_nu_slice = ( moz_brow_nu_sub.search( pattern ) != -1 ) ? moz_brow_nu_sub.search( pattern ) : '';
                    //check to make sure there was a result, if not do  nothing
                    ( sub_nu_slice ) ? moz_brow_nu_sub = moz_brow_nu_sub.substr( 0, sub_nu_slice ) : '';
                }
                if ( moz_brow == 'Netscape6' )
                {
                    moz_brow = 'Netscape';
                }
                else if ( moz_brow == 'rv' || moz_brow == '' )// default value if no other gecko name fit
                {
                    moz_brow = 'Mozilla';
                } 
                if ( !moz_brow_nu )// use rv number if nothing else is available
                {
                    moz_brow_nu = nu;
                    moz_brow_nu_sub = nu;
                }
                if (n.productSub)
                {
                    release_date = n.productSub;
                }
            }
            else if (ie)
            {
                str_pos=nua.indexOf('MSIE');
                nu=nua.substr((str_pos+5),3);
                brow = 'Microsoft Internet Explorer';
            }
            // default to navigator app name
            else 
            {
                brow = nan;
            }
            op5=(op&&(nu.substring(0,1)==5));
            op6=(op&&(nu.substring(0,1)==6));
            op7=(op&&(nu.substring(0,1)==7));
            op8=(op&&(nu.substring(0,1)==8));
            op9=(op&&(nu.substring(0,1)==9));
            ie4=(ie&&!dom);
            ie5=(ie&&(nu.substring(0,1)==5));
            ie6=(ie&&(nu.substring(0,1)==6));
            ie7=(ie&&(nu.substring(0,1)==7));
            // default to get number from navigator app version.
            if(!nu) 
            {
                nu = nav.substring(0,1);
            }
            /*ie5x tests only for functionavlity. dom or ie5x would be default settings. 
            Opera will register true in this test if set to identify as IE 5*/
            ie5x=(d.all&&dom);
            ie5mac=(mac&&ie5);
            ie5xwin=(win&&ie5x);
            
            
        
            adclip.client = {
                'nu':              nu,
                'brow':            brow,
                'ie':              ie,
                'ie4':             ie4,
                'ie5':             ie5,
                'ie5x':            ie5x,
                'ie6':             ie6,
                'ie7':             ie7,
                'ns4':             ns4,
                'moz':             moz,
                'moz_rv_sub':      moz_rv_sub,
                'release_date':    release_date,
                'moz_brow':        moz_brow,
                'moz_brow_nu':     moz_brow_nu,
                'moz_brow_nu_sub': moz_brow_nu_sub,
                'rv_full':         rv_full,
                'mac':             mac,
                'win':             win,
                'old':             old,
                'lin':             lin,
                'ie5mac':          ie5mac,
                'ie5xwin':         ie5xwin,
                'konq':            konq,
                'saf':             saf,
                'op':              op,
                'op4':             op4,
                'op5':             op5,
                'op6':             op6,
                'op7':             op7
            }
        

        } ());

        

        
        
        adclip.vars.categoriesDependentOnCountry = {
            // countryID: [catID1, ..., catIDn-1]
            /*
            '1': [1,2,3], //Portugal
            '2': [1,3], //Inglaterra
            //'3': [1,2]  // Brasil
            */

            
            
        };
        
        
        // translations
        
        adclip.translations = {
        
            

            /*        
            'pt_pt':{
                    'LANG': 'pt-PT',
                    'CATEGORIES_BY_ID': {'1': 'Imobiliário', '2': 'Automóveis', '3': 'Emprego'},
                    'REGIONS_BY_ID': {'1': {
                                            '1': 'Portugal',
                                            '2': 'Inglaterra',
                                            //'3': 'Brasil'
                                            }
                    }
                    
            },
            'en_us':{
                    'LANG': 'en-US',
                    'CATEGORIES_BY_ID': {'1': 'Real Estate', '2': 'Cars', '3': 'Jobs'},
                    'REGIONS_BY_ID': {'1': {
                                            '1': 'Portugal',
                                            '2': 'England',
                                            //'3': 'Brazil'
                                            }
                    }
            
            },
            */
            
            
            'global': {
                    'LANGUAGES': {
                        'pt-PT': 'Português',
                        'en-US': 'English'
                    },
                    'REGION1_BY_LANGUAGE': {
                        'pt-PT': 1,
                        'en-US': 2
                    }
                    
                    
            }
        };
        
        adclip.addTranslations = function(lang, translations){
            var mix = {};
            lang = lang.toLowerCase().replace("-", '_');
            
            for(var x in adclip.translations[lang]){
                mix[x] = adclip.translations[lang][x];
            }
            
            for(var x in translations){
                mix[x] = translations[x];
            }
            
            adclip.translations[lang] = mix;
        }
        
        
        adclip.t = function(sentence, lang){
            if(typeof lang == 'undefined' || !lang) lang = adclip.lang();
            lang = lang.toLowerCase().replace("-", '_');
            return adclip.translations[lang][sentence];
            
        }

        adclip.url.clear = function(str) {
            return str.replace(/&&/gi, '&')
                      .replace(/\?&/gi, '?')
                      .replace(/&$/gi, '');
        }

        adclip.url.encode = function(str) {
              str = encodeURIComponent(str);
              return str;
        }
        
        adclip.url.decode = function(str) {
            str = str.replace(/\+/gi, ' ');
            str = decodeURIComponent(str);
            return str;
        }

        adclip.lang = function(lang){
            if(adclip.isTrue(lang)){
                 adclip.defLang = lang;
             } else {
                if(adclip.defLang == ''){
                    return 'en-US';
                } else {
                    return adclip.defLang;
                }
            }
        }
       
       
        adclip.getLanguage = function(lang){
            if(typeof lang == 'undefined' || !lang) lang = adclip.lang();
            return adclip.translations['global']['LANGUAGES'][lang];   
        }
               
       
        adclip.getCategory = function(id, lang){
            if(typeof lang == 'undefined' || !lang) lang = adclip.lang();
            lang = lang.toLowerCase().replace("-", '_');
            return adclip.url.decode(adclip.translations[lang]['CATEGORIES_BY_ID'][id]);   
        }
        
        
        adclip.getRegion = function(level, id, lang){
            if(typeof lang == 'undefined' || !lang) lang = adclip.lang();
            lang = lang.toLowerCase().replace("-", '_');
            return adclip.url.decode(adclip.translations[lang]['REGIONS_BY_ID'][level][id]);
        }
        
        
        adclip.isTrue = function(varTest){
            if(typeof varTest != 'undefined' && (varTest == true || varTest || varTest != '' || varTest != 0 )){
                return true;
            } else {
                return false;
            }
        }
        
        
        /**
         * Retruns the x position of the given object in the window / screen.
         */
        adclip.element.findPosX = function(obj) {
            var curleft = 0;
            if(obj.offsetParent)
                while(1) 
                {
                  if(obj.style.position.toLowerCase() != 'relative' && obj.style.position.toLowerCase() != 'absolute')
                    curleft += obj.offsetLeft;
                    
                  if(!obj.offsetParent)
                    break;
                  obj = obj.offsetParent;
                }
            else if(obj.x)
                if(obj.style.position.toLowerCase() != 'relative' && obj.style.position.toLowerCase() != 'absolute')
                    curleft += obj.x;
            return curleft;
        }

        /**
         * Retruns the x position of the given object in the window / screen.
         */
        adclip.element.findPosY = function(obj) {
            var curtop = 0;
            if(obj.offsetParent)
                while(1)
                {
                  if(obj.style.position.toLowerCase() != 'relative' && obj.style.position.toLowerCase() != 'absolute')
                    curtop += obj.offsetTop;
                    
                  if(!obj.offsetParent)
                    break;
                  obj = obj.offsetParent;
                }
            else if(obj.y)
                if(obj.style.position.toLowerCase() != 'relative' && obj.style.position.toLowerCase() != 'absolute')
                    curtop += obj.y;
            return curtop;
        }
        
        adclip.events.onChangeLanguage = function(opts){
            adclip.lang(opts.language);
            
            // change language on SearchBox
            if(typeof adclip.clips.searchBox.prototype.instance != "undefined" && adclip.clips.searchBox.prototype.instance.length > 0){
                for(var x in adclip.clips.searchBox.prototype.instance){
                    adclip.clips.searchBox.prototype.instance[x].draw();
                }
            
            }
            
            
            
            // callBack
            if(typeof adclip_onChangeLanguage == "function") adclip_onChangeLanguage(opts);
        }
        
        
        
        
        /** XHConn - Simple XMLHTTP Interface - bfults@gmail.com - 2005-04-08        **
         ** Code licensed under Creative Commons Attribution-ShareAlike License      **
         ** http://creativecommons.org/licenses/by-sa/2.0/                           **/
        adclip.ajax.XHConn = function()
        {
          var xmlhttp, bComplete = false;
          try { xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); }
          catch (e) { try { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); }
          catch (e) { try { xmlhttp = new XMLHttpRequest(); }
          catch (e) { xmlhttp = false; }}}
          if (!xmlhttp) return null;
          this.connect = function(sURL, sMethod, sVars, fnDone, async)
          {
            if (!xmlhttp) return false;
            bComplete = false;
            sMethod = sMethod.toUpperCase();

            try {
              if (sMethod == "GET")
              {
                xmlhttp.open(sMethod, sURL+"?"+sVars, async);
                sVars = "";
              }
              else
              {
                xmlhttp.open(sMethod, sURL, async);
                xmlhttp.setRequestHeader("Method", "POST "+sURL+" HTTP/1.1");
                xmlhttp.setRequestHeader("Content-Type",
                  "application/x-www-form-urlencoded");
              }
              xmlhttp.onreadystatechange = function(){
                if (xmlhttp.readyState == 4 && !bComplete)
                {
                  bComplete = true;
                  fnDone(xmlhttp);
                }};
              xmlhttp.send(sVars);
            }
            catch(z) { return false; }
            return true;
          };
          return this;
        }
        
        
        adclip.url.maker = function(type, config, values, locationOn){
            var url = '';
            var page = adclip.vars.goPage[type.toLowerCase()];
            if(adclip.isTrue(config.opt_target)){
                // Outside of my site
                url = adclip.vars.baseURL + adclip.vars.goPage.adclipresult + '?';
                
            } else {
                //On my site                
                if(config.opt_urlTarget.split('?').length > 1){
                    url += config.opt_urlTarget; // + '&';
                    // para browser normais poderia ser config.opt_urlTarget.substr(-1,1) mas em IE assim retorna sempre "h" independente do final, vai-se lá entender.
                    if(config.opt_urlTarget.substr(config.opt_urlTarget.length-1,1) != '?' && config.opt_urlTarget.substr(config.opt_urlTarget.length-1,1) != '&') url += '&';
                } else {
                    url += config.opt_urlTarget + '?';
                }
            }
                
            vaulesParams = '';
            for(var c in values){
                var val = (typeof(values[c]) == "string") ? values[c].replace(/#/gi, '') : values[c];
                vaulesParams += '&' + c + '=' + val;
            }
            
            
            var tmp = '';
            tmp =  vaulesParams +
                    (!adclip.isTrue(values.language) ? '&language=' + config.language : '') +
                    (config.ownerOnly ? '&ow=1' : '') +
                    (config.characterSet ? '&charSet=' + config.characterSet : '');
                    
            
            url += "bcparameters=" + adclip.url.encode(page + '?' + tmp);
            url += (config.publicKey ? '&clip=' + config.publicKey : '');
            


            if(adclip.isTrue(locationOn)){
                parent.location = url;
            } else {
                return url;
            }
            
        };
        

        
        adclip.utils.colorHexStrip = function(color){
            return (typeof(color) == "string") ? color.replace(/#|\s/gi, '') : color;
        };
       
       // emula ajax por JS Tag
        adclip.fajax.getObj = function(src, objReturn){
           if(!adclip.isTrue(objReturn)) objReturn = 'bc_fajaxObj';
           var head = document.getElementsByTagName("head")[0];
           var script = document.createElement('script');
           
           script.type = 'text/javascript';
           script.src = src + (src.indexOf('?')>0 ? '&' : '?') + "objReturn=" + objReturn + '&' + adclip.time.mktime();
           head.appendChild(script);
        }
        
        
        adclip.time.mktime = function() {
            // http://kevin.vanzonneveld.net
            // +   original by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
            // +   improved by: baris ozdil
            // +      input by: gabriel paderni 
            // +   improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
            // *     example 1: mktime( 14, 10, 2, 2, 1, 2008 );
            // *     returns 1: 1201871402
            
            var no, i = 0, d = new Date(), argv = arguments, argc = argv.length;
         
            var dateManip = {
                0: function(tt){ return d.setHours(tt); },
                1: function(tt){ return d.setMinutes(tt); },
                2: function(tt){ return d.setSeconds(tt); },
                3: function(tt){ return d.setMonth(parseInt(tt)-1); },
                4: function(tt){ return d.setDate(tt); },
                5: function(tt){ return d.setYear(tt); }
            };
         
            for( i = 0; i < argc; i++ ){
                no = parseInt(argv[i]);
                if(no && isNaN(no)){
                    return false;
                } else if(no){
                    // arg is number, let's manipulate date object
                    if(!dateManip[i](no)){
                        // failed
                        return false;
                    }
                }
            }
         
            return Math.floor(d.getTime()/1000);
        }
        
        
        
        adclip.asset.css = function(href, id){
            var head = document.getElementsByTagName("head")[0];
            var link = document.createElement('link');
            if(adclip.isTrue(id)){
                link.id = id;
            }
            link.type = 'text/css';
            link.href = href;
            link.rel = 'stylesheet';
            head.appendChild(link);
        }
        

        adclip.array.existValue = function(needle, haystack, strict){
            // *     example 1: adclip.array.existValue(2, [1,2,3]);
            // *     returns 1: true

            var found = false, key, strict = !!strict;
         
            for (key in haystack) {
                if ((strict && haystack[key] === needle) || (!strict && haystack[key] == needle)) {
                    found = true;
                    break;
                }
            }
         
            return found;
        }

        
        adclip.array.implode = function( glue, pieces ) {
            return ( ( pieces instanceof Array ) ? pieces.join ( glue ) : pieces );
        }
        
        // Color Tools
        
        adclip.color.hex2rgb = function(hex){

              var o=hex.toLowerCase().replace(/#/gi, '');
              var c=o.length;
              
              if(c == 3){
                o = o + o;
              }
              else if(c < 6){
                return [64, 127, 127];
              }
              
	            return {  r: parseInt(o.slice(0,2),16),
                        g: parseInt(o.slice(2,4),16),
                        b: parseInt(o.slice(4),16)
                     }

        }
        
        
        adclip.color.rgb2hsl = function(r, g, b){
            r /= 255, g /= 255, b /= 255;
            var max = Math.max(r, g, b), min = Math.min(r, g, b);
            var h, s, l = (max + min) / 2;

            if(max == min){
                h = s = 0; // achromatic
            }else{
                var d = max - min;
                s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
                switch(max){
                    case r: h = (g - b) / d + (g < b ? 6 : 0); break;
                    case g: h = (b - r) / d + 2; break;
                    case b: h = (r - g) / d + 4; break;
                }
                h /= 6;
            }

            //return [h, s, l];
            return {'h': h, 's': s, 'l': l};
        }
        
        adclip.color.colorWhiteOrBlack = function(hex){

            var rgb = adclip.color.hex2rgb(hex);
            var hsl = adclip.color.rgb2hsl(rgb.r, rgb.g, rgb.b);
            return hsl.l > 0.5 ? '#000000' : '#ffffff';
            
        }
        
        
       adclip.string.trim =  function(str, charlist) {
            var whitespace, l = 0, i = 0;
            str += '';
            
            if (!charlist) {
                // default list
                whitespace = " \n\r\t\f\x0b\xa0\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u3000";
            } else {
                // preg_quote custom list
                charlist += '';
                whitespace = charlist.replace(/([\[\]\(\)\.\?\/\*\{\}\+\$\^\:])/g, '\$1');
            }
            
            l = str.length;
            for (i = 0; i < l; i++) {
                if (whitespace.indexOf(str.charAt(i)) === -1) {
                    str = str.substring(i);
                    break;
                }
            }
            
            l = str.length;
            for (i = l - 1; i >= 0; i--) {
                if (whitespace.indexOf(str.charAt(i)) === -1) {
                    str = str.substring(0, i + 1);
                    break;
                }
            }
            
            return whitespace.indexOf(str.charAt(0)) === -1 ? str : '';
        }
        
}

if(typeof adclip.clips.results=="undefined" || !adclip.clip.Results){



    adclip.clips.results = function() {

        var strHref;
        var strQueryString;
        var params;
        var BCURL;
        var clipKey;
        var hideMenu = 0;
        var bcparameters;
        var lu = '';

        if (window.location.href.split('acgoto=')[1] && !window.location.href.split('bcparameters=')[1]) {

            clipKey = window.location.href.split('acgoto=')[1].split('&')[0];
            strHref = adclip.url.maker('goto',
                                        {
                                            'publicKey': clipKey,
                                            'opt_urlTarget': this.clearURLparameters(window.location.href)
                                        },
                                        {},
                                        false
                                       );
        }
        else if (!window.location.href.split('bcparameters=')[1] // if not exist bcparameters
            && typeof adclip_ResultConf != 'undefined'
            && typeof adclip_ResultConf.onLoad_goTo != 'undefined'
            ) {
            lu = '';
            if (typeof adclip_ResultConf.onLoad_goTo == 'undefined') adclip_ResultConf.onLoad_goTo = { 'config': {}, 'params': {} };
            adclip_ResultConf.onLoad_goTo.config.opt_target = false;

            switch (adclip_ResultConf.onLoad_goTo.page) {
                case 'clipchannel':
                    adclip.vars.goPage[adclip_ResultConf.onLoad_goTo.page] = adclip.vars.goPage[adclip_ResultConf.onLoad_goTo.page].replace(/@tlp_channel@/gi, adclip_ResultConf.onLoad_goTo.params.tc)
                    break;
                case 'cliphome':
                    hideMenu = 0;
                    adclip.vars.goPage[adclip_ResultConf.onLoad_goTo.page] = adclip.vars.goPage[adclip_ResultConf.onLoad_goTo.page].replace(/@tlp_home@/gi, adclip_ResultConf.onLoad_goTo.params.th)
                    break;
            }

            strHref = adclip.url.maker(adclip_ResultConf.onLoad_goTo.page,
                               adclip_ResultConf.onLoad_goTo.config,
                               adclip_ResultConf.onLoad_goTo.params,
                               false);
            
        } else {
            strHref = window.location.href;
        }

        strQueryString = strHref.split('?');
        if (strQueryString[1]) {
            strQueryString[1] = strQueryString[1].split("#")[0];
            params = strQueryString[1].split("&");
            BCURL = strQueryString[0] + '?';
            clipKey = '';

            bcparameters = '';
            bcparametersExist = false;
            for (var x = 0; x <= params.length - 1; x++) {
                if (params[x].substr(0, 13) == "bcparameters=") {
                    bcparameters = params[x].substr(13);
                    bcparametersExist = true;
                }
                /**/
                else if (params[x].substr(0, 8) == "acgoto=") {
                    bcparameters = params[x].substr(8);
                    bcparametersExist = true;
                }

                else if (params[x].substr(0, 5) == "clip=") {
                    clipKey = '&' + params[x];
                }
                else if (params[x].substr(0, 3) == "oo=") {
                    hideMenu = params[x];
                }
                else {
                    BCURL += '&' + params[x];
                }


            }

            lu = adclip.url.encode(location.search.split('#')[0]);

            if (bcparametersExist) {
                bcparameters = encodeURI(adclip.url.decode(bcparameters));
                var ssl = bcparameters.split('hp=1').length > 1 ? true : false;

                var url = (ssl ? adclip.vars.baseURL.replace(/p:/i, 'ps:') : adclip.vars.baseURL) +
                  bcparameters +
                  (bcparameters.indexOf('?') > 0 ? '&' : '?') +
                  'BCURL=' + adclip.url.encode(adclip.url.clear(BCURL)) +
                  clipKey +
                  '&oo=' + (typeof adclip_ResultConf != 'undefined' && adclip_ResultConf.hide_menu ? 1 : hideMenu) +
                  (lu != '' ? '&lu=' + lu : '');


                document.write('<iframe width="100%" scrolling="no" height="1200" onload="adclip.tmp.resizeResultFrame();" frameborder="0" marginheight="0" marginwidth="0" id="adclipresult" name="content" src="' + adclip.url.clear(url) + '" allowtransparency="true"></iframe>');
                window.scrollTo(0, 0);
                adclip.tmp.height = -1;
                adclip.tmp.resizeResultFrame();
                setInterval("adclip.tmp.resizeResultFrame()", 100);
            }

        }
    }

    adclip.clips.results.prototype.clearURLparameters = function(url) {

        url = url.split("#")[0];
        var urlC = url.split('?');
        if (urlC[1]) {
            var urlP = urlC[1].split('&');
            var params = [];
            for (var x = 0; x <= urlP.length - 1; x++) {
                if (urlP[x].split("bcparameters=")[1]) continue;
                if (urlP[x].split("acgoto=")[1]) continue;
                params[params.length] = urlP[x];
            }
            return adclip.url.clear(urlC[0] + (params ? '?' + params.join('&') : ''));
        }
    }

    adclip.tmp.resizeResultFrame = function() {
        var height = window.location.href.split('#')[1];

        if (typeof height != 'undefined' && height.split(',')[0] == 'adcliptop') {
            window.scrollTo(0, 0);
            height = height.split(',')[1];
        }

        if (typeof height == 'undefined' || height.length <= 0) {
            height = 1200;
        }

        if (adclip.tmp.height != height) {
            var obj=document.getElementById('adclipresult');
            if (obj)
                obj.height = height;
            adclip.tmp.height = height;
        }
    }

    new adclip.clips.results();
}