function openNewUrl(id,name,url){ 
parent.PW.Dialog({ 
				'id': id, 
				'name': name, 
				'url': url 
			}).loadIframe(url); 
}
function fixpic2(Obj)
{var thisvalue=0;
//argument[0]-Obj,[1]-width,[2]-height;
var Objwidth=Objheight=70;
var ObjOrgwidth=Obj.width,ObjOrgheight=Obj.height;
if(arguments.length>1){Objwidth=arguments[1];}
if(arguments.length>2){Objheight=arguments[2];}
var wscale=ObjOrgwidth/Objwidth;
var hscale=ObjOrgheight/Objheight;
	if(wscale>1){
		if(wscale>hscale){Obj.style.width=Objwidth.toString()+'px';Obj.style.height=parseInt(ObjOrgheight/wscale).toString()+'px';}
		else{Obj.style.height=Objheight.toString()+'px';Obj.style.width=parseInt(ObjOrgwidth/hscale).toString()+'px';}
	}
	else{
		if(hscale>1){
			if(hscale>wscale){Obj.style.height=Objheight.toString()+'px';Obj.style.width=parseInt(ObjOrgwidth/hscale).toString()+'px';}
			else{Obj.style.width=Objwidth.toString()+'px';Obj.style.height=parseInt(ObjOrgheight/wscale).toString()+'px';}
		}
	}
}
var HomepageFavorite={Homepage:function(){if(document.all){document.body.style.behavior = 'url(#default#homepage)';document.body.setHomePage(window.location.href);}else if(window.sidebar){if(window.netscape){try {netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");}catch(e){alert("该操作被浏览器拒绝，如果想启用该功能，请在地址栏内输入 about:config,然后将项 signed.applets.codebase_principal_support 值该为true");history.go(-1);}}var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch);prefs.setCharPref('browser.startup.homepage', window.location.href);}},Favorite:function Favorite(sURL, sTitle) {try {window.external.addFavorite(sURL, sTitle);}catch(e){try {window.sidebar.addPanel(sTitle, sURL, "");}catch (e) {alert("加入收藏失败,请手动添加.");}}}}
function toDesktop(sUrl,sName){try{var WshShell = new ActiveXObject("WScript.Shell");var oUrlLink = WshShell.CreateShortcut(WshShell.SpecialFolders("Desktop") + "\\" + sName + ".url"); oUrlLink.TargetPath = sUrl;oUrlLink.Save(); }catch(e){alert("当前IE安全级别不允许操作！");}} 
(function (bool) {
    var html;
    if (bool) {
        html = window.HTMLElement.prototype;
        window.__defineGetter__("event", function () {
            var o = arguments.callee;
            do {if (o.arguments[0] instanceof Event) return o.arguments[0];            
            } while (o = o.caller);
            return null;
        });
        Event.prototype.__defineGetter__("fromElement", function () {
            return this.relatedTarget;
        });
        html.contains = function (o) {
            do {if (o == this) return true;} while (o = o.parentNode);
            return false;
        };
}})(/Firefox/.test(window.navigator.userAgent));

//$('#Currencies').click(function(){$('#Currenciessub').toggle("slow");});
function showover(obj1,obj2,ClassName){
$("#"+obj1).mouseover(function(){$("#"+obj1).attr("className",ClassName+"o");$("#"+obj2).show();});
$("#"+obj1).mouseout(function(){
	var e = window.event;
   if(!this.contains(e.toElement || e.fromElement)){$("#"+obj1).attr("className",ClassName);$("#"+obj2).hide();}
   });
}



function CheckAll(form){
	var ifcheck = null;
	for (var i=0;i<form.elements.length-5;i++){
		var e = form.elements[i];
		if(e.type=='checkbox'){
			if (ifcheck === null) ifcheck = !e.checked;
			e.checked = ifcheck;
			if (typeof e.onclick == 'function') e.onclick();
		}
	}
	return ifcheck;
}
function show_okx(vi){for(i=1;i<vi;i++){if($("#hidden_"+i).css("display")=="none"){$("#hidden_"+i).css("display","block");}else{$("#hidden_"+i).css("display","none");}}}
function show_okxd(vi){if($("#hidden_"+vi).css("display")=="none"){$("#hidden_"+vi).css("display","block");}else{$("#hidden_"+vi).css("display","none");}}
function openwin(w,h,l,t,titlestr,cont_url)
{
    g_pop=new Popup({ contentType:1,isReloadOnClose:false,width:w,height:h,left:l,top:t});
    g_pop.setContent("title",titlestr);
    g_pop.setContent("contentUrl",cont_url);
    g_pop.build();
    g_pop.show();
    void(0);
}

