RegExp.escape=function(b){if(!arguments.callee.sRE){var a=["/",".","*","+","?","|","(",")","[","]","{","}","\\","$"];arguments.callee.sRE=new RegExp("(\\"+a.join("|\\")+")","g")}return b.replace(arguments.callee.sRE,"\\$1")};var Portal={};var tabs_news=["newscenter","newschannel"];Portal.News={jcarouselNewsCenter:null,jcarouselNewsChannel:null,chooseTab:function(a){if(Portal.News.jcarouselNewsCenter){Portal.News.jcarouselNewsCenter.stopAuto()}if(Portal.News.jcarouselNewsChannel){Portal.News.jcarouselNewsChannel.stopAuto()}CNC.Global.chooseTabOfArea(a,"news");if(a=="newscenter"&&Portal.News.jcarouselNewsCenter){Portal.News.jcarouselNewsCenter.startAuto();$("#newscenterboxheader").show()}else{if(a=="newschannel"){if(Portal.News.jcarouselNewsChannel){Portal.News.jcarouselNewsChannel.startAuto()}else{$("#newschannelscroll").jcarousel({auto:13,wrap:"circular",buttonPrevHTML:null,buttonNextHTML:null,scroll:1,animation:"slow",size:15,initCallback:function(c,b){c.stopAuto();Portal.News.jcarouselNewsChannel=c;c.clip.hover(function(){c.stopAuto()},function(){c.startAuto()})}})}$("#newscenterboxheader").hide()}}}};Portal.NewsCenter={items:[],itemVisibleInCallback:function(f,d,c,e,b){var a=f.index(c,Portal.NewsCenter.items.length)-1;f.add(c,Portal.NewsCenter.itemHTML(a));$("#newscenterboxheader").html(Portal.NewsCenter.items[a].description+" | "+Portal.NewsCenter.items[a]._last_post)},itemVisibleOutCallback:function(e,c,b,d,a){e.remove(b)},itemHTML:function(a){return'<div class="bcncr_wrapper" onclick="location.href=\'/forum/index.php?showforum=205&findtopic='+Portal.NewsCenter.items[a].tid+'\';"><div class="bcncr_jcarousel"><img src="'+Portal.NewsCenter.items[a].thumb_url+'" border="0"></div><div class="bcncr_text"><div class="headline_white">'+Portal.NewsCenter.items[a].title+'</div><div class="bcncr_subtitle">'+Portal.NewsCenter.items[a]._teaser+"</div></div></div>"}};$(function(){var a="";$("#newscenterscroll").html(a);$("#newscenterscroll").jcarousel({auto:21,wrap:"circular",buttonPrevHTML:"<div><div></div></div>",buttonNextHTML:"<div><div></div></div>",scroll:1,animation:"slow",initCallback:function(c,b){c.stopAuto();Portal.News.jcarouselNewsCenter=c;c.clip.hover(function(){c.stopAuto()},function(){c.startAuto()})},itemVisibleInCallback:{onBeforeAnimation:Portal.NewsCenter.itemVisibleInCallback},itemVisibleOutCallback:{onAfterAnimation:Portal.NewsCenter.itemVisibleOutCallback}})});var tabs_registration=["register","login"];Portal.Registration={username_allowed_chars:"",user_display_name_max_length:26,def_username:"",def_email:"",def_password:"",checkFieldErrors:[],setFieldError:function(a,b){$("#box_register input[name="+a+"]").addClass("error");$("#box_register select[name="+a+"]").addClass("error");$("#preg_hook_"+a).hide();$("#preg_cross_"+a).show();if(b){$("#box_register input[name="+a+"]").unbind("mouseover");$("#box_register input[name="+a+"]").unbind("mouseout");$("#box_register input[name="+a+"]").mouseover(function(){if(CNC.LANG.Registration["tt_"+a+"_error_"+b]){showTooltip(CNC.LANG.Registration["tt_"+a+"_error_"+b])}});$("#box_register input[name="+a+"]").mouseout(function(){hideTooltip()});$("#preg_cross_"+a).unbind("mouseover");$("#preg_cross_"+a).unbind("mouseout");$("#preg_cross_"+a).mouseover(function(){if(CNC.LANG.Registration["tt_"+a+"_error_"+b]){showTooltip(CNC.LANG.Registration["tt_"+a+"_error_"+b])}});$("#preg_cross_"+a).mouseout(function(){hideTooltip()})}Portal.Registration.checkFieldErrors.push(a)},setFieldOK:function(a){$("#box_register input[name="+a+"]").removeClass("error");$("#box_register select[name="+a+"]").removeClass("error");$("#preg_hook_"+a).show();$("#preg_cross_"+a).hide();$("#box_register input[name="+a+"]").unbind("mouseover");$("#box_register input[name="+a+"]").unbind("mouseout");$("#preg_cross_"+a).unbind("mouseover");$("#preg_cross_"+a).unbind("mouseout");Portal.Registration.checkFieldErrors=$.grep(Portal.Registration.checkFieldErrors,function(b){return b!=a})},checkFieldType:function(){if(!$("#box_register input[name=type]:checked").val()){Portal.Registration.setFieldError("type")}else{Portal.Registration.setFieldOK("type")}},checkFieldUsername:function(){var a=false;var c=$("#box_register input[name=username]").val();if(!c||c.length<3||c.length>Portal.Registration.user_display_name_max_length){Portal.Registration.setFieldError("username","none");a=true}if(c==Portal.Registration.def_username){Portal.Registration.setFieldError("username","taken");a=true}if(Portal.Registration.username_allowed_chars!=""){var b=new RegExp();b.compile("^["+RegExp.escape(Portal.Registration.username_allowed_chars)+"]+$");if(!b.test(c)){Portal.Registration.setFieldError("username","allowedchars");a=true}}if(c.replace(/ /g,"").replace(/^[0-9]+$/g,"")==""){Portal.Registration.setFieldError("username","allowedchars");a=true}c=c.replace("+","&#43;");$.ajax({url:"http://www.cnc-arena.com/forum/index.php?act=xmlout&do=check-user-name&name="+escape(c),async:false,success:function(d){if(d=="found"){Portal.Registration.setFieldError("username","taken");a=true}}});if(!a){Portal.Registration.setFieldOK("username")}},checkFieldEmail:function(){inputval=$("#box_register input[name=email]").val();errorField=false;if(!inputval){Portal.Registration.setFieldError("email","missing");errorField=true}if(inputval==Portal.Registration.def_email){Portal.Registration.setFieldError("email","taken");errorField=true}$.ajax({url:"http://www.cnc-arena.com/forum/index.php?act=xmlout&do=check-email-address&email="+encodeURIComponent(inputval),async:false,success:function(a){if(a=="found"){Portal.Registration.setFieldError("email","taken");errorField=true}else{if(a=="banned"){Portal.Registration.setFieldError("email","taken");errorField=true}else{if(a=="invalid"){Portal.Registration.setFieldError("email","invalid");errorField=true}}}}});if(!errorField){Portal.Registration.setFieldOK("email")}},checkFieldPassword:function(){inputval=$("#box_register input[name=password]").val();errorField=false;if(!inputval){Portal.Registration.setFieldError("password","no");Portal.Registration.setFieldError("password_fake","no");errorField=true}if(inputval.length<3||inputval.length>32){Portal.Registration.setFieldError("password","length");Portal.Registration.setFieldError("password_fake","length");errorField=true}if(inputval==Portal.Registration.def_password){Portal.Registration.setFieldError("password","no");Portal.Registration.setFieldError("password_fake","no");errorField=true}if(!errorField){Portal.Registration.setFieldOK("password");Portal.Registration.setFieldOK("password_fake")}},checkFieldCountry:function(){if(!$("#box_register select[name=country_id]").val()){Portal.Registration.setFieldError("country_id")}else{Portal.Registration.setFieldOK("country_id")}},checkFieldTerms:function(){if($("#box_register input[name=type]:checked").val()=="personal"){if($("#box_register input[name=useofterms]:checked").val()!="yes"){Portal.Registration.setFieldError("useofterms")}else{Portal.Registration.setFieldOK("useofterms")}}},submit:function(){var a=false;var b=false;Portal.Registration.checkFieldType();Portal.Registration.checkFieldUsername();Portal.Registration.checkFieldEmail();Portal.Registration.checkFieldPassword();Portal.Registration.checkFieldCountry();Portal.Registration.checkFieldTerms();if(Portal.Registration.checkFieldErrors.length==0){document.theRegRegForm.submit()}}};$(function(){$("#box_register input[name=type]").click(function(){$("#preg_submitpersonal").hide();$("#preg_submitbusiness").hide();$("#preg_submitinfo").hide();$("#preg_submit"+$(this).val()).show();Portal.Registration.checkFieldType()});$("#box_register input[name=username]").focus(function(){if($(this).val()==Portal.Registration.def_username){$(this).val("")}}).blur(function(){if($(this).val()==""){$(this).val(Portal.Registration.def_username)}Portal.Registration.checkFieldUsername()});$("#box_register input[name=email]").focus(function(){if($(this).val()==Portal.Registration.def_email){$(this).val("")}}).blur(function(){if($(this).val()==""){$(this).val(Portal.Registration.def_email)}Portal.Registration.checkFieldEmail()});$("#box_register input[name=password_fake]").focus(function(){$("#box_register input[name=password_fake]").hide();$("#box_register input[name=password]").show().focus()});$("#box_register input[name=password]").blur(function(){if($(this).val()==""||$(this).val()==Portal.Registration.def_password){$("#box_register input[name=password]").hide();$("#box_register input[name=password_fake]").show()}Portal.Registration.checkFieldPassword()});$("#box_register select[name=country_id]").blur(function(){Portal.Registration.checkFieldCountry()});$("#box_register input[name=useofterms]").click(function(){Portal.Registration.checkFieldTerms()});if($("#overlay").length==0){$("body").append('<div class="apple_overlay" id="overlay"><div class="contentWrap"></div></div>')}$("a[rel=#overlay]").overlay({mask:"#333",effect:"apple",onBeforeLoad:function(){var a=this.getOverlay().find(".contentWrap");if(this.getTrigger().attr("href")!="#"){a.load(this.getTrigger().attr("href"))}else{if(this.getTrigger().attr("content")){a.html(this.getTrigger().attr("content"))}}}});CNC.LANG.Registration.tt_username_error_allowedchars=CNC.LANG.Registration.tt_username_error_allowedchars.replace(/<#CHARS#>/,Portal.Registration.username_allowed_chars);CNC.LANG.Registration.tt_username_error_none=CNC.LANG.Registration.tt_username_error_none.replace(/<#SIGNS#>/,Portal.Registration.user_display_name_max_length);$("#box_login input[name=UserName]").focus(function(){if($(this).val()==Portal.Registration.def_username){$(this).val("")}}).blur(function(){if($(this).val()==""){$(this).val(Portal.Registration.def_username)}});$("#box_login input[name=PassWord]").focus(function(){if($(this).val()==Portal.Registration.def_password){$(this).val("")}}).blur(function(){if($(this).val()==""){$(this).val(Portal.Registration.def_password)}})});Portal.UserPanel={scrollToLastPosts:function(){$("html,body").animate({scrollTop:$("#portal_lastposts").offset().top-120},2000,function(){})},openUTBox:function(){$("#bcup_usertools").show();$("#bcup_usertools").css("width","0");$("#bcup_usertools").animate({width:"212px"},1000,function(){$("#bcup_list").hide();$("#bcup_editprofile").hide()})},closeUTBox:function(){$("#bcup_list").show();$("#bcup_editprofile").show();$("#bcup_usertools").animate({width:"0"},1000,function(){$("#bcup_usertools").hide()})},openFNBox:function(){$("#bcup_favnewsrooms").show();$("#bcup_favnewsrooms").css("width","0");$("#bcup_favnewsrooms").animate({width:"212px"},1000,function(){$("#bcup_list").hide();$("#bcup_editprofile").hide()})},closeFNBox:function(){$("#bcup_list").show();$("#bcup_editprofile").show();$("#bcup_favnewsrooms").animate({width:"0"},1000,function(){$("#bcup_favnewsrooms").hide()})},openFFBox:function(){$("#bcup_favforums").show();$("#bcup_favforums").css("width","0");$("#bcup_favforums").animate({width:"212px"},1000,function(){$("#bcup_list").hide();$("#bcup_editprofile").hide()})},closeFFBox:function(){$("#bcup_list").show();$("#bcup_editprofile").show();$("#bcup_favforums").animate({width:"0"},1000,function(){$("#bcup_favforums").hide()})},openFFSelect:function(){$("#portal_userpanel_global").hide();$("#portal_userpanel_ff").show()},openFNSelect:function(){$("#portal_userpanel_global").hide();$("#portal_userpanel_fn").show()}};var tabs=["usedmachines","newmachines","tools"];Portal.Marketplace={langUMinputtext:"",langMDinputtext:"",langTOOLSinputtext:"",submitSearchUM:function(){window.open("http://www.cnc-arena.com/forum/index.php?act=um&code=search_offer&q="+$("#bcum_q").val(),"UMSearch")},submitSearchMD:function(){window.open("http://www.cnc-arena.com/neumaschinen?site=search&q="+$("#bcmd_q").val(),"MDSearch")},submitSearchTOOLS:function(){window.open("http://www.cnc-arena.com/emarket/werkzeuge?site=search&q="+$("#bctools_q").val(),"TOOLSSearch")},randomTab:function(){var a=Math.ceil(Math.random()*3);switch(a){case 3:chooseTab("tools");break;case 2:chooseTab("newmachines");break}}};$(function(){$("#box_usedmachines input[type=text]").focus(function(){$(this).css("color","");$(this).css("font-style","");if($(this).val()==Portal.Marketplace.langUMinputtext){$(this).val("")}}).blur(function(){if($(this).val()==""||$(this).val()==Portal.Marketplace.langUMinputtext){$(this).val(Portal.Marketplace.langUMinputtext);$(this).css("color","#DBDBDB");$(this).css("font-style","italic")}});$("#box_usedmachines input[type=text]").blur();$("#box_newmachines input[type=text]").focus(function(){$(this).css("color","");$(this).css("font-style","");if($(this).val()==Portal.Marketplace.langMDinputtext){$(this).val("")}}).blur(function(){if($(this).val()==""||$(this).val()==Portal.Marketplace.langMDinputtext){$(this).val(Portal.Marketplace.langMDinputtext);$(this).css("color","#DBDBDB");$(this).css("font-style","italic")}});$("#box_newmachines input[type=text]").blur();$("#box_tools input[type=text]").focus(function(){$(this).css("color","");$(this).css("font-style","");if($(this).val()==Portal.Marketplace.langTOOLSinputtext){$(this).val("")}}).blur(function(){if($(this).val()==""||$(this).val()==Portal.Marketplace.langTOOLSinputtext){$(this).val(Portal.Marketplace.langTOOLSinputtext);$(this).css("color","#DBDBDB");$(this).css("font-style","italic")}});$("#box_tools input[type=text]").blur();$("#bcum_q").autocomplete("http://www.cnc-arena.com/forum/index.php?act=um&code=search_suggestions",{selectFirst:false,width:353}).bind("result",function(){Portal.Marketplace.submitSearchUM()});$("#bcmd_q").autocomplete("http://www.cnc-arena.com/newmachines?site=ajax&type=quickSearch&get=keywords",{selectFirst:false,width:353}).bind("result",function(){Portal.Marketplace.submitSearchMD()});$("#bctools_q").autocomplete("http://www.cnc-arena.com/emarket/tools?site=ajax&type=quickSearch&get=keywords",{selectFirst:false,width:353}).bind("result",function(){Portal.Marketplace.submitSearchTOOLS()})});Portal.Virtualfair={URL:"/de/messe/"};$(function(){$("#virtualfairscroll").jcarousel({vertical:false,auto:5,buttonPrevHTML:null,buttonNextHTML:null,scroll:1,initCallback:function(b,a){b.clip.hover(function(){b.stopAuto()},function(){b.startAuto()})}});$("#portal_virtualfair .box_content").click(function(){location.href=Portal.Virtualfair.URL})});$(function(){$("#last_videos").jcarousel({auto:10,wrap:"circular",buttonPrevHTML:null,buttonNextHTML:null,scroll:1,initCallback:function(b,a){jCarousel=b;b.clip.hover(function(){b.stopAuto()},function(){b.startAuto()})}})});Portal.LastPosts={setCookieTopicNumbers:function(a){CNC.Cookie.setCookie("portal_last_topics_number",a,365);location.href="http://www.cnc-arena.com/"}};Portal.OnlineUsers={openList:function(){$("#box_content_lastposts").css("border-right","1px solid #DBDBDB");$("#box_content_lastposts").animate({width:"600px","padding-right":"14px"},1000);$("#bcou_openbutton").hide();$(".bclp_entry_right").removeClass("wide");$("#box_content_lastposts").removeClass("wide");$("#box_content_onlineusers").show("slide",{direction:"right"},1000);CNC.Cookie.setCookie("portal_onlinelist","open",365)},closeList:function(){$("#box_content_onlineusers").hide("slide",{direction:"right"},1000,function(){$("#bcou_openbutton").show();CNC.Cookie.setCookie("portal_onlinelist","closed",365)});$("#box_content_lastposts").animate({width:"910px","padding-right":"44px"},1000,function(){$("#box_content_lastposts").css("border-right","none")})}};$(function(){if(CNC.LANG.id!="de"){return}var e=$("<div></div>");e.css({position:"absolute",top:"237px",left:"-88px",display:"none","z-index":5});var b=$("<img />");b.attr("src","/images/portal/metav_closed.png");e.append(b);b.mouseenter(function(){$(this).unbind("mouseenter");metavopenwrap.show().animate({width:"795px"})});metavopenwrap=$("<div></div>");metavopenwrap.css({position:"absolute",top:"0",left:"0",width:"110px",height:"166px",display:"none","z-index":6});metavopenwrap.mouseleave(function(){metavopenwrap.animate({width:"110px"},function(){metavopenwrap.hide();b.mouseenter(function(){$(this).unbind("mouseenter");metavopenwrap.show().animate({width:"795px"})})})});e.append(metavopenwrap);metavopen=$("<img />");metavopen.attr("src","/images/portal/metav_open.jpg").attr("border","0");metavopen.css({position:"absolute","z-index":7});metavopenwrap.append($("<a></a>").attr("href","http://www.cnc-arena.com/de/forum/newsroom-cncarena/innovationpark-der-cnc-arena-auf-der-metav-2012--61791.html").append(metavopen));$("#page").append(e);metavwraploaded=false;b.load(function(){metavwraploaded=true});var a=237;var c=237;function d(){var f=$(window).scrollTop()+237;if(f<237){f=237}if(f>=237){f+=10}if(f!=a){percent=0.03*(f-a);if(percent>0){percent=Math.ceil(percent)}else{percent=Math.floor(percent)}c=c+percent;e.css({top:c+"px"});a+=percent;window.setTimeout(d,10)}}$(window).scroll(function(){if(metavwraploaded){e.fadeIn()}d()})});
