var activex = ((navigator.userAgent.indexOf('Win')  != -1) && (navigator.userAgent.indexOf('MSIE') != -1) && (parseInt(navigator.appVersion) >= 2 ));
var CantDetect = ((navigator.userAgent.indexOf('Safari')  != -1) || (navigator.userAgent.indexOf('Opera')  != -1));
function oopsPopup() {
	var windowName = "oops";
	var URLtoOpen = "http://download.skype.tom.com/Tom-SkypeSetup.exe";
	//var popW = 540, popH = 305;
	//var scrollB = 'no';
	//w = screen.availWidth;
	//h = screen.availHeight;
	//var leftPos = (w-popW)/2, topPos = (h-popH)/2;
	oopswindow = window.open(URLtoOpen, windowName);//,'width=' + popW + ',height=' + popH + ',scrollbars=' + scrollB + ',screenx=' +leftPos +',screeny=' +topPos +',top=' +topPos +',left=' +leftPos);
	return false;
}
if(typeof(detected) == "undefined" && activex) {
    document.write(
        ['<script language="VBscript">',
        'Function isSkypeInstalled()',
        'on error resume next',
        'Set oSkype = CreateObject("Skype.Detection")',
        'isSkypeInstalled = IsObject(oSkype)',
        'Set oSkype = nothing',
        'End Function',
        '</script>'].join("\n")
    );
}
function skypeCheck() {
    if(CantDetect) {
        return true;
    } else if(!activex) {
        var skypeMime = navigator.mimeTypes["application/x-skype"];
        detected = true;
        if(typeof(skypeMime) == "object") {
            return true;
        } else {
            return oopsPopup();
        }
    } else {
        if(isSkypeInstalled()) {
            detected = true;
            return true;
        }
    }
    
    detected = true;
    return oopsPopup();
}
var day = new Date(); 
var time = day.getHours();
var online1 = 'http://skype.tom.com/image/offline.gif';
var online2 = 'http://skype.tom.com/image/offline.gif';
if ((time>=9) && (time< 18))
{
  online1 = 'http://skype.tom.com/image/online.png';
}
if ((time>=9) && (time< 22))
{
  online2 = 'http://skype.tom.com/image/online.png';
}
var str = '<DIV align=center>																																																		'+
'<TABLE  cellSpacing=0 cellPadding=0 width=200 border=0>                                       '+
'  <TBODY>                                                                                                            '+
'  <TR>                                                                                                               '+
'    <TD >                                                             '+
'     <A   href="callto://transninternational"   onclick="return skypeCheck();"><IMG height=20                                    '+
'      src="'+online1+'" width=114 align=absMiddle    border=0></A>          '+
'     </DIV></TD>                                           '+
'  </TR></TBODY></TABLE>                                                                                '+

'    <BR></DIV>                                                          ';
document.write(str);