var popwin;
function __doOpenArticle(popname, channelid, articleid)
{
	var aim = popname + "?cid="+channelid+"&id="+articleid;
	var dleft = 200,dtop = 0;
	pop = open(aim,"OpenDetail","height=600,width=600,status=no,toolbar=no,menubar=no,location=no,resizable=no,directories=no,top="+dtop+",left="+dleft+"","");
	pop.focus();
}
function __doOpenVote(aim)
{
	var dleft = 200,dtop = 0;
	pop = open(aim,"OpenDetail","height=620,width=600,status=no,toolbar=no,menubar=no,location=no,resizable=no,directories=no,top="+dtop+",left="+dleft+"","");
	pop.focus();
}

function __doOpenArticle1(aim)
{
	//var aim = popname + "?cid="+channelid+"&id="+articleid;
	var dleft = 200,dtop = 0;
	pop = open(aim,"OpenDetail","height=620,width=600,status=no,toolbar=no,menubar=no,location=no,resizable=no,directories=no,top="+dtop+",left="+dleft+"","");
	pop.focus();
}
function __doOpenArticle2(aim)
{
	//var aim = popname + "?cid="+channelid+"&id="+articleid;
	var dleft = 200,dtop = 0;
	pop = open(aim,"OpenDetail","height=620,width=620,status=yes,toolbar=no,menubar=no,location=no,resizable=yes,directories=no,scrollbars=yes,top="+dtop+",left="+dleft+"","");
	pop.focus();
}
function _doOpenVote(popname, vcode)
{
	var aim = popname + "?vcode="+vcode;
	var dleft = 100,dtop = 0;
	pop = open(aim,"OpenDetail","height=560,width=600,status=no,toolbar=no,menubar=no,location=no,resizable=no,directories=no,top="+dtop+",left="+dleft+"","");
	pop.focus();
}

function MM_openBrWindow(theURL,winName,features) 
{
	var w=618;
	var h=536;
	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0; 
	TopPosition = (screen.height) ? (screen.height-h)/2 : 0; 
  if (features=="")
  {
	  features = 'menubar=no,scrollbars=no,resizable=yes,top='+TopPosition+',left='+LeftPosition+',width='+w+',height='+h;
  } 
 return window.open(theURL,winName,features);
  
}

function __doOpenMap(arg1,arg2){	
	if(window.parent.pop == null){
		window.parent.pop = open("/SpeedMap/SpeedMap.aspx?drawmode="+arg1+"&searchdata="+arg2,"BianJi","height=768,width=1024,status=no,toolbar=no,menubar=no,location=no,resizable=no,directories=no,top=0,left=0",true);
	}else{
		window.parent.pop.document.SpeedMap.SetVariable("_root.drawmode",arg1);
		window.parent.pop.document.SpeedMap.SetVariable("_root.searchdata",arg2);
		window.parent.pop.document.SpeedMap.GotoFrame(3);
		
	}
	window.parent.pop.focus();
}

function _doOpenMap(strmap)
{
	
	if (popwin!=null&&!popwin.closed&&popwin.open)
	{
		popwin.focus();
        popwin.document.SpeedMap.SetVariable('_root.searchdata',strmap);
        popwin.document.SpeedMap.GotoFrame(3);                                      	                                    	
    }
	else
	{
        popwin=MM_openBrWindow('/speedmap/speedmap.aspx?drawmode=0&searchdata='+strmap,'popwin','');
        popwin.focus();
    }
   // return false;
}

function _doOpenMap2(strtown)
{
	var aim = "pop_map.aspx?town="+strtown;
	var dleft = 100,dtop = 0;
	pop = open(aim,"OpenDetail","height=560,width=600,status=no,toolbar=no,menubar=no,location=no,resizable=no,directories=no,top="+dtop+",left="+dleft+"","");
	pop.focus();
}

function showallcount(c){
	document.all("realcount").innerHTML = "&nbsp;"+c+"&nbsp;";	
}

