﻿var screen_height = window.screen.height;
var screen_width = window.screen.width;
var resizemode=2;
ht = window.parent.document.getElementsByTagName("html");

function showDialog(url,w,h)
{	ht[0].style.filter = "progid:DXImageTransform.Microsoft.BasicImage(grayscale=1)"; 
    window.showModalDialog(url,"_Child","dialogHeight:"+ h + "px; dialogWidth:"+ w + "px; edge: Raised; center:1; help:0; resizable:0; dialogHide:0;status:0;scroll:1");   
     ht[0].style.filter = ""
}
function imgresize2(o,w,h){
	 	if (resizemode==2 || o.onmousewheel){
	 	if(o.width>o.height) 
	 	     { if(o.width > w ){ o.style.width= w + 'px'} }
	    else
	         { if(o.height > h){ o.style.height= h + 'px';} }
		}
}

function UpLoadAdv(upID,upType,upWidth,upHeight,upSize,UserType,UpSavePath,ReFileTopic,ReWidth,ReHeight,ReSize,ReoFileName)
{   
    ht[0].style.filter = "progid:DXImageTransform.Microsoft.BasicImage(grayscale=1)";
    var getBackValue = window.showModalDialog("/Ccc/UpLoad.aspx?" + upID + "," + upType + "," + upWidth + "," + upHeight + "," + upSize + "," + UserType + "," + UpSavePath,"_Child","dialogHeight:340px; dialogWidth:500px; edge: Raised; center:1; help:0; resizable:0; dialogHide:0;status:0;scroll:0");
    //alert(getBackValue);
    if(typeof(getBackValue)=="undefined") 
        getBackValue   =   "";     //当返回值出现以外的时候设置返回值为空（如用户没有点返回而是直接关闭了窗口）  
    else
    {   var returnStr = getBackValue.split("||");	
        document.getElementById (upID).value = returnStr[0];
        if(ReFileTopic != 0)	document.getElementById (ReFileTopic).value = returnStr[5];
        if(ReWidth != 0)	document.getElementById (ReWidth).value = returnStr[2];
        if(ReHeight != 0)	document.getElementById (ReHeight).value = returnStr[3];
        if(ReSize != 0)	document.getElementById (ReSize).value = returnStr[1];
        if(ReoFileName != 0)	document.getElementById (ReoFileName).value = returnStr[4];
    } 
    ht[0].style.filter = ""
}

 //收藏到我的收藏夹 ('SaveType','BoardID','postid', 'posttopic')
function doSaveToMyCollection(url,topic) { window.open('aCollection.aspx?url='+ url + '&T=' + topic,'_Child','height=1,widht=1') }   

function dojumpboard(o)         //站内导航下拉框跳转函数
{  if(o!=0) 
    {   switch(o) {
            case "hellimg":
                window.location.href="/Show.aspx";
                break;
            case "2":
                window.location.href ="/Home.aspx";
                break;
            case "1":
                window.location.href="/";
                break;            
            default:
                var oi = o.substring(0,1); 
                if(oi=="0") { window.location.href="/BoardList.aspx?BoardID=" + o.substring(1);} else { window.location.href="/Board.aspx?BoardID="+o;}
        }
    }    
}

//地区选择函数
function doArea(vid) {window.location.href="/gocity.aspx" }

function imgresize(o){ if(resizemode==2 || o.onmousewheel) { if(o.width > 500 ){ o.style.width= '500px'} } }


//文字型的

//设为首页: 
//<a href=# onClick="this.style.behavior='url(#default#homepage)';this.setHomePage('http://www.baidu.com');">设为首页</a>

//加入收藏
//<span style="CURSOR: hand" onClick="window.external.addFavorite('http://www.baidu.com','百度')" >加入收藏</span>

//图片型的

//设为首页
//<a href=# onClick="this.style.behavior='url(#default#homepage)';this.setHomePage('http://www.baidu.com');"><img border="0" src="Images/About_2.gif" width="84" height="19" /></a>

//加入收藏
//<a href=#><img border="0" src="images/A_2.jpg" width="150" height="39" id="shoucang" onClick="window.external.addFavorite('http://www.baidu.com','百度')" /></a>


function AddFavorite(sURL, sTitle)
    {
        try
        { window.external.addFavorite(sURL, sTitle);}
        catch (e)
        {
            try { window.sidebar.addPanel(sTitle, sURL, ""); } 
            catch (e){  alert("加入收藏失败，请使用Ctrl+D进行添加"); }
        }
    }
    
    
function PlayMusic(o,w,h)
{   var vw = 260;
    var vh = 240;
    var vL = screen_width - vw-10;
    var vH1 = screen_height - vh - 60;  
    window.open(o,"_Child","width=" + vw + ",height=" + vh + ",left=" + vL + ",top=" + vH1  )
}
