﻿function tot(mobnumber)
{
    return mobnumber.replace(/０/g,"0").replace(/１/g,"1").replace(/２/g,"2").replace(/３/g,"3").replace(/４/g,"4").replace(/５/g,"5").replace(/６/g,"6").replace(/７/g,"7").replace(/８/g,"8").replace(/９/g,"9").replace(/－/g,"-").replace(/ /g,"").replace(/　/g,"");
}

function FlashAD(flashsrc,flashid,flashwidth,flashheight,flashlink,target){
	var fObj = ("<table width="+flashwidth+" height="+flashheight+" border=0 cellpadding=0 cellspacing=0><tr><td>");
	fObj += ("<div style=\"position:relative\">");
	fObj += ("<embed id=\""+flashid+"\" style=\"position:absolute;z-index:0\" src="+flashsrc+" quality=\"high\" width="+flashwidth+" height="+flashheight+" TYPE=\"application/x-shockwave-flash\" PLUGINSPAGE=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\" wmode=\"opaque\"></embed>");
	fObj += ("<div style=\"background:white;filter:alpha(opacity=0);-moz-opacity:0;position: relative;z-index:10;left:0pt;top:0pt;width:"+flashwidth+"px;height:"+flashheight+"px;\">");
	fObj += ("<a href="+flashlink+" target=\""+target+"\" style=\"cursor:pointer;display:block;width:"+flashwidth+"px;height:"+flashheight+"px;\"></a>");
	fObj += ("</div></div></td></tr></table>");
	return fObj;
}


function checkByteLength(str,minlen,maxlen) 
{
    var l = str.length;
    var blen = 0;
    for(i=0; i<l; i++) 
        if ((str.charCodeAt(i) & 0xff00) != 0) 
            blen +=2;
        else
            blen +=1;
    if (blen > maxlen || blen < minlen) return false;
    return true;
}

function ChangeGetCode(imgID)
{
    var obj = typeof(imgID) == 'string' ? $(imgID) : imgID;
    obj.src = (obj.src.split('&')[0] + '&' + Math.random());
}