jQuery.noConflict();
var $jQpty = jQuery;
jQuery.fn.extend( {
	outerHtml: function( replacement )
	{
		if (replacement)
		{
			return this.each(function (){ jQuery(this).replaceWith(replacement); });
		}
		var tmp_node = jQuery("<div></div>").append( jQuery(this).clone() );
		var markup = tmp_node.html();
		tmp_node.remove();
		return markup;
	}
});

jQuery.extend({URLEncode:function(c){var o='';var x=0;c=c.toString();var r=/(^[a-zA-Z0-9_.]*)/;
  while(x<c.length){var m=r.exec(c.substr(x));
	if(m!=null && m.length>1 && m[1]!=''){o+=m[1];x+=m[1].length;
	}else{if(c[x]==' ')o+='+';else{var d=c.charCodeAt(x);var h=d.toString(16);
	o+='%'+(h.length<2?'0':'')+h.toUpperCase();}x++;}}return o;},
URLDecode:function(s){var o=s;var binVal,t;var r=/(%[^%]{2})/;
  while((m=r.exec(o))!=null && m.length>1 && m[1]!=''){b=parseInt(m[1].substr(1),16);
  t=String.fromCharCode(b);o=o.replace(m[1],t);}return o;}
});

jQuery.fn.center = function () {
	this.css("position","absolute");
	this.css("left", ( jQuery(window).width() - this.width() ) / 2+jQuery(window).scrollLeft() + "px");
	this.css("margin-top", ( jQuery(window).height() - this.height() ) / 2+jQuery(window).scrollTop() + "px"); return this;
}

jQuery.fn.centerFixed = function () {
	this.css("left", ( jQuery(window).width() - this.width() ) / 2);
	this.css("top", ( jQuery(window).height() - this.height() ) / 2); 
	return this;
}
jQuery.fn.vcenter = function () {
	this.css("margin-top", ( jQuery(window).height() - this.height() ) / 2); return this;
}
function str_replace (from,to,source) {
	count = from.length;
	newString = ""
	while (source.indexOf(from)>=0) 
	{
		act = source.indexOf(from);
		newString += source.substr(0, act)
		if (act >= 0) 
			newString += to
		source = source.substr((act+count), source.length);
	}
	if (source.length >0) 
		newString += source
	return newString
}

jQuery(document).ready(function () {
	if (jQuery('#sCheckDomainName').length)
		document.getElementById('sCheckDomainName').setAttribute( "autocomplete", "off" );

	if (jQuery('.tx_powermail_pi1_form').length)
		jQuery('input:text:visible:first').focus();

	jQuery('.rit_ajaxtags_info_morelink').click(function(){ jQuery(this).remove(); jQuery('.rit_ajaxtags_info_more').fadeIn()})
	jQuery('.box_angebot').mouseenter(function () { jQuery(this).find('.corner').fadeIn(); });
	jQuery('.box_angebot').mouseleave(function () { jQuery(this).find('.corner').fadeOut(); });

	jQuery('.bloghouse_shorter_show').click(function(){jQuery('#'+this.id+'_block').slideToggle();jQuery(this).slideToggle(); })
	jQuery('.bloghouse_article_page_show').click(function(){
		jQuery('#'+this.id+'_link').click();
		jQuery('.bloghouse_article_page_show').removeClass('bloghouse_article_page_active');
		jQuery(this).addClass('bloghouse_article_page_active');
		window.location.hash = '#bloghouse_article'
	
	})

	jQuery('.box_reference').mouseenter(function () { jQuery(this).find('.corner').fadeIn(); });
	jQuery('.box_reference').mouseleave(function () { jQuery(this).find('.corner').fadeOut(); });

	var infobox_height = 0;
	jQuery('.infos').each( function(){if (infobox_height < jQuery(this).height()) infobox_height = jQuery(this).height()})
	jQuery('.infos').each( function(){jQuery(this).css('height',infobox_height+'px')})

	var box_angebot_icon_height = 0;
	jQuery('.box_angebot_icon').each( function(){if (box_angebot_icon_height < jQuery(this).height()) box_angebot_icon_height = jQuery(this).height()})
	jQuery('.box_angebot_icon').each( function(){jQuery(this).css('height',box_angebot_icon_height+'px')})

	jQuery('.topnavi_link').each( function() { jQuery(this).parent().click( function(){document.location.href=jQuery(this).children('.topnavi_link').attr('href'); }  ) } )

	jQuery("a[class='pty_video_player']").click(function() {
		ptyPlayVideo(this.id)
	});
	jQuery('.last_seen_line').mouseenter(function () { 
		bPos = jQuery("#"+this.id+"_icon").css('backgroundPosition').split(' ');
		jQuery("#"+this.id+"_icon").css({"background-position": bPos[0]+" "+(parseInt(bPos[1])-21)+"px"}); 
	});
	jQuery('.last_seen_line').mouseleave(function () { 
		bPos = jQuery("#"+this.id+"_icon").css('backgroundPosition').split(' ');
		jQuery("#"+this.id+"_icon").css({"background-position": bPos[0]+" "+(parseInt(bPos[1])-0+21)+"px"}); 
	});
	// ### Tabs aktivieren
	jQuery('.box_tabs .head span a').click(function(){
		// ### Aktuellen Tab abwählen
		jQuery(this).parent().parent().parent().find('.tab_active').removeClass('tab_active');
		jQuery(this).parent().parent().parent().parent().find('.inner .tab_content').hide();
		
		// ### Tab aktivieren
		jQuery(this).parent().parent().addClass('tab_active');
		
		// ### Bereich aktivieren
		jQuery('#'+jQuery(this).attr("rel")).show();

		if (this.id.substr(0,22) == "bloghouse_article_page")
		{
			jQuery('.bloghouse_article_page_show').removeClass('bloghouse_article_page_active');
			bottomTab = this.id.split('_link');
			jQuery('#'+bottomTab[0]).addClass('bloghouse_article_page_active');
			window.location.hash = '#bloghouse_article'
		}		

		// ### False
		return false;
	});

	jQuery(document).keyup(function(e) { 
		if (e.keyCode == 27) 
		{  
			jQuery('#global_login_form').fadeOut();jQuery('#global_login_form_top').fadeOut();
			jQuery('#global_register_form').fadeOut();jQuery('#global_register_form_top').fadeOut();
			jQuery('#shorturl_div').fadeOut();
		} 
	});

	(function () {
	   var script = document.createElement('script');
	   script.type = 'text/javascript';
	   script.async = true;
	   script.src = 'http://www.google.com/recaptcha/api/js/recaptcha_ajax.js';
	   (document.getElementsByTagName('head')[0] || document.body).appendChild(script);
	})();
	
});
function noop(){}


/*  Video-Player */


/**
 * SWFObject v1.5: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
 *
 * SWFObject is (c) 2007 Geoff Stearns and is released under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 *
 */
