var browserUserAgent = navigator.userAgent.toLowerCase();
var operaBrowser = (browserUserAgent.indexOf("opera") != -1);
var ieBrowser = (browserUserAgent.indexOf("msie") != -1) && (document.all) && (!operaBrowser);
var ieBrowser5 = (ieBrowser) && (browserUserAgent.indexOf("msie 5") != -1);
var ieBrowser6 = (ieBrowser) && (browserUserAgent.indexOf("msie 6") != -1);
var maxposts = 0;
var timeout_constant = 40000;
function tags(tag,name) {
	var txt="ordertype=";
	if (_ascdesc==0)
		txt+="0";
	else 
		txt+="1";	
	location.href="/myfeed/blog/ir/"+name+"?categories="+encodeURIComponent(tag)+'&'+txt;
}
function get_element(id) {  
	if (document.getElementById)
		return document.getElementById(id);
	else if (document.all)
		return document.all[id];
	else if (document.layers)
		return document.layers[id];
}
function add_event (elm, evType, fn, useCapture) {	
	if (elm.addEventListener) {
		elm.addEventListener(evType, fn, useCapture);
		return true;
	} else if (elm.attachEvent) {
		var r = elm.attachEvent('on' + evType, fn);
		return r;		
	} else {
		elm ['on' + evType] = fn;
	}	
}
function getSuffix(obj) {
	if (obj) 
		return _getSuffix(obj.id);
	return "";
}
function _getSuffix(suffix) {
	var pos = suffix.lastIndexOf('_');
	if (pos != -1)
		return suffix.substring(pos+1);
	return suffix;
}
function genericParent(row) {
	var parent;
	if (row) {
		if (row.parentElement)
			parent = row.parentElement;
		else
			parent = row.parentNode;
	}
	return parent;	
}
function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}
function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}
function eraseCookie(name) {
	createCookie(name,"",-1);
}
var hourglassObj;
function setHourglass(obj) {
	hourglassObj=obj;
	obj.style.cursor="wait";
	var parentObj = obj;
	for (var n = 0; n < 10; ++n) {
		parentObj = genericParent (parentObj);
		if (parentObj && parentObj.style) 
			parentObj.style.cursor="wait";
	}
}
function resetHourglass() {
	if (hourglassObj)  {
		hourglassObj.style.cursor="pointer";		
		var parentObj = hourglassObj;
		for (var n = 0; n < 10; ++n) {
			parentObj = genericParent (parentObj);
			if (parentObj && parentObj.style) 
				parentObj.style.cursor="pointer";
		}
    }		
}
function _diagnostics(message,code,codeDescription,description,errorMessage) {
	this.message = message;
	this.code = code;
	this.codeDescription = codeDescription;
	this.description = description;
	this.errorMessage = errorMessage;
}
var diagnostics;
function parseDiagnostics (xmlHttp) {
	diagnostics = null;
	if (!xmlHttp) 
		return;
	else if (!xmlHttp.responseXML) {
		if (xmlHttp.responseText) {
			alert ('MySyndicaat Error!\r\n\nSession is expired. Please login again.\n\n');
		}
		return;
	} else if (!xmlHttp.responseXML.documentElement) {
		if (ieBrowser) {
			alert ('MySyndicaat Error!\r\n\nSession is expired. Please login again.\n\n');
		}
		return;
	} else
		parseXMLDiagnostics (xmlHttp.responseXML);
}
function parseXMLDiagnostics (dom) {
	diagnostics = null;
	if (!dom)
		return;
	if (!dom.documentElement)
		return;
	if (dom.documentElement.nodeName.toUpperCase() == 'DIAGNOSTICS') {
		var message;
		var code;
		var codeDescription;
		var description;
		if (!dom.documentElement) {
			diagnostics = null;
			return;
		}
		var errors = dom.documentElement.childNodes;
		for (n = 0; n < errors.length; ++n) {
			if (errors[n].nodeType == 1) {
				message = errors[n].nodeName;
				var details = errors[n].childNodes;
				for (m = 0; m < details.length; ++m) {
					if (details[m].nodeType == 1) {
						if (details[m].tagName == 'code') {
							if (details[m].textContent)
								code = details[m].textContent;
							else
								code = details[m].text;
						} else if (details[m].tagName == 'code-description') {
							if (details[m].textContent)
								codeDescription = details[m].textContent;
							else
								codeDescription = details[m].text;
						} else if (details[m].tagName == 'description') {
							if (details[m].textContent)
								description = details[m].textContent;
							else
								description = details[m].text;
						}
					}
				}
			}
		}
		if (code == 'ERROR_039')
			errorMessage = 'Error: a feedbot with the same name already exists.';
		else if (code == 'ERROR_099') {
			if (description.length > 800) {
				var index = description.substring(800).indexOf('<br>');
				if (index != -1) {
					description = description.substring(0, 800 + index) + '\r\n\n...';
				} else {
					index = description.substring(800).indexOf('&lt;br&gt;');
					if (index != -1) 
						description = description.substring(0, 800 + index) + '\r\n\n...';
					else
						description = description.substring(0, 800) + '\r\n\n...';				
				}
			} 
			description = replaceStr (description, '<br>', "\r\n\n");		
			description = replaceStr (description, '&lt;br&gt;', "\r\n\n");		
			errorMessage = 'Error: one or more feedbots with the same name already exist.\r\n\n\n'+description;
		} else if ((code == 'ERROR_098') || (code == 'ERROR_097') || (code == 'ERROR_047')) {
			description = replaceStr (description, '<br>', "\r\n\n");		
			description = replaceStr (description, '&lt;br&gt;', "\r\n\n");		
			errorMessage = 'MySyndicaat Error!\r\n\n' + description;
		} else {
			if (description && codeDescription)
				errorMessage = 'MySyndicaat Error!\r\n\n' + description + '\r\n\n' + codeDescription;
			else if (description)
				errorMessage = 'MySyndicaat Error!\r\n\n' + description;
			else
				errorMessage = 'MySyndicaat Error!\r\n\n' + codeDescription;
		}
		diagnostics = new _diagnostics(message,code,codeDescription,description,errorMessage);
	}
}
function httpSend(xmlHttp, request) {
	try {
		xmlHttp.send(request);
	} catch (ex) {
		var ret = reportException(ex);
		alert("XMLHttp send exception.\r\n" + ret);
	}
}
function httpGet(xmlHttp, url, onreadystatechangefn) {
	try {
		xmlHttp.open("GET", url, true);
		if (onreadystatechangefn)
			xmlHttp.onreadystatechange = onreadystatechangefn;
		httpSend(xmlHttp, null);
	} catch (ex) {
		var ret = reportException(ex);
		alert("XMLHttp get exception.\r\n" + ret);
	}
}
function httpPost(xmlHttp, url, onreadystatechangefn, xmlDoc) {
	xmlHttp.open("POST", url, true);
	if (onreadystatechangefn)
		xmlHttp.onreadystatechange = onreadystatechangefn;
	httpSend(xmlHttp, xmlDoc);
}
function reportException(ex, message) {
	var ret = "Javascript exception: ";
	if (message)
		ret += message;
	ret += " " + ex;
	
	if (ieBrowser) {
		retc += " " + ex.name + ": " + ex.message + " (" + ex.number + ")";
	}
	return ret;
}
function setEditXMLHttpTimeout() { 
    this.e_xmlHttpTimeout = setTimeout(this.e_funXMLTimeout,timeout_constant);
}
function clearEditXMLHttpTimeout() {
	clearTimeout(this.e_xmlHttpTimeout); 
}
function editXMLHttpInProgress() { 
    if (this.e_xmlHttp) switch ( this.e_xmlHttp.readyState ) {
        case 1, 2, 3:
            return true;
        break;	
        
        default:
            return false;
        break;
    } else
		return false;
}
function funEditXMLHttpTimeout() { 
	if (editXML.e_inProgress ()) 
       	editXML.e_xmlHttp.abort();
	editXML.e_xmlHttp = null;
	alert("The connection was refused when attempting to contact the remote host");
	resetHourglass();
}
function getEditXMLHttp() { 
	if (this.e_xmlHttp) {
		if (this.e_inProgress ()) 
	       	this.e_xmlHttp.abort();
		this.e_xmlHttp = null;
	}
	if (ieBrowser) {
		var ieBrowserName = ieBrowser5 ? "Microsoft.XMLHTTP" : "Msxml2.XMLHTTP";
		try {
			this.e_xmlHttp = new ActiveXObject(ieBrowserName);
		} catch (ex) {
			var ret = returnException(ex);
			alert("To use Microsoft XMLHttpRequest object, you need to enable active scripting and activeX controls.\r\n" + ret);
		}
	} else {
		this.e_xmlHttp = new XMLHttpRequest();
		if (!this.e_xmlHttp) {
			alert("Your browser does not support the XMLHttpRequest object.");
		}
	}
}
function editXMLHttp () {
	this.e_xmlHttp = null; 
	this.e_xmlHttpTimeout = null; 
	this.e_setXMLTimeout = setEditXMLHttpTimeout;
	this.e_clearXMLTimeout = clearEditXMLHttpTimeout;
	this.e_funXMLTimeout = funEditXMLHttpTimeout;
	this.e_getXMLHttp = getEditXMLHttp;
	this.e_inProgress = editXMLHttpInProgress;
}
var editXML = new editXMLHttp();
function getXMLDoc() {
	var xmlDoc = null;
	if (ieBrowser) {
		try {
			xmlDoc = new ActiveXObject('Microsoft.XMLDOM');
		} catch (ex) {
			var ret = returnException(ex);
			alert("To use Microsoft XMLDOM object, you need to enable active scripting and activeX controls.\r\n" + ret);
		}
	} else if (document.implementation.createDocument) {
		xmlDoc = document.implementation.createDocument('','',null);
		if (!xmlDoc) {
			alert("Your browser does not support the XMLDOM object.");
		}
	}
	return xmlDoc;
}
function _width() {
  var myWidth = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    myWidth = window.innerWidth;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    myWidth = document.documentElement.clientWidth;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    myWidth = document.body.clientWidth;
  }
  return myWidth;
}
function _height() {
  var myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    myHeight = document.body.clientHeight;
  }
  return myHeight;
}
function setPropsSize(size) {
	var dialogs = get_element("dialogs");
	if (dialogs) {
		var left = (_width() - size) / 2 - 25;
		if (left < 0)
			left = 0;
		var height = _height() - 250;
		var top;
		if (ieBrowser) {
			top = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop;
			top += 100;
		} else {
			top = window.pageYOffset + 100;
		}
		dialogs.style.left=left+"px";
		dialogs.style.top=top+"px";
	}
}
function press_click_mail(event) {
	if (document.all){
  		if (event.keyCode == 13){
		   event.returnValue=false;
		   event.cancel = true;
		   mailto_send_click(event);
  		} else if (event.keyCode == 27) {
		   event.returnValue=false;
		   event.cancel = true;
		   mailto_close_click(event);
		}
	} else if (document.getElementById){
  		if (event.which == 13) {
   			event.returnValue=false;
   			event.cancel = true;
		   	mailto_send_click(event);
  		} else if (event.which == 27) {
		   event.returnValue=false;
		   event.cancel = true;
		   mailto_close_click(event);
		}
 	} else if(document.layers) {
	  	if (event.which == 13) {
   			event.returnValue=false;
   			event.cancel = true;
		   	mailto_send_click(event);
   		} else if (event.which == 27) {
		   event.returnValue=false;
		   event.cancel = true;
		   mailto_close_click(event);
 		}
 	}
}
var enc64List, dec64List;
function initBase64() {
    enc64List = new Array();
    dec64List = new Array();
    var i;
    for (i = 0; i < 26; i++) {
        enc64List[enc64List.length] = String.fromCharCode(65 + i);
    }
    for (i = 0; i < 26; i++) {
        enc64List[enc64List.length] = String.fromCharCode(97 + i);
    }
    for (i = 0; i < 10; i++) {
        enc64List[enc64List.length] = String.fromCharCode(48 + i);
    }
    enc64List[enc64List.length] = "+";
    enc64List[enc64List.length] = "/";
    for (i = 0; i < 128; i++) {
        dec64List[dec64List.length] = -1;
    }
    for (i = 0; i < 64; i++) {
        dec64List[enc64List[i].charCodeAt(0)] = i;
    }
}
function base64Encode(str) {
    var c, d, e, end = 0;
    var u, v, w, x;
    var ptr = -1;
    var input = str.split("");
    var output = "";
    while(end == 0) {
        c = (typeof input[++ptr] != "undefined") ? input[ptr].charCodeAt(0) : 
            ((end = 1) ? 0 : 0);
        d = (typeof input[++ptr] != "undefined") ? input[ptr].charCodeAt(0) : 
            ((end += 1) ? 0 : 0);
        e = (typeof input[++ptr] != "undefined") ? input[ptr].charCodeAt(0) : 
            ((end += 1) ? 0 : 0);
        u = enc64List[c >> 2];
        v = enc64List[(0x00000003 & c) << 4 | d >> 4];
        w = enc64List[(0x0000000F & d) << 2 | e >> 6];
        x = enc64List[e & 0x0000003F];
        if (end >= 1) {x = "=";}
        if (end == 2) {w = "=";}
        if (end < 3) {output += u + v + w + x;}
    }
    var formattedOutput = "";
    var lineLength = 76;
    while (output.length > lineLength) {
    	formattedOutput += output.substring(0, lineLength) + "\n";
    	output = output.substring(lineLength);
    }
    formattedOutput += output;
    return formattedOutput;
}
function base64Decode(str) {
    var c=0, d=0, e=0, f=0, i=0, n=0;
    var input = str.split("");
    var output = "";
    var ptr = 0;
    do {
        f = input[ptr++].charCodeAt(0);
        i = dec64List[f];
        if ( f >= 0 && f < 128 && i != -1 ) {
            if ( n % 4 == 0 ) {
                c = i << 2;
            } else if ( n % 4 == 1 ) {
                c = c | ( i >> 4 );
                d = ( i & 0x0000000F ) << 4;
            } else if ( n % 4 == 2 ) {
                d = d | ( i >> 2 );
                e = ( i & 0x00000003 ) << 6;
            } else {
                e = e | i;
            }
            n++;
            if ( n % 4 == 0 ) {
                output += String.fromCharCode(c) + 
                          String.fromCharCode(d) + 
                          String.fromCharCode(e);
            }
        }
    }
    while (typeof input[ptr] != "undefined");
    output += (n % 4 == 3) ? String.fromCharCode(c) + String.fromCharCode(d) : 
              ((n % 4 == 2) ? String.fromCharCode(c) : "");
    return output;
}
initBase64();
function plus_id_click(e) {
	var target = e.currentTarget ? e.currentTarget : e.srcElement;
	var suffix = getSuffix(target);
	var plus_id = get_element("plus_"+parseInt(suffix));
	if (plus_id)
		plus_id.style.display = "none";
	var minus_id = get_element("minus_"+parseInt(suffix));
	if (minus_id)
		minus_id.style.display = "";
	var summary_id = get_element("summary_"+parseInt(suffix));
	if (summary_id)
		summary_id.style.display = "none";
	var content_id = get_element("content_"+parseInt(suffix));
	if (content_id)
		content_id.style.display = "";
	var author_id = get_element("author_"+parseInt(suffix));
	if (author_id)
		author_id.style.display = "";
	var category_id = get_element("category_"+parseInt(suffix));
	if (category_id)
		category_id.style.display = "block";
	var buttons_id = get_element("buttons_"+parseInt(suffix));
	if (buttons_id)
		buttons_id.style.display = "block";
	var others_id = get_element("others_"+parseInt(suffix));
	if (others_id)
		others_id.style.display = "block";
}
function minus_id_click(e) {
	var target = e.currentTarget ? e.currentTarget : e.srcElement;
	var suffix = getSuffix(target);
	var plus_id = get_element("plus_"+parseInt(suffix));
	if (plus_id)
		plus_id.style.display = "";
	var minus_id = get_element("minus_"+parseInt(suffix));
	if (minus_id)
		minus_id.style.display = "none";
	var summary_id = get_element("summary_"+parseInt(suffix));
	if (summary_id)
		summary_id.style.display = "";
	var content_id = get_element("content_"+parseInt(suffix));
	if (content_id)
		content_id.style.display = "none";
	var author_id = get_element("author_"+parseInt(suffix));
	if (author_id)
		author_id.style.display = "none";
	var category_id = get_element("category_"+parseInt(suffix));
	if (category_id)
		category_id.style.display = "none";
	var buttons_id = get_element("buttons_"+parseInt(suffix));
	if (buttons_id)
		buttons_id.style.display = "none";
	var others_id = get_element("others_"+parseInt(suffix));
	if (others_id)
		others_id.style.display = "none";
}
function readmore(suffix) {
	var plus_id = get_element("plus_"+parseInt(suffix));
	if (plus_id)
		plus_id.style.display = "none";
	var minus_id = get_element("minus_"+parseInt(suffix));
	if (minus_id)
		minus_id.style.display = "";
	var summary_id = get_element("summary_"+parseInt(suffix));
	if (summary_id)
		summary_id.style.display = "none";
	var content_id = get_element("content_"+parseInt(suffix));
	if (content_id)
		content_id.style.display = "";
	var author_id = get_element("author_"+parseInt(suffix));
	if (author_id)
		author_id.style.display = "";
	var category_id = get_element("category_"+parseInt(suffix));
	if (category_id)
		category_id.style.display = "block";
	var buttons_id = get_element("buttons_"+parseInt(suffix));
	if (buttons_id)
		buttons_id.style.display = "block";
	var others_id = get_element("others_"+parseInt(suffix));
	if (others_id)
		others_id.style.display = "block";
}
function plus(suffix) {
	var plus_id = get_element("plus_"+parseInt(suffix));
	if (plus_id) {
		add_event (plus_id, 'click', plus_id_click, false);
		plus_id.style.cursor="pointer";
	}
	var _text = readCookie("_text");
	if ((_text==null) || (_text=='1'))
		expand(suffix);
	else if (_text=='2')
		fulltxt(suffix);
}
function minus(suffix) {
	var minus_id = get_element("minus_"+parseInt(suffix));
	if (minus_id) {
		add_event (minus_id, 'click', minus_id_click, false);
		minus_id.style.cursor="pointer";
	} 
}
var _mail_guid_value;
var _blog_guid_value;
var _feedbotName;
var _userName;
function email(localUrl,guid,title) {
	_mail_guid_value = guid;
	var index = -1;
	if (localUrl) {
		var pos = localUrl.indexOf('_');
		if (pos != -1) {
			_userName = localUrl.substring(0,pos);
			_feedbotName = localUrl.substring(pos+1);
		}
	}
	var your_email = readCookie('your_email');
	if (your_email == null)
		your_email = '';
	var email_addr = readCookie('email_addr');
	if (email_addr == null)
		email_addr = '';

	var pre_mailto='<form name="mailto" action="javascript:void(0)"><TABLE width="440px" cellPadding=5 cellSpacing=3 bgColor=#eeeeee class=login><TR><TD style="TEXT-ALIGN: left" vAlign=top bgColor=#eeeeee><table width="100%" cellpadding="1" border="0">';
	var mailto0='<tr class="dialogtitlerow"><td colspan="2" align="center"><span class="majorLabel">E-Mail Post</span></td></tr>';
	var mailto1='<tr class="dialogrow"><td colspan="2"><span class="fieldLabel"></span></td></tr>';
	var mailto2='<tr class="dialogrow"><td><span class="fieldLabel">Your e-mail:</span></td><td><input title="Your e-mail address (mandatory)." class="dialogInput" type="text" id="MAILFROM_ADDRESS" value="'+your_email+'" maxlength="256" size="50"></td></tr>';
	var mailto3='<tr class="dialogrow"><td><span class="fieldLabel">To:</span></td><td><input title="Enter one or more e-mail addresses. Separate e-mail addresses with a semi-colon (mandatory)." class="dialogInput" type="text" id="MAILTO_ADDRESS" value="'+email_addr+'" maxlength="256" size="50"></td></tr>';
	var mailto4='<tr class="dialogrow"><td><span class="fieldLabel">Subject:</span></td><td><input title="Enter subject text describing your e-mail (optional)." class="dialogInput" type="text" id="MAILTO_SUBJECT" value="FWD:'+title+'" maxlength="256" size="50"></td></tr>';
	var mailto5='<tr class="dialogrow"><td><span class="fieldLabel">Comments:</span></td><td><textarea title="Enter your own comments (optional)." class="dialogInput" id="MAILTO_COMMENTS" rows="2" cols="52"></textarea></td></tr>';
	var mailto6='<tr class="dialogrow"><td><span class="fieldLabel">Send As:</span></td><td><input type="radio" checked name="type" id="MAILTO_TYPE_HTML" value="text/html">&nbsp;<span class="fieldLabel">HTML</span>&nbsp;&nbsp;&nbsp;<input type="radio" name="type" id="MAILTO_TYPE_TEXT" value="text/plain">&nbsp;<span class="fieldLabel">TEXT</span></td></tr></form>';	
	var mailto7='<tr><td width="100%" colspan="5"align="right">&nbsp;<input type="button" class="button" value="&nbsp;&nbsp;Send&nbsp;&nbsp;" class="button"id="MAILTO_SEND" class="button" title="Click here to send this post."/>&nbsp;<input type="button" value="&nbsp;&nbsp;Cancel&nbsp;&nbsp;" class="button"id="MAILTO_CLOSE" title="Click here to close this form."/>&nbsp;&nbsp;</td></tr>';
	var post_mailto='</table></TD></TR></TABLE></form>';
	
	setPropsSize(440);
	var innerHTML = pre_mailto + mailto0 + mailto1 + mailto2 + mailto3 + mailto4 + mailto5 + mailto6 + mailto7 + post_mailto;
	var dialogs = get_element("dialogs");
	dialogs.innerHTML = innerHTML;
	var fun = (function () {
		dialogs.style.visibility="visible";
		var mailto_send = get_element("MAILTO_SEND");		
		if (mailto_send)
			add_event (mailto_send, 'click', mailto_send_click, false);
		var mailto_close = get_element("MAILTO_CLOSE");		
		if (mailto_close)
			add_event (mailto_close, 'click', mailto_close_click, false);
		var mailfrom_address = get_element("MAILFROM_ADDRESS");		
		if (mailfrom_address) {
			add_event (mailfrom_address, 'keydown', press_click_mail, false);
			mailfrom_address.focus();
		}
		var mailto_address = get_element("MAILTO_ADDRESS");		
		if (mailto_address) 
			add_event (mailto_address, 'keydown', press_click_mail, false);
		var mailto_subject = get_element("MAILTO_SUBJECT");		
		if (mailto_subject)
			add_event (mailto_subject, 'keydown', press_click_mail, false);
		var mailto_comments = get_element("MAILTO_COMMENTS");		
		if (mailto_comments)
			add_event (mailto_comments, 'keydown', press_click_mail, false);
	});
	setTimeout(fun,100);	
}
function mailto_close_click(e) {
	var target = e.currentTarget ? e.currentTarget : e.srcElement;
	var dialogs = get_element("dialogs");
	if (dialogs)
		dialogs.style.visibility="hidden";	
}
function mailto_send_click(e) {
	var target = e.currentTarget ? e.currentTarget : e.srcElement;
	var mailfrom_address = get_element("MAILFROM_ADDRESS");	
	if ((mailfrom_address.value == null) || (mailfrom_address.value.length == 0)) {
		alert ("Please enter your e-mail address");
		mailfrom_address.focus();
		return;
	}
	var mailto_address = get_element("MAILTO_ADDRESS");	
	if ((mailto_address.value == null) || (mailto_address.value.length == 0)) {
		alert ("Please enter the e-mail address of your recepient.");
		mailto_address.focus();
		return;
	}
	createCookie('your_email',mailfrom_address.value,90);
	createCookie('email_addr',mailto_address.value,90);

	var mailto_subject = get_element("MAILTO_SUBJECT");	
	var mailto_comments = get_element("MAILTO_COMMENTS");	
	var mailto_type_html = get_element("MAILTO_TYPE_HTML");	
	var mailto_type_text = get_element("MAILTO_TYPE_TEXT");	
	var mailto_type_value = "text/plain";
	if ((mailto_type_html)&&(mailto_type_text)) {
		if (mailto_type_html.checked == true)
			mailto_type_value = mailto_type_html.value;
		else
			mailto_type_value = mailto_type_text.value;
	}
	
  	if ((_mail_guid_value)	&& (mailto_address)) {
		editXML.e_getXMLHttp();
		var xmlDoc = getXMLDoc();
		if (xmlDoc) {
			createMailDom(xmlDoc,mailfrom_address,mailto_address,mailto_subject,mailto_comments,mailto_type_value);	
			var fun = (function () {
			    try { 
				  	if (!editXML) { 
						resetHourglass(); 
						return; 
					}
			 	 } catch (e) {
					resetHourglass(); 
					return;
				}
				if (!editXML.e_xmlHttp) {
					resetHourglass(); 
					return;
				}
				if (editXML.e_xmlHttp.readyState == 4) {
					if (editXML.e_xmlHttp.status == 200) {
						editXML.e_clearXMLTimeout();
						resetHourglass();					
						try {
							parseDiagnostics (editXML.e_xmlHttp);
							if (diagnostics) {
								if (diagnostics.code != 101)  {
									alert(diagnostics.errorMessage);
									return;
								}
								else
									alert(diagnostics.description);
							} 				
		  					var dialogs = get_element("dialogs");
							if (dialogs)
								dialogs.style.visibility="hidden";	
							window.status = "Done";	
						} catch (e) {
							window.status = "Done";
							alert ("MySyndicaat - Send Mail System Error: XML Response processing failed. Contact MySyndicaat Support Team.");
						}
					}
				}
			});
		  	setHourglass(target);
		  	editXML.e_setXMLTimeout ();
		 	httpPost(editXML.e_xmlHttp, '/mysynd/sendpost', fun, xmlDoc);
		} else
			alert ("MySyndicaat - Send Mail System Error: DOM creation failed. Contact MySyndicaat Support Team.");		
	}
}
function createMailDom (xmlDoc,mailfrom_address,mailto_address,mailto_subject,mailto_comments,mailto_type_value) {
	var objPI = xmlDoc.createProcessingInstruction('xml', 'version="1.0" encoding="utf-8"');
	xmlDoc.appendChild(objPI);
	var documentElement = xmlDoc.createElement('mails');
	xmlDoc.appendChild(documentElement);
	var mailElement = xmlDoc.createElement('mail');
	documentElement.appendChild(mailElement);
	mailElement.setAttribute('guid', _mail_guid_value);
	mailElement.setAttribute('from', mailfrom_address.value);
	mailElement.setAttribute('address', mailto_address.value);
	if (mailto_subject)
	 	mailElement.setAttribute('subject', mailto_subject.value);
	else
		mailElement.setAttribute('subject', '');
	if (mailto_comments)
	 	mailElement.setAttribute('comments', mailto_comments.value);
	else
		mailElement.setAttribute('comments', '');
	if (mailto_type_value)
	 	mailElement.setAttribute('type', mailto_type_value);
	else
		mailElement.setAttribute('type', 'text/plain');
	if (_feedbotName)
	 	mailElement.setAttribute('aggrName', _feedbotName);
	else
		mailElement.setAttribute('aggrName', '');
	if (_userName)
	 	mailElement.setAttribute('aggrUserName', _userName);
	else
		mailElement.setAttribute('aggrUserName', '');
}
function pdf(localUrl,guid) {
	var path='/mysynd/pdf?p='+encodeURI(base64Encode("localUrl="+localUrl+"&guid="+encodeURIComponent(guid)));
	window.location = path;
}
function save(localUrl,guid) {
	var path='/mysynd/savepost?p='+encodeURI(base64Encode("localUrl="+localUrl+"&guid="+encodeURIComponent(guid)));
	window.location = path;
}
function blogthis(suffix) {
	alert("blogthis_"+suffix);
}
var _blogpost_guid_value;	
var _blogpost_localUrl_value;	
function blogthis(localUrl,guid,title) {
	_blogpost_guid_value = guid;
	_blogpost_localUrl_value = localUrl;
	var index = -1;
	if (localUrl) {
		var pos = localUrl.indexOf('_');
		if (pos != -1) {
			_userName = localUrl.substring(0,pos);
			_feedbotName = localUrl.substring(pos+1);
		}
	}
	
	var blog_url = readCookie('blog_url');
	var blog_name = readCookie('blog_name');
	var blog_user = readCookie('blog_user');
	var blog_type = readCookie('blog_type');
	
	if (!blog_url)
			blog_url = "";
	if (!blog_name)
			blog_name = "";
	if (!blog_user)
			blog_user = "";
	if (!blog_type)
			blog_type = "wp";
	var blog_type_wp = "";
	var blog_type_mt = "";
	if (blog_type == "wp")
		 blog_type_wp = "checked";
	else if (blog_type == "mt")
		 blog_type_mt = "checked";
	
	var pre_blog='<form name="blogthis" action="javascript:void(0)"><TABLE width="450px" cellPadding=5 cellSpacing=3 bgColor=#eeeeee class=login><TR><TD style="TEXT-ALIGN: left" vAlign=top bgColor=#eeeeee><table width="100%" cellpadding="1" border="0">';
	var blog0='<tr class="dialogtitlerow"><td colspan="2" align="center"><span class="majorLabel">Blog This!</span></td></tr>';
	var blog1='<tr class="dialogrow"><td colspan="2"><span class="fieldLabel"></span></td></tr>';
	var blog2='<tr class="dialogrow"><td><span class="fieldLabel">Blog API Url:</span></td><td><input title="Enter the API Url of your blog server (mandatory)." class="dialogInput" type="text" id="BLOG_URL" value="'+blog_url+'" maxlength="256" size="50"></td></tr>';
	var blog3='<tr class="dialogrow"><td><span class="fieldLabel">Blog Name:</span></td><td><input title="Enter your blog name (mandatory)." class="dialogInput" type="text" id="BLOG_NAME" value="'+blog_name+'" maxlength="256" size="50"></td></tr>';
	var blog4='<tr class="dialogrow"><td><span class="fieldLabel">Username:</span></td><td><input title="Enter your blog user name(mandatory)." class="dialogInput" type="text" id="BLOG_USER" value="'+blog_user+'" maxlength="256" size="50"></td></tr>';
	var blog5='<tr class="dialogrow"><td><span class="fieldLabel">Password:</span></td><td><input title="Enter tyour blog password (mandatory)." class="dialogInput" type="password" id="BLOG_PASSWD" value="" maxlength="256" size="50"></td></tr>';
	var blog6='<tr class="dialogrow"><td><span class="fieldLabel">Provider:</span></td><td><input type="radio" '+blog_type_wp+' name="type" id="BLOG_TYPE_WP" value="wp">&nbsp;<span class="fieldLabel">WordPress</span>&nbsp;&nbsp;&nbsp;<input type="radio" name="type" '+blog_type_mt+' id="BLOG_TYPE_MT" value="mt">&nbsp;<span class="fieldLabel">MovableType</span></td></tr></form>';	
	var blog7='<tr class="dialogrow"><td>&nbsp;</td><td><input type="checkbox" name="check" id="BLOG_CHECK" value="checked">&nbsp;<span class="fieldLabel">Post only if categories match existing ones</span></td></tr></form>';	
	var blog8='<tr><td colspan="2" align="right">&nbsp;<input type="button" class="button" value="&nbsp;&nbsp;Post&nbsp;&nbsp;" class="button"id="BLOG_SEND" class="button" title="Click here to send this post."/>&nbsp;<input type="button" value="&nbsp;&nbsp;Cancel&nbsp;&nbsp;" class="button"id="BLOG_CLOSE" title="Click here to close this form."/></td></tr>';
	var post_blog='</table></TD></TR></TABLE></form>';
	
	setPropsSize(450);
	var innerHTML = pre_blog + blog0 + blog1 + blog2 + blog3 + blog4 + blog5 + blog6 + blog7 + blog8 + post_blog;
	var dialogs = get_element("dialogs");
	dialogs.innerHTML = innerHTML;
	var fun = (function () {
		dialogs.style.visibility="visible";
		var blog_send = get_element("BLOG_SEND");		
		if (blog_send)
			add_event (blog_send, 'click', blog_send_click, false);
		var blog_close = get_element("BLOG_CLOSE");		
		if (blog_close)
			add_event (blog_close, 'click', blog_close_click, false);
		var blog_url = get_element("BLOG_URL");		
		if (blog_url) {
			add_event (blog_url, 'keydown', press_click_blog, false);
			blog_url.focus();
		}
		var blog_name = get_element("BLOG_NAME");		
		if (blog_name)
			add_event (blog_name, 'keydown', press_click_blog, false);
		var blog_user = get_element("BLOG_USER");		
		if (blog_user)
			add_event (blog_user, 'keydown', press_click_blog, false);
		var blog_passwd = get_element("BLOG_PASSWD");		
		if (blog_passwd)
			add_event (blog_passwd, 'keydown', press_click_blog, false);
	});
	setTimeout(fun,100);	
}
function blog_close_click(e) {
	var target = e.currentTarget ? e.currentTarget : e.srcElement;
	var dialogs = get_element("dialogs");
	if (dialogs)
		dialogs.style.visibility="hidden";	
}
function blog_send_click(e) {
	var target = e.currentTarget ? e.currentTarget : e.srcElement;
	var blog_url = get_element("BLOG_URL");	
	var blog_user = get_element("BLOG_USER");	
	var blog_name = get_element("BLOG_NAME");	
	var blog_passwd = get_element("BLOG_PASSWD");	
	var blog_type_wp = get_element("BLOG_TYPE_WP");	
	var blog_type_mt = get_element("BLOG_TYPE_MT");	
	var blog_check = get_element("BLOG_CHECK");	

	var blogUrl = get_element("BLOG_URL");	
	if ((blogUrl.value == null) || (blogUrl.value.length == 0)) {
		alert ("Please enter your blog API Url! ");
		blogUrl.focus();
		return;
	}
	createCookie('blog_url',blogUrl.value,90);
	var blogName = get_element("BLOG_NAME");	
	if ((blogName.value == null) || (blogName.value.length == 0)) {
		alert ("Please enter your blog name! ");
		blogName.focus();
		return;
	}
	createCookie('blog_name',blogName.value,90);
	var blogUser = get_element("BLOG_USER");	
	if ((blogUser.value == null) || (blogUser.value.length == 0)) {
		alert ("Please enter your blog user name! ");
		blogUser.focus();
		return;
	}
	createCookie('blog_user',blogUser.value,90);
	var blogPwd = get_element("BLOG_PASSWD");	
	if ((blogPwd.value == null) || (blogPwd.value.length == 0)) {
		alert ("Please enter your blog password! ");
		blogPwd.focus();
		return;
	}
	var blog_type_value = "wp";
	if ((blog_type_wp)&&(blog_type_mt)) {
		if (blog_type_wp.checked == true)
			blog_type_value = blog_type_wp.value;
		else
			blog_type_value = blog_type_mt.value;
	}
	createCookie('blog_type',blog_type_value,90);
	
  	if ((_blogpost_guid_value)	&& (blog_url)) {
		editXML.e_getXMLHttp();
		var xmlDoc = getXMLDoc();
		if (xmlDoc) {
			createBlogDom(xmlDoc,blog_url,blog_name,blog_user,blog_passwd,blog_type_value,blog_check);	
			var fun = (function () {
			    try { 
				  	if (!editXML) { 
						resetHourglass(); 
						return; 
					}
			 	 } catch (e) {
					resetHourglass(); 
					return;
				}
				if (!editXML.e_xmlHttp) {
					resetHourglass(); 
					return;
				}
				if (editXML.e_xmlHttp.readyState == 4) {
					if (editXML.e_xmlHttp.status == 200) {
						editXML.e_clearXMLTimeout();
						resetHourglass();					
						try {
							parseDiagnostics (editXML.e_xmlHttp);
							if (diagnostics) {
								if (diagnostics.code != 101)  {
									alert(diagnostics.errorMessage);
									return;
								}
								else
									alert(diagnostics.description);
							} 				
		  					var dialogs = get_element("dialogs");
							if (dialogs)
								dialogs.style.visibility="hidden";	
							window.status = "Done";	
						} catch (e) {
							window.status = "Done";
							alert ("MySyndicaat - Send Mail System Error: XML Response processing failed. Contact MySyndicaat Support Team.");
						}
					}
				}
			});
		  	setHourglass(target);
		  	editXML.e_setXMLTimeout ();
		 	httpPost(editXML.e_xmlHttp, '/mysynd/blogpost?p='+encodeURI(base64Encode("localUrl="+_blogpost_localUrl_value)), fun, xmlDoc);
		} else
			alert ("MySyndicaat - Send Mail System Error: DOM creation failed. Contact MySyndicaat Support Team.");		
	}

	var dialogs = get_element("dialogs");
	if (dialogs)
		dialogs.style.visibility="hidden";	
}
function createBlogDom(xmlDoc,blog_url,blog_name,blog_user,blog_passwd,blog_type_value,blog_check) {
	var objPI = xmlDoc.createProcessingInstruction('xml', 'version="1.0" encoding="utf-8"');
	xmlDoc.appendChild(objPI);
	var documentElement = xmlDoc.createElement('blogposts');
	xmlDoc.appendChild(documentElement);
	var blogElement = xmlDoc.createElement('blogpost');
	documentElement.appendChild(blogElement);
	blogElement.setAttribute('guid', _blogpost_guid_value);
	if (blog_url)
	 	blogElement.setAttribute('blogurl', blog_url.value);
	else
		blogElement.setAttribute('blogurl', '');
	if (blog_name)
	 	blogElement.setAttribute('blogname', blog_name.value);
	else
		blogElement.setAttribute('blogname', '');
	if (blog_user)
	 	blogElement.setAttribute('username', blog_user.value);
	else
		blogElement.setAttribute('username', '');
	if (blog_passwd)
	 	blogElement.setAttribute('password', blog_passwd.value);
	else
		blogElement.setAttribute('password', '');
	if (blog_type_value)
	 	blogElement.setAttribute('type', blog_type_value);
	else
		blogElement.setAttribute('type', 'wp');
	if (blog_check)		
	 	blogElement.setAttribute('check', blog_check.checked);
}
function press_click_blog(event) {
	if (document.all){
  		if (event.keyCode == 13){
		   event.returnValue=false;
		   event.cancel = true;
		   blog_send_click(event);
  		} else if (event.keyCode == 27) {
		   event.returnValue=false;
		   event.cancel = true;
		   blog_close_click(event);
		}
	} else if (document.getElementById){
  		if (event.which == 13) {
   			event.returnValue=false;
   			event.cancel = true;
		   	blog_send_click(event);
  		} else if (event.which == 27) {
		   event.returnValue=false;
		   event.cancel = true;
		   blog_close_click(event);
		}
 	} else if(document.layers) {
	  	if (event.which == 13) {
   			event.returnValue=false;
   			event.cancel = true;
		   	blog_send_click(event);
   		} else if (event.which == 27) {
		   event.returnValue=false;
		   event.cancel = true;
		   blog_close_click(event);
 		}
 	}
}
function expandall() {
	selectObj("summaries",true);
	selectObj("fulltext",false);
	createCookie('_text','1',90);
	for (var n=1; true; ++n) {
		var plus_id = get_element("plus_"+parseInt(n));
		if (plus_id)
			expand(n);
		else 
			break;
	}
}
function full_text() {
	selectObj("summaries",false);
	selectObj("fulltext",true);
	createCookie('_text','2',90);
	for (var n=1; true; ++n) {
		var plus_id = get_element("plus_"+parseInt(n));
		if (plus_id)
			fulltxt(n);
		else 
			break;
	}
}
function expand(suffix) {
	var plus_id = get_element("plus_"+parseInt(suffix));
	if (plus_id)
		plus_id.style.display = "";
	var minus_id = get_element("minus_"+parseInt(suffix));
	if (minus_id)
		minus_id.style.display = "none";
	var summary_id = get_element("summary_"+parseInt(suffix));
	if (summary_id)
		summary_id.style.display = "block";
	var content_id = get_element("content_"+parseInt(suffix));
	if (content_id)
		content_id.style.display = "none";
	var author_id = get_element("author_"+parseInt(suffix));
	if (author_id)
		author_id.style.display = "";
	var category_id = get_element("category_"+parseInt(suffix));
	if (category_id)
		category_id.style.display = "block";
	var buttons_id = get_element("buttons_"+parseInt(suffix));
	if (buttons_id)
		buttons_id.style.display = "none";
	var others_id = get_element("others_"+parseInt(suffix));
	if (others_id)
		others_id.style.display = "none";
}
function fulltxt(suffix) {
	var plus_id = get_element("plus_"+parseInt(suffix));
	if (plus_id)
		plus_id.style.display = "none";
	var minus_id = get_element("minus_"+parseInt(suffix));
	if (minus_id)
		minus_id.style.display = "";
	var summary_id = get_element("summary_"+parseInt(suffix));
	if (summary_id)
		summary_id.style.display = "none";
	var content_id = get_element("content_"+parseInt(suffix));
	if (content_id)
		content_id.style.display = "block";
	var author_id = get_element("author_"+parseInt(suffix));
	if (author_id)
		author_id.style.display = "";
	var category_id = get_element("category_"+parseInt(suffix));
	if (category_id)
		category_id.style.display = "block";
	var buttons_id = get_element("buttons_"+parseInt(suffix));
	if (buttons_id)
		buttons_id.style.display = "block";
	var others_id = get_element("others_"+parseInt(suffix));
	if (others_id)
		others_id.style.display = "block";
}
function ordertype(orderType) {
	var txt="";
	if ((_query != null) && (_query != '') && (_query != '*')) {
			txt+='query='+encodeURI(_query);
	} else if ((_categ != null) && (_categ != '')) {
		txt+='categories='+encodeURI(_categ);
	} else if ((_date != null) && (_date != '')) {
		txt+='daterange='+encodeURI(_date);
	}
	var path=window.location.pathname + '?ordertype='+orderType+'&'+txt;
	window.location = path;
}
var _ascdesc=0;
var _page=0;
var _query='*';
var _categ='';
var _date='';
function loadAsc(str) {
	if ((str.indexOf("ordertype") == 1) || (str.indexOf("ordertype") == 0)) {
		var arr=str.split('=');
		if (arr != null)
			_ascdesc = parseInt(arr[1]);
	}
}
function loadPage(str) {
	if ((str.indexOf("page") == 1) || (str.indexOf("page") == 0)) {
		var arr=str.split('=');
		if (arr != null)
			_page = parseInt(arr[1]);
	}
}
function loadQuery(str) {
	if ((str.indexOf("query") == 1) || (str.indexOf("query") == 0)) {
		var arr=str.split('=');
		if (arr != null)
			_query = decodeURI(arr[1]);
	}
}
function loadCateg(str) {
	if ((str.indexOf("categories") == 1) || (str.indexOf("categories") == 0)) {
		var arr=str.split('=');
		if (arr != null)
			_categ = decodeURI(arr[1]);
	}
}
function loadDate(str) {
	if ((str.indexOf("daterange") == 1) || (str.indexOf("daterange") == 0)) {
		var arr=str.split('=');
		if (arr != null)
			_date = decodeURI(arr[1]);
	}
}
function onloadMenu() {
	if (window.location.search && window.location.search.length) {
		var params=window.location.search.split('&');
		if (params != null) for (var n=0; n < params.length; ++n) {
			loadAsc(params[n]);
			loadPage(params[n]);
			loadQuery(params[n]);
			loadCateg(params[n]);
			loadDate(params[n]);
		}
		selectObj("sorttitle",false);
		var ascending = get_element("ascending");
		if (ascending) 
			ascending.innerHTML = 'Newest posts first';
		var descending = get_element("descending");
		if (descending) 
			descending.innerHTML = 'Oldest posts first';
		if (_ascdesc == 0) {
			selectObj("ascending",true);
			selectObj("descending",false);
		} else {
			selectObj("ascending",false);
			selectObj("descending",true);
		}
	} else {
		selectObj("ascending",true);
		selectObj("descending",false);
	}
	selectObj("allposts",false);
	selectObj("search",false);
	var _text = readCookie("_text");
	if ((_text==null)||(_text=='1')) {
		selectObj("summaries",true);
		selectObj("fulltext",false);
		createCookie('_text','1',90);
	} else if (_text=='2') {
		selectObj("summaries",false);
		selectObj("fulltext",true);
		createCookie('_text','2',90);
	}
	if ((_query != null) && (_query != '') && (_query != '*')) {
		var queryObj = get_element("searchinput");
		if (queryObj)
			queryObj.value = _query;
	}
}
function selectObj(name,selected) {
	var obj = get_element(name);
	if (obj) {
		if (selected) {
			obj.style.color = '#FF6600';
		} else {
			obj.style.color = '#666666';
		}
	}
}
function gotopage(page) {
	var txt="ordertype=";
	if (_ascdesc==0)
		txt+="0";
	else 
		txt+="1";
	if ((_query != null) && (_query != '') && (_query != '*')) {
			txt+='&query='+encodeURI(_query);
	} else if ((_categ != null) && (_categ != '')) {
		txt+='&categories='+encodeURI(_categ);
	} else if ((_date != null) && (_date != '')) {
		txt+='&daterange='+encodeURI(_date);
	}
	var path=window.location.pathname + '?page='+page+'&'+txt;
	window.location = path;
}
function _gotopage_1() {
	var obj = get_element("goto_1");
	if (obj && (obj.value != null) && (obj.value.length > 0)) {
		var page=parseInt(obj.value);
		if (page != 0)
			gotopage(page);
	}
}
function _gotopage_2() {
	var obj = get_element("goto_2");
	if (obj && (obj.value != null) && (obj.value.length > 0)) {
		var page=parseInt(obj.value);
		if (page != 0)
			gotopage(page);
	}
}
function search() {
	var txt="ordertype=";
	if (_ascdesc==0)
		txt+="0";
	else 
		txt+="1";
	var obj = get_element("searchinput");
	if (obj) {
		if ((obj.value != null) && (obj.value.length > 0)) {		
			var path=window.location.pathname+'?query='+encodeURI(obj.value)+'&'+txt;
			window.location = path;
		} else {
			var path=window.location.pathname+'?query=*&'+txt;
			window.location = path;
		}
	}
}
function press_click_search(event) {
	if (document.all){
  		if (event.keyCode == 13){
		   event.returnValue=false;
		   event.cancel = true;
		   search();
  		} 
	} else if (document.getElementById){
  		if (event.which == 13) {
   			event.returnValue=false;
   			event.cancel = true;
		   	search();
  		} 
 	} else if(document.layers) {
	  	if (event.which == 13) {
   			event.returnValue=false;
   			event.cancel = true;
		   	search();
   		} 
 	}
}
function favourite(title) {
	if (ieBrowser) 
		window.external.AddFavorite(window.location,title);
}
function makeArray() {
  var args = makeArray.arguments;
  for (var i = 0; i < args.length; i++) {
    this[i] = args[i];
  }
  this.length = args.length;
}
function click_calendar(obj) {
	var onedigit = new makeArray("01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12");
	var dateStr, dateStr1;
	if (parseInt(obj.date.getDate()) < 10)
		dateStr=obj.date.getFullYear()+'-'+onedigit[parseInt(obj.date.getMonth())]+'-'+onedigit[parseInt(obj.date.getDate()-1)];
	else
		dateStr=obj.date.getFullYear()+'-'+onedigit[parseInt(obj.date.getMonth())]+'-'+obj.date.getDate();
	var date1=obj.date;
	date1.setDate(date1.getDate()+1);
	if (parseInt(date1.getDate()) < 10)
		dateStr1=date1.getFullYear()+'-'+onedigit[parseInt(date1.getMonth())]+'-'+onedigit[parseInt(date1.getDate()-1)];
	else
		dateStr1=date1.getFullYear()+'-'+onedigit[parseInt(date1.getMonth())]+'-'+date1.getDate();
	var path=window.location.pathname + '?daterange='+dateStr+'%20to%20'+dateStr1;
	window.location = path;
}
function allposts() {
	var path=window.location.pathname;
	window.location = path;
}