function ReplaceDemo(con,n){
if(n>1){ 
		var re = /<font(.+)size=("\d+"|\d+)/ig;
		document.all(con).innerHTML=document.all(con).innerHTML.replace(re,function($0,$1,$2){return "<font style='line-height:150%' size="+($2*n).toString();}); 
		//document.all(con).innerHTML=document.all(con).innerHTML.replace(/font(.+)size=("\d+"|\d+)/ig,function($0,$1,$2){alert($2);return "font style='line-height:150%' size="+(parseInt($0.substr(10))*n).toString();});                   // 返回替换后的字符串。
	}
}
function __doOpenMapDetail(aim){
	
	var dleft = 100,dtop = 0;
	pop = open(aim,"OpenDetail","height=550,width=550,status=no,toolbar=no,menubar=no,location=no,resizable=no,directories=no,top="+dtop+",left="+dleft+"","");
	pop.focus();
}

function ShowSubMenu(eventTarget)
{
	HideAllMenu();
	var mn = eventTarget.parentElement.parentElement.parentElement.children(1).children(0).children(0);
	mn.style.display = "";	
}
function HideSubMenu(eventTarget)
{
	HideAllMenu();
	var mn = eventTarget.parentElement.parentElement.parentElement.children(1).children(0).children(0);
	mn.style.display = "none";	
}
function ShowMeMenu(eventTarget)
{
	HideAllMenu();
	var mn = eventTarget;
	mn.style.display = "";	
}
function HideMeMenu(eventTarget)
{
	HideAllMenu();
	var mn = eventTarget;
	mn.style.display = "none";	
}
function HideAllMenu(){
	var items = window.document.all.tags("div");
	for (i=0; i<items.length; i++)
	{
		if(items[i].className == "imenu")
		{
			items[i].style.display = "none";		
		}
	}

}
function ZooMimg(o)
{
	var zoom=parseInt(o.style.zoom, 10)||100;zoom+=event.wheelDelta/12;if (zoom>0) o.style.zoom=zoom+'%';
	return false;
}
function InitImg(o)
{
	if(o.width>500){o.resized=true;o.style.width=500;}
	return false;
}
function CreateControl(DivID, ObjectID, URL, WIDTH, HEIGHT, BGCOLOR)//创建flash
{
  var d = document.getElementById(DivID);
  d.innerHTML = '<object id="'+ObjectID+'" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="swflash.cab#version=9.0.28.0" '+
				'width="'+WIDTH+'" height="'+HEIGHT+'" VIEWASTEXT>'+
				'<param name="movie" value="'+URL+'" /><param name="quality" value="high" /><param name="allowScriptAccess" value="sameDomain" />'+
				'<PARAM NAME="wmode" VALUE="opaque"><param name="loop" value="false" /><param name="menu" value="false">'+
				'<embed src="'+URL+'" quality="high" loop="false" width="'+WIDTH+'" height="'+HEIGHT+'" name="'+ObjectID+'" align="" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>';			
}
function CreateDateControl(DivID, ObjectID)//显示日历Flash
{
  var d = document.getElementById(DivID);
	  d.innerHTML = '<object id="'+ObjectID+'" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="images/swflash.cab#version=8,0,22,0" '+
				'width="207" height="215" style="position:absolute;Z-INDEX:1;" VIEWASTEXT>'+
				'<param name="movie" value="images/ChoseDate.swf" /><param name="quality" value="high" /><param name="allowScriptAccess" value="sameDomain" />'+
				'<param name="loop" value="false" /><param name="menu" value="false"><param name="wmode" value="transparent" />'+
				'<embed src="images/ChoseDate.swf" quality="high" loop="false" width="207" height="215" name="'+ObjectID+'" align="" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>';			

}
function closeChoseDate() {//关闭日历
	for(i = 0; i < document.all.length; i++){
		if(document.all(i).tagName == "OBJECT" && document.all(i).classid == "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"){
			document.all(i).GotoFrame(2);
		}
	}
}

function __doOpenWindows(aim){		
	window.open(aim,"","height=260,width=400,status=no,toolbar=no,menubar=no,scrollbars=yes,location=no,resizable=no,directories=no,top=270,left=330","");
	
}

function __doOpenWin(url,wd,ht){
	var pop = open(url,"","width="+wd+",height="+ht+",status=no,toolbar=no,menubar=no,location=no,resizable=no,directories=no,top=220,left=390");
	pop.focus();
}
