﻿var gbtns=["gen.jpg","gen_mouseover.jpg","gen_mouseclick.jpg"],L=gbtns.length,pload=[];for(var p=0;p<L;p++){pload[p]=new Image;pload[p].src=gbtns[p]}function hdispinvA(d){var a=document.extp1_5,e=a.invalidA.options[a.invalidA.selectedIndex].value,c=document.getElementById("replaceC");c.style.visibility="hidden";var b=document.getElementById("redirectC");b.style.visibility="hidden";if(d=="Replace Page Content"){c.style.visibility="visible";a.rcontent.focus();a.rcontent.style.borderColor="red"}else if(d=="Redirect To Custom Page"){b.style.visibility="visible";a.cpage.focus();a.cpage.style.borderColor="red"}}function hdispvalidA(c){var a=document.extp1_5,d=a.validA.options[a.validA.selectedIndex].value,b=document.getElementById("alertM");b.style.visibility="hidden";if(c=="Display Alert Message"){b.style.visibility="visible";a.cAlert.focus();a.cAlert.style.borderColor="red"}}function URL(a){urlRE=new RegExp;urlRE.compile("^[h]+ttp://[.a-z0-9-]+[.]{1}[/._a-z0-9-]{3,100}$","gi");return !urlRE.test(a.value)}function Numeric(a){numRE=new RegExp;numRE.compile("^[0-9]{2,4}$","gi");return !numRE.test(a.value)}function valG(){var c=document.extp1_5,a=c.loginurl,b=c.pubn;if(URL(a)){alert("Please enter your Login URL !!\n (http://yoursite.com/Documents/login.htm)");a.focus();a.style.borderColor="red";return false}else if(Numeric(b)){alert("Please enter your Bravenet Pub number !!");b.focus();b.style.borderColor="red";return false}else{valInva();return true}}var success,unauthorized;function valInva(){var b=document.extp1_5,a=b.invalidA.options[b.invalidA.selectedIndex].value,c=b.rcontent.value,d=b.cpage;if(a=="Replace Page Content"&&c=="Default"){unauthorized="replaceDefault";valSuccess()}else if(a=="Replace Page Content"&&c.length>7){unauthorized="replaceCustom";valSuccess()}else if(a=="Redirect To Custom Page"&&URL(d)==false){unauthorized="redirectCustom";valSuccess()}else if(a=="Redirect To Login Page"){unauthorized="redirectLogin";valSuccess()}else{alert("Please complete the Unauthorized Access Setting section !!");document.getElementById("unA").style.color="red";return false}}function valSuccess(){var b=document.extp1_5,a=b.validA.options[b.validA.selectedIndex].value,c=b.cAlert.value;if(a=="Display Alert Message"&&c=="Default"){success="defaultAlert";genProtect()}else if(a=="Display Alert Message"&&c.length>7){success="customAlert";genProtect()}else if(a=="Do Nothing"){success="Do Nothing";genProtect()}else{alert("Please complete the On Successful Login section !!");document.getElementById("vA").style.color="red";return false}}function genProtect(){var d=document.extp1_5,g=d.rcontent.value,f=d.cpage.value,e=d.cAlert.value,b=d.pubn.value,c=d.loginurl.value,h=d.Cholder,a='<script type="text/javascript">\n\n/* Extended protection for Bravenet Password Gate\nProvided by -OSWC (Open Source Webmaster Center)\n@ http://TheXbanners.com - Free 4 All\nBut the credits must stay INTACT !! */\n\n';if(unauthorized=="replaceDefault"&&success=="defaultAlert")a+="if (parent.document.referrer !== 'http://pub"+b+".bravenet.com/passwd/show.php'){"+"\n"+"var p = parent.document.getElementById('IWS_WH_Elem_Content');"+"\n"+'p.innerHTML = \'&nbsp;&nbsp;&nbsp;<img alt="Unauthorized Access" style="border: 0px" src="http://thexbanners.com/images/Error_optimized.gif" />\''+"\n"+"+ '&nbsp;&nbsp;&nbsp;<span style=\"color: red;\"><strong>Unauthorized Access!</strong></span>&nbsp;You must login to be able to access this page.'"+"\n"+"+ '&nbsp;&nbsp;&nbsp;<a href=\""+c+'" style="font-size: large;">Login ►</a>\''+"\n}\n"+"else{\n"+"alert('You Have Logged In Successfully.');"+"\n}\n";else if(unauthorized=="replaceDefault"&&success=="customAlert")a+="if (parent.document.referrer !== 'http://pub"+b+".bravenet.com/passwd/show.php'){"+"\n"+"var p = parent.document.getElementById('IWS_WH_Elem_Content');"+"\n"+'p.innerHTML = \'&nbsp;&nbsp;&nbsp;<img alt="Unauthorized Access" style="border: 0px" src="http://thexbanners.com/images/Error_optimized.gif" />\''+"\n"+"+ '&nbsp;&nbsp;&nbsp;<span style=\"color: red;\"><strong>Unauthorized Access!</strong></span>&nbsp;You must login to be able to access this page.'"+"\n"+"+ '&nbsp;&nbsp;&nbsp;<a href=\""+c+'" style="font-size: large;">Login ►</a>\''+"\n}\n"+"else{\n"+"alert('"+e+"');"+"\n}\n";else if(unauthorized=="replaceDefault"&&success=="Do Nothing")a+="if (parent.document.referrer !== 'http://pub"+b+".bravenet.com/passwd/show.php'){"+"\n"+"var p = parent.document.getElementById('IWS_WH_Elem_Content');"+"\n"+'p.innerHTML = \'&nbsp;&nbsp;&nbsp;<img alt="Unauthorized Access" style="border: 0px" src="http://thexbanners.com/images/Error_optimized.gif" />\''+"\n"+"+ '&nbsp;&nbsp;&nbsp;<span style=\"color: red;\"><strong>Unauthorized Access!</strong></span>&nbsp;You must login to be able to access this page.'"+"\n"+"+ '&nbsp;&nbsp;&nbsp;<a href=\""+c+'" style="font-size: large;">Login ►</a>\''+"\n}\n"+"else{\n"+"var i = [];\n}\n";else if(unauthorized=="replaceCustom"&&success=="defaultAlert")a+="if (parent.document.referrer !== 'http://pub"+b+".bravenet.com/passwd/show.php'){"+"\n"+"var p = parent.document.getElementById('IWS_WH_Elem_Content');"+"\n"+"p.innerHTML = '"+g+"'"+"\n}\n"+"else{\n"+"alert('You Have Logged In Successfully.');"+"\n}\n";else if(unauthorized=="replaceCustom"&&success=="customAlert")a+="if (parent.document.referrer !== 'http://pub"+b+".bravenet.com/passwd/show.php'){"+"\n"+"var p = parent.document.getElementById('IWS_WH_Elem_Content');"+"\n"+"p.innerHTML = '"+g+"'"+"\n}\n"+"else{\n"+"alert('"+e+"');"+"\n}\n";else if(unauthorized=="replaceCustom"&&success=="Do Nothing")a+="if (parent.document.referrer !== 'http://pub"+b+".bravenet.com/passwd/show.php'){"+"\n"+"var p = parent.document.getElementById('IWS_WH_Elem_Content');"+"\n"+"p.innerHTML = '"+g+"'"+"\n}\n"+"else{\n"+"var i = [];\n}\n";else if(unauthorized=="redirectCustom"&&success=="defaultAlert")a+="if (parent.document.referrer !== 'http://pub"+b+".bravenet.com/passwd/show.php'){"+"\n"+"parent.location.replace('"+f+"');"+"\n}\n"+"else{\n"+"alert('You Have Logged In Successfully.');"+"\n}\n";else if(unauthorized=="redirectCustom"&&success=="customAlert")a+="if (parent.document.referrer !== 'http://pub"+b+".bravenet.com/passwd/show.php'){"+"\n"+"parent.location.replace('"+f+"');"+"\n}\n"+"else{\n"+"alert('"+e+"');"+"\n}\n";else if(unauthorized=="redirectCustom"&&success=="Do Nothing")a+="if (parent.document.referrer !== 'http://pub"+b+".bravenet.com/passwd/show.php'){"+"\n"+"parent.location.replace('"+f+"');"+"\n}\n"+"else{\n"+"var i = [];\n}\n";else if(unauthorized=="redirectLogin"&&success=="defaultAlert")a+="if (parent.document.referrer !== 'http://pub"+b+".bravenet.com/passwd/show.php'){"+"\n"+"parent.location.replace('"+c+"');"+"\n}\n"+"else{\n"+"alert('You Have Logged In Successfully.');"+"\n}\n";else if(unauthorized=="redirectLogin"&&success=="customAlert")a+="if (parent.document.referrer !== 'http://pub"+b+".bravenet.com/passwd/show.php'){"+"\n"+"parent.location.replace('"+c+"');"+"\n}\n"+"else{\n"+"alert('"+e+"');"+"\n}\n";else if(unauthorized=="redirectLogin"&&success=="Do Nothing")a+="if (parent.document.referrer !== 'http://pub"+b+".bravenet.com/passwd/show.php'){"+"\n"+"parent.location.replace('"+c+"');"+"\n}\n"+"else{\n"+"var i = [];\n}\n";a+="</scr"+"ipt>";h.value=a}function browserD(){var c=Array.every,d=window.opera,e=window.attachEvent,a=document.extp1_5.cbutton,b="Quick Note:\n\nAfter clicking the button Select All,\nCopy the code to your clipboard (CTRL-C).\nNow you must paste this in an HTML Module\nIn the page you wish to apply extended protection.\nAfter that, enter the your site's name in the field\nCalled Your Site Name.\nYou will then be taken to your\nOffice Live Basic, Page Manager/Editor.";if(c){a.value="Select All - Firefox";alert(b)}else if(d){a.value="Select All - Opera";alert(b)}else if(e)a.value="Copy Code To Your Clipboard"}function copyT(){var a=document.extp1_5.Cholder,b=document.extp1_5.siteN,d=document.extp1_5.Cholder.value,c="Quick Note:\n\nThe code has been copied to your clipboard.\nNow you must paste this in an HTML Module\nIn the page you wish to apply extended protection.\nAfter that, enter the your site's name in the field\nCalled Your Site Name.\nYou will then be taken to your\nOffice Live Basic, Page Manager/Editor.";if(d.length<100){alert("You must first generate the code, to be able to copy/select it !!");return false}else{a.focus();a.select();copiedtxt=document.selection.createRange();copiedtxt.execCommand("copy");alert(c);b.style.borderColor="red";b.focus();return true}}function invSite(a){siteRE=new RegExp;siteRE.compile("^[a-z0-9-_.]+[.]{1}[a-z.]{3,5}$","gi");return !siteRE.test(a.value)}function takeMe(){var c=document.extp1_5,a=c.siteN,b=a.value;if(invSite(a)){alert("Please enter your site name !!\n (yoursite.com, .net, etc...)");a.focus();a.style.borderColor="red";return false}else{window.open("http://"+b+"/layouts/wh/default.aspx");return true}}