function sack(file) {
	this.xmlhttp = null;
	this.resetData = function() {
		this.method = "POST";
  		this.queryStringSeparator = "?";
		this.argumentSeparator = "&";
		this.URLString = "";
		this.encodeURIString = true;
  		this.execute = false;
  		this.element = null;
		this.elementObj = null;
		this.requestFile = file;
		this.vars = new Object();
		this.responseStatus = new Array(2);
  	};
	this.resetFunctions = function() {
  		this.onLoading = function() { };
  		this.onLoaded = function() { };
  		this.onInteractive = function() { };
  		this.onCompletion = function() { };
  		this.onError = function() { };
		this.onFail = function() { };
	};
	this.reset = function() {
		this.resetFunctions();
		this.resetData();
	};
	this.createAJAX = function() {
		try {
			this.xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e1) {
			try {
				this.xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e2) {
				this.xmlhttp = null;
			}
		}
		if (! this.xmlhttp) {
			if (typeof XMLHttpRequest != "undefined") {
				this.xmlhttp = new XMLHttpRequest();
			} else {
				this.failed = true;
			}
		}
	};
	this.setVar = function(name, value){
		this.vars[name] = Array(value, false);
	};
	this.encVar = function(name, value, returnvars) {
		if (true == returnvars) {
			return Array(encodeURIComponent(name), encodeURIComponent(value));
		} else {
			this.vars[encodeURIComponent(name)] = Array(encodeURIComponent(value), true);
		}
	}
	this.processURLString = function(string, encode) {
		encoded = encodeURIComponent(this.argumentSeparator);
		regexp = new RegExp(this.argumentSeparator + "|" + encoded);
		varArray = string.split(regexp);
		for (i = 0; i < varArray.length; i++){
			urlVars = varArray[i].split("=");
			if (true == encode){
				this.encVar(urlVars[0], urlVars[1]);
			} else {
				this.setVar(urlVars[0], urlVars[1]);
			}
		}
	}
	this.createURLString = function(urlstring) {
		if (this.encodeURIString && this.URLString.length) {
			this.processURLString(this.URLString, true);
		}
		if (urlstring) {
			if (this.URLString.length) {
				this.URLString += this.argumentSeparator + urlstring;
			} else {
				this.URLString = urlstring;
			}
		}
		this.setVar("rndval", new Date().getTime());
		urlstringtemp = new Array();
		for (key in this.vars) {
			if (false == this.vars[key][1] && true == this.encodeURIString) {
				encoded = this.encVar(key, this.vars[key][0], true);
				delete this.vars[key];
				this.vars[encoded[0]] = Array(encoded[1], true);
				key = encoded[0];
			}
			urlstringtemp[urlstringtemp.length] = key + "=" + this.vars[key][0];
		}
		if (urlstring){
			this.URLString += this.argumentSeparator + urlstringtemp.join(this.argumentSeparator);
		} else {
			this.URLString += urlstringtemp.join(this.argumentSeparator);
		}
	}
	this.runResponse = function() {
		eval(this.response);
	}
	this.runAJAX = function(urlstring) {
		if (this.failed) {
			this.onFail();
		} else {
			this.createURLString(urlstring);
			if (this.element) {
				this.elementObj = document.getElementById(this.element);
			}
			if (this.xmlhttp) {
				var self = this;
				if (this.method == "GET") {
					totalurlstring = this.requestFile + this.queryStringSeparator + this.URLString;
					this.xmlhttp.open(this.method, totalurlstring, true);
				} else {
					this.xmlhttp.open(this.method, this.requestFile, true);
					try {
						this.xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded")
					} catch (e) { }
				}
				this.xmlhttp.onreadystatechange = function() {
					switch (self.xmlhttp.readyState) {
						case 1:
							self.onLoading();
							break;
						case 2:
							self.onLoaded();
							break;
						case 3:
							self.onInteractive();
							break;
						case 4:
							self.response = self.xmlhttp.responseText;
							self.responseXML = self.xmlhttp.responseXML;
							self.responseStatus[0] = self.xmlhttp.status;
							self.responseStatus[1] = self.xmlhttp.statusText;
							if (self.execute) {
								self.runResponse();
							}
							if (self.elementObj) {
								elemNodeName = self.elementObj.nodeName;
								elemNodeName.toLowerCase();
								if (elemNodeName == "input"
								|| elemNodeName == "select"
								|| elemNodeName == "option"
								|| elemNodeName == "textarea") {
									self.elementObj.value = self.response;
								} else {
									self.elementObj.innerHTML = self.response;
								}
							}
							if (self.responseStatus[0] == "200") {
								self.onCompletion();
							} else {
								self.onError();
							}
							self.URLString = "";
							break;
					}
				};
				this.xmlhttp.send(this.URLString);
			}
		}
	};
	this.reset();
	this.createAJAX();
}
var serverSideFile = '/admin/poll/ajax-poller-cast-vote-php.php';
var voteLeftImage = 'http://img1.rusenews.eu/news/i/graph_left_1.gif';
var voteRightImage = 'http://img1.rusenews.eu/news/i/graph_right_1.gif';
var voteCenterImage = 'http://img1.rusenews.eu/news/i/graph_middle_1.gif';
var graphMaxWidth = 265;
var graphMinWidth = 15;
var pollScrollSpeed = 5;
var useCookiesToRememberCastedVotes = true;
var txt_totalVotes = 'Общо гласували: ';
var ajaxObjects = new Array();
var pollVotes = new Object();
var pollVoteCounted = new Array();
var totalVotes = new Array();
var preloadedImages = new Array();
preloadedImages[0] = new Image();
preloadedImages[0].src = voteLeftImage;
preloadedImages[1] = new Image();
preloadedImages[1].src = voteRightImage;
preloadedImages[2] = new Image();
preloadedImages[2].src = voteCenterImage;
function Poller_Get_Cookie(name) { 
   var start = document.cookie.indexOf(name+"="); 
   var len = start+name.length+1; 
   if ((!start) && (name != document.cookie.substring(0,name.length))) return null; 
   if (start == -1) return null; 
   var end = document.cookie.indexOf(";",len); 
   if (end == -1) end = document.cookie.length; 
   return unescape(document.cookie.substring(len,end)); 
} 
function Poller_Set_Cookie(name,value,expires,path,domain,secure) { 
	expires = expires * 60*60*24*1000;
	var today = new Date();
	var expires_date = new Date( today.getTime() + (expires) );
    var cookieString = name + "=" +escape(value) + 
       ( (expires) ? ";expires=" + expires_date.toGMTString() : "") + 
       ( (path) ? ";path=" + path : "") + 
       ( (domain) ? ";domain=" + domain : "") + 
       ( (secure) ? ";secure" : ""); 
    document.cookie = cookieString; 
}
function showVoteResults(pollId,ajaxIndex){
	document.getElementById('poller_waitMessage' + pollId).style.display='none';
	var xml = ajaxObjects[ajaxIndex].response;
	xml = xml.replace(/\n/gi,'');
	var reg = new RegExp("^.*?<pollerTitle>(.*?)<.*$","gi");
	var pollerTitle = xml.replace(reg,'$1');
	var resultDiv = document.getElementById('poller_results' + pollId);
	var titleP = document.createElement('P');
	titleP.className='result_pollerTitle';
	titleP.innerHTML = pollerTitle;
	resultDiv.appendChild(titleP);	
	var options = xml.split(/<option>/gi);
	pollVotes[pollId] = new Object();
	totalVotes[pollId] = 0;
	for(var no=1;no<options.length;no++){
		var elements = options[no].split(/</gi);
		var currentOptionId = false;
		for(var no2=0;no2<elements.length;no2++){
			if(elements[no2].substring(0,1)!='/'){
				var key = elements[no2].replace(/^(.*?)>.*$/gi,'$1');
				var value = elements[no2].replace(/^.*?>(.*)$/gi,'$1');
				if(key.indexOf('optionText')>=0){
					var pOption = document.createElement('P');
					pOption.className='result_pollerOption';
					pOption.innerHTML = value;
					resultDiv.appendChild(pOption);					
				}
				if(key.indexOf('optionId')>=0){
					currentOptionId = value/1;
				}
				if(key.indexOf('votes')>=0){
					var voteDiv = document.createElement('DIV');
					voteDiv.className='result_pollGraph';
					resultDiv.appendChild(voteDiv);	
					var leftImage = document.createElement('IMG');
					leftImage.src = voteLeftImage;
					voteDiv.appendChild(leftImage);
					var numberDiv = document.createElement('DIV');
					numberDiv.style.backgroundImage = 'url(\'' + voteCenterImage + '\')';
					numberDiv.innerHTML = '0%';
					numberDiv.id = 'result_voteTxt' + currentOptionId;
					voteDiv.appendChild(numberDiv);	
					var rightImage = document.createElement('IMG');
					rightImage.src = voteRightImage;
					voteDiv.appendChild(rightImage);						
					pollVotes[pollId][currentOptionId] = value;					
					totalVotes[pollId] = totalVotes[pollId]/1 + value/1;
				}
			}
		}
	}
	var totalVoteP = document.createElement('P');
	totalVoteP.className = 'result_totalVotes';
	totalVoteP.innerHTML = txt_totalVotes + totalVotes[pollId];
	voteDiv.appendChild(totalVoteP);	
	setPercentageVotes(pollId);
	slideVotes(pollId,0);
}
function setPercentageVotes(pollId){
	for(var prop in pollVotes[pollId]){
		pollVotes[pollId][prop] =  Math.round( (pollVotes[pollId][prop] / totalVotes[pollId]) * 100);				
	}	
	var currentSum = 0;
	for(var prop in pollVotes[pollId]){
		currentSum = currentSum + pollVotes[pollId][prop]/1;			
	}
	pollVotes[pollId][prop] = pollVotes[pollId][prop] + (100-currentSum);
}
function slideVotes(pollId,currentPercent){
	currentPercent = currentPercent/1 + 1;
	for(var prop in pollVotes[pollId]){
		if(pollVotes[pollId][prop]>=currentPercent){
			var obj = document.getElementById('result_voteTxt' + prop);
			obj.innerHTML = currentPercent + '%';
			obj.style.width = Math.max(graphMinWidth,Math.round(currentPercent/100*graphMaxWidth)) + 'px';
		}			
	}
	if(currentPercent<100)setTimeout('slideVotes("' + pollId + '","' + currentPercent + '")',pollScrollSpeed);
}
function prepareForPollResults(pollId){
	document.getElementById('poller_waitMessage' + pollId).style.display='block';
	document.getElementById('poller_question' + pollId).style.display='none';	
}
function castMyVote(pollId,formObj){	
	var elements = formObj.elements['vote[' + pollId + ']'];
	var optionId = false;
	for(var no=0;no<elements.length;no++){
		if(elements[no].checked)optionId = elements[no].value;
	}
	Poller_Set_Cookie('dhtmlgoodies_poller_' + pollId,'1',6000000);
	if(optionId){
		var ajaxIndex = ajaxObjects.length;
		ajaxObjects[ajaxIndex] = new sack();
		ajaxObjects[ajaxIndex].requestFile = serverSideFile + '?pollId=' + pollId + '&optionId=' + optionId;
		prepareForPollResults(pollId);
		ajaxObjects[ajaxIndex].onCompletion = function(){ showVoteResults(pollId,ajaxIndex); };	
		ajaxObjects[ajaxIndex].runAJAX();
	}
}
function displayResultsWithoutVoting(pollId){
	var ajaxIndex = ajaxObjects.length;
	ajaxObjects[ajaxIndex] = new sack();
	ajaxObjects[ajaxIndex].requestFile = serverSideFile + '?pollId=' + pollId;
	prepareForPollResults(pollId);
	ajaxObjects[ajaxIndex].onCompletion = function(){ showVoteResults(pollId,ajaxIndex); };
	ajaxObjects[ajaxIndex].runAJAX();	
}
//max height
var ElementMaxHeight = function() {
  this.initialize.apply(this, arguments);
}
ElementMaxHeight.prototype = {
  initialize: function(className) {
    this.elements = document.getElementsByClassName(className || 'maxheight');    
    this.textElement = document.createElement('span');
    this.textElement.appendChild(document.createTextNode('A'));
    this.textElement.style.display = 'block';
    this.textElement.style.position = 'absolute';
    this.textElement.style.fontSize = '1em';
    this.textElement.style.top = '-1000px';
    this.textElement.style.left = '-1000px';
    document.body.appendChild(this.textElement);
    this.textElementHeight = document.getDimensions(this.textElement).height;
    var __object = this;
    var __checkFontSize = this.checkFontSize;
    this.checkFontSizeInterval = window.setInterval(function() {return __checkFontSize.apply(__object)}, 500);
    this.expand();
    var __expand = this.expand;
    if (window.addEventListener) {
      window.addEventListener('resize', function(event) {return __expand.apply(__object, [( event || window.event)])}, false);
    } else if (window.attachEvent) {
      window.attachEvent('onresize', function(event) {return __expand.apply(__object, [( event || window.event)])});
    }
  },
  expand: function() {
    this.reset();
  	for (var i = 0; i < this.elements.length; i++) {  	
      this.elements[i].style.height = document.getDimensions(this.elements[i].parentNode).height + 'px';
  	}
  },
  reset: function() {
    for (var i = 0; i < this.elements.length; i++) {    
      this.elements[i].style.height = 'auto';
    }
  },
  checkFontSize: function() {
  	var height = document.getDimensions(this.textElement).height;
  	if(this.textElementHeight != height) {
  		this.textElementHeight = height;
  		this.expand();
  	}
  }  
}
if (!!document.evaluate) {
  document._getElementsByXPath = function(expression, parentElement) {
    var results = [];
    var query = document.evaluate(expression, parentElement || document,
      null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
    for (var i = 0, length = query.snapshotLength; i < length; i++)
      results.push(query.snapshotItem(i));
    return results;
  }
}
document.getElementsByClassName = function(className, parentElement) {
  if (!!document.evaluate) {
    var q = ".//*[contains(concat(' ', @class, ' '), ' " + className + " ')]";
    return document._getElementsByXPath(q, parentElement);
  } else {
    var children = (parentElement || document.body).getElementsByTagName('*');
    var elements = [], child;
    for (var i = 0, length = children.length; i < length; i++) {
      child = children[i];
      if (child.className.length != 0 &&
          (child.className == className ||
           child.className.match(new RegExp("(^|\\s)" + className + "(\\s|$)")))) {      
        elements.push(child);
      }
    }
    return elements;
  }
}
document.getDimensions = function (element) {
  var display = element.style.display;
  if (display != 'none' && display != null) { // Safari bug
    return {width: element.offsetWidth, height: element.offsetHeight};
  }

  return {width: originalWidth, height: originalHeight};
}
//+or- font
var tgs = new Array( 'div','td','tr','a');
var szs = new Array( '7pt','8pt','9pt','10pt','11pt','12pt','13pt' );
var startSz = 1;

// +/-
function ts( trgt,inc ) {
	if (!document.getElementById) return
	var d = document,cEl = null,sz = startSz,i,j,cTags;
	
	sz += inc;
	if ( sz < 0 ) sz = 0;
	if ( sz > 6 ) sz = 6;
	startSz = sz;
		
	if ( !( cEl = d.getElementById( trgt ) ) ) cEl = d.getElementsByTagName( trgt )[ 0 ];

	cEl.style.fontSize = szs[ sz ];

	for ( i = 0 ; i < tgs.length ; i++ ) {
		cTags = cEl.getElementsByTagName( tgs[ i ] );
		for ( j = 0 ; j < cTags.length ; j++ ) cTags[ j ].style.fontSize = szs[ sz ];
	}
}
// size
function tsz( trgt,sz ) {
	if (!document.getElementById) return
	var d = document,cEl = null,i,j,cTags;
	
	if ( !( cEl = d.getElementById( trgt ) ) ) cEl = d.getElementsByTagName( trgt )[ 0 ];

	cEl.style.fontSize = sz;

	for ( i = 0 ; i < tgs.length ; i++ ) {
		cTags = cEl.getElementsByTagName( tgs[ i ] );
		for ( j = 0 ; j < cTags.length ; j++ ) cTags[ j ].style.fontSize = sz; //szs[ sz ];
	}
}

function resizeShort(short, summary){
	short.setStyle({overflow:'hidden'});
	
	if (summary){
		var i = 0;
		var text = summary.innerHTML.stripTags();
		summary.update(text);
		
		while (short.scrollHeight > short.offsetHeight) {
			i++;
			if (i > 100) break;
			var text = summary.innerHTML;
			summary.update(text.replace(/\W*\w+\W*$/, ''));
		}
	}
}
function clearPreloadPage() { 
if (document.getElementById){
document.getElementById('loading').style.visibility='hidden';
}else{
if (document.layers){ 
document.loading.visibility = 'hidden'; }
else { 
document.all.loading.style.visibility = 'hidden'; }
	}
}
/*
url = document.location.href;

if(self!=top){if(document.images)
top.location.replace(window.location.href);else
top.location.href=window.location.href;}
if(top!=self){top.location=self.location;}
*/
var bustcachevar=1
var loadstatustext="<img src='/templates/standard_blau/img/page/loading.gif' />"
var loadedobjects=""
var defaultcontentarray=new Object()
var bustcacheparameter=""

function ajaxpage(url,containerid,targetobj){var page_request=false
if(window.XMLHttpRequest)
page_request=new XMLHttpRequest()
else if(window.ActiveXObject){try{page_request=new ActiveXObject("Msxml2.XMLHTTP")}
catch(e){try{page_request=new ActiveXObject("Microsoft.XMLHTTP")}
catch(e){}}}
else
return false
var ullist=targetobj.parentNode.parentNode.getElementsByTagName("li")
for(var i=0;i<ullist.length;i++)
ullist[i].className=""  
targetobj.parentNode.className="selected"  
if(url.indexOf("#default")!=-1){ 
document.getElementById(containerid).innerHTML=defaultcontentarray[containerid]
return}
document.getElementById(containerid).innerHTML=loadstatustext
page_request.onreadystatechange=function(){loadpage(page_request,containerid)}
if(bustcachevar)
bustcacheparameter=(url.indexOf("?")!=-1)? "&"+new Date().getTime() : "?"+new Date().getTime()
page_request.open('GET',url+bustcacheparameter,true)
page_request.send(null)}
function loadpage(page_request,containerid){if(page_request.readyState==4&&(page_request.status==200||window.location.href.indexOf("http")==-1))
document.getElementById(containerid).innerHTML=page_request.responseText}
function loadobjs(revattribute){if(revattribute!=null&&revattribute!=""){ 
var objectlist=revattribute.split(/\s*,\s*/)
for(var i=0;i<objectlist.length;i++){var file=objectlist[i]
var fileref=""
if(loadedobjects.indexOf(file)==-1){if(file.indexOf(".js")!=-1){
fileref=document.createElement('script')
fileref.setAttribute("type","text/javascript");
fileref.setAttribute("src", file);}
else if(file.indexOf(".css")!=-1){ 
fileref=document.createElement("link")
fileref.setAttribute("rel", "stylesheet");
fileref.setAttribute("type", "text/css");
fileref.setAttribute("href", file);}}
if(fileref!=""){
document.getElementsByTagName("head").item(0).appendChild(fileref)
loadedobjects+=file+" " }}}}
function savedefaultcontent(contentid){if(typeof defaultcontentarray[contentid]=="undefined") 
defaultcontentarray[contentid]=document.getElementById(contentid).innerHTML}
function startajaxtabs(){for(var i=0;i<arguments.length;i++){var ulobj=document.getElementById(arguments[i])
var ulist=ulobj.getElementsByTagName("li") 
for(var x=0;x<ulist.length;x++){var ulistlink=ulist[x].getElementsByTagName("a")[0]
if(ulistlink.getAttribute("rel")){
var modifiedurl=ulistlink.getAttribute("href").replace(/^http:\/\/[^\/]+\//i, "http://"+window.location.hostname+"/")
ulistlink.setAttribute("href", modifiedurl)
savedefaultcontent(ulistlink.getAttribute("rel")) 
ulistlink.onclick=function(){ajaxpage(this.getAttribute("href"), this.getAttribute("rel"), this)
loadobjs(this.getAttribute("rev"))
return false}
if(ulist[x].className=="selected"){
ajaxpage(ulistlink.getAttribute("href"), ulistlink.getAttribute("rel"), ulistlink) 
loadobjs(ulistlink.getAttribute("rev")) }}}}}
function resize_iframe(){var height=window.innerWidth;if(document.body.clientHeight){height=document.body.clientHeight;}
document.getElementById("glu").style.height=parseInt(height-
document.getElementById("glu").offsetTop-8)+"px";}
window.onresize=resize_iframe;function checkUsername(username){document.getElementById('message').innerHTML='Проверка...';var xmlhttp=false;try{xmlhttp=new ActiveXObject('Msxml2.XMLHTTP');}catch(e){try{xmlhttp=new
ActiveXObject('Microsoft.XMLHTTP');}catch(E){xmlhttp=false;}}
if(!xmlhttp&&typeof XMLHttpRequest!='undefined'){xmlhttp=new XMLHttpRequest();}
var url='checkuname.php?username='+username;xmlhttp.open('GET',url,true);xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==4){var content=xmlhttp.responseText;if(content){switch(content){case "1":document.getElementById('message').innerHTML = "<span style='color:red'>Избраното от Вас потребителско име е заето. Моля изберете друго.</span>"; break;
case "2":document.getElementById('message').innerHTML = "<span style='color:green'>Потребителското име, което сте избрали е достъпно!</span>"; break;
default:document.getElementById('message').innerHTML=""; break;}}}}
xmlhttp.send(null)
return;}
function Start(page){OpenWin=this.open(page,"CtrlWindow", "toolbar=yes,menubar=yes,location=yes,scrollbars=yes,resizable=yes");}
function MM_jumpMenu(targ,selObj,restore){eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if(restore)selObj.selectedIndex=0;}
function verifyCompatibleBrowser(){this.ver=navigator.appVersion
this.dom=document.getElementById?1:0
this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0; 
this.ie4=(document.all&&!this.dom)?1:0;this.ns5=(this.dom&&parseInt(this.ver)>=5)?1:0;this.ns4=(document.layers&&!this.dom)?1:0;this.bw=(this.ie5||this.ie4||this.ns4||this.ns5)
return this}
bw=new verifyCompatibleBrowser()
var speed=50
var loop,timer
function ConstructObject(obj,nest){nest=(!nest)?'':'document.'+nest+'.'
this.el=bw.dom?document.getElementById(obj):bw.ie4?document.all[obj]:bw.ns4?eval(nest+'document.'+obj):0;this.css=bw.dom?document.getElementById(obj).style:bw.ie4?document.all[obj].style:bw.ns4?eval(nest+'document.'+obj):0;this.scrollWidth=bw.ns4?this.css.document.width:this.el.offsetWidth
this.clipWidth=bw.ns4?this.css.clip.width:this.el.offsetWidth
this.left=MoveAreaLeft;this.right=MoveAreaRight;this.MoveArea=MoveArea;this.x;this.y;this.obj=obj+"Object" 
eval(this.obj+"=this") 
return this}
function MoveArea(x,y){this.x=x;this.y=y
this.css.left=this.x+"px";
this.css.top=this.y+"px";}
function MoveAreaRight(move){if(this.x>-this.scrollWidth+objContainer.clipWidth){this.MoveArea(this.x-move,0)
if(loop)setTimeout(this.obj+".right("+move+")",speed) }}
function MoveAreaLeft(move){if(this.x<0){this.MoveArea(this.x-move,0)
if(loop)setTimeout(this.obj+".left("+move+")",speed) }}
function PerformScroll(speed){if(initialised){loop=true;if(speed>0)objScroller.right(speed)
else objScroller.left(speed)}}
function CeaseScroll(){loop=false
if(timer)clearTimeout(timer)}
var initialised;function InitialiseScrollableArea(divContainer,divContent){objContainer=new ConstructObject(divContainer)
objScroller=new ConstructObject(divContent,divContainer)
objScroller.MoveArea(0,0)
objContainer.css.visibility='visible'
initialised=true;}
function ReloadWin(){var ns4=(document.layers&&!this.dom)?1:0;if(ns4){self.location.reload();}else{return false;}}
imgArr=new Image;imgAro=new Image;imgUp=new Image;imgUpo=new Image;imgArr.src="http://www.pyce.info/i/arr.gif";
imgAro.src="http://www.pyce.info/i/arr_o.gif";
imgUp.src="http://www.pyce.info/i/up.gif";
imgUpo.src="http://www.pyce.info/i/up_o.gif";
function img_over(img){if(img.name.substring(0,3)=="arr") img.src = "http://www.pyce.info/i/arr_o.gif";
else img.src="/i/" + img.name + "_o.gif";}
function img_out(img){if(img.name.substring(0,3)=="arr") img.src = "http://www.pyce.info/i/arr.gif";
else img.src="/i/" + img.name + ".gif";}
function SymError(){return true;}
window.onerror=SymError;function drucke(id,theme){var html=document.getElementById(id).innerHTML;html=html.replace(/src="/gi,'src="../' );
html=html.replace(/&lt;/gi,'<');html=html.replace(/&gt;/gi,'>');var pFenster=window.open('',null,'height=600,width=780,toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes');var HTML='<html><head></head><body style="font-family:arial,verdana;font-size:12px" onload="window.print()">' + html + '</body></html>' ;
pFenster.document.write(HTML);pFenster.document.close();}
function showhide(id,id2,text,text2){if(document.getElementById(id).style.display=="none"){
document.getElementById(id).style.display="";
document.getElementById(id2).innerHTML=text;}else{document.getElementById(id).style.display="none";
document.getElementById(id2).innerHTML=text2;}
return true;}
function getFile(area,id){var winWidth=500;var winHeight=400;var w=(screen.width-winWidth)/2;var h=(screen.height-winHeight)/2-60;var url='index.php?do=dl&p=downloadfile&area='+area+'&fileid='+id;var name='id';var features='menubar=yes,scrollbars=yes,toolbar=yes,resizable=yes,status=no,location=no,width='+winWidth+',height='+winHeight+',top='+h+',left='+w;window.open(url,name,features);}
function getLink(area,id){var winWidth=800;var winHeight=600;var w=(screen.width-winWidth)/2;var h=(screen.height-winHeight)/2-60;var url='index.php?do=dl&p=golink&area='+area+'&id='+id;var name='id';var features='menubar=yes,scrollbars=yes,toolbar=yes,resizable=yes,status=yes,location=yes,width='+winWidth+',height='+winHeight+',top='+h+',left='+w;window.open(url,name,features);}
function helpwin(title,msg){var width="300", height="125";
var left=(screen.width/2)-width/2;var top=(screen.height/2)-height/2;var styleStr='toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbar=no,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+',top='+top+',screenX='+left+',screenY='+top;var msgWindow=window.open("","msgWindow", styleStr);
var head='<head><title>'+title+'</title></head>';var body='<center>'+msg+'<br><p><form><input type="button" value="   Done   " onClick="self.close()"></form>';
msgWindow.document.write(head+body);}
function popex(url,name,width,height,center,resize,scroll,posleft,postop){if(posleft!=0){x=posleft}
if(postop!=0){y=postop}
if(!scroll){scroll=1}
if(!resize){resize=1}
if((parseInt(navigator.appVersion)>=4)&&(center)){X=(screen.width-width)/2;Y=(screen.height-height)/2;}
if(scroll!=0){scroll=1}
var Win=window.open(url,name,'width='+width+',height='+height+',top='+Y+',left='+X+',resizable='+resize+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no');}
function popup(datei,name,breite,hoehe,srcoll){var posX=10;var posY=10;var scrolly=srcoll;var id=name;window.open(datei,name,"resizable=yes,scrollbars=" + scrolly + " ,width=" + breite + ",height=" + hoehe + "screenX=" + posX + ",screenY=" + posY + ",left=" + posX + ",top=" + posY + "");}
function enzypop(datei){var posX=10;var posY=10;var h=450;var w=500;window.open(datei,name,"resizable=yes,scrollbars=yes,width=" + w + ",height=" + h + "screenX=" + posX + ",screenY=" + posY + ",left=" + posX + ",top=" + posY + "");}
function msgpop(datei,name,breite,hoehe,srcoll){var posX=(screen.availWidth-breite)/2;var posY=(screen.availHeight-hoehe)/2;var scrolly=srcoll;var id=name;window.open(datei,name,"scrollbars=" + scrolly + ",resizable=yes, width=" + breite + ",height=" + hoehe + "screenX=" + posX + ",screenY=" + posY + ",left=" + posX + ",top=" + posY + "");}
function gbild(img_id,galid,area,ascdesc){var winWidth=640;var winHeight=480;var w=(screen.width-winWidth)/2;var h=(screen.height-winHeight)/2-60;var url='index.php?p=gallerypic&img_id='+img_id+'&galid='+galid+'&area='+area+'&ascdesc='+ascdesc+'#'+img_id;var name='name';var features='scrollbars=yes,resizable=yes,toolbar=yes,width='+winWidth+',height='+winHeight+',top='+h+',left='+w;window.open(url,name,features);}
function inline_popup(img_id){var winWidth=640;var winHeight=480;var w=(screen.width-winWidth)/2;var h=(screen.height-winHeight)/2-60;var url='index.php?p=misc&do=inlineshots&img_id='+img_id;var name='name';var features='scrollbars=yes,resizable=yes,toolbar=yes,width='+winWidth+',height='+winHeight+',top='+h+',left='+w;window.open(url,name,features);}
tags=new Array();function getarraysize(thearray){for(i=0;i<thearray.length;i++){if((thearray[i]=="undefined") || (thearray[i] == "") || (thearray[i] == null)) return i;}
return thearray.length;}
function arraypush(thearray,value){thearraysize=getarraysize(thearray);thearray[thearraysize]=value;}
function arraypop(thearray){thearraysize=getarraysize(thearray);retval=thearray[thearraysize-1];delete thearray[thearraysize-1];return retval;}
function setmode(modevalue){document.cookie="cmscodemode="+modevalue+"; path=/; expires=Wed, 1 Jan 2100 00:00:00 GMT;";}
function normalmode(theform){return true;}
function stat(thevalue){document.bbform.status.value=eval(thevalue+"_text");}
function setfocus(theform){theform.text.focus();}
var selectedText="";
AddTxt="";
function getActiveText(msg){selectedText=(document.all)?document.selection.createRange().text:window.getSelection();if(msg.createTextRange)msg.caretPos=document.selection.createRange().duplicate();return true;}
function AddText(NewCode,theform){if(theform.text.createTextRange&&theform.text.caretPos){var caretPos=theform.text.caretPos;caretPos.text=caretPos.text.charAt(caretPos.text.length-1)==' '?NewCode+' ':NewCode;}else theform.text.value+=NewCode
AddTxt="";setfocus(theform);}
function smilie(thesmilie){var ie=document.all?1:0;if(!ie){document.f.text.value+=' '+thesmilie+' '}else{AddSmile=" "+thesmilie+" ";
theform=f;AddText(AddSmile,theform);}}
function unametofield(theuser){opener.document.f.tofromname.value=''+theuser+'';window.close();}
var MessageMax="";
var Override="";
MessageMax=parseInt(MessageMax);if(MessageMax<0){MessageMax=0;}
var B_open=0;var I_open=0;var U_open=0;var QUOTE_open=0;var CODE_open=0;var PHP_open=0;var ktags=new Array();var myAgent=navigator.userAgent.toLowerCase();var myVersion=parseInt(navigator.appVersion);var is_ie=((myAgent.indexOf("msie") != -1)  && (myAgent.indexOf("opera") == -1));
var is_nav=((myAgent.indexOf('mozilla')!=-1)&&(myAgent.indexOf('spoofer')==-1)&&(myAgent.indexOf('compatible')==-1)&&(myAgent.indexOf('opera')==-1)&&(myAgent.indexOf('webtv')==-1)&&(myAgent.indexOf('hotjava')==-1));var is_win=((myAgent.indexOf("win")!=-1) || (myAgent.indexOf("16bit")!=-1));
var is_mac=(myAgent.indexOf("mac")!=-1);
var allcookies=document.cookie;var pos=allcookies.indexOf("kmode=");
prep_mode();
function prep_mode() {
	if(pos!=1){
		var cstart=pos+7;
		var cend=allcookies.indexOf(";", cstart);
	if(cend==-1){
		cend=allcookies.length;
	}
	cvalue=allcookies.substring(cstart,cend);
	if(cvalue=='helpmode'){
		document.f.kmode[0].checked=true;
	}
	else {
		document.f.kmode[1].checked=true;
		}
	}
else{
	document.f.kmode[1].checked=true;
	}
}
function setmode(mVal){document.cookie="kmode="+mVal+"; path=/; expires=Wed, 1 Dez 2040 00:00:00 GMT;";}
function normmodestat(){if(document.f.kmode[0].checked){return true;}
else{return false;}}
function khelp(msg){document.f.khelp_msg.value=eval("khelp_" + msg );}
function stacksize(thearray){for(i=0;i<thearray.length;i++){if((thearray[i]=="") || (thearray[i] == null) || (thearray == 'undefined') ) {
return i;}}
return thearray.length;}
function pushstack(thearray,newval){arraysize=stacksize(thearray);thearray[arraysize]=newval;}
function popstack(thearray){arraysize=stacksize(thearray);theval=thearray[arraysize-1];delete thearray[arraysize-1];return theval;}
function closeall(){if(ktags[0]){while(ktags[0]){tagRemove=popstack(ktags)
document.f.text.value+="[/" + tagRemove + "]";
if((tagRemove!='FONT')&&(tagRemove!='SIZE')&&(tagRemove!='COLOR')){eval("document.f." + tagRemove + ".value = ' " + tagRemove + " '");
eval(tagRemove+"_open = 0");}}}
ktags=new Array();document.f.text.focus();}
function add_code(NewCode){document.f.text.value+=NewCode;document.f.text.focus();}
function changefont(theval,thetag){if(theval==0)
return;if(doInsert("[" + thetag + "=" + theval + "]", "[/" + thetag + "]", true))
pushstack(ktags,thetag);document.f.ffont.selectedIndex=0;document.f.fsize.selectedIndex=0;document.f.fcolor.selectedIndex=0;}
function easytag(thetag){var tagOpen=eval(thetag+"_open");
if(normmodestat()){inserttext=prompt(prompt_start+"\n[" + thetag + "]xxx[/" + thetag + "]");
if((inserttext!=null)&&(inserttext!="") ) {
doInsert("[" + thetag + "]" + inserttext + "[/" + thetag + "] ", "", false);}}
else{if(tagOpen==0){if(thetag=="PHP") {
var openphp='<?php ';var closephp=' ?>';}else{var openphp='';var closephp='';}
if(doInsert("[" + thetag + "]"+openphp+"", "[/" + thetag + "]", true)){
eval(thetag+"_open = 1");
eval("document.f." + thetag + ".value += '*'");
pushstack(ktags,thetag);khelp('close');}}
else{lastindex=0;for(i=0;i<ktags.length;i++){if(ktags[i]==thetag){lastindex=i;}}
while(ktags[lastindex]){if(thetag=="PHP") {
var closephp=' ?>';}else{var closephp='';}
tagRemove=popstack(ktags);doInsert(""+closephp+"[/" + tagRemove + "]", "", false)
eval("document.f." + tagRemove + ".value = ' " + tagRemove + " '");
eval(tagRemove+"_open = 0");}}}}
function tag_list(){var listtype=prompt(list_prompt,"");
if((listtype=="a") || (listtype == "1") || (listtype == "i")){
thelist="[LIST=" + listtype + "]\n";}
else{thelist="[LIST]\n";}
var listentry="initial";
while((listentry!="") && (listentry != null)){
listentry=prompt(list_prompt2,"");
if((listentry!="") && (listentry != null)){
thelist=thelist+"[*]" + listentry + "\n";}}
doInsert(thelist+"[/LIST]\n", "", false);}
function tag_url(){var FoundErrors='';var enterURL=prompt(text_enter_url,"http://");
var enterTITLE=prompt(text_enter_url_name,"Webseiten-Name");
if(!enterURL){FoundErrors+=" " + error_no_url;}
if(!enterTITLE){FoundErrors+=" " + error_no_title;}
if(FoundErrors){alert(""+FoundErrors);
return;}
doInsert("[URL="+enterURL+"]"+enterTITLE+"[/URL]", "", false);}
function tag_image(){var FoundErrors='';var enterURL=prompt(text_enter_image,"http://");
if(!enterURL){FoundErrors+=" " + error_no_url;}
if(FoundErrors){alert(""+FoundErrors);
return;}
doInsert("[IMG]"+enterURL+"[/IMG]", "", false);}
function tag_email(){var emailAddress=prompt(text_enter_email,"");
if(!emailAddress){alert(error_no_email);return;}
doInsert("[EMAIL]"+emailAddress+"[/EMAIL]", "", false);}
function doInsert(ktag,kctag,once){var isClose=false;var obj_ta=document.f.text;if((myVersion>=4)&&is_ie&&is_win){if(obj_ta.isTextEdit){obj_ta.focus();var sel=document.selection;var rng=sel.createRange();rng.colapse;if((sel.type=="Text" || sel.type == "None") && rng != null){
if(kctag!="" && rng.text.length > 0)
ktag+=rng.text+kctag;else if(once)
isClose=true;rng.text=ktag;}}
else{if(once)
isClose=true;obj_ta.value+=ktag;}}
else{if(once)
isClose=true;obj_ta.value+=ktag;}
obj_ta.focus();return isClose;}
function pnbox(){var winWidth=580;var winHeight=500;var w=(screen.width-winWidth)/2;var h=(screen.height-winHeight)/2-60;var url='index.php?templateid=pn';var name='id';var features='scrollbars=yes,toolbar=yes,resizable=yes,width='+winWidth+',height='+winHeight+',top='+h+',left='+w;window.open(url,name,features);}
function pnto(ato){var winWidth=580;var winHeight=500;var w=(screen.width-winWidth)/2;var h=(screen.height-winHeight)/2-60;var url='index.php?templateid=pn&action=compose&an='+ato;var name='id';location.href=url;}
function emailto(ato){var winWidth=580;var winHeight=400;var w=(screen.width-winWidth)/2;var h=(screen.height-winHeight)/2-60;var url='index.php?templateid=email&action=compose&an='+ato;var name='id';location.href=url;}
function MM_callJS(jsStr){return eval(jsStr)}
function MWJ_retrieveCookie(cookieName){var cookieJar=document.cookie.split("; " );
for(var x=0;x<cookieJar.length;x++){var oneCookie=cookieJar[x].split("=" );
if(oneCookie[0]==escape(cookieName)){return unescape(oneCookie[1]);}}
return null;}
function koobi4_setCookie(name,value){value=value+'@';var lifeTime=31536000;var currentStr=MWJ_retrieveCookie(name);if(!currentStr){MWJ_setCookie(name,value,lifeTime);}else if(currentStr.indexOf(value)+1){value=new RegExp(value,'');MWJ_setCookie(name,currentStr.replace(value,''),lifeTime);}else{MWJ_setCookie(name,currentStr+value,lifeTime);}}
function MWJ_setCookie(cookieName,cookieValue,lifeTime,path,domain,isSecure){if(!cookieName){return false;}
if(lifeTime=="delete" ) { lifeTime = -10; }
document.cookie=escape(cookieName)+"=" + escape( cookieValue ) +
(lifeTime?";expires=" + ( new Date( ( new Date() ).getTime() + ( 1000 * lifeTime ) ) ).toGMTString() : "" ) +
(path?";path=" + path : "") + ( domain ? ";domain=" + domain : "") + 
(isSecure?";secure" : "");
if(lifeTime<0){if(typeof(MWJ_retrieveCookie(cookieName))=="string" ) { return false; } return true; }
if(typeof(MWJ_retrieveCookie(cookieName))=="string" ) { return true; } return false;}
var ie=document.all?1:0;function high(kselect){if(ie){while(kselect.tagName!="TR"){
kselect=kselect.parentElement;}}
else{while(kselect.tagName!="TR"){
kselect=kselect.parentNode;}}}
function off(kselect){if(ie){while(kselect.tagName!="TR"){
kselect=kselect.parentElement;}}}
function changesel(kselect){if(kselect.checked){high(kselect);}
else{off(kselect);}}
function selall(kselect){var fmobj=document.kform;for(var i=0;i<fmobj.elements.length;i++){var e=fmobj.elements[i];if((e.name!='allbox')&&(e.type=='checkbox')&&(!e.disabled)){e.checked=fmobj.allbox.checked;if(fmobj.allbox.checked){high(e);}
else{off(e);}}}}
function CheckCheckAll(kselect){var fmobj=document.kform;var TotalBoxes=0;var TotalOn=0;for(var i=0;i<fmobj.elements.length;i++){var e=fmobj.elements[i];if((e.name!='allbox')&&(e.type=='checkbox')){TotalBoxes++;if(e.checked){TotalOn++;}}}
if(TotalBoxes==TotalOn){fmobj.allbox.checked=true;}
else{fmobj.allbox.checked=false;}}
function select_read(){var fmobj=document.kform;for(var i=0;i<fmobj.elements.length;i++){var e=fmobj.elements[i];if((e.type=='hidden')&&(e.value==1)&&(!isNaN(e.name))){eval("fmobj.msgid_" + e.name + ".checked=true;");
high(e);}}}
function getNewHttpObject(){var objType=false;try{objType=new ActiveXObject('Msxml2.XMLHTTP');}catch(e){try{objType=new ActiveXObject('Microsoft.XMLHTTP');}catch(e){objType=new XMLHttpRequest();}}
return objType;}
function getAXAH(url,elementContainer){document.getElementById(elementContainer).innerHTML='<blink class="loading"><img src="/templates/standard_blau/img/page/loading.gif" border="0" hspace="6" align="absmiddle"><\/blink>';
var theHttpRequest=getNewHttpObject();theHttpRequest.onreadystatechange=function(){processAXAH(elementContainer);};theHttpRequest.open("GET", url);
theHttpRequest.send(false);function processAXAH(elementContainer){if(theHttpRequest.readyState==4){if(theHttpRequest.status==200){document.getElementById(elementContainer).innerHTML=theHttpRequest.responseText;}else{document.getElementById(elementContainer).innerHTML="<p><span class='redtxt'>Error!<\/span> HTTP request return the following status message:&nbsp;" + theHttpRequest.statusText +"<\/p>";}}}}
function makeRequest(url,myelement){var http_request=false;if(window.XMLHttpRequest){http_request=new XMLHttpRequest();if(http_request.overrideMimeType){http_request.overrideMimeType('text/html');}}else if(window.ActiveXObject){try{http_request=new ActiveXObject("Msxml2.XMLHTTP");}catch(e){try{http_request=new ActiveXObject("Microsoft.XMLHTTP");}catch(e){}}}
if(!http_request){return false;}
var now=new Date();url+='?m='+now.getYear()+now.getMonth()+now.getDate()+now.getHours()+now.getMinutes()+now.getSeconds()+'';http_request.onreadystatechange=function(){alertContents(http_request,myelement);};http_request.open('GET',url,true);http_request.send(null);}
function alertContents(http_request,myelement){if(http_request.readyState==4){if(http_request.status==200){tmp=document.getElementById(myelement);tmp.innerHTML=http_request.responseText;}else{}}}
function makeRequest(url,myelement){var http_request=false;if(window.XMLHttpRequest){http_request=new XMLHttpRequest();if(http_request.overrideMimeType){http_request.overrideMimeType('text/html');}}else if(window.ActiveXObject){try{http_request=new ActiveXObject("Msxml2.XMLHTTP");}catch(e){try{http_request=new ActiveXObject("Microsoft.XMLHTTP");}catch(e){}}}
if(!http_request){return false;}
var now=new Date();url+='?m='+now.getYear()+now.getMonth()+now.getDate()+now.getHours()+now.getMinutes()+now.getSeconds()+'';http_request.onreadystatechange=function(){alertContents(http_request,myelement);};http_request.open('GET',url,true);http_request.send(null);}
function alertContents(http_request,myelement){if(http_request.readyState==4){if(http_request.status==200){tmp=document.getElementById(myelement);tmp.innerHTML=http_request.responseText;}else{}}}

function checkUrl(username){document.getElementById('message').innerHTML='Проверка...';var xmlhttp=false;try{xmlhttp=new ActiveXObject('Msxml2.XMLHTTP');}catch(e){try{xmlhttp=new
ActiveXObject('Microsoft.XMLHTTP');}catch(E){xmlhttp=false;}}
if(!xmlhttp&&typeof XMLHttpRequest!='undefined'){xmlhttp=new XMLHttpRequest();}
var url='checkurl.php?url='+username;xmlhttp.open('GET',url,true);xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==4){var content=xmlhttp.responseText;if(content){switch(content){case "1":document.getElementById('message').innerHTML = "<span style='color:red'><blink>Този URL вече е добавен и няма да бъде одобрен.</blink></span>"; 
	var but = document.getElementById('sendContactEmail');
	but.style.display = "none";
break;
case "2":document.getElementById('message').innerHTML = "<span style='color:green'>Този URL не е индексиран при нас!</span>"; 
	var but = document.getElementById('sendContactEmail');
	but.style.display = "block";
break;
default:document.getElementById('message').innerHTML=""; break;}}}}
xmlhttp.send(null)
return;}
if (document.images) {
     button1 = new Image
     button2 = new Image
     button3 = new Image
     button4 = new Image
     button1.src = '/i/left_red_btn.gif'
     button2.src = '/i/left_red_over_btn.gif'
     button3.src = '/i/right_red_btn.gif'
     button4.src = '/i/right_red_over_btn.gif'
 }
function rusePreloadImages() {
	var myimages = new Array();
	for (i=0; i < rusePreloadImages.arguments.length; i++){
		myimages[i]=new Image();
		myimages[i].src = rusePreloadImages.arguments[i];
	}
}
function ruse_navHor( tableCellRef, hoverFlag, navStyle ) {
	if ( hoverFlag ) {
		switch ( navStyle ) {
			case 1:
				tableCellRef.style.backgroundColor = '#605f5f';
				break;
			default:
				if ( document.getElementsByTagName ) {
					tableCellRef.getElementsByTagName( 'a' )[0].style.color = '#ffffff';
				}
		}
	} else {
		switch ( navStyle ) {
			case 1:
				tableCellRef.style.backgroundColor = '#000000';
				break;
			default:
				if ( document.getElementsByTagName ) {
					tableCellRef.getElementsByTagName( 'a' )[0].style.color = '#ffffff';
				}
		}
	}
}
function ruseImgSwap( strId, intSwap ) {
	ruseShowImgSwap( strId, intSwap );
}
function ruseShowImgSwap( strId, intSwap ) {
	var imgObj = document.getElementById( strId );
	var strTemp = imgObj.src;
	var intStrLength = strTemp.length;
	var intChop, strEnd; 
	if ( intSwap ) {
		if (strTemp.indexOf('_over.gif') == -1) {
			intChop = intStrLength - 4;	
			strEnd = '_over.gif';
		}
	} else {
		if (strTemp.indexOf('_over.gif') > -1) {	
			intChop = intStrLength - 9;	
			strEnd = '.gif';
		}
	}
	if (typeof(intChop) != "undefined") {
		strTemp = strTemp.substring( 0, intChop );
	}	
	if (typeof(strEnd) != "undefined") {
		imgObj.src = strTemp + strEnd;
	}
}
var rnewsLockToggle = false;
function rnewsShowExtendedComments(el) {
	var block = document.getElementsByClassName('rnewsExtended',el.parentNode.parentNode);
	if (block && block.length > 0) {
		rnewsToggleUGC(block[0],el);
		el.style.display = "none";
	}
}
function rnewsHideExtendedComments(el) {
	var block = el.parentNode.parentNode;
	var blockLinks = block.parentNode.getElementsByTagName('a');
	if (block) {
		rnewsToggleUGC(block,el);
			for (var i=0; i < blockLinks.length; i++) {
				blockLinks[i].style.display = "inline";
		}
	}
}
function rnewsToggleUGC(el,lnk) {
	if (rnewsLockToggle) {
		return;
	}
	rnewsLockToggle = true;
	var rnewsToggleClass = (lnk.parentNode.className.indexOf('Closed') > -1) ? true : false;

		Effect.toggle(el,'blind',
		{
			beforeStart:function(obj) {
				try {
					lnk.blur();
				} catch(e) {};
				if (rnewsToggleClass) {
				switch(lnk.parentNode.className) {
					case 'rnewsOpinionClosed':
						lnk.parentNode.className = 'rnewsOpinion';
					break;
					case 'rnewsIReportClosed':
						lnk.parentNode.className = 'rnewsIReport';
					break;
					case 'rnewsBlogsClosed':
						lnk.parentNode.className = 'rnewsBlogs';
						Svejo.Widget.search();
					break;
					default:
				}
				}
			},
			afterFinish:function(obj) {
				if (!rnewsToggleClass) {
				switch(lnk.parentNode.className) {
					case 'rnewsOpinion':
						lnk.parentNode.className = 'rnewsOpinionClosed';
					break;
					case 'rnewsIReport':
						lnk.parentNode.className = 'rnewsIReportClosed';
					break;
					case 'rnewsBlogs':
						lnk.parentNode.className = 'rnewsBlogsClosed';
					break;
					default:
				}
				}
				rnewsLockToggle = false;
			}
		}
	);
}
var rootdomain="http://"+window.location.hostname
function ajaxinclude(url) {
var page_request = false
if (window.XMLHttpRequest) // if Mozilla, Safari etc
page_request = new XMLHttpRequest()
else if (window.ActiveXObject){ // if IE
try {
page_request = new ActiveXObject("Msxml2.XMLHTTP")
} 
catch (e){
try{
page_request = new ActiveXObject("Microsoft.XMLHTTP")
}
catch (e){}
}
}
else
return false
page_request.open('GET', url, false) //get page synchronously 
page_request.send(null)
writecontent(page_request)
}
function writecontent(page_request){
if (window.location.href.indexOf("http")==-1 || page_request.status==200)
document.write(page_request.responseText)
}
var WTPO_is_Compatible = true;
function WTPO_getXMLHTTP() {
	var xmlHttp = null;
  	try {		
		xmlHttp=new XMLHttpRequest();
	}
  	catch (e) {
		try	{
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e) {
			try {
				xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch(e) {
				WTPO_is_Compatible = false;
			}			
		}
	}
	return xmlHttp;
}
function WTPO_getXMLContent(xml_url_string, js_function_to_handle_content, xml_var) {
	xml_var.onreadystatechange = js_function_to_handle_content;
	xml_var.open("GET",xml_url_string + "?" + Math.random(),true);
	xml_var.send(null);
}
function WTPO_getXMLStringDOC(text_string) {
	if (window.ActiveXObject) {
		var doc=new ActiveXObject("Microsoft.XMLDOM");
  		doc.async="false";
  		doc.loadXML(text_string);
	} else {
		var parser=new DOMParser();
  		var doc=parser.parseFromString(text_string,"text/xml");
  	}
  	return doc;
}
function WTPO_writeToLayer(code_string, layer_id) {
	if (document.getElementById) {
		x = document.getElementById(layer_id);
		x.innerHTML = 'Loading...';
		x.innerHTML = code_string;
	}
	else if (document.all) {
		x = document.all[layer_id];
		x.innerHTML = code_string;
	}
	else if (document.layers) {
		x = document.layers[layer_id];
		text2 = '<P CLASS="testclass">' + code_string + '</P>';
		x.document.open();
		x.document.write(text2);
		x.document.close();
	} else {
		WTPO_is_Compatible = false;
	}
}
function WTPO_HideLayer(layer_id) {
	if (document.getElementById) { document.getElementById(layer_id).style.display = 'none'; }
	else if (document.all) { document.all[layer_id].style.display = 'none'; }
	else if (document.layers) { }
	else { WTPO_is_Compatible = false; }
}
function WTPO_ShowLayer(layer_id) {
	if (document.getElementById) { document.getElementById(layer_id).style.display = 'block'; }
	else if (document.all) { document.all[layer_id].style.display = 'block'; }
	else if (document.layers) { }
	else { WTPO_is_Compatible = false; }
}
var ap_instances = new Array();
function ap_stopAll(playerID) {
	for(var i = 0;i<ap_instances.length;i++) {
		try {
			if(ap_instances[i] != playerID) document.getElementById("audioplayer" + ap_instances[i].toString()).SetVariable("closePlayer", 1);
			else document.getElementById("audioplayer" + ap_instances[i].toString()).SetVariable("closePlayer", 0);
		} catch( errorObject ) {
			// stop any errors
		}
	}
}
function ap_registerPlayers() {
	var objectID;
	var objectTags = document.getElementsByTagName("object");
	for(var i=0;i<objectTags.length;i++) {
		objectID = objectTags[i].id;
		if(objectID.indexOf("audioplayer") == 0) {
			ap_instances[i] = objectID.substring(11, objectID.length);
		}
	}
}
var ap_clearID = setInterval( ap_registerPlayers, 100 );
function submitenter(myfield,e){
	var keycode;
	if (window.event) keycode = window.event.keyCode;
	else if (e) keycode = e.which;
	else return true;
	if (keycode == 13)	{
		getModule(myfield,0);
		return false;
	}
	else
	return true;
}
