function vdemo(id,w,h) {
   //popup('/Content.sa?w='+w+'&h='+h+'&demo='+id,'DEMO',w,h,'STATUS=NO,SCROLLBARS=NO',true);
   //alert('test');
   golink('/Content.sa?w='+w+'&h='+h+'&demo='+id);
}
function setImg(id,src) {
   var ele = document.getElementById(id);
   if(!ele) { return; }
   if(src.indexOf('.') < 0) { src = src + '.gif';   }
   if(src.indexOf('/') < 0) { src = '/images/'+src; }
   ele.src = src;
}
function popup(url,name,w,h,opt,center) {
   if(inGoLink) { return; } inGoLink = 1;
   if(!w && !h && !opt && !center) {
      win = window.open(url);
   } else {
      if(center) {
         var l = (screen.width/2)-(w/2);
         var t = (screen.height/2)-(h/2);
         opt = opt + ',LEFT='+l+',TOP='+t;
      }
      win = window.open(url,name,'WIDTH='+w+',HEIGHT='+h+','+opt);
   }
   window.setTimeout('inGoLink=false;',20);
   return win;
}
inGoLink = 0;
function golink(url,frame) {
   if(inGoLink) { return; } inGoLink = 1;
   if(frame) {
      eval('document.'+frame).location = url;
   } else {
      document.location = url;
   }
   window.setTimeout('inGoLink=false;',20);
}
