﻿

//打开特定尺寸的窗口
function openWin(url,width,height)
{ 
    if(width==null)
        width=730;
    if(height==null)
        height=400;
    window.open(url,"newwindow","height="+height+",width="+width+",toolbar=no,menubar=no,scrollbars=no,resizable=no, location=no,status=no");
}

function $(obj)
{
    return document.getElementById(obj);
} 
function go(href)
{
    window.location=href;
}

function testGo(params,paraname)
{
    if($(params[paraname]).href!='')
    {
        go($(params[paraname]).href);
    }
}


function hotKey(event, parameters)
{
 
    switch(event.keyCode)
    {   
            
        case 73:
        {
           testGo(parameters,'exif');
           break;
        }
        case 66:
        {
            testGo(parameters,'back');
            break;
        }
        case 37:
        {
            testGo(parameters,'prev');
            break;
        }
        case 38:
        {
            testGo(parameters,'first');
            break;
        }
        case 39:
        {
            testGo(parameters,'next');
            break;
        }
        case 40:
        {
            testGo(parameters,'last');
            break;
        }
        case 83:
        {
            testGo(parameters,'auto');
            break;
        }
    }
}

function resize(obj)
{
    if(obj.height>100)
    {
        obj.height=100;
    }    
}

function MeetFriend(link, p)
{
  var pi = p.selectedIndex;
  var s = p.options[pi].value;
  if(s&& s>0)
  {
    var url = link + s;
    var WindowObj = window.open(url, "_blank");
    try{
      var obj = WindowObj.name;
    }catch(e){
      alert("您的浏览器不允许弹出窗口");
    }
  }
}