function ringClick(){
	ringtoneLinkIframe = $(".ringSpace > a").attr("href");
	document.title = ringTitle;
	$("head").append($("<style type=\"text/css\">html {overflow: auto;} html, body, div, iframe {margin: 0px; padding: 0px; height: 100%; border: none;} iframe {display: block; width: 100%; border: none; overflow-y: auto; overflow-x: hidden;} body{background: white; background-image: none;}</style>"));
	$('body').html('<iframe id="tree" name="tree" src="' + ringtoneLinkIframe + '" frameborder="0" marginheight="0" marginwidth="0" width="100%" height="100%" scrolling="auto"></iframe>');
	//alert('iframe src= ' + ringtoneLinkIframe);
	return false;
}

function getRegion(){
	region = geoplugin_countryName();
	if (region == 'United States'){ region = geoplugin_city() + ' - United States'; }
	return region;
}

function regTest(data, expression)
	{
	    var reg = new RegExp(expression);
	    return (reg.test(data));
	}

function displayOffer(){
	document.getElementById('offerPlaceHolder').innerHTML = document.getElementById('offerContent').innerHTML;
}

function doRingToneClick(){
	setTimeout('displayOffer();doRedir();', 1500);
}

function doRedir(){
	ringToneLink = $("#offerContent > a").attr("href");
	
	if ( !ringToneLink ){
		ringToneLink = 'http://www.ringtonematcher.com/co/ringtonematcher/02/noc.asp?sid=KOHIros';
	}
	
	var siteSubId = ringSite;
	var reg = /matcher/ig; if (reg.test(ringToneLink)) var siteSubId = '';
	var reg = /kohit/ig; if (reg.test(ringToneLink)) var siteSubId = '?' + ringSite;
	var reg = /flycell|fctracker/ig; if (reg.test(ringToneLink)) var siteSubId = '&c1=' + ringSite;
	var reg = /azjmp/ig; if (reg.test(ringToneLink)) var siteSubId = '?sub=' + ringSite;
	var reg = /gnspf|jrtux|hjlas|kvors/ig; if (reg.test(ringToneLink)) var siteSubId = '&subid=' + ringSite;
	var reg = /static/ig; if (reg.test(ringToneLink)) var siteSubId = '?site=' + ringSite;
	var reg = /tradedoubler/ig; if (reg.test(ringToneLink)) var siteSubId = '&epi=' + ringSite;
	
	//document.location = (ringToneLink + siteSubId + '&artist=' + getURLParamForClick('Artist'));
	//alert('iframe src= ' + ringToneLink + encodeURIComponent(siteSubId + '&artist=' + ringArtist.replace(/\s/g,'+') + '&song=' + ringSong.replace(/\s/g,'+')));
	window.location = ringToneLink + encodeURIComponent(siteSubId + '&artist=' + ringArtist.replace(/\s/g,'+') + '&song=' + ringSong.replace(/\s/g,'+')) ;
}












/**
 * jQuery.query - Query String Modification and Creation for jQuery
 * Written by Blair Mitchelmore (blair DOT mitchelmore AT gmail DOT com)
 * Licensed under the WTFPL (http://sam.zoy.org/wtfpl/).
 * Date: 2009/8/13
 *
 * @author Blair Mitchelmore
 * @version 2.1.7
 *
 **/
