﻿// JScript File
//validURL('noteohm');
function validURL(tmUrl){
    var url = window.location.href;
    if (url.indexOf(tmUrl) != -1 ){
        document.write("<a href=javascript:tm_popup('" + tmUrl + "');><img src='/images_index/trustmark.gif' width='40' height='23' border='0' /></a>")
    }else{
        //alert('Wrong URL'); 
        //document.write("<font color='red' face='tahoma' size='2'><b>Invalid URL</b></font>");
    }
}

function tm_popup(tmUrl){
    var w=800;
    var h=600;
    if (document.all || document.layers) {
        w = screen.availWidth;h = screen.availHeight;
    }
    var popW=450, popH=520;var leftPos = (w-popW)/2, topPos = (h-popH)/2;
    miniWindow=window.open('http://www.trustmarkthai.com/register/Cert.aspx?login=' + tmUrl + '','miniWindow','toolbar=no,resizable=no,scrollbars=yes,location=yes,frameborder=no,border=no,status=no,menubar=no,width=' + popW + ',height=' + popH + ',top=' + topPos + ',left=' + leftPos);
    if (miniWindow.opener == null) miniWindow.opener = self;miniWindow.focus();
}  