function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
/***********************************************
* Floating Top Bar script- © Dynamic Drive (www.dynamicdrive.com)
* Sliding routine by Roy Whittle (http://www.javascript-fx.com/)
* This notice must stay intact for legal use.
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/
/***********************************************
* Floating Top Bar script- Â© Dynamic Drive (www.dynamicdrive.com)
* Sliding routine by Roy Whittle (http://www.javascript-fx.com/)
* This notice must stay intact for legal use.
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

var persistclose=0 //set to 0 or 1. 1 means once the bar is manually closed, it will remain closed for browser session
var startX =   iecompattest().clientWidth-155 //set x offset of bar in pixels
var startY = 5 //set y offset of bar in pixels
var verticalpos="fromtop" //enter "fromtop" or "frombottom"

function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function get_cookie(Name) {
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) {
offset += search.length
end = document.cookie.indexOf(";", offset);
if (end == -1) end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}

function closebar(){
if (persistclose)
document.cookie="remainclosed=1"
document.getElementById("topbar").style.visibility = "hidden"
}
function ShowPollArchive(){

window.open("pollingArchive.aspx",null,"height=550,width=450,scrollbars=yes,resizable=yes")
}
function staticbar(){
	staticbar2();
	barheight=document.getElementById("topbar").offsetHeight
	var ns = (navigator.appName.indexOf("Netscape") != -1) || window.opera;
	var d = document;
	function ml(id){
		var el=d.getElementById(id);
		if (!persistclose || persistclose && get_cookie("remainclosed")=="")
		el.style.visibility="visible"
		if(d.layers)el.style=el;
		el.sP=function(x,y){this.style.left=(iecompattest().clientWidth-155)+"px";this.style.top=y+"px";};
		el.x =  startX;
		if (verticalpos=="fromtop")
		el.y = startY;
		else{
		el.y = ns ? pageYOffset + innerHeight : iecompattest().scrollTop + iecompattest().clientHeight;
		el.y -= startY;
		}
		return el;
	}
	window.stayTopLeft=function(){		
		if (verticalpos=="fromtop"){
		var pY = ns ? pageYOffset : iecompattest().scrollTop;
		ftlObj.y += (pY + startY - ftlObj.y)/8;
		}
		else{
		var pY = ns ? pageYOffset + innerHeight - barheight: iecompattest().scrollTop + iecompattest().clientHeight - barheight;
		ftlObj.y += (pY - startY - ftlObj.y)/8;
		}
		ftlObj.sP(ftlObj.x, ftlObj.y);
		setTimeout("stayTopLeft()", 10);
	}
	ftlObj = ml("topbar");
	stayTopLeft();
}

/***********************************************
* Floating Top Bar script- Â© Dynamic Drive (www.dynamicdrive.com)
* Sliding routine by Roy Whittle (http://www.javascript-fx.com/)
* This notice must stay intact for legal use.
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

var persistclose2=0 //set to 0 or 1. 1 means once the bar is manually closed, it will remain closed for browser session
var startX2 = 5 //set x offset of bar in pixels
var startY2 = 5 //set y offset of bar in pixels
var verticalpos2="fromtop" //enter "fromtop" or "frombottom"

function iecompattest2(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function get_cookie2(Name) {
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) {
offset += search.length
end = document.cookie.indexOf(";", offset);
if (end == -1) end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}

function closebar2(){
if (persistclose2)
document.cookie="remainclosed2=1"
document.getElementById("topbar2").style.visibility = "hidden"
}
function ShowPollArchive2(){

window.open("pollingArchive.aspx",null,"height=550,width=450,scrollbars=yes,resizable=yes")
}
function staticbar2(){
	
	barheight=document.getElementById("topbar2").offsetHeight
	var ns = (navigator.appName.indexOf("Netscape") != -1) || window.opera;
	var d = document;
	function ml2(id){
		var el=d.getElementById(id);
		if (!persistclose2 || persistclose2 && get_cookie("remainclosed2")=="")
		el.style.visibility="visible"
		if(d.layers)el.style=el;
		el.sP=function(x,y){this.style.left=x+"px";this.style.top=y+"px";};		
		el.x =  startX2;
		if (verticalpos2=="fromtop")
		el.y = startY2;
		else{
		el.y = ns ? pageYOffset + innerHeight : iecompattest().scrollTop + iecompattest().clientHeight;
		el.y -= startY2;
		}
		return el;
	}
	window.stayTopLeft2=function(){		
		if (verticalpos2=="fromtop"){
		var pY = ns ? pageYOffset : iecompattest().scrollTop;
		ftlObj2.y += (pY + startY2 - ftlObj2.y)/8;
		}
		else{
		var pY = ns ? pageYOffset + innerHeight - barheight: iecompattest().scrollTop + iecompattest().clientHeight - barheight;
		ftlObj2.y += (pY - startY2 - ftlObj2.y)/8;
		}
		ftlObj2.sP(ftlObj2.x, ftlObj2.y);		
		setTimeout("stayTopLeft2()", 10);
	}
	ftlObj2 = ml2("topbar2");
	
	stayTopLeft2();
}
if (window.addEventListener)
window.addEventListener("load", staticbar, false)
else if (window.attachEvent)
window.attachEvent("onload", staticbar)
else if (document.getElementById)
window.onload=staticbar



//RegistertimerId = setInterval("self.status='Loading...';", 10);


if (window.addEventListener)
window.addEventListener("load", staticbar, false)
else if (window.attachEvent)
window.attachEvent("onload", staticbar)
else if (document.getElementById)
window.onload=staticbar
function LoginPop(PageName)
{
window.open("Login.aspx?PName="+PageName,null,"height=150,width=350");

}
		function ShowRateWindow(ID)
		  {
		    var x, y;
		    x = (screen.width / 2) - 150;
		    y = (screen.height / 2) - 160;
		    window.open("vote.aspx?id=" + ID,null,"width=420px,height=550px,left=" + x + ",top=" + y + "status=no,resizable=no,location=no,scrollbars=yes");
		  }
		  
		  function SetPanelActive(PnlName)
		  {
		  if (PnlName=="TendersPnl"){
				document.getElementById("TendersPnl").style.display="block";
				document.getElementById("TendersLnk").style.color="DarkSlateGray";
				document.getElementById("NewsLnk").style.color="DarkGray";
				document.getElementById("AnalysisLnk").style.color="DarkGray";
				document.getElementById("NewsPnl").style.display="none";
				document.getElementById("AnalysisPnl").style.display="none";
				}
		  else if (PnlName=="NewsPnl"){
				document.getElementById("NewsPnl").style.display="block";
				document.getElementById("NewsLnk").style.color="DarkSlateGray";
				document.getElementById("AnalysisLnk").style.color="DarkGray";
				document.getElementById("TendersLnk").style.color="DarkGray";
				document.getElementById("TendersPnl").style.display="none";
				document.getElementById("AnalysisPnl").style.display="none";
				}
		  else if (PnlName=="AnalysisPnl"){
				document.getElementById("AnalysisPnl").style.display="block";
				document.getElementById("AnalysisLnk").style.color="DarkSlateGray";
				document.getElementById("NewsLnk").style.color="DarkGray";
				document.getElementById("TendersLnk").style.color="DarkGray";
				document.getElementById("TendersPnl").style.display="none";
				document.getElementById("NewsPnl").style.display="none";
				}
		  return false;
		  }
		  
		
//######################################################################################

var up,down;var min1,sec1,Hr1;var cHr1,cmin1,csec1,cmin2,csec2;
var dcday1,dcHr1,dcmin1,dcsec1;
var Wdcday1,WdcHr1,Wdcmin1,Wdcsec1,Wdown;
function ToPersianChar(c)
{
var c1=parseInt(c/10);
var c2=c-(c1*10);
var o1=1632+c1;
var o2=1632+c2;
return "&#" + o1 + ";" + "&#" + o2 + ";";
}
function Display(Hr,min,sec) {
var disp;
if(Hr<=9) disp=" ";//ToPersianChar(0);
else disp=" ";
disp+=ToPersianChar(Hr)+":"
if(min<=9) disp+=ToPersianChar(min)+":";
else disp+=ToPersianChar(min)+":";

if(sec<=9) disp+=ToPersianChar(sec);
else disp+=ToPersianChar(sec);
return(disp);
}
function Up(H,M,S) {
//cHr1=0;
//cmin1=0;
//csec1=0;
cHr1=(H);
cmin1=(M);
csec1=(S);
UpRepeat();
}
function UpRepeat() {

csec1++;
if(csec1==60) {
csec1=0; cmin1++;
}
if (cmin1==60){
cmin1=0;csec1=0;cHr1++;
}
if (cHr1==24){
cHr1=0;cmin1=0;csec1=0;
}
document.getElementById('countbox').innerHTML=Display(cHr1,cmin1,csec1);
up=setTimeout("UpRepeat()",1000);
}
