var activex = ((navigator.userAgent.indexOf('Win')  != -1) && (navigator.userAgent.indexOf('MSIE') != -1) && (parseInt(navigator.appVersion) >= 4 ));
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 str = '<DIV align=center>																																																		'+
'<TABLE cellSpacing=0 cellPadding=0 width=92 border=0>                                       '+
'  <TBODY>                                                                                                            '+
'  <TR>                                                                                                               '+
'    <TD align="center">&nbsp;</TD></TR>'+
'  <TR>                                                                                                               '+
'    <TD align="left">&nbsp;&nbsp;&nbsp;<img src="images/qqonline.gif"></td><td>                                                            '+
'     <A class=greylink  href="skype:OPCSUN?chat" title="Call Customer Service!" onclick="return skypeCheck();">ENGLISH</A><!--<br /><A           '+
'      href="callto://OPCSUN" onclick="return skypeCheck();"><IMG height=20                                    '+
'      src="http://mystatus.skype.com/smallclassic/OPCSUN" width=100 align=absMiddle border=0 alt="Call Customer Service!"></A>-->'+
'  </TD></TR>'+
'  <TR>'+
'    <TD align="center">&nbsp;</TD></TR>'+
'  <TR>'+
'    <TD align="left">&nbsp;&nbsp;&nbsp;<img src="images/qqonline.gif"></td><td>                                                          '+
'     <A class=greylink  href="skype:ccy-1212?chat" title="Call Customer Service!" onclick="return skypeCheck();">Japnese 1</A><!--<br /><A           '+
'      href="callto://skype:ccy-1212" onclick="return skypeCheck();"><IMG height=20                                    '+
'      src="http://mystatus.skype.com/smallclassic/skype:ccy-1212" width=100 align=absMiddle border=0 alt="Call Customer Service!"></A>-->'+
'  </TD></TR>'+
'  <TR>'+
'    <TD align="center">&nbsp;</TD></TR>'+
'  <TR>'+
'    <TD align="left">&nbsp;&nbsp;&nbsp;<img src="images/qqonline.gif"></td><td>                                                          '+
'     <A class=greylink  href="skype:johnniesun?chat" title="Call Customer Service!" onclick="return skypeCheck();">Japnese 2</A><!--<br /><A           '+
'      href="callto://skype:johnniesun" onclick="return skypeCheck();"><IMG height=20                                    '+
'      src="http://mystatus.skype.com/smallclassic/skype:johnniesun" width=100 align=absMiddle border=0 alt="Call Customer Service!"></A>-->'+
'  </TD></TR>'+
'</TBODY></TABLE></DIV>                                                          ';

document.write(str);