if(typeof deconcept=="undefined"){var deconcept=new Object();}if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a){if(!document.getElementById){return;}this.DETECT_KEY=_a?_a:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(_1){this.setAttribute("swf",_1);}if(id){this.setAttribute("id",id);}if(w){this.setAttribute("width",w);}if(h){this.setAttribute("height",h);}if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true;}if(c){this.addParam("bgcolor",c);}var q=_7?_7:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var _c=(_8)?_8:window.location;this.setAttribute("xiRedirectUrl",_c);this.setAttribute("redirectUrl","");if(_9){this.setAttribute("redirectUrl",_9);}};deconcept.SWFObject.prototype={useExpressInstall:function(_d){this.xiSWFPath=!_d?"expressinstall.swf":_d;this.setAttribute("useExpressInstall",true);},setAttribute:function(_e,_f){this.attributes[_e]=_f;},getAttribute:function(_10){return this.attributes[_10];},addParam:function(_11,_12){this.params[_11]=_12;},getParams:function(){return this.params;},addVariable:function(_13,_14){this.variables[_13]=_14;},getVariable:function(_15){return this.variables[_15];},getVariables:function(){return this.variables;},getVariablePairs:function(){var _16=new Array();var key;var _18=this.getVariables();for(key in _18){_16[_16.length]=key+"="+_18[key];}return _16;},getSWFHTML:function(){var _19="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath);}_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\"";_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";var _1a=this.getParams();for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}var _1c=this.getVariablePairs().join("&");if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath);}_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\">";_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";var _1d=this.getParams();for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}var _1f=this.getVariablePairs().join("&");if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}_19+="</object>";}return _19;},write:function(_20){if(this.getAttribute("useExpressInstall")){var _21=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var n=(typeof _20=="string")?document.getElementById(_20):_20;n.innerHTML=this.getSWFHTML();return true;}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var _23=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var _26=3;while(axo){try{_26++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_26);_23=new deconcept.PlayerVersion([_26,0,0]);}catch(e){axo=null;}}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}}return _23;};deconcept.PlayerVersion=function(_29){this.major=_29[0]!=null?parseInt(_29[0]):0;this.minor=_29[1]!=null?parseInt(_29[1]):0;this.rev=_29[2]!=null?parseInt(_29[2]):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.major<fv.major){return false;}if(this.major>fv.major){return true;}if(this.minor<fv.minor){return false;}if(this.minor>fv.minor){return true;}if(this.rev<fv.rev){return false;}return true;};deconcept.util={getRequestParameter:function(_2b){var q=document.location.search||document.location.hash;if(_2b==null){return q;}if(q){var _2d=q.substring(1).split("&");for(var i=0;i<_2d.length;i++){if(_2d[i].substring(0,_2d[i].indexOf("="))==_2b){return _2d[i].substring((_2d[i].indexOf("=")+1));}}}return "";}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var _2f=document.getElementsByTagName("OBJECT");for(var i=_2f.length-1;i>=0;i--){_2f[i].style.display="none";for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[i][x]=function(){};}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true;}}if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id];};}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;

var vp = new SWFObject("/fileadmin/templates/flash/player-licensed.swf","ply","520","311","9","#FFFFFF");
var vplayer = null;
function playerReady(obj) {vplayer = document.getElementsByName(obj.id)[0];vplayer.addModelListener('STATE', 'stateMonitor');};
function stateMonitor(obj) {if(obj.newstate == 'COMPLETED') {stopVideo();}};
function ptyStopVideo(){ jQuery('#video_player').remove(); jQuery('#video_layer').animate({opacity: 0}, function() { jQuery('#video_layer').remove(); } );}
function ptyPlayVideo(i)
{
	osc.evt('PlayVideo',i);		
	video= '<div id="video_layer" onclick="ptyStopVideo()"><div id="video_player"></div></div>'
	jQuery('body').prepend(video);
	jQuery('#video_layer').css({opacity: 0})
	jQuery('#video_layer').animate({opacity: 0.8})
	vp.addParam("allowfullscreen","true");
	vp.addParam("autostart","true");
	vp.addParam("flashvars","file=/"+i+"&allowfullscreen=true&volume=80&autostart=true");
	vp.write("video_player");
	jQuery('#video_player').vcenter()

}

// BSa 2011-04-15
// Ein PTY Namespace im global aufmachen
if(PTY === undefined)
{
    var PTY = {};
}

/*global window, document, $, jQuery */
/*jslint browser: true, undef: true, nomen: true, eqeqeq: true, plusplus: true, bitwise: true, regexp: true, strict: true, newcap: true, maxerr: 50, indent: 4 */
(function()
{
    "use strict";
    var $ = jQuery;

/*
	document.write('<link rel="stylesheet" href="/fileadmin/templates/php/domaincheck/social_bookmarks/social_bookmarks.css"/>');
*/
    // Array of Bookmark Services
    var services = [
    {
        'name': 'Browser',
        'img': 'bookmark',
        'url': ''
    },
    {
        'name': 'Delicious',
        'img': 'delicious',
        'url': 'http://delicious.com/post',
        'param': {
            'url': 'url',
            'title': 'title'
        }
    },
    {
        'name': 'Digg',
        'img': 'digg',
        'url': 'http://digg.com/submit',
        'param': {
            'url': 'url',
            'title': 'title'
        }
    },
    {
        'name': 'Live',
        'img': 'live',
        'url': 'https://favorites.live.com/quickadd.aspx',
        'param': {
            'url': 'url',
            'title': 'title',
            'defaults':'top=1&marklet=1&mkt=de-de'
        }
    },
    {
        'name': 'Facebook',
        'img': 'facebook',
        'url': 'http://www.new.facebook.com/sharer.php',
        'param': {
            'url': 'u',
            'title': 't'
        }
    },
    {
        'name': 'MySpace',
        'img': 'myspace',
        'url': 'http://www.myspace.com/Modules/PostTo/Pages/',
        'param': {
            'url': 'u',
            'title': 't'
        }
    },
    {
        'name': 'Mister Wong',
        'url': 'http://www.mister-wong.de/index.php',
        'img': 'misterwong',
        'param': {
            'url': 'bm_url',
            'title': 'bm_description',
            'defaults': 'action=addurl'
        }
    },
    {
        'name': 'Technorati',
        'url': 'http://technorati.com/faves',
        'img': 'technorati',
        'param': {
            'url': 'add',
            'title': 'title'
        }
    },
    {
        'name': 'StumpleUpon',
        'url': 'http://www.stumbleupon.com/refer.php',
        'img': 'stumbleupon',
        'param': {
            'url': 'url',
            'title': 'title'
        }
    },
    {
        'name': 'Newsvine',
        'url': 'http://www.newsvine.com/_wine/save',
        'img': 'newsvine',
        'param': {
            'url': 'u',
            'title': 'h'
        }
    },
    {
        'name': 'Magnolia',
        'url': 'http://ma.gnolia.com/bookmarklet/add',
        'img': 'magnolia',
        'param': {
            'url': 'url',
            'title': 'title',
            'defaults': 'action=addurl'
        }
    },
    {
        'name': 'Google',
        'url': 'http://www.google.com/bookmarks/mark',
        'img': 'google',
        'param': {
            'url': 'bkmk',
            'title': 'title',
            'defaults': 'op=edit&output=popup'
        }
    },
    {
        'name': 'Yahoo MyWeb',
        'url': 'http://myweb2.search.yahoo.com/myresults/bookmarklet',
        'img': 'yahoo_myweb',
        'param': {
            'url': 'u',
            'title': 't'
        }
    }];


    PTY.CSS3Support = (function()
    {
        var test = $('<div></div>');
        var featureDetectionRadius = function () {
            var radiusDetection = function (css) {
                try {
                    var style = test.css(css);
                    if (style !== 'null' && style !== '') {
                        var regTest = style.match(/10px/i);
                        if (regTest) {
                            return true;
                        }
                    }
                } catch(err) {
                    return false;
                }
                return false;
            };
            var hasFeature = false;
            test.css('-moz-border-radius', '10px');
            hasFeature = radiusDetection('-moz-border-radius-topleft');

            if(hasFeature === true)
            {
                return true;
            }
            else
            {
                test.css('-webkit-border-radius', '10px');
                hasFeature = radiusDetection('-webkit-border-bottom-left-radius');
            }
            if(hasFeature === true)
            {
                return true;
            }
            else
            {
                test.css('border-radius', '10px');
                hasFeature = radiusDetection('border-bottom-left-radius');
            }
            if(hasFeature === true)
            {
                return true;
            }
            else
            {
                hasFeature = radiusDetection('border-radius');
            }
            return hasFeature;
        };



        var featureDetectionGradient = function () {
            var gradientDetection = function (css) {
                try {
                    var style = test.css(css);
                    if (style !== 'null' && style !== '') {
                        var regTest = style.match(/linear/i);
                        if (regTest) {
                            return true;
                        }
                    }
                } catch(err) {
                    return false;
                }
                return false;
            };
            var hasFeature = false;

            test.css('background-image', '-moz-linear-gradient(0 13px 90deg, #d0d0d0, #fff)');

            hasFeature = gradientDetection('background-image');
            if(hasFeature === true)
            {
                return true;
            }
            else
            {
                test.css('background-image', '-webkit-gradient(linear, 0% 0%, 0% 13, from(white), to(#D0D0D0))');
                hasFeature = gradientDetection('background-image');
            }
            if(hasFeature === true)
            {
                return true;
            }
            else
            {
                test.css('background-image', 'gradient(linear,left top, left 13, color-stop(0,#fff), color-stop(1,  #d0d0d0)');
                hasFeature = gradientDetection('background-image');
            }

            return hasFeature;
        };
        return (featureDetectionGradient() === true && featureDetectionRadius() === true);
    }());


    var listMarkup = function()
    {
        var portal, siteTitle,siteURL, list, pos, i,service,param;
        // Remove internal Bookmarking for !IE && !!FF
        if (!window.sidebar && !document.all) {
            services.shift();
        }


        portal = 'portunity';
        siteTitle = document.title;
        siteURL = location.href;
        list = [];

        pos = 'left';
        for (i = 0; i < services.length; i+= 1) {
            service = services[i];
            service.pos = pos;
            if (service.param) {
                param = [];
                param.push(service.param.url + '=' + siteURL);
                param.push(service.param.title + '=' + siteTitle);
                if (service.param.defaults !== undefined) {
                    param.push(service.param.defaults);
                }
                service.href = service.url + '?' + param.join('&');
            }
            else {
                service.href = service.url;
            }

            if (service.name !== 'Browser') {
                service.href = 'http://addbookmark.eu/add/?portal='+portal+'&amp;bookmark_service=' + service.name + '&amp;url=' + siteURL + '&amp;redir=' + encodeURIComponent(service.href);
            }
            else{
                service.pos = service.pos + ' internalBookmark';
            }

            list.push('<li class="' + service.pos + '"><a href="' + service.href + '"><span class="img ' + service.img + '"></span><span class="name">' + service.name + '</span></a></li>');

            pos = (pos === 'left') ? 'right' : 'left';

        }
        return '<ul>' + list.join('') + '</ul>';


    };
    var boxMarkup = function()
    {
        var content = [];
        content.push('<div class="box">');

        if(PTY.CSS3Support === true)
        {
            content.push('<div class="bg"></div>');
        }
        else{
            content.push('<div class="bg">');
            content.push('<div class="top"><div class="corner"></div></div>');
            content.push('<div class="bottom"><div class="corner"></div></div>');
        }

        content.push('<div class="head">');
        content.push('<div class="close"></div>');
        content.push('</div>');
        content.push('<div class="content">' + listMarkup() + '</div>');
        content.push('</div>');

        return content.join('');
    };




    var dimensions = {
        start:{
            width:0,
            height:0
        },
        end:{
            width:255,
            height:190
        }
    };
    $(document).ready(function() {

        // Erstmal das Bookmarking in den Dom hängen
        $('li#social_bookmarks').addClass('block');
        $('li#social_bookmarks').append('<ul><li class="top">Bookmark</a></li><li><div class="socialbookmarks topleft"></div></li></ul>');


        if(PTY.CSS3Support === true)
        {
            $('.socialbookmarks').addClass('css3');
        }
        $('.socialbookmarks').addClass('closed');

        $('.socialbookmarks').html(boxMarkup());

        $('.socialbookmarks .bg').css({
            opacity:0.9
        });
        if(PTY.CSS3Support !== false)
        {
            $('.socialbookmarks').height($('.socialbookmarks').height() + 2 );
        }

        dimensions.start.width = $('.socialbookmarks').width();
        dimensions.start.height = $('.socialbookmarks').height();

        $('.socialbookmarks .head').mouseenter(function(){

        var parent = $(this).parents('.socialbookmarks');
            if(parent.hasClass('closed')){
                parent.find('.box').animate({
                    width:dimensions.end.width,
                    height:dimensions.end.height
                },500,'linear',function(){
                    parent.removeClass('closed');
                    parent.addClass('opened');
                });
            }
        });


        $('.socialbookmarks .close').click(function(){
        var parent = $(this).parents('.socialbookmarks');

            parent.removeClass('opened');

            parent.find('.box').animate({
                width:dimensions.start.width,
                height:dimensions.start.height
            },500,'linear',function(){
                parent.addClass('closed');
            });

        });
        $('.socialbookmarks .internalBookmark a').click(function(){
            if (window.sidebar) {
                window.sidebar.addPanel(document.title, location.href, '');
            }
            else {
                if (document.all) {
                    window.external.AddFavorite(location.href, document.title);
                }
            }
        });
    });
}());



/* tx_ritispsuiteexchangeuser_pi1 begin */

jQuery(document).ready(function() {

//	if (jQuery('#ServiceLoginUser').length)
//		jQuery('#ServiceLoginUser').focus();
	


	jQuery('#user').keypress(function(e) {
		if(e.keyCode == 13 && jQuery(this).val()) {
			if (jQuery('#pass').val() == 'Passwort')
				jQuery('#pass').focus()
			else
				ispsCheckLogin()
		}
	});
	jQuery('#pass').keypress(function(e) {
		if(e.keyCode == 13 && jQuery(this).val()) {
			if (jQuery('#user').val() == 'Loginname')
				jQuery('#user').focus()
			else
				ispsCheckLogin()
		}
	});
	
	jQuery('#ServiceLoginUser').keypress(function(e) {
		if(e.keyCode == 13 && jQuery(this).val()) {
			if (jQuery('#ServiceLoginPassword').val() == 'Passwort')
				jQuery('#ServiceLoginPassword').focus()
			else
				ispsLogin()
		}
	});
	jQuery('#ServiceLoginPassword').keypress(function(e) {
		if(e.keyCode == 13 && jQuery(this).val()) {
			if (jQuery('#ServiceLoginUser').val() == 'Loginname')
				jQuery('#ServiceLoginUser').focus()
			else
				ispsLogin()
		}
	});

	jQuery('.global_login_link').click( function() { jQuery('#global_login_form_top').centerFixed(); jQuery('#global_login_form').css({ opacity: 0, display: 'block' }).animate({opacity: 0.75}); jQuery('#global_login_form_top').fadeIn(); jQuery('#user').focus(); osc.evt('CommunityLogin','Open') } );
	jQuery('#global_logout_link').click( function() { 
/*PTYONLY*/
		jQuery('body').append('<iframe id="wikilogin" src="/wiki/index.php?powerlogout=1&title=Spezial:Abmelden&returnto=Hauptseite" frameborder="0" style="display:none"></iframe>');
		osc.evt('CommunityLogin','Logout')
/*PTYONLY*/
//		jQuery('#global_logout').submit() 
		} 
	);
	jQuery('#global_login_submit').click( function() {ispsCheckLogin() } );
	jQuery('#global_forgot_submit').click( function() {ispsForgotPassword();osc.evt('ForgotPassword','Submit') } );
	jQuery('#global_login_show_forgot').click(function () {  jQuery('#global_login_form_login').slideUp(200,function() {jQuery('#global_login_form_forgot').slideToggle() }); osc.evt('ForgotPassword','Open') } );
	jQuery('.ispsuite_show_forgot').click(function () {jQuery('#global_login_form_top').centerFixed(); jQuery('#global_login_form').css({ opacity: 0, display: 'block' }).animate({opacity: 0.75});jQuery('#global_login_form_login').hide(); jQuery('#global_login_form_forgot').show();  jQuery('#global_login_form_top').fadeIn();jQuery('#forgot_user').focus();  osc.evt('ForgotPassword','Open')  } );
	 
	jQuery('#global_login_show_login').click(function () {  jQuery('#global_login_form_forgot').slideUp(200,function() {jQuery('#global_login_form_login').slideToggle() }); osc.evt('ForgotPassword','Close') } );
	
	jQuery('#set_newpasswd_submit').click(function () {  ispsCheckNewPassword() } );
	
/*PTYONLY*/
	jQuery("#global_login_submit").attr("href", "javascript:noop();")
	jQuery("#global_login_show_forgot").attr("href", "javascript:noop();")
	jQuery("#global_forgot_submit").attr("href", "javascript:noop();")
	jQuery("#global_login_show_login").attr("href", "javascript:noop();")
	
/*PTYONLY*/
	
} );

function ispsCheckNewPassword()
{
	jQuery('#newpasswd').val(jQuery.trim( jQuery('#newpasswd').val() ))
	if (jQuery('#newpasswd').val().length < 6) {
		jQuery('#newpasswd').focus();
		jQuery('#newpasswd_error').slideDown();
	} else if (jQuery('#newpasswd').val() != jQuery('#newpasswd_confirm').val()) {
		jQuery('#newpasswd').focus();
		jQuery('#newpasswd_error').slideDown();
	} else jQuery('#set_newpasswd_form').submit()
	
}

function ispsLogin()
{
	jQuery('#ispsuite_submit_result').text("");
	jQuery('#ispsuite_submit_button').slideUp(200,function() {jQuery('#ispsuite_submit_button_replace').slideDown(200); } )
	jQuery.ajax({
		type: 'post',
		url: '/community/',
		data: "tx_ritispsuiteexchangeuser_pi1[m]=aj_checkuser&tx_ritispsuiteexchangeuser_pi1[user]="+jQuery('#ServiceLoginUser').val()+"&tx_ritispsuiteexchangeuser_pi1[pass]="+jQuery('#ServiceLoginPassword').val(),
		success: function(data){
			if (jQuery(data).find('result').text() == '1') {
				osc.evt('CommunityLogin','ISPSdirect')
				document.getElementById('ispsuite').submit();
				return;
			} else {
				osc.evt('CommunityLogin','Failed')
				jQuery('#ispsuite_submit_button_replace').slideUp(200,function() {jQuery('#ispsuite_submit_button').slideDown(200); } )
				jQuery('#ispsuite_submit_result').text(jQuery(data).find('message').text())
			}
		}
 	});	
}
function ispsLoginDirect()
{
	osc.evt('CommunityLogin','ISPSdirect');
	l = jQuery('#ServiceLoginDirect').val().split(':|:')
	tmp = '<form id="ispsuitedirect" method="post" accept-charset="ISO-8859-1" action="https://service.portunity.net/service/soft/login.php">';
	tmp += '<input type="hidden" id="ServiceLoginUser" name="XLoginname" value="'+decryptString(l[0],-11)+'"/>';
	tmp += '<input type="hidden" id="ServiceLoginPassword" name="XLogincode" value="'+decryptString(l[1],-11)+'"/>';
	tmp += '<input type="hidden" name="XSprache" value=""/>';
	tmp += '<input type="hidden" name="XfPopup" value="0"/>';
	tmp += '</form>';
	jQuery('BODY').append(tmp);
	document.getElementById('ispsuitedirect').submit();
	jQuery('#ispsuitedirect').remove(tmp);
}
function ispsCheckLogin()
{
	if(jQuery('#user').val() == '' || jQuery('#user').val() == 'Loginname') {
		alert('Bitte geben Sie Ihren Loginnamen ein');
		jQuery('#user').focus();
	} else if(jQuery('#pass').val() == '' || jQuery('#pass').val() == 'Passwort')
	{
		alert('Bitte geben Sie Ihr Password ein');
		jQuery('#pass').focus();
	} else {
		jQuery('#global_login_submit_button').slideUp(200,function() {jQuery('#global_login_submit_button_replace').slideDown(200); } )

		if (jQuery('input[name=global_login_target]:checked').attr('id') == "global_login_target_webmail")
		{
			osc.evt('CommunityLogin','Webmail')
			tmp  = '<form id="imp_login_direct" method="POST" action="https://webmail.portunity.de/v3/imp/redirect.php">';
			tmp += '<input type="hidden" name="new_lang" value="de_DE" />';
			tmp += '<input type="hidden" name="imapuser" value="'+jQuery('#user').val()+'"/>';
			tmp += '<input type="hidden" name="pass" value="'+jQuery('#pass').val()+'"/>';
			tmp += '</form>';
			jQuery('body').append(tmp);
			document.getElementById('imp_login_direct').submit();
			return;
		}

		if (jQuery('input[name=global_login_target]:checked').attr('id') == "global_login_target_isps")
		{
			jQuery.ajax({
				type: 'post',
				url: '/community/',
				data: "tx_ritispsuiteexchangeuser_pi1[m]=aj_checkuser&tx_ritispsuiteexchangeuser_pi1[user]="+encodeURIComponent(jQuery('#user').val())+"&tx_ritispsuiteexchangeuser_pi1[pass]="+encodeURIComponent(jQuery('#pass').val()),
				success: function(data){
					if (jQuery(data).find('result').text() == '1') {
						osc.evt('CommunityLogin','ISPSuite')
						tmp  = '<form id="ispsuite_login_direct" method="post" accept-charset="ISO-8859-1" action="https://service.portunity.net/service/soft/login.php">';
						tmp += '<input type="hidden" name="XLoginname" value="'+jQuery('#user').val()+'"/>';
						tmp += '<input type="hidden" name="XLogincode" value="'+jQuery('#pass').val()+'"/>';
						tmp += '<input type="hidden" name="XfPopup" value="0" />';
						tmp += '</form>';
						jQuery('body').append(tmp);
						document.getElementById('ispsuite_login_direct').submit();
						return;
					} else {
						osc.evt('CommunityLogin','Failed')
						jQuery('#global_login_submit_button_replace').slideUp(200,function() {jQuery('#global_login_submit_button').slideDown(200); } )
						jQuery('#global_login_submit_result').text(jQuery(data).find('message').text())
					}
				}
		 	});
		}
		
		
		
		
		if(document.URL.indexOf("/wiki.html") > 0 || document.URL.indexOf("/wiki/") > 0)
		{
			jQuery("#global_login").attr("action", "/community/login-redirect")
			jQuery("#global_logout").attr("action", "/community/login-redirect")
		}
		else
		{
			jQuery("#global_login").attr("action", document.URL)
			jQuery("#global_logout").attr("action", document.URL)
		}

		jQuery.ajax({
			type: 'post',
			url: '/community/',
			data: "tx_ritispsuiteexchangeuser_pi1[m]=aj_checkuser&tx_ritispsuiteexchangeuser_pi1[user]="+encodeURIComponent(jQuery('#user').val())+"&tx_ritispsuiteexchangeuser_pi1[pass]="+encodeURIComponent(jQuery('#pass').val()),
			success: function(data){
				if (jQuery(data).find('result').text() == '1') {
					jQuery('#global_login_submit_button_replace').slideUp(200);
/*PTYONLY*/
					osc.evt('CommunityLogin','Success')
					jQuery('body').append('<iframe id="wikilogin" src="/wiki/Spezial:Anmelden?powerlogin=2" frameborder="0" style="display:none"></iframe>');
/*PTYONLY*/
//					jQuery('#global_login').submit();
				} else {
					osc.evt('CommunityLogin','Failed')
					jQuery('#global_login_submit_button_replace').slideUp(200,function() {jQuery('#global_login_submit_button').slideDown(200); } )
					jQuery('#global_login_submit_result').text(jQuery(data).find('message').text())
				}
			}
	 	});
	}
	return false;
}
function ispsForgotPassword()
{
	if(jQuery('#forgot_user').val() == '' || jQuery('#forgot_user').val() == 'Loginname') {
		alert('Bitte geben Sie Ihren Loginnamen ein');
		jQuery('#forgot_user').focus();
	} else {
		jQuery('#global_forgot_submit_button').slideUp(200,function() {jQuery('#global_forgot_submit_button_replace').slideDown(200); } )
		jQuery.ajax({
			url: '/community/',
			type: 'post',
			data: "tx_ritispsuiteexchangeuser_pi1[m]=aj_forgotpassword&tx_ritispsuiteexchangeuser_pi1[user]="+jQuery('#forgot_user').val(),
			success: function(data){
				if (jQuery(data).find('result').text() == '1') {
					jQuery('#global_forgot_submit_button_container').hide();
					jQuery('#global_forgot_submit_button_replace').slideUp(200,function() {jQuery('#global_forgot_submit_button').slideDown(200); } )
					jQuery('#global_forgot_submit_result').text(jQuery(data).find('message').text())
				}
				else
				{
					jQuery('#global_forgot_submit_button_replace').slideUp(200,function() {jQuery('#global_forgot_submit_button').slideDown(200); } )
					jQuery('#global_forgot_submit_result').text(jQuery(data).find('message').text())
				}
			}
	 	});
	}
	return false;
}
/* tx_ritispsuiteexchangeuser_pi1 end */



/* tx_rituserregistration_pi1 start */
jQuery(document).ready(function() {
	if (jQuery('#tx_rituserregistration_pi1_regform').length)
	{
		jQuery('.global_register_link').click( function() { 
			jQuery('#global_register_form_top').centerFixed(); jQuery('#global_register_form').css({ opacity: 0, display: 'block' }).animate({opacity: 0.75}); jQuery('#global_register_form_top').fadeIn(); 
Recaptcha.create("6LdpJAcAAAAAAHLKPrFt1Ip6gu7tDkh6o9jKRs44",
    "recaptcha",
    {
      theme: "red",
      callback: Recaptcha.focus_response_field
    }
  );			
			} );
		jQuery('#tx_rituserregistration_pi1_regform')[0].reset();
		jQuery('#tx_rituserregistration_pi1_step').val('0');	
		jQuery("#global_register_submit").attr("href", "javascript:noop();")
		jQuery('#global_register_submit').click( function () {
			tx_rituserregistration_send()
		} );
		
		jQuery('.tx_rituserregistration_field').each(function() {
			jQuery(this).focus(function() {
				if(jQuery('#'+jQuery(this).attr('id')+'_error').length) {
					jQuery('#'+jQuery(this).attr('id')+'_error').fadeOut(300);
				}
			});
		});
		jQuery('.tx_rituserregistration_phonefield').each(function() {
			jQuery(this).focus(function() {
				if(jQuery('#tx_rituserregistration_phone_error').length) {
					jQuery('#tx_rituserregistration_phone_error').slideUp(300).remove(300);
				}
			});
		});
	
	}
});


function tx_rituserregistration_send()
{
	fError = 0;
	jQuery('#tx_rituserregistration_captcha_line_error').remove()
	jQuery('tx_rituserregistration_phonecode_line_error').remove()
	jQuery('#tx_rituserregistration_username').val(jQuery.trim((jQuery('#tx_rituserregistration_username').val())));
	if(jQuery('#tx_rituserregistration_username').val().length<6 || jQuery('#tx_rituserregistration_username').val() != jQuery('#tx_rituserregistration_username').val().replace(/[^A-Za-z0-9-_]/g,''))
	{
		jQuery('#tx_rituserregistration_username_error').remove()
		jQuery('#tx_rituserregistration_username_line').after('<div id="tx_rituserregistration_username_error" class="tx_rituserregistration_error">'+tx_rituserregistration_messages.name2short+'</div>');
		jQuery('#tx_rituserregistration_username_error').slideDown();
		fError = 1;
	}
	jQuery('#tx_rituserregistration_password').val(jQuery.trim((jQuery('#tx_rituserregistration_password').val())));
	if(jQuery('#tx_rituserregistration_password').val().length<6) 
	{
		jQuery('#tx_rituserregistration_password_error').remove()
		jQuery('#tx_rituserregistration_password_line').after('<div id="tx_rituserregistration_password_error" class="tx_rituserregistration_error">'+tx_rituserregistration_messages.password2short+'</div>');
		jQuery('#tx_rituserregistration_password_error').slideDown();
		fError = 1;
	}
	if(jQuery('#tx_rituserregistration_password').val() != jQuery('#tx_rituserregistration_password_repeat').val())
	{
		jQuery('#tx_rituserregistration_password_repeat_error').remove();
		jQuery('#tx_rituserregistration_password_repeat_line').after('<div id="tx_rituserregistration_password_repeat_error" class="tx_rituserregistration_error">'+tx_rituserregistration_messages.passwordmismatch+'</div>');
		jQuery('#tx_rituserregistration_password_repeat_error').slideDown();
		fError = 1;
	}
	expression = new RegExp("^.+@[^\.].*\.[a-z]{2,}$")
	if(!jQuery('#tx_rituserregistration_email').val().match(expression))
	{
		jQuery('#tx_rituserregistration_email_error').remove();
		jQuery('#tx_rituserregistration_email_line').after('<div id="tx_rituserregistration_email_error" class="tx_rituserregistration_error">'+tx_rituserregistration_messages.emailinvalid+'</div>');
		jQuery('#tx_rituserregistration_email_error').slideDown();
		fError = 1;
	}
	

	jQuery('#tx_rituserregistration_phone_country').val(jQuery('#tx_rituserregistration_phone_country').val().replace(/[^0-9]/g,''))
	jQuery('#tx_rituserregistration_phone_city').val(jQuery('#tx_rituserregistration_phone_city').val().replace(/[^0-9]/g,''))
	if (jQuery('#tx_rituserregistration_phone_city').val().substring(0,1) == 0)
		jQuery('#tx_rituserregistration_phone_city').val(jQuery('#tx_rituserregistration_phone_city').val().substring(1))
	jQuery('#tx_rituserregistration_phone_number').val(jQuery('#tx_rituserregistration_phone_number').val().replace(/[^0-9]/g,''))
	if(!jQuery('#tx_rituserregistration_phone_country').val() || !jQuery('#tx_rituserregistration_phone_city').val() || !jQuery('#tx_rituserregistration_phone_number').val())
	{
		jQuery('#tx_rituserregistration_phone_error').remove()
		jQuery('#tx_rituserregistration_phone_line').after('<div id="tx_rituserregistration_phone_error" class="tx_rituserregistration_error">'+tx_rituserregistration_messages.phoneInvalid+'</div>');
		jQuery('#tx_rituserregistration_phone_error').slideDown();
		fError = 1;
	}
	if(!jQuery('#tx_rituserregistration_legalnotice').attr('checked'))
	{
		jQuery('#tx_rituserregistration_legalnotice_error').remove()
		jQuery('#tx_rituserregistration_legalnotice_line').after('<div id="tx_rituserregistration_legalnotice_error" class="tx_rituserregistration_error">'+tx_rituserregistration_messages.acceptlegalnotice+'</div>');
		jQuery('#tx_rituserregistration_legalnotice_error').slideDown();
		fError = 1;
	}
	if (!fError)
	{
		jQuery('#global_register_submit_button').slideUp(200,function() {jQuery('#global_register_submit_button_replace').slideDown(200); } )
		jQuery.ajax({
			type: 'post',
			url: '/community/',
			data: "tx_rituserregistration_pi1[m]=ajax&tx_rituserregistration_pi1[rt]=register&"+jQuery("#tx_rituserregistration_pi1_regform").serialize(),
			success: function(data){
				if (jQuery(data).find('result').text() == '1')
				{
					jQuery('#tx_rituserregistration_pi1_regform').animate({height: 'toggle'}, 500, function() { jQuery('#tx_rituserregistration_pi1_regform').html(jQuery(data).find('message').text()) ; jQuery('#tx_rituserregistration_pi1_regform').animate({height: 'toggle'}, 500) } );
				}
				else
				{
					jQuery('#global_register_submit_button_replace').slideUp(200,function() {jQuery('#global_register_submit_button').slideDown(200); } )
					jQuery('#tx_rituserregistration_username_error').remove();
					if (jQuery(data).find('message').text() =='nameinuse')
					{
						jQuery('#tx_rituserregistration_username_line').after('<div id="tx_rituserregistration_username_error" class="tx_rituserregistration_error">'+tx_rituserregistration_messages.nameinuse+'</div>');
						jQuery('#tx_rituserregistration_username_error').slideDown();
					}
					jQuery('#tx_rituserregistration_email_error').remove();
					if (jQuery(data).find('message').text() =='emailinuse')
					{
						jQuery('#tx_rituserregistration_email_line').after('<div id="tx_rituserregistration_email_error" class="tx_rituserregistration_error">'+tx_rituserregistration_messages.emailinuse+'</div>');
						jQuery('#tx_rituserregistration_email_error').slideDown();
					}
					jQuery('#tx_rituserregistration_captcha_line_error').remove();
					if (jQuery(data).find('message').text() == 'captchafailed')
					{
						jQuery('#tx_rituserregistration_captcha_line').after('<div id="tx_rituserregistration_captcha_line_error" class="tx_rituserregistration_error">'+tx_rituserregistration_messages.captchafailed+'</div>');
						jQuery('#tx_rituserregistration_captcha_line_error').slideDown();
					}

					if (jQuery(data).find('message').text() == 'startPhoneCheck')
					{
						jQuery('#tx_rituserregistration_pi1_step').val(jQuery(data).find('message').text());
						jQuery('#tx_rituserregistration_validationset').html(jQuery(data).find('content').text());
						jQuery('#tx_rituserregistration_dataset').slideUp(1000, function() {jQuery('#tx_rituserregistration_validationset').slideDown();});
					}
					if (jQuery(data).find('message').text() == 'validatePhoneCheck')
					{
						jQuery('#tx_rituserregistration_pi1_step').val(jQuery(data).find('message').text());
						jQuery('#tx_rituserregistration_validationset').slideUp(500).delay(500).html(jQuery(data).find('content').text());
						jQuery('#tx_rituserregistration_validationset').slideDown();
					}
					jQuery('#tx_rituserregistration_phonecode_line_error').remove();
					if (jQuery(data).find('message').text() == 'validatePhoneFailed')
					{
						jQuery('#tx_rituserregistration_phonecode_line').after('<div id="tx_rituserregistration_phonecode_line_error" class="tx_rituserregistration_error">'+tx_rituserregistration_messages.phonecodefailed+'</div>');
						jQuery('#tx_rituserregistration_phonecode_line_error').slideDown();
					}
				}
			}
	 	});
	}
}
/* tx_rituserregistration_pi1 end */


/*  shorturl begin */

(function()
{
    var $ = jQuery;

	var base_directory = '/fileadmin/templates/php/short_url/';
	var current_url = document.URL;


var makeShortUrl = function ()
{
		var buttonPositionTop = $('#short_url').offset().top;
		var buttonPositionLeft = $('#short_url').offset().left;
		
		var divPositionTop = Math.ceil(buttonPositionTop-60);
		var divPositionLeft = Math.ceil(buttonPositionLeft+580);

		$('#shorturl_div').remove();
		$('#shorturl_box').remove();
		
		$('body').append('<div id="shorturl_div"></div>');
		$('#shorturl_div').append('<div id="shorturl_covering" class="covering" onclick="jQuery(\'#shorturl_div\').fadeOut();"></div>');
		$('#shorturl_div').append('<div class="box box_green covering_top" id="shorturl_box" style="width: 300px; display: block;"></div>');
		$('#shorturl_box').append('<div class="head"><h2>Kurz-URL</h2></div>');
		$('#shorturl_box').append('<div id="shorturl_inner" class="inner" style="position: relative;"></div>');
		$('#shorturl_inner').append('<div id="shorturl_pleasewait" style="text-align: center;"><img src="/typo3conf/ext/rit_userregistration/res/images/waiting.gif"></div>');

		$('#shorturl_covering').centerFixed();
		$('#shorturl_covering').css({ opacity: 0, display: 'block' }).animate({opacity: 0.75}); 
		$('#shorturl_covering').fadeIn(); $('#user').focus();
		
		$('#shorturl_box').centerFixed();
		$('#shorturl_box').css({ opacity: 0, display: 'block' }).animate({opacity: 1}); 
		$('#shorturl_box').fadeIn(); $('#user').focus();
		
		$('#shorturl_pleasewait').centerFixed();

		shortUrlAjaxRequest();
}


var shortUrlAjaxRequest = function ()
{
	$.ajax({
		type: 'POST',
		url: base_directory + 'shorturl_ajax.php',
		data: 'longurl=' + encodeURIComponent(current_url),
		success: function (dataShortUrl)
		{
			var dataShortUrl = $.parseJSON(dataShortUrl);
			var shortUrl = dataShortUrl['shorturl'];
	
			$('#shorturl_pleasewait').remove();
			$('#shorturl_inner').append('<p style="color: #000000;">Sie können diese URL bei Twitter oder Facebook verwenden, um anderen diese Seite zu zeigen:</p>');
			$('#shorturl_inner').append('<p><center><input class="input" id="short_url_generated" type="text" name="short_url_generated" style="width: 202px; text-align: center;" value="' + shortUrl + '"/></center></p>');
			$('#shorturl_inner').append('<br/><p><center><p class="btn btn_blue_on_white" style="width: 85px; margin-bottom: 10px;"><span><a onclick="jQuery(\'#shorturl_div\').fadeOut();" id="shorturl_close_button" class="hoverlink" tabindex="1">schließen</a></span></p></center></p>');
			
			$('#short_url_generated').focus();
			$('#short_url_generated').select();

		}
	});
}

var buttonMarkup = function()
    {
        var content = [];
        content.push('<div class="box">');

        if(PTY.CSS3Support === true)
        {
            content.push('<div class="bg"></div>');
        }
        else
        {
            content.push('<div class="bg">');
            content.push('<div class="top"><div class="corner"></div></div>');
            content.push('<div class="bottom"><div class="corner"></div></div>');
        }
        content.push('<div class="head"></div>');

        return content.join('');
    };


$(document).ready(function()
{
  $('li#social_bookmarks').append('<ul style="margin-top:10px;"><li class="top">Kurz URL</a></li><li><div id="short_url"></div></li></ul>');

  $('#short_url').html(buttonMarkup());
 
         if(PTY.CSS3Support === true)
        {
            $('#short_url').addClass('css3');
        }
        $('#short_url .bg').css({
            opacity:0.9
        });
        if(PTY.CSS3Support !== false)
        {
            $('#short_url').height($('#short_url').height() + 2 );
        }
  
  $('#short_url').click(makeShortUrl);
  return;
	$('#short_url').append('<a id="short_url_button">Short-URL</span>');
	$('#short_url_button').click(makeShortUrl);
})


}());

/* shorturl end */

/* rit_ajaxcomment begin */

jQuery(document).ready( function() {
	rit_ajaxcomment_init();
	
	tempURL = document.URL.split('#');
	if (tempURL.length == 2)
	{
		if (tempURL[1] == 'comments_block')
		{
			jQuery('#rit_ajaxcomment_writenew').click();
			jQuery('#tx_ritajaxcomments_pi1_comment').focus();
		}
	}
	
})
function rit_ajaxcomment_init()
{
	jQuery('#rit_ajaxcomment_writenew').click(function() {jQuery('#rit_ajaxcomment_textarea').slideToggle('fast'); rit_ajaxcomment_loadcaptcha(); document.getElementById('tx_ritajaxcomments_pi1_form').elements[0].focus()} )
	jQuery('#rit_ajaxcomment_writenew_send').click(function() {	
		jQuery('.tx_ritajaxcomments_required').each( 
			function()
			{
				jQuery(this).focus(function(){jQuery('#'+this.id+'_error').remove()});
				if (jQuery(this).hasClass('tx_ritajaxcomments_required_email'))
				{
					if (!jQuery(this).val().match(/^.+@[^\.].*\.[a-z]{2,}$/) && !jQuery('#'+this.id+'_error').length) {jQuery(this).after('<div class="tx_ritajaxcomments_field_error" id="'+this.id+'_error">'+jQuery("#tx_ritajaxcomments_required_email").val()+'</div>')}
				}
				else
				{
					if (!jQuery(this).val() && !jQuery('#'+this.id+'_error').length){jQuery(this).after('<div class="tx_ritajaxcomments_field_error" id="'+this.id+'_error">'+jQuery("#tx_ritajaxcomments_required_text").val()+'</div>')}
				}
			}
		)

		if (!jQuery('.tx_ritajaxcomments_field_error').length)
		{
			jQuery('.rit_ajaxcomment_actiontoggle').toggle(); 
			jQuery('#rit_ajaxcomment_textarea').slideUp('fast');
			rit_ajaxcomment_send();
		}
	});
	jQuery('#rit_ajaxcomment_writenew_send').keypress(function(e) {
		if(e.keyCode == 13) {
			jQuery('#rit_ajaxcomment_writenew_send').click()
		}
	});
}
function rit_ajaxcomment_loadcaptcha()
{
	if (jQuery('#tx_ritajaxcomments_recaptcha').length)
	{
		Recaptcha.create("6LdpJAcAAAAAAHLKPrFt1Ip6gu7tDkh6o9jKRs44",
			"tx_ritajaxcomments_recaptcha",
			{
				theme: "clean",
//				callback: Recaptcha.focus_response_field
			}
		);
	}
}

function rit_ajaxcomment_send()
{
	jQuery.ajax({
		data: 'tx_ritajaxcomments_pi1[m]=aj_comment&tx_ritajaxcomments_pi1[prefix]='+jQuery('#tx_ritajaxcomments_pi1_prefix').val()+'&tx_ritajaxcomments_pi1[offset]='+jQuery('#tx_ritajaxcomments_pi1_offset').val()+'&tx_ritajaxcomments_pi1[showuid]='+jQuery('#tx_ritajaxcomments_pi1_showuid').val()+'&tx_ritajaxcomments_pi1[comment]='+(jQuery('#tx_ritajaxcomments_pi1_comment').val())+'&recaptcha_response_field='+(jQuery('#recaptcha_response_field').val())+'&recaptcha_challenge_field='+(jQuery('#recaptcha_challenge_field').val())+'&'+jQuery('.tx_ritajaxcomments_personaldata').serialize(),
		type: 'POST',
		success: function(data) {
			if (jQuery(data).find('result').text() == '1')
			{
				jQuery('#rit_ajaxcomments_container').replaceWith(jQuery(data).find('comments').text());
				document.getElementById('tx_ritajaxcomments_pi1_form').reset()
				rit_ajaxcomment_init();
			}
			else
			{
				if (jQuery(data).find('info').text() == 'adminreview')
				{
					jQuery('.rit_ajaxcomment_actiontoggle').toggle();
					document.getElementById('tx_ritajaxcomments_pi1_form').reset()
					jQuery('.tx_ritajaxcomments_adminreview_info').html(jQuery(data).find('message').text());
					jQuery('.tx_ritajaxcomments_adminreview_info').slideDown().delay(5000).slideUp();
				}
				if (jQuery(data).find('info').text() == 'captchafailed')
				{
					jQuery('.rit_ajaxcomment_actiontoggle').toggle();
					jQuery('#rit_ajaxcomment_textarea').slideDown('fast');
					jQuery('.tx_ritajaxcomments_recaptcha_error').html(jQuery(data).find('message').text());
					jQuery('.tx_ritajaxcomments_recaptcha_error').slideDown().delay(4000).slideUp();
				}
				
			}
		}
	})
}


/* rit_ajaxcomment end */


/* rit_ajaxtags begin */
	
jQuery(document).ready( function() {
	rit_ajaxtag_init();
	jQuery('.rit_ajaxtags_input_line').keypress(function(e) {
		if(e.keyCode == 13 && jQuery(this).val()) {
			jQuery('#'+this.id.replace('_data','')).click()
		}
	});
	jQuery('.rit_ajaxtags_input').keypress(function(e) {
		if(e.keyCode == 13 && jQuery('.rit_ajaxtags_input_line').val()) {
			jQuery('#'+this.id.replace('_data','')).click()
		}
	});
	tempURL = document.URL.split('#');
	if (tempURL.length == 2)
	{
		if (tempURL[1] == 'tags_block')
			jQuery('.rit_ajaxtags_input_line').focus();
	}
	
	rit_ajaxtag_tagcanvas_init();

	jQuery(window.frames).bind('load resize', function() {rit_ajaxtag_tagcanvas_init();});

	jQuery('.box_tabs .head span a').click(function() {rit_ajaxtag_tagcanvas_init();}); 

})
function rit_ajaxtag_init()
{
	jQuery('.rit_ajaxtags_check').click(function() {
		jQuery.ajax({
			data: 'tx_ritajaxtags_pi1[m]=aj_tagclick&tx_ritajaxtags_pi1[set]='+jQuery(this).is(':checked')+'&tx_ritajaxtags_pi1[data]='+this.id+'&tx_ritajaxtags_pi1[title]='+jQuery('title').text()+'&tx_ritajaxtags_pi1[image]='+jQuery("meta[property='og:image']").attr("content"),
			type: 'POST',
			success: function(data) {
				if (jQuery(data).find('result').text() == '1')
				{
					jQuery('#rit_ajaxtags_container'+jQuery(data).find('contentuid').text()).replaceWith(jQuery(data).find('tags').text());
					rit_ajaxtag_init();
				}
			}
		})
	} );
	jQuery('.rit_ajaxtags_input').click(function() {
		jQuery.ajax({
			data: 'tx_ritajaxtags_pi1[m]=aj_taginput&tx_ritajaxtags_pi1[data]='+jQuery('#'+this.id+'_data').val()+'&tx_ritajaxtags_pi1[field]='+jQuery('#'+this.id+'_field').val()+'&tx_ritajaxtags_pi1[title]='+jQuery('title').text()+'&tx_ritajaxtags_pi1[image]='+jQuery("meta[property='og:image']").attr("content"),
			type: 'POST',
			success: function(data) {
				if (jQuery(data).find('result').text() == '1')
				{
					jQuery('#rit_ajaxtags_container'+jQuery(data).find('contentuid').text()).replaceWith(jQuery(data).find('tags').text());
					window.setTimeout("rit_ajaxtag_init()", 1000);
					jQuery('.rit_ajaxtags_input_line').focus();
				}
			}
		})
	} );
	
}
function rit_ajaxtag_tagcanvas_init()
{
	if (jQuery.isFunction(jQuery.fn.tagcanvas)) {
		jQuery('.rit_ajax_tag_cloud').tagcanvas({
			decel: 0.99,
			depth: 0.8,
			hideTags: false,
			maxSpeed: (jQuery.browser.msie && jQuery.browser.version < 9 ? 0.5 : 0.05),
			outlineColour: "#FF9D33",
			outlineOffset: 2,
			outlineThickness : 0,
			reverse: 'true',
			textColour: "#0C76DC",
			textHeight: 15,
			weight: 'true',
			weightGradient: {0:'#0C76DC',  1:'#707070'},
			weightMode:'both',
			weightSize : 2,
		},'weightTags')
	}
} 
/* rit_ajaxtags end */


/* search begin */



var g_PTY_GoogleSearchComplete_Execute = 0;
var google;
// ### Hilfsfunktion welche den Eingabefocus zurück ins Eingabefeld setzt
function PTY_GoogleSearchSetFocus ()
{
	jQuery("input.gsc-input").focus();
}

// ### Callback-Funktion für Google-Suche zur Umgruppierung Steuerung der DIVs
function PTY_GoogleSearchComplete (searchControl, searcher)
{
	if (g_PTY_GoogleSearchComplete_Execute==0)
	{
		jQuery("#content_top").hide();
		jQuery("#content_left").hide();
		jQuery("#content_mid").hide();
		jQuery("#cse").show();
		osc.evt('GoogleSearch',jQuery("input.gsc-input").val())		
		g_PTY_GoogleSearchComplete_Execute=1;
	}
	
	// ### Breadcrumb ersetzen
	jQuery("span.loc").html('<a href="/">Home</a> > <a href="javascript:PTY_GoogleSearchSetFocus();">Suche</a> > <span class="breadcrumb_last">'+jQuery("input.gsc-input").val()+'</span>');
	
	// ### Eingabefocus ins Eingabefeld setzen
	jQuePTY_GoogleSearchSetFocus ();
}

function PTY_GoogleSearchLoad ()
{
	// ### Google-Suche
	google.load('search', '1', {language : 'de', nocss:1,callback:PTY_GoogleSearchLoaded});
}
function PTY_GoogleSearchLoaded()
{
//	google.setOnLoadCallback(function() {
		var customSearchControl = new google.search.CustomSearchControl('009860688110767600210:ibwlwanl9gg');
		customSearchControl.setResultSetSize(google.search.Search.FILTERED_CSE_RESULTSET);
		customSearchControl.setSearchCompleteCallback(null, PTY_GoogleSearchComplete);
		var options = new google.search.DrawOptions();
		options.setSearchFormRoot('cse-search-form');
		customSearchControl.draw('cse', options);
		
		jQuery("#cse-search-form").css("width","295px");
		
		// ### Google-Code um DIV + Span beim Button erweitern
		var GoogleCode = jQuery("td.gsc-search-button").html();
		jQuery("td.gsc-search-button input").remove();
		jQuery("td.gsc-search-button").append('<div class="btn_blue_on_blue"><span class="gsc-search-button">'+GoogleCode+'</span></div>');
		
		// ### Button-Text in Kleinbuchstaben
		jQuery("input.gsc-search-button").attr('value', 'suchen');
//	}, true);
}

jQuery(document).ready(function() {
if (jQuery('#search').length)
{
  var script = document.createElement("script");
  script.src = "https://www.google.com/jsapi?callback=PTY_GoogleSearchLoad";
  script.type = "text/javascript";
  document.getElementsByTagName("head")[0].appendChild(script);
}
})

/* search end */



var PluginDetect={version:"0.7.5",name:"PluginDetect",handler:function(c,b,a){return function(){c(b,a)}},isDefined:function(b){return typeof b!="undefined"},isArray:function(b){return(/array/i).test(Object.prototype.toString.call(b))},isFunc:function(b){return typeof b=="function"},isString:function(b){return typeof b=="string"},isNum:function(b){return typeof b=="number"},isStrNum:function(b){return(typeof b=="string"&&(/\d/).test(b))},getNumRegx:/[\d][\d\.\_,-]*/,splitNumRegx:/[\.\_,-]/g,getNum:function(b,c){var d=this,a=d.isStrNum(b)?(d.isDefined(c)?new RegExp(c):d.getNumRegx).exec(b):null;return a?a[0]:null},compareNums:function(h,f,d){var e=this,c,b,a,g=parseInt;if(e.isStrNum(h)&&e.isStrNum(f)){if(e.isDefined(d)&&d.compareNums){return d.compareNums(h,f)}c=h.split(e.splitNumRegx);b=f.split(e.splitNumRegx);for(a=0;a<Math.min(c.length,b.length);a++){if(g(c[a],10)>g(b[a],10)){return 1}if(g(c[a],10)<g(b[a],10)){return -1}}}return 0},formatNum:function(b,c){var d=this,a,e;if(!d.isStrNum(b)){return null}if(!d.isNum(c)){c=4}c--;e=b.replace(/\s/g,"").split(d.splitNumRegx).concat(["0","0","0","0"]);for(a=0;a<4;a++){if(/^(0+)(.+)$/.test(e[a])){e[a]=RegExp.$2}if(a>c||!(/\d/).test(e[a])){e[a]="0"}}return e.slice(0,4).join(",")},$$hasMimeType:function(a){return function(d){if(!a.isIE&&d){var c,b,e,f=a.isString(d)?[d]:d;if(!f||!f.length){return null}for(e=0;e<f.length;e++){if(/[^\s]/.test(f[e])&&(c=navigator.mimeTypes[f[e]])&&(b=c.enabledPlugin)&&(b.name||b.description)){return c}}}return null}},findNavPlugin:function(l,e,c){var j=this,h=new RegExp(l,"i"),d=(!j.isDefined(e)||e)?/\d/:0,k=c?new RegExp(c,"i"):0,a=navigator.plugins,g="",f,b,m;for(f=0;f<a.length;f++){m=a[f].description||g;b=a[f].name||g;if((h.test(m)&&(!d||d.test(RegExp.leftContext+RegExp.rightContext)))||(h.test(b)&&(!d||d.test(RegExp.leftContext+RegExp.rightContext)))){if(!k||!(k.test(m)||k.test(b))){return a[f]}}}return null},getMimeEnabledPlugin:function(a,f){var e=this,b,c=new RegExp(f,"i"),d="";if((b=e.hasMimeType(a))&&(b=b.enabledPlugin)&&(c.test(b.description||d)||c.test(b.name||d))){return b}return 0},getPluginFileVersion:function(f,b){var h=this,e,d,g,a,c=-1;if(h.OS>2||!f||!f.version||!(e=h.getNum(f.version))){return b}if(!b){return e}e=h.formatNum(e);b=h.formatNum(b);d=b.split(h.splitNumRegx);g=e.split(h.splitNumRegx);for(a=0;a<d.length;a++){if(c>-1&&a>c&&d[a]!="0"){return b}if(g[a]!=d[a]){if(c==-1){c=a}if(d[a]!="0"){return b}}}return e},AXO:window.ActiveXObject,getAXO:function(b){var f=null,d,c=this,a;try{f=new c.AXO(b)}catch(d){}return f},convertFuncs:function(g){var a,h,f,b=/^[\$][\$]/,d={},c=this;for(a in g){if(b.test(a)){d[a]=1}}for(a in d){try{h=a.slice(2);if(h.length>0&&!g[h]){g[h]=g[a](g);delete g[a]}}catch(f){}}},initScript:function(){var c=this,a=navigator,e="/",i=a.userAgent||"",g=a.vendor||"",b=a.platform||"",h=a.product||"";c.OS=100;if(b){var f,d=["Win",1,"Mac",2,"Linux",3,"FreeBSD",4,"iPhone",21.1,"iPod",21.2,"iPad",21.3,"Win.*CE",22.1,"Win.*Mobile",22.2,"Pocket\\s*PC",22.3,"",100];for(f=d.length-2;f>=0;f=f-2){if(d[f]&&new RegExp(d[f],"i").test(b)){c.OS=d[f+1];break}}}c.convertFuncs(c);c.isIE=new Function("return "+e+"*@cc_on!@*"+e+"false")();c.verIE=c.isIE&&(/MSIE\s*(\d+\.?\d*)/i).test(i)?parseFloat(RegExp.$1,10):null;c.ActiveXEnabled=false;if(c.isIE){var f,j=["Msxml2.XMLHTTP","Msxml2.DOMDocument","Microsoft.XMLDOM","ShockwaveFlash.ShockwaveFlash","TDCCtl.TDCCtl","Shell.UIHelper","Scripting.Dictionary","wmplayer.ocx"];for(f=0;f<j.length;f++){if(c.getAXO(j[f])){c.ActiveXEnabled=true;break}}c.head=c.isDefined(document.getElementsByTagName)?document.getElementsByTagName("head")[0]:null}c.isGecko=(/Gecko/i).test(h)&&(/Gecko\s*\/\s*\d/i).test(i);c.verGecko=c.isGecko?c.formatNum((/rv\s*\:\s*([\.\,\d]+)/i).test(i)?RegExp.$1:"0.9"):null;c.isSafari=(/Safari\s*\/\s*\d/i).test(i)&&(/Apple/i).test(g);c.isChrome=(/Chrome\s*\/\s*(\d[\d\.]*)/i).test(i);c.verChrome=c.isChrome?c.formatNum(RegExp.$1):null;c.isOpera=(/Opera\s*[\/]?\s*(\d+\.?\d*)/i).test(i);c.verOpera=c.isOpera&&((/Version\s*\/\s*(\d+\.?\d*)/i).test(i)||1)?parseFloat(RegExp.$1,10):null;c.addWinEvent("load",c.handler(c.runWLfuncs,c))},init:function(c){var b=this,a,c;if(!b.isString(c)){return -3}if(c.length==1){b.getVersionDelimiter=c;return -3}c=c.toLowerCase().replace(/\s/g,"");a=b[c];if(!a||!a.getVersion){return -3}b.plugin=a;if(!b.isDefined(a.installed)){a.installed=a.version=a.version0=a.getVersionDone=null;a.$=b;a.pluginName=c}b.garbage=false;if(b.isIE&&!b.ActiveXEnabled){if(a!==b.java){return -2}}return 1},fPush:function(b,a){var c=this;if(c.isArray(a)&&(c.isFunc(b)||(c.isArray(b)&&b.length>0&&c.isFunc(b[0])))){a.push(b)}},callArray:function(b){var c=this,a;if(c.isArray(b)){for(a=0;a<b.length;a++){if(b[a]===null){return}c.call(b[a]);b[a]=null}}},call:function(c){var b=this,a=b.isArray(c)?c.length:-1;if(a>0&&b.isFunc(c[0])){c[0](b,a>1?c[1]:0,a>2?c[2]:0,a>3?c[3]:0)}else{if(b.isFunc(c)){c(b)}}},getVersionDelimiter:",",$$getVersion:function(a){return function(g,d,c){var e=a.init(g),f,b,h;if(e<0){return null};f=a.plugin;if(f.getVersionDone!=1){f.getVersion(null,d,c);if(f.getVersionDone===null){f.getVersionDone=1}}a.cleanup();b=(f.version||f.version0);b=b?b.replace(a.splitNumRegx,a.getVersionDelimiter):b;return b}},cleanup:function(){},addWinEvent:function(d,c){var e=this,a=window,b;if(e.isFunc(c)){if(a.addEventListener){a.addEventListener(d,c,false)}else{if(a.attachEvent){a.attachEvent("on"+d,c)}else{b=a["on"+d];a["on"+d]=e.winHandler(c,b)}}}},winHandler:function(d,c){return function(){d();if(typeof c=="function"){c()}}},WLfuncs0:[],WLfuncs:[],runWLfuncs:function(a){a.winLoaded=true;a.callArray(a.WLfuncs0);a.callArray(a.WLfuncs);if(a.onDoneEmptyDiv){a.onDoneEmptyDiv()}},winLoaded:false,$$onWindowLoaded:function(a){return function(b){if(a.winLoaded){a.call(b)}else{a.fPush(b,a.WLfuncs)}}},div:null,divWidth:50,pluginSize:1,emptyDiv:function(){var c=this,a,e,b,d=0;if(c.div&&c.div.childNodes){for(a=c.div.childNodes.length-1;a>=0;a--){b=c.div.childNodes[a];if(b&&b.childNodes){if(d==0){for(e=b.childNodes.length-1;e>=0;e--){b.removeChild(b.childNodes[e])}c.div.removeChild(b)}else{}}}}},DONEfuncs:[],onDoneEmptyDiv:function(){var c=this,a,b;if(!c.winLoaded){return}if(c.WLfuncs&&c.WLfuncs.length&&c.WLfuncs[c.WLfuncs.length-1]!==null){return}for(a in c){b=c[a];if(b&&b.funcs){if(b.OTF==3){return}if(b.funcs.length&&b.funcs[b.funcs.length-1]!==null){return}}}for(a=0;a<c.DONEfuncs.length;a++){c.callArray(c.DONEfuncs)}c.emptyDiv()},getWidth:function(c){if(c){var a=c.scrollWidth||c.offsetWidth,b=this;if(b.isNum(a)){return a}}return -1},getTagStatus:function(m,g,a,b){var c=this,f,k=m.span,l=c.getWidth(k),h=a.span,j=c.getWidth(h),d=g.span,i=c.getWidth(d);if(!k||!h||!d||!c.getDOMobj(m)){return -2}if(j<i||l<0||j<0||i<0||i<=c.pluginSize||c.pluginSize<1){return 0}if(l>=i){return -1}try{if(l==c.pluginSize&&(!c.isIE||c.getDOMobj(m).readyState==4)){if(!m.winLoaded&&c.winLoaded){return 1}if(m.winLoaded&&c.isNum(b)){if(!c.isNum(m.count)){m.count=b}if(b-m.count>=10){return 1}}}}catch(f){}return 0},getDOMobj:function(g,a){var f,d=this,c=g?g.span:0,b=c&&c.firstChild?1:0;try{if(b&&a){c.firstChild.focus()}}catch(f){}return b?c.firstChild:null},setStyle:function(b,g){var f=b.style,a,d,c=this;if(f&&g){for(a=0;a<g.length;a=a+2){try{f[g[a]]=g[a+1]}catch(d){}}}},insertDivInBody:function(i){var g,d=this,h="pd33993399",c=null,f=document,b="<",a=(f.getElementsByTagName("body")[0]||f.body);if(!a){try{f.write(b+'div id="'+h+'">o'+b+"/div>");c=f.getElementById(h)}catch(g){}}a=(f.getElementsByTagName("body")[0]||f.body);if(a){if(a.firstChild&&d.isDefined(a.insertBefore)){a.insertBefore(i,a.firstChild)}else{a.appendChild(i)}if(c){a.removeChild(c)}}else{}},insertHTML:function(g,b,h,a,k){var l,m=document,j=this,q,o=m.createElement("span"),n,i,f="<";var c=["outlineStyle","none","borderStyle","none","padding","0px","margin","0px","visibility","visible"];if(!j.isDefined(a)){a=""}if(j.isString(g)&&(/[^\s]/).test(g)){q=f+g+' width="'+j.pluginSize+'" height="'+j.pluginSize+'" ';for(n=0;n<b.length;n=n+2){if(/[^\s]/.test(b[n+1])){q+=b[n]+'="'+b[n+1]+'" '}}q+=">";for(n=0;n<h.length;n=n+2){if(/[^\s]/.test(h[n+1])){q+=f+'param name="'+h[n]+'" value="'+h[n+1]+'" />'}}q+=a+f+"/"+g+">"}else{q=a}if(!j.div){j.div=m.createElement("div");i=m.getElementById("plugindetect");if(i){j.div=i}else{j.div.id="plugindetect";j.insertDivInBody(j.div)}j.setStyle(j.div,c.concat(["width",j.divWidth+"px","height",(j.pluginSize+3)+"px","fontSize",(j.pluginSize+3)+"px","lineHeight",(j.pluginSize+3)+"px","verticalAlign","baseline","display","block"]));if(!i){j.setStyle(j.div,["position","absolute","right","0px","top","0px"])}}if(j.div&&j.div.parentNode){j.div.appendChild(o);j.setStyle(o,c.concat(["fontSize",(j.pluginSize+3)+"px","lineHeight",(j.pluginSize+3)+"px","verticalAlign","baseline","display","inline"]));try{if(o&&o.parentNode){o.focus()}}catch(l){}try{o.innerHTML=q}catch(l){}if(o.childNodes.length==1&&!(j.isGecko&&j.compareNums(j.verGecko,"1,5,0,0")<0)){j.setStyle(o.firstChild,c.concat(["display","inline"]))}return{span:o,winLoaded:j.winLoaded,tagName:(j.isString(g)?g:"")}}return{span:null,winLoaded:j.winLoaded,tagName:""}},flash:{mimeType:["application/x-shockwave-flash","application/futuresplash"],progID:"ShockwaveFlash.ShockwaveFlash",classID:"clsid:D27CDB6E-AE6D-11CF-96B8-444553540000",getVersion:function(){var b=function(i){if(!i){return null}var e=/[\d][\d\,\.\s]*[rRdD]{0,1}[\d\,]*/.exec(i);return e?e[0].replace(/[rRdD\.]/g,",").replace(/\s/g,""):null};var d,h=this,f=h.$,j,g,k=null,c=null,a=null;if(!f.isIE){d=f.findNavPlugin("Flash");if(d&&d.description&&f.hasMimeType(h.mimeType)){k=b(d.description)}if(k){k=f.getPluginFileVersion(d,k)}}else{for(g=15;g>2;g--){c=f.getAXO(h.progID+"."+g);if(c){a=g.toString();break}}if(a=="6"){try{c.AllowScriptAccess="always"}catch(j){return"6,0,21,0"}}try{k=b(c.GetVariable("$version"))}catch(j){}if(!k&&a){k=a}}h.installed=k?1:-1;h.version=f.formatNum(k);return true}},windowsmediaplayer:{mimeType:["application/x-mplayer2","application/asx","application/x-ms-wmp"],progID:"wmplayer.ocx",classID:"clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6",getVersion:function(){var b=this,a=null,e=b.$,d,f=null,c;b.installed=-1;if(!e.isIE){if(e.hasMimeType(b.mimeType)){f=e.findNavPlugin("Windows\\s*Media.*Plug-?in",0,"Totem")||e.findNavPlugin("Flip4Mac.*Windows\\s*Media.*Plug-?in",0,"Totem");d=(e.isGecko&&e.compareNums(e.verGecko,e.formatNum("1.8"))<0);d=d||(e.isOpera&&e.verOpera<10);if(!d&&e.getMimeEnabledPlugin(b.mimeType[2],"Windows\\s*Media.*Firefox.*Plug-?in")){c=e.getDOMobj(e.insertHTML("object",["type",b.mimeType[2],"data",""],["src",""],"",b));if(c){a=c.versionInfo}}}}else{f=e.getAXO(b.progID);if(f){a=f.versionInfo}}b.installed=f&&a?1:(f?0:-1);b.version=e.formatNum(a)}},silverlight:{mimeType:"application/x-silverlight",progID:"AgControl.AgControl",digits:[20,20,9,12,31],getVersion:function(){var e=this,c=e.$,k=document,i=null,b=null,f=null,h=true,a=[1,0,1,1,1],u=[1,0,1,1,1],j=function(d){return(d<10?"0":"")+d.toString()},n=function(s,d,v,w,t){return(s+"."+d+"."+v+j(w)+j(t)+".0")},o=function(s,d,t){return r(s,(d==0?t:u[0]),(d==1?t:u[1]),(d==2?t:u[2]),(d==3?t:u[3]),(d==4?t:u[4]))},r=function(w,t,s,y,x,v){var v;try{return w.IsVersionSupported(n(t,s,y,x,v))}catch(v){}return false};if(!c.isIE){var g;if(c.hasMimeType(e.mimeType)){g=c.isGecko&&c.compareNums(c.verGecko,c.formatNum("1.6"))<=0;if(c.isGecko&&g){h=false}f=c.findNavPlugin("Silverlight.*Plug-?in",0);if(f&&f.description){i=c.formatNum(f.description)}if(i){u=i.split(c.splitNumRegx);if(parseInt(u[2],10)>=30226&&parseInt(u[0],10)<2){u[0]="2"}i=u.join(",")}}e.installed=f&&h&&i?1:(f&&h?0:(f?-0.2:-1))}else{b=c.getAXO(e.progID);var m,l,q;if(b&&r(b,a[0],a[1],a[2],a[3],a[4])){for(m=0;m<e.digits.length;m++){q=u[m];for(l=q+(m==0?0:1);l<=e.digits[m];l++){if(o(b,m,l)){h=true;u[m]=l}else{break}}if(!h){break}}if(h){i=n(u[0],u[1],u[2],u[3],u[4])}}e.installed=b&&h&&i?1:(b&&h?0:(b?-0.2:-1))}e.version=c.formatNum(i)}},adobereader:{mimeType:"application/pdf",navPluginObj:null,progID:["AcroPDF.PDF","PDF.PdfCtrl"],classID:"clsid:CA8A9780-280D-11CF-A24D-444553540000",INSTALLED:{},pluginHasMimeType:function(d,c,f){var b=this,e=b.$,a;for(a in d){if(d[a]&&d[a].type&&d[a].type==c){return 1}}if(e.getMimeEnabledPlugin(c,f)){return 1}return 0},getVersion:function(i,j){var f=this,c=f.$,h,d,k,m=p=null,g=null,l=null,a,b;j=(c.isString(j)&&j.length)?j.replace(/\s/,"").toLowerCase():f.mimeType;if(c.isDefined(f.INSTALLED[j])){f.installed=f.INSTALLED[j];return}if(!c.isIE){a="Adobe.*PDF.*Plug-?in|Adobe.*Acrobat.*Plug-?in|Adobe.*Reader.*Plug-?in";if(f.getVersionDone!==0){f.getVersionDone=0;p=c.getMimeEnabledPlugin(f.mimeType,a);if(!p&&c.hasMimeType(f.mimeType)){p=c.findNavPlugin(a,0)}if(p){f.navPluginObj=p;g=c.getNum(p.description)||c.getNum(p.name);g=c.getPluginFileVersion(p,g);if(!g&&c.OS==1){if(f.pluginHasMimeType(p,"application/vnd.adobe.pdfxml",a)){g="9"}else{if(f.pluginHasMimeType(p,"application/vnd.adobe.x-mars",a)){g="8"}}}}}else{g=f.version}m=c.getMimeEnabledPlugin(j,a);f.installed=m&&g?1:(m?0:(f.navPluginObj?-0.2:-1))}else{p=c.getAXO(f.progID[0])||c.getAXO(f.progID[1]);b=/=\s*([\d\.]+)/g;try{d=(p||c.getDOMobj(c.insertHTML("object",["classid",f.classID],["src",""],"",f))).GetVersions();for(k=0;k<5;k++){if(b.test(d)&&(!g||RegExp.$1>g)){g=RegExp.$1}}}catch(h){}f.installed=g?1:(p?0:-1)}if(!f.version){f.version=c.formatNum(g)}f.INSTALLED[j]=f.installed}},zz:0};PluginDetect.initScript();

function oscClass() {
	this.originalSrc = '';
}

oscClass.prototype.getOSCParams = function(param) {
	var OSCparams;
	var x,y;
	var newDoclabel = '';
	var newSid = '';
	
	param = param.replace(/&amp;/g, "&");
	var arrParams = param.split('&');
	for (var i=0; i<arrParams.length; i++) {
		var arrValues = arrParams[i].split('=');
		if (arrValues[0] == 'doclabel') {
			newDoclabel = arrValues[1];
		}
		if (arrValues[0] == 'sid') {
			newSid = arrValues[1];
		} 
	}
	
	OSCparams = param;
	
	if (self.innerHeight) // all except Explorer
	{
		x = self.innerWidth;
		y = self.innerHeight;
	}
	else if (document.documentElement && document.documentElement.clientHeight)
		// Explorer 6 Strict Mode
	{
		x = document.documentElement.clientWidth;
		y = document.documentElement.clientHeight;
	}
	else if (document.body) // other Explorers
	{
		x = document.body.clientWidth;
		y = document.body.clientHeight;
	}
	var l;
	if (navigator.language)	l = navigator.language;
	else l = navigator.browserLanguage;
	
	if (navigator.cookieEnabled == true) {
		var c, c1, c2;
		var d = new Date();
		var usrCookie = new Array(3);
		var oscCookieAvailable = false;
		var usrCookieAvailable = false;
	
		if (document.cookie) {
			c = document.cookie;
			var pos = c.indexOf("osc=");
			if ( pos > -1 )	{
				var pos2 = c.indexOf(";",pos+4);
				if ( pos2 > -1)
					c1 = c.substring(pos+4, c.indexOf(";",pos));
				else
					c1 = c.substring(pos+4);
				oscCookieAvailable = true;
			}

			var pos = c.indexOf("osc_usr=");
			if ( pos > -1 )	{
				var pos2 = c.indexOf(";",pos+8);
				if ( pos2 > -1)
					c2 = c.substring(pos+8, c.indexOf(";",pos));
				else
					c2 = c.substring(pos+8);
				usrCookieAvailable = true;
				usrCookie = c2.split("_");
			}
		}
	
		if (newSid != '') {
			c1 = newSid;
			oscCookieAvailable = true;
			if (usrCookieAvailable  &&  c1 != usrCookie[3]){
				usrCookie[1]++;
			}
		}
	
		if (!oscCookieAvailable) {
			c1 = d.getTime().toString() + Math.floor(100000*Math.random()).toString();
			if (usrCookieAvailable){
				usrCookie[1]++;
			}
		}
		if(!usrCookieAvailable){
			usrCookie[0] = c1;
			usrCookie[1] = 1;
			usrCookie[2] = 0;
		}
		
		var a = new Date(d.getTime() +1000*60*30);			
		document.cookie = 'osc=' + c1 + '; expires=' + a.toGMTString() + '; path=/;';				
		
		if (newSid == '')
			OSCparams += "&sid=" + encodeURIComponent(c1);
		OSCparams += "&usrid=" + encodeURIComponent(usrCookie[0].toString());
		OSCparams += "&usrcnt=" + encodeURIComponent(usrCookie[1].toString());
		OSCparams += "&usrlsthit=" + encodeURIComponent(usrCookie[2]);
		
		var t = Math.floor(d.getTime() / 1000);
		usrCookie[2] = t.toString();
		usrCookie[3] = c1;
		c2 = usrCookie.join("_");
		a = new Date(2030,0,0);			
		document.cookie = 'osc_usr=' + c2 + '; expires=' + a.toGMTString() + '; path=/;';
	}

	if (newDoclabel == '') {
		OSCparams += "&doclabel=" + encodeURIComponent(document.title);
	}
	var plugins = '';
	plugins += 'Flash|' + encodeURIComponent(PluginDetect.getVersion('Flash')) + ';';
	plugins += 'WindowsMediaPlayer|' + encodeURIComponent(PluginDetect.getVersion('WindowsMediaPlayer')) + ';';
	plugins += 'Silverlight|' + encodeURIComponent(PluginDetect.getVersion('Silverlight')) + ';';
	plugins += 'AdobeReader|' + encodeURIComponent(PluginDetect.getVersion('AdobeReader')) + ';';
	OSCparams += "&sw=" + screen.width;
	OSCparams += "&sh=" + screen.height;
	OSCparams += "&cd=" + screen.colorDepth;
	OSCparams += "&ww=" + x;
	OSCparams += "&wh=" + y;
	OSCparams += "&bl=" + encodeURIComponent(l);
	OSCparams += "&ua=" + encodeURIComponent(navigator.userAgent);
	OSCparams += "&ref=" + encodeURIComponent(document.referrer);
	OSCparams += "&url=" + encodeURIComponent(document.URL);
	OSCparams += "&plugins=" + encodeURIComponent(plugins);

	return OSCparams;
}


oscClass.prototype.img = function(param) {
	var src = window.location.protocol + '//svc3.odoscope.com/sp.gif?' + osc.getOSCParams(param);
	osc.originalSrc = src;
	
	var e = document.getElementById('oscImg');
	if (e == null) {
		document.write('<img id="oscImg" src="' + src + '" alt="oscImg" />');
	}
	else {
		e.src = src;
	}	
}

oscClass.prototype.evt = function(eventName, eventValue) {
	var e = document.getElementById('oscImg');
	if (e != null) {
		e.src = osc.originalSrc + '&' + encodeURIComponent(eventName) + '=' + encodeURIComponent(eventValue);
	}
	return true;
}

var osc = new oscClass(); 