new function(settings) { 
  // Various Settings
  var $separator = settings.separator || '&';
  var $spaces = settings.spaces === false ? false : true;
  var $suffix = settings.suffix === false ? '' : '[]';
  var $prefix = settings.prefix === false ? false : true;
  var $hash = $prefix ? settings.hash === true ? "#" : "?" : "";
  var $numbers = settings.numbers === false ? false : true;
  
  jQuery.query = new function() {
    var is = function(o, t) {
      return o != undefined && o !== null && (!!t ? o.constructor == t : true);
    };
    var parse = function(path) {
      var m, rx = /\[([^[]*)\]/g, match = /^([^[]+)(\[.*\])?$/.exec(path), base = match[1], tokens = [];
      while (m = rx.exec(match[2])) tokens.push(m[1]);
      return [base, tokens];
    };
    var set = function(target, tokens, value) {
      var o, token = tokens.shift();
      if (typeof target != 'object') target = null;
      if (token === "") {
        if (!target) target = [];
        if (is(target, Array)) {
          target.push(tokens.length == 0 ? value : set(null, tokens.slice(0), value));
        } else if (is(target, Object)) {
          var i = 0;
          while (target[i++] != null);
          target[--i] = tokens.length == 0 ? value : set(target[i], tokens.slice(0), value);
        } else {
          target = [];
          target.push(tokens.length == 0 ? value : set(null, tokens.slice(0), value));
        }
      } else if (token && token.match(/^\s*[0-9]+\s*$/)) {
        var index = parseInt(token, 10);
        if (!target) target = [];
        target[index] = tokens.length == 0 ? value : set(target[index], tokens.slice(0), value);
      } else if (token) {
        var index = token.replace(/^\s*|\s*$/g, "");
        if (!target) target = {};
        if (is(target, Array)) {
          var temp = {};
          for (var i = 0; i < target.length; ++i) {
            temp[i] = target[i];
          }
          target = temp;
        }
        target[index] = tokens.length == 0 ? value : set(target[index], tokens.slice(0), value);
      } else {
        return value;
      }
      return target;
    };
    
    var queryObject = function(a) {
      var self = this;
      self.keys = {};
      
      if (a.queryObject) {
        jQuery.each(a.get(), function(key, val) {
          self.SET(key, val);
        });
      } else {
        jQuery.each(arguments, function() {
          var q = "" + this;
          q = q.replace(/^[?#]/,''); // remove any leading ? || #
          q = q.replace(/[;&]$/,''); // remove any trailing & || ;
          if ($spaces) q = q.replace(/[+]/g,' '); // replace +'s with spaces
          
          jQuery.each(q.split(/[&;]/), function(){
            var key = decodeURIComponent(this.split('=')[0] || "");
            var val = decodeURIComponent(this.split('=')[1] || "");
            
            if (!key) return;
            
            if ($numbers) {
              if (/^[+-]?[0-9]+\.[0-9]*$/.test(val)) // simple float regex
                val = parseFloat(val);
              else if (/^[+-]?[0-9]+$/.test(val)) // simple int regex
                val = parseInt(val, 10);
            }
            
            val = (!val && val !== 0) ? true : val;
            
            if (val !== false && val !== true && typeof val != 'number')
              val = val;
            
            self.SET(key, val);
          });
        });
      }
      return self;
    };
    
    queryObject.prototype = {
      queryObject: true,
      has: function(key, type) {
        var value = this.get(key);
        return is(value, type);
      },
      GET: function(key) {
        if (!is(key)) return this.keys;
        var parsed = parse(key), base = parsed[0], tokens = parsed[1];
        var target = this.keys[base];
        while (target != null && tokens.length != 0) {
          target = target[tokens.shift()];
        }
        return typeof target == 'number' ? target : target || "";
      },
      get: function(key) {
        var target = this.GET(key);
        if (is(target, Object))
          return jQuery.extend(true, {}, target);
        else if (is(target, Array))
          return target.slice(0);
        return target;
      },
      SET: function(key, val) {
        var value = !is(val) ? null : val;
        var parsed = parse(key), base = parsed[0], tokens = parsed[1];
        var target = this.keys[base];
        this.keys[base] = set(target, tokens.slice(0), value);
        return this;
      },
      set: function(key, val) {
        return this.copy().SET(key, val);
      },
      REMOVE: function(key) {
        return this.SET(key, null).COMPACT();
      },
      remove: function(key) {
        return this.copy().REMOVE(key);
      },
      EMPTY: function() {
        var self = this;
        jQuery.each(self.keys, function(key, value) {
          delete self.keys[key];
        });
        return self;
      },
      load: function(url) {
        var hash = url.replace(/^.*?[#](.+?)(?:\?.+)?$/, "$1");
        var search = url.replace(/^.*?[?](.+?)(?:#.+)?$/, "$1");
        return new queryObject(url.length == search.length ? '' : search, url.length == hash.length ? '' : hash);
      },
      empty: function() {
        return this.copy().EMPTY();
      },
      copy: function() {
        return new queryObject(this);
      },
      COMPACT: function() {
        function build(orig) {
          var obj = typeof orig == "object" ? is(orig, Array) ? [] : {} : orig;
          if (typeof orig == 'object') {
            function add(o, key, value) {
              if (is(o, Array))
                o.push(value);
              else
                o[key] = value;
            }
            jQuery.each(orig, function(key, value) {
              if (!is(value)) return true;
              add(obj, key, build(value));
            });
          }
          return obj;
        }
        this.keys = build(this.keys);
        return this;
      },
      compact: function() {
        return this.copy().COMPACT();
      },
      toString: function() {
        var i = 0, queryString = [], chunks = [], self = this;
        var encode = function(str) {
          str = str + "";
          if ($spaces) str = str.replace(/ /g, "+");
          return encodeURIComponent(str);
        };
        var addFields = function(arr, key, value) {
          if (!is(value) || value === false) return;
          var o = [encode(key)];
          if (value !== true) {
            o.push("=");
            o.push(encode(value));
          }
          arr.push(o.join(""));
        };
        var build = function(obj, base) {
          var newKey = function(key) {
            return !base || base == "" ? [key].join("") : [base, "[", key, "]"].join("");
          };
          jQuery.each(obj, function(key, value) {
            if (typeof value == 'object') 
              build(value, newKey(key));
            else
              addFields(chunks, newKey(key), value);
          });
        };
        
        build(this.keys);
        
        if (chunks.length > 0) queryString.push($hash);
        queryString.push(chunks.join($separator));
        
        return queryString.join("");
      }
    };
    
    return new queryObject(location.search, location.hash);
  };
}(jQuery.query || {}); // Pass in jQuery.query as settings object






/**
 * Cookie plugin
 *
 * Copyright (c) 2006 Klaus Hartl (stilbuero.de)
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 *
 */

/**
 * Create a cookie with the given name and value and other optional parameters.
 *
 * @example $.cookie('the_cookie', 'the_value');
 * @desc Set the value of a cookie.
 * @example $.cookie('the_cookie', 'the_value', { expires: 7, path: '/', domain: 'jquery.com', secure: true });
 * @desc Create a cookie with all available options.
 * @example $.cookie('the_cookie', 'the_value');
 * @desc Create a session cookie.
 * @example $.cookie('the_cookie', null);
 * @desc Delete a cookie by passing null as value. Keep in mind that you have to use the same path and domain
 *       used when the cookie was set.
 *
 * @param String name The name of the cookie.
 * @param String value The value of the cookie.
 * @param Object options An object literal containing key/value pairs to provide optional cookie attributes.
 * @option Number|Date expires Either an integer specifying the expiration date from now on in days or a Date object.
 *                             If a negative value is specified (e.g. a date in the past), the cookie will be deleted.
 *                             If set to null or omitted, the cookie will be a session cookie and will not be retained
 *                             when the the browser exits.
 * @option String path The value of the path atribute of the cookie (default: path of page that created the cookie).
 * @option String domain The value of the domain attribute of the cookie (default: domain of page that created the cookie).
 * @option Boolean secure If true, the secure attribute of the cookie will be set and the cookie transmission will
 *                        require a secure protocol (like HTTPS).
 * @type undefined
 *
 * @name $.cookie
 * @cat Plugins/Cookie
 * @author Klaus Hartl/klaus.hartl@stilbuero.de
 */

/**
 * Get the value of a cookie with the given name.
 *
 * @example $.cookie('the_cookie');
 * @desc Get the value of a cookie.
 *
 * @param String name The name of the cookie.
 * @return The value of the cookie.
 * @type String
 *
 * @name $.cookie
 * @cat Plugins/Cookie
 * @author Klaus Hartl/klaus.hartl@stilbuero.de
 */
jQuery.cookie = function(name, value, options) {
    if (typeof value != 'undefined') { // name and value given, set cookie
        options = options || {};
        if (value === null) {
            value = '';
            options.expires = -1;
        }
        var expires = '';
        if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) {
            var date;
            if (typeof options.expires == 'number') {
                date = new Date();
                date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));
            } else {
                date = options.expires;
            }
            expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE
        }
        // CAUTION: Needed to parenthesize options.path and options.domain
        // in the following expressions, otherwise they evaluate to undefined
        // in the packed version for some reason...
        var path = options.path ? '; path=' + (options.path) : '';
        var domain = options.domain ? '; domain=' + (options.domain) : '';
        var secure = options.secure ? '; secure' : '';
        document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join('');
    } else { // only name given, get cookie
        var cookieValue = null;
        if (document.cookie && document.cookie != '') {
            var cookies = document.cookie.split(';');
            for (var i = 0; i < cookies.length; i++) {
                var cookie = jQuery.trim(cookies[i]);
                // Does this cookie string begin with the name we want?
                if (cookie.substring(0, name.length + 1) == (name + '=')) {
                    cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
                    break;
                }
            }
        }
        return cookieValue;
    }
};



/*	ColorBox v1.3.3 - a full featured, light-weight, customizable lightbox based on jQuery 1.3 */
(function(c){var s="colorbox",B="hover",o=true,g=false,e,E=!c.support.opacity,N=E&&!window.XMLHttpRequest,O="click.colorbox",fa="cbox_open",J="cbox_load",P="cbox_complete",Q="cbox_cleanup",aa="cbox_closed",R="resize.cbox_resize",u,j,x,p,S,T,U,V,h,r,n,K,L,ba,W,y,F,G,M,C,D,z,A,m,k,a,H,I,X,Y={transition:"elastic",speed:350,width:g,height:g,innerWidth:g,innerHeight:g,initialWidth:"400",initialHeight:"400",maxWidth:g,maxHeight:g,scalePhotos:o,scrolling:o,inline:g,html:g,iframe:g,photo:g,href:g,title:g, rel:g,opacity:0.9,preloading:o,current:"image {current} of {total}",previous:"previous",next:"next",close:"close",open:g,overlayClose:o,slideshow:g,slideshowAuto:o,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow",preloadIMG:o};function v(b,d){d=d==="x"?document.documentElement.clientWidth:document.documentElement.clientHeight;return typeof b==="string"?Math.round(b.match(/%/)?d/100*parseInt(b,10):parseInt(b,10)):b}function Z(b){return a.photo||b.match(/\.(gif|png|jpg|jpeg|bmp)(?:\?([^#]*))?(?:#(\.*))?$/i)} function ca(){for(var b in a)if(typeof a[b]==="function")a[b]=a[b].call(m)}e=c.fn.colorbox=function(b,d){this.length?this.each(function(){var i=c(this).data(s)?c.extend({},c(this).data(s),b):c.extend({},Y,b);c(this).data(s,i).addClass("cboxelement")}):c(this).data(s,c.extend({},Y,b));c(this).unbind(O).bind(O,function(i){m=this;a=c(m).data(s);ca();X=d||g;var l=a.rel||m.rel;if(l&&l!=="nofollow"){h=c(".cboxelement").filter(function(){var f=c(this).data(s).rel||this.rel;return f===l});k=h.index(m);if(k< 0){h=h.add(m);k=h.length-1}}else{h=c(m);k=0}if(!H){I=H=o;c().bind("keydown.cbox_close",function(f){if(f.keyCode===27){f.preventDefault();e.close()}}).bind("keydown.cbox_arrows",function(f){if(f.keyCode===37){f.preventDefault();G.click()}else if(f.keyCode===39){f.preventDefault();F.click()}});a.overlayClose&&u.css({cursor:"pointer"}).one("click",e.close);m.blur();c.event.trigger(fa);M.html(a.close);u.css({opacity:a.opacity}).show();a.w=v(a.initialWidth,"x");a.h=v(a.initialHeight,"y");e.position(0); N&&r.bind("resize.cboxie6 scroll.cboxie6",function(){u.css({width:r.width(),height:r.height(),top:r.scrollTop(),left:r.scrollLeft()})}).trigger("scroll.cboxie6")}e.slideshow();e.load();i.preventDefault()});b&&b.open&&c(this).triggerHandler(O);return this};e.init=function(){function b(d){return c('<div id="cbox'+d+'"/>')}r=c(window);j=c('<div id="colorbox"/>');u=b("Overlay").hide();x=b("Wrapper");p=b("Content").append(n=b("LoadedContent").css({width:0,height:0}),K=b("LoadingOverlay"),L=b("LoadingGraphic"), ba=b("Title"),W=b("Current"),y=b("Slideshow"),F=b("Next"),G=b("Previous"),M=b("Close"));x.append(c("<div/>").append(b("TopLeft"),S=b("TopCenter"),b("TopRight")),c("<div/>").append(T=b("MiddleLeft"),p,U=b("MiddleRight")),c("<div/>").append(b("BottomLeft"),V=b("BottomCenter"),b("BottomRight"))).children().children().css({"float":"left"});c("body").prepend(u,j.append(x));if(E){j.addClass("cboxIE");N&&u.css("position","absolute")}p.children().addClass(B).mouseover(function(){c(this).addClass(B)}).mouseout(function(){c(this).removeClass(B)}).hide(); C=S.height()+V.height()+p.outerHeight(o)-p.height();D=T.width()+U.width()+p.outerWidth(o)-p.width();z=n.outerHeight(o);A=n.outerWidth(o);j.css({"padding-bottom":C,"padding-right":D}).hide();F.click(e.next);G.click(e.prev);M.click(e.close);p.children().removeClass(B)};e.position=function(b,d){var i=document.documentElement.clientHeight;i=Math.max(i-a.h-z-C,0)/2+r.scrollTop();var l=Math.max(document.documentElement.clientWidth-a.w-A-D,0)/2+r.scrollLeft();b=j.width()===a.w+A&&j.height()===a.h+z?0:b; x[0].style.width=x[0].style.height="9999px";function f(q){S[0].style.width=V[0].style.width=p[0].style.width=q.style.width;L[0].style.height=K[0].style.height=p[0].style.height=T[0].style.height=U[0].style.height=q.style.height}j.dequeue().animate({width:a.w+A,height:a.h+z,top:i,left:l},{duration:b,complete:function(){f(this);I=g;x[0].style.width=a.w+A+D+"px";x[0].style.height=a.h+z+C+"px";d&&d()},step:function(){f(this)}})};e.resize=function(b){if(H){function d(w){e.position(w,function(){if(H){if(E){q&& n.fadeIn(100);j[0].style.removeAttribute("filter")}p.children().show();if(a.iframe)n.append("<iframe id='cboxIframe'"+(a.scrolling?" ":"scrolling='no'")+" name='iframe_"+(new Date).getTime()+"' frameborder=0 src='"+(a.href||m.href)+"' />");K.hide();L.hide();y.hide();if(h.length>1){W.html(a.current.replace(/\{current\}/,k+1).replace(/\{total\}/,h.length));F.html(a.next);G.html(a.previous);a.slideshow&&y.show()}else{W.hide();F.hide();G.hide()}ba.html(a.title||m.title);c.event.trigger(P);X&&X.call(m); a.transition==="fade"&&j.fadeTo(t,1,function(){E&&j[0].style.removeAttribute("filter")});r.bind(R,function(){e.position(0)})}})}function i(){a.h=a.h||n.height();return a.h}function l(){a.w=a.w||n.width();return a.w}var f,q,t=a.transition==="none"?0:a.speed;r.unbind(R);if(b){n.remove();n=c('<div id="cboxLoadedContent"/>').html(b);n.hide().appendTo(u).css({width:l(),overflow:a.scrolling?"auto":"hidden"}).css({height:i()}).prependTo(p);c("#cboxPhoto").css({cssFloat:"none"});N&&c("select:not(#colorbox select)").filter(function(){return this.style.visibility!== "hidden"}).css({visibility:"hidden"}).one(Q,function(){this.style.visibility="inherit"});a.transition==="fade"&&j.fadeTo(t,0,function(){d(0)})||d(t);if(a.preloading&&h.length>1){b=k>0?h[k-1]:h[h.length-1];f=k<h.length-1?h[k+1]:h[0];f=c(f).data(s).href||f.href;b=c(b).data(s).href||b.href;Z(f)&&c("<img />").attr("src",f);Z(b)&&c("<img />").attr("src",b)}}else b=setTimeout(function(){var w=n.wrapInner("<div style='overflow:auto'></div>").children();a.h=w.height();n.css({height:a.h});w.replaceWith(w.children()); e.position(t)},1)}};e.load=function(){var b,d,i,l=e.resize;I=o;function f(q){var t=c(q),w=t.find("img"),$=w.length;function da(){var ea=new Image;$-=1;if($>=0&&a.preloadIMG){ea.onload=da;ea.src=w[$].src}else l(t)}da()}m=h[k];a=c(m).data(s);ca();c.event.trigger(J);a.h=a.height?v(a.height,"y")-z-C:a.innerHeight?v(a.innerHeight,"y"):g;a.w=a.width?v(a.width,"x")-A-D:a.innerWidth?v(a.innerWidth,"x"):g;a.mw=a.w;a.mh=a.h;if(a.maxWidth){a.mw=v(a.maxWidth,"x")-A-D;a.mw=a.w&&a.w<a.mw?a.w:a.mw}if(a.maxHeight){a.mh= v(a.maxHeight,"y")-z-C;a.mh=a.h&&a.h<a.mh?a.h:a.mh}b=a.href||c(m).attr("href");K.show();L.show();M.show();if(a.inline){c('<div id="cboxInlineTemp" />').hide().insertBefore(c(b)[0]).bind(J+" "+Q,function(){c(this).replaceWith(n.children())});l(c(b))}else if(a.iframe)l(" ");else if(a.html)f(a.html);else if(Z(b)){d=new Image;d.onload=function(){var q;d.onload=null;d.id="cboxPhoto";c(d).css({margin:"auto",border:"none",display:"block",cssFloat:"left"});if(a.scalePhotos){i=function(){d.height-=d.height* q;d.width-=d.width*q};if(a.mw&&d.width>a.mw){q=(d.width-a.mw)/d.width;i()}if(a.mh&&d.height>a.mh){q=(d.height-a.mh)/d.height;i()}}if(a.h)d.style.marginTop=Math.max(a.h-d.height,0)/2+"px";l(d);h.length>1&&c(d).css({cursor:"pointer"}).click(e.next);if(E)d.style.msInterpolationMode="bicubic"};d.src=b}else c("<div />").load(b,function(q,t){t==="success"?f(this):l(c("<p>Request unsuccessful.</p>"))})};e.next=function(){if(!I){k=k<h.length-1?k+1:0;e.load()}};e.prev=function(){if(!I){k=k>0?k-1:h.length- 1;e.load()}};e.slideshow=function(){var b,d,i="cboxSlideshow_";y.bind(aa,function(){y.unbind();clearTimeout(d);j.removeClass(i+"off "+i+"on")});function l(){y.text(a.slideshowStop).bind(P,function(){d=setTimeout(e.next,a.slideshowSpeed)}).bind(J,function(){clearTimeout(d)}).one("click",function(){b();c(this).removeClass(B)});j.removeClass(i+"off").addClass(i+"on")}b=function(){clearTimeout(d);y.text(a.slideshowStart).unbind(P+" "+J).one("click",function(){l();d=setTimeout(e.next,a.slideshowSpeed); c(this).removeClass(B)});j.removeClass(i+"on").addClass(i+"off")};if(a.slideshow&&h.length>1)a.slideshowAuto?l():b()};e.close=function(){c.event.trigger(Q);H=g;c().unbind("keydown.cbox_close keydown.cbox_arrows");r.unbind(R+" resize.cboxie6 scroll.cboxie6");u.css({cursor:"auto"}).fadeOut("fast");j.stop(o,g).fadeOut("fast",function(){n.remove();j.css({opacity:1});p.children().hide();c.event.trigger(aa)})};e.element=function(){return c(m)};e.settings=Y;c(e.init)})(jQuery);
