﻿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 FlashObj(PlayerServer, FlashID, FlashVarsValues, swf_width, swf_height)
{
	var fObj = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" '
	+ 'codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" '
	+ 'width="'+swf_width+'" height="'+swf_height+'" id="'+FlashID+'">'
	+ '<param name="allowScriptAccess" value="sameDomain" /><param name="wmode" value="transparent" />'
	+ '<param name="movie" value="'+PlayerServer+'" />'
	+ '<param name="quality" value="high" /><param name="wmode" value="transparent"><param name="allowFullScreen" value="true" />'
	+ '<param name="FlashVars" value="'+FlashVarsValues+'" />'
	+ '<embed src="'+PlayerServer+'" allowFullScreen="true" wmode="transparent" FlashVars="'+FlashVarsValues+'" '
	+ 'quality="high" width="'+swf_width+'" height="'+swf_height+'" name="'+FlashID+'" align="middle" allowScriptAccess="sameDomain" '
	+ 'type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>';
	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());
}