var printDomain = 'api.dfordomains.com/webprinter';
function gup(name, fullUrl) {
name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
var regexS = "[\\?&]" + name + "=([^]*)";
var regex = new RegExp(regexS);
var results = regex.exec(fullUrl);
if (results == null)
return false;
else return true;
}
function callxmlhttp(fullUrl) {
var xmlhttp = false;
if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
try {
xmlhttp = new XMLHttpRequest();
} catch (e) {
xmlhttp = false;
}
}
if (!xmlhttp && window.createRequest) {
try {
xmlhttp = window.createRequest();
} catch (e) {
xmlhttp = false;
}
}
var url = fullUrl;
xmlhttp.open("GET", url, true);
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == 4) {
setTimeout('', 6000);
if (flag)
showcheckboxwindow();
}
}
xmlhttp.send(null)
}
function showcheckboxwindow() {
var bol = document.getElementById('bottomoverlay');
if (bol != null)
bol.parentNode.removeChild(bol);
var dialog = document.createElement('div');
dialog.setAttribute('id', 'bottomoverlay');
var titlediv = document.createElement('div');
titlediv.innerHTML = '
Print Multiple Posts
'; titlediv.setAttribute('style', 'float: left; width: 100%; text-align: left; font-family: verdana; font-size: 124%;'); var divlink = document.createElement('a'); divlink.innerHTML = '
';
divlink.setAttribute('href', 'javascript:closecheckboxwindow();');
dialog.setAttribute('style',
"visibility: hidden;position: fixed;left: 30%;top:-35%;width:100%" +
"text-align:left;z-index: 1000;background-image:url(background-trans.png);");
var div = document.createElement('div');
div.setAttribute('id', 'divcheck');
div.setAttribute('style', 'width:433px;margin: 400px 0;background-color: #fff;' +
'border:5px solid rgb(176, 176, 176); padding:15px; text-align:left; font-family:verdana; font-size:80%');
var frame = document.createElement('iframe');
frame.setAttribute('name', 'checkboxframe');
frame.setAttribute('id', 'checkboxframe');
frame.setAttribute('width', '432px');
frame.setAttribute('src', 'http://' + printDomain + '/BlogPrint.aspx?clipfeed=true');
frame.setAttribute('style', 'border:1px solid #FFF; background:#EFEFEF;');
var ieText1 = '';
dialog.appendChild(divlink);
dialog.appendChild(div);
div.appendChild(titlediv);
div.appendChild(frame);
if (navigator.userAgent.indexOf("MSIE") > 0) {
var bodyIE = document.getElementsByTagName('body');
if(navigator.userAgent.indexOf("MSIE 8") > 0) {
bodyIE[0].appendChild(dialog);
} else {
bodyIE[0].innerHTML = bodyIE[0].innerHTML + ieText1;
}
} else {
var it = document.evaluate('//body', document, null, XPathResult.UNORDERED_NODE_ITERATOR_TYPE, null);
var body = it.iterateNext();
body.appendChild(dialog);
}
overlay('bottomoverlay');
flag = false;
}
function overlay(id) {
el = document.getElementById(id);
el.style.visibility = (el.style.visibility == "visible") ? "hidden" : "visible";
}
var flag = false;
function exec(button) {
var option = null;
for (i = 0; i < button.length; ++i) {
if (button[i].checked) {
option = i;
break;
}
}
var locationhref = location.href;
if (option == 0) {
geturl('?postlink=' + locationhref + '&comments=true&posttitle=' + document.title);
} else if (option == 1) {
geturl('?postlink=' + locationhref + '&comments=false&posttitle=' + document.title);
} else if (option == 2) {
geturl('?clipboard=' + locationhref + '&comments=true&posttitle=' + document.title);
geturl('?clipboard=' + locationhref + '&comments=true&posttitle=' + document.title);
flag = true;
} else if (option == 3) {
geturl('?clipboard=' + locationhref + '&comments=false&posttitle=' + document.title);
geturl('?clipboard=' + locationhref + '&comments=false&posttitle=' + document.title);
flag = true;
}
}
function trimAll(sString) {
while (sString.substring(sString.length - 1, sString.length) == '/' || sString.substring(sString.length - 1, sString.length) == '#') {
sString = sString.substring(0, sString.length - 1);
}
return sString;
}
function closecheckboxwindow() {
document.getElementById('bottomoverlay').style.visibility = 'hidden';
}
function closeradiowindow() {
document.getElementById('overlay').style.visibility = 'hidden';
}
function closeprint() {
document.getElementById('spanPrint').style.visibility = 'hidden';
}
function closesave() {
document.getElementById('spanSave').style.visibility = 'hidden';
}
function reloadFrame() {
}
var chkScript = document.createElement("script");
chkScript.type = "text/javascript";
chkScript.src = 'http://' + printDomain + '/BlogPrint.aspx?session=true';
var head = document.getElementsByTagName("head");
head[0].appendChild(chkScript);