// JavaScript Document

//iframe导入
/*<script type="text/JavaScript">ifr(' top.aspx','1000','130');</script>*/

 function ifr(url,w,h){document.write('<iframe id="ifr" name="ifr" width="'+w+'" height="'+h+'"border="0" frameborder="0" allowTransparency="true" scrolling="no" src="'+url+'"></iframe>');}

////--------------------------------------------------------------------------------------------------
//// png图片透底
function correctPNG() 
{
for(var i=0; i<document.images.length; i++)
{
var img = document.images[i]
var imgName = img.src.toUpperCase()
if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
{
var imgID = (img.id) ? "id='" + img.id + "' " : ""
var imgClass = (img.className) ? "class='" + img.className + "' " : ""
var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
var imgStyle = "display:inline-block;" + img.style.cssText 
if (img.align == "left") imgStyle = "float:left;" + imgStyle
if (img.align == "right") imgStyle = "float:right;" + imgStyle
if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle 
var strNewHTML = "<span "+ imgID + imgClass + imgTitle + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";" + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader" + "(src='" + img.src + "', sizingMethod='scale');\"></span>" 
img.outerHTML = strNewHTML
i = i-1
}
}
}
window.attachEvent("onload", correctPNG); 

//--------------------------------------------------------------------------------------------------
//插入flash
/*<script language='JavaScript' type='text/javascript'>LoadFlash("admin.swf","transparent",300,250)</script>*/
function LoadFlash(url,wmode,width,Height)
{ 
document.write(
  '<embed src="' + url + '" wmode=' + wmode +
  ' quality="high" pluginspage=http://www.macromedia.com/go/getflashplayer type="application/x-shockwave-flash" width="' + width + 
  '" height="' + Height + '"></embed>');   
}



//屏蔽鼠标右键


//function stop(){ 

//return false; 

//} 

//document.oncontextmenu=stop; 


function add(){
window.external.AddFavorite("http://www.caretechmed.com","Care Tech");
}


function setHome(obj){
var tmp = new Object();
tmp = obj;
tmp.style.behavior="url(#default#homepage)";
tmp.setHomePage("http://www.caretechmed.com");
}



