function IsNumeric(sText)
{
var ValidChars = "0123456789";
var IsNumber=true;
var Char;
if(sText != '') {
for (i = 0; i < sText.length && IsNumber == true; i++)
{
Char = sText.charAt(i);
if (ValidChars.indexOf(Char) == -1)
{
error = true;
}
else {
error = false;
}
}
if(error) { alert('Въведеният от Вас номер е невалиден!'); return true; }
}
}
function GoPay(id) {
document.forms['pay'+id].submit();
}
function showhide(divid) {
if(document.getElementById(''+divid+'').style.display == '') {
document.getElementById(''+divid+'').style.display = 'none';
} else {
document.getElementById(''+divid+'').style.display = ''
}
}
function show2hide(show,hide) {
if(document.getElementById(''+show+'').style.display == '') {
document.getElementById(''+show+'').style.display = 'none';
document.getElementById(''+hide+'').style.display = '';
} else {
document.getElementById(''+hide+'').style.display = 'none';
document.getElementById(''+show+'').style.display = '';
}
}
function validate_form(frm) {
var chk = document.forms[frm];
if(frm == 'regform') {
if(chk.num.value == '') {
chk.num.focus();
alert('Празно поле!');
return false;
}
else if(!chk.email.value.match(/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/)){
chk.email.focus();
alert('Моля въведете валиден E-Mail адрес!');
return false;
}
else {
return true;
}
}
else if (frm == 'lost_password') {
if(!chk.email.value.match(/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/)){
chk.email.focus();
alert('Моля въведете валиден E-Mail адрес!');
return false;
}
}
else if (frm == 'password_change') {
if(chk.cur_password.value == '') {
chk.cur_password.focus();
alert('Празно поле!');
return false;
}
else if(chk.password.value == '') {
chk.password.focus();
alert('Празно поле!');
return false;
}
else if(chk.passwordagain.value == '') {
chk.passwordagain.focus();
alert('Празно поле!');
return false;
}
else {
return true;
}
}
else if (frm == 'contactform') {
if(chk.name.value == '') {
chk.name.focus();
alert('Празно поле!');
return false;
}
else if(!chk.email.value.match(/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/)){
chk.email.focus();
alert('Моля въведете валиден E-Mail адрес!');
return false;
}
else if(chk.phone.value == '') {
chk.phone.focus();
alert('Празно поле!');
return false;
}
else if(chk.comments.value == '') {
chk.comments.focus();
alert('Празно поле!');
return false;
}
else {
return true;
}
}
else if (frm == 'settings') {
if(chk.gender.value == '') {
chk.gender.focus();
alert('Празно поле!');
return false;
}
else if(chk.first_name.value == '') {
chk.first_name.focus();
alert('Празно поле!');
return false;
}
else if(chk.last_name.value == '') {
chk.last_name.focus();
alert('Празно поле!');
return false;
}
else if(chk.country.value == '') {
chk.country.focus();
alert('Празно поле!');
return false;
}
else if(chk.city.value == '') {
chk.city.focus();
alert('Празно поле!');
return false;
}
else if(chk.address.value == '') {
chk.address.focus();
alert('Празно поле!');
return false;
}
else if(chk.phone.value == '') {
chk.phone.focus();
alert('Празно поле!');
return false;
}
else {
return true;
}
}
else if (frm == 'phonebook') {
if(chk.num.value == '') {
chk.num.focus();
alert('Празно поле!');
return false;
}
else if(chk.description.value == '') {
chk.description.focus();
alert('Празно поле!');
return false;
}
else {
return true;
}
}
else if (frm == 'checkform') {
if(chk.num.value == '') {
chk.num.focus();
alert('Празно поле!');
return false;
}
else if(chk.dest.value == '') {
chk.dest.focus();
alert('Празно поле!');
return false;
}
else {
return true;
}
}
else if (frm == 'make_call') {
if(chk.calling_number.value == '') {
chk.calling_number.focus();
alert('Празно поле!');
return false;
}
}
else if (frm == 'loginform' || frm == 'memberslogin') {
if(!chk.username.value.match(/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/)){
chk.username.focus();
alert('Моля въведете валиден E-Mail адрес!');
return false;
}
else if(chk.password.value == '') {
chk.password.focus();
alert('Празно поле!');
return false;
}
else {
return true;
}
}
}
/*
+-------------------------------------------------------------------+
| J S - T O O L T I P (v1.3) |
| |
| Copyright Gerd Tentler www.gerd-tentler.de/tools |
| Created: Feb. 15, 2005 Last modified: Dec. 16, 2005 |
+-------------------------------------------------------------------+
| This program may be used and hosted free of charge by anyone for |
| personal purpose as long as this copyright notice remains intact. |
| |
| Obtain permission before selling the code for this program or |
| hosting this software on a commercial website or redistributing |
| this software over the Internet or in any other medium. In all |
| cases copyright must remain intact. |
+-------------------------------------------------------------------+
======================================================================================================
This script was tested with the following systems and browsers:
- Windows XP: IE 6, NN 4, NN 7, Opera 7, Firefox 1
- Mac OS X: IE 5, Safari 1
If you use another browser or system, this script may not work for you - sorry.
------------------------------------------------------------------------------------------------------
USAGE:
Use the toolTip-function with mouse-over and mouse-out events (see example below).
- To show a tooltip, use this syntax: toolTip(text, width in pixels, opacity in percent)
Note: width and opacity are optional
- To hide a tooltip, use this syntax: toolTip()
------------------------------------------------------------------------------------------------------
EXAMPLE:
some text here
======================================================================================================
*/
var OP = (navigator.userAgent.indexOf('Opera') != -1) ? true : false;
var IE = (navigator.userAgent.indexOf('MSIE') != -1 && !OP) ? true : false;
var GK = (navigator.userAgent.indexOf('Gecko') != -1) ? true : false;
var NN4 = document.layers;
var DOM = document.getElementById;
function TOOLTIP() {
//----------------------------------------------------------------------------------------------------
// Configuration
//----------------------------------------------------------------------------------------------------
this.width = 150; // width (pixels)
this.bgColor = '#FFFFC0'; // background color
this.textColor = '#A00000'; // text color
this.borderColor = '#D00000'; // border color
this.opacity = 90; // opacity (percent) - doesn't work with all browsers
this.cursorDistance = 12; // distance from cursor (pixels)
// don't change
this.text = '';
this.height = 0;
this.obj = 0;
this.sobj = 0;
this.active = false;
// -------------------------------------------------------------------------------------------------------
// Functions
// -------------------------------------------------------------------------------------------------------
this.create = function() {
if(!this.sobj) this.init();
var t = '
';
if(NN4) {
t = '';
this.sobj.document.write(t);
this.sobj.document.close();
}
else {
this.sobj.border = '1px solid ' + this.borderColor;
this.setOpacity();
if(document.getElementById) document.getElementById('ToolTip').innerHTML = t;
else document.all.ToolTip.innerHTML = t;
}
if(DOM) this.height = this.obj.offsetHeight;
else if(IE) this.height = this.sobj.pixelHeight;
else if(NN4) this.height = this.obj.clip.bottom;
this.show();
}
this.init = function() {
if(DOM) {
this.obj = document.getElementById('ToolTip');
this.sobj = this.obj.style;
}
else if(IE) {
this.obj = document.all.ToolTip;
this.sobj = this.obj.style;
}
else if(NN4) {
this.obj = document.ToolTip;
this.sobj = this.obj;
}
}
this.show = function() {
var ext = (document.layers ? '' : 'px');
var left = mouseX;
var top = mouseY;
if(left + this.width + this.cursorDistance > winX) left -= this.width + this.cursorDistance;
else left += this.cursorDistance;
if(top + this.height + this.cursorDistance > winY) top -= this.height;
else top += this.cursorDistance;
this.sobj.left = left + ext;
this.sobj.top = top + ext;
if(!this.active) {
this.sobj.visibility = 'visible';
this.active = true;
}
}
this.hide = function() {
if(this.sobj) this.sobj.visibility = 'hidden';
this.active = false;
}
this.setOpacity = function() {
this.sobj.filter = 'alpha(opacity=' + this.opacity + ')';
this.sobj.mozOpacity = '.1';
if(this.obj.filters) this.obj.filters.alpha.opacity = this.opacity;
if(!document.all && this.sobj.setProperty) this.sobj.setProperty('-moz-opacity', this.opacity / 100, '');
}
}
//----------------------------------------------------------------------------------------------------
// Build layer, get mouse coordinates and window width, create tooltip-object
//----------------------------------------------------------------------------------------------------
var tooltip = mouseX = mouseY = winX = winY = 0;
if(document.layers) {
document.write('');
document.captureEvents(Event.MOUSEMOVE);
}
else document.write('');
document.onmousemove = getMouseXY;
function getMouseXY(e) {
if(IE) {
bodyScrollTop = document.documentElement && document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop;
bodyScrollLet = document.documentElement && document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft;
mouseX = event.clientX + bodyScrollLet;//document.body.scrollLeft;
mouseY = event.clientY + bodyScrollTop;//document.body.scrollTop;
}
else {
mouseX = e.pageX;
mouseY = e.pageY;
}
if(mouseX < 0) mouseX = 0;
if(mouseY < 0) mouseY = 0;
else if(GK || NN4) {
winX = window.innerWidth - 25;
winY = window.innerHeight;
}
else if(DOM) {
winX = document.body.offsetWidth - 25;
winY = document.body.offsetHeight;
}
else {
winX = screen.width - 25;
winY = screen.height;
}
if(tooltip && tooltip.active) tooltip.show();
}
function toolTip(text, width, opacity) {
if(text) {
tooltip = new TOOLTIP();
tooltip.text = text;
if(width) tooltip.width = width;
if(opacity) tooltip.opacity = opacity;
tooltip.create();
}
else if(tooltip) tooltip.hide();
}
// http request
var xmlHttp
var divtagshow
var divtagget
function make_call(num,numtwo,wh)
{
divtagget=wh
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
{
alert ("Browser does not support HTTP Request")
return
}
var url="../mods/mod.req.php"
url=url+"?num="+num+"&num2="+numtwo
xmlHttp.onreadystatechange=stateChanged_get
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
function stateChanged_get()
{
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{
document.getElementById(divtagget).innerHTML=xmlHttp.responseText
//document.write(xmlHttp.responseText);
}
}
function GetXmlHttpObject()
{
var xmlHttp=null;
try
{
// Firefox, Opera 8.0+, Safari
xmlHttp=new XMLHttpRequest();
}
catch (e)
{
//Internet Explorer
try
{
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
}
return xmlHttp;
}