<!-- BEGIN #

function CheckUncheckAll(the_form) 
{
    for (var i=0; i < the_form.elements.length; i++) 
    {
	if (the_form.elements[i].type=="checkbox") 
	{
	    the_form.elements[i].checked = !(the_form.elements[i].checked);
	}
    }
}


function PopupSendSms(ta, tg)
{
    var pv = "PV";
    if (ta == pv)
    {
	var url = "menu.php?inc=send_sms&op=sendsmstopv&dst_p_num="+tg;
    }
    else
    {
	var url = "menu.php?inc=send_sms&op=sendsmstogr&dst_gp_code="+tg;
    }
    newwin=window.open("","WinSendSms","scrollbars","resizable=yes")
    newwin.moveTo(20,100)
    newwin.resizeTo(500,500)
    newwin.location=url	    
}

function PopupReplySms(tg, mssg)
{
    var url = "menu.php?inc=send_sms&op=sendsmstopv&dst_p_num="+tg+"&message="+mssg;

    newwin=window.open("","WinSendSms","scrollbars","resizable=yes")
    newwin.moveTo(20,100)
    newwin.resizeTo(500,500)
    newwin.location=url	    
}

function ConfirmURL(inputText, inputURL)
{ 
    if (confirm(inputText)) document.location=inputURL
}















function oc(a)
{
var o = {};
for(var i=0;i<a.length;i++)
{
o[a[i]]='';
}
return o;
}



function SmsCountKeyUp(maxChar)
{


var msg = document.forms.fm_sendsms.message;
var left = document.forms.fm_sendsms.charNumberLeftOutput;
var totalCharsCost = 0;



for(i = 0; i< msg.value.length; i++){
if(msg.value[i] in oc(['^' , '{' , '}' , '\\' , '[' , '~' , ']' , '|' , '\u20ac']))
totalCharsCost += 2;
else totalCharsCost +=1;
}



var smsLenLeft = maxChar - totalCharsCost;


if (smsLenLeft >= 0)
{
left.value = smsLenLeft;
}
else
{
var msgMaxLen = maxChar;
left.value = 0;
msg.value = msg.value.substring(0, msgMaxLen);
}
}

function SmsCountKeyDown(maxChar)
{
var msg = document.forms.fm_sendsms.message;
var left = document.forms.fm_sendsms.charNumberLeftOutput;
var totalCharsCost = 0;



for(i = 0; i< msg.value.length; i++){
if(msg.value[i] in oc(['^' , '{' , '}' , '\\' , '[' , '~' , ']' , '|' , '\u20ac']))
totalCharsCost += 2;
else totalCharsCost +=1;
}

var smsLenLeft = maxChar - totalCharsCost;
if (smsLenLeft >= 0)
{
left.value = smsLenLeft;
}
else
{
var msgMaxLen = maxChar;
left.value = 0;
msg.value = msg.value.substring(0, msgMaxLen);
}
}









function linkto(url)
{
    window.location.href = url;
}

function SureConfirm()
{
    if (confirm('Are you sure ?')) {return true;} else {return false;}
}
// END -->