function ip2location_status(){ return "OK"; }
function ip2location_translation(mid){
switch(mid)
{
case 1:
return "How are you?
Wish you a nice day";
break;
case 2:
return "Welcome to our website.
Don't miss out our upcoming events";
break;
default:
return "";
}
}
var text = "";
var delay = 100;
var currentChar = 1;
var destination="";
function type()
{
text = text.replace(/
/g, "\n");
if (document.getElementById)
{
var dest=document.getElementById(destination);
if (dest)
{
dest.innerHTML=text.substr(0, currentChar).replace(/\n/g, "
");
currentChar++
if (currentChar>text.length)
{
currentChar=1;
setTimeout("type()", 5000);
}
else
{
setTimeout("type()", delay);
}
}
}
}
function startTyping(textParam, delayParam, destinationParam, myheight, mywidth, imgsrc, toppad, bottompad, fontsize, lmargin, rmargin, txtcss)
{
text = textParam;
delay = delayParam;
currentChar = 1;
destination = destinationParam;
document.write("
");
if (imgsrc != "") {
document.write("
");
if (imgsrc.indexOf("paperclip") >= 0) {
brandingpic = "http://www.iplocationtools.com/images/branding.png";
brandColour = "#000000";
brandX = 35;
brandY = 8;
}
else if (imgsrc.indexOf("blue") >= 0) {
brandingpic = "http://www.iplocationtools.com/images/branding_white.png";
brandColour = "#ffffff";
brandX = 32;
brandY = 5;
}
else if (imgsrc.indexOf("tv") >= 0) {
brandingpic = "http://www.iplocationtools.com/images/branding_white.png";
brandColour = "#ffffff";
brandX = 27;
brandY = 15;
}
else if (imgsrc.indexOf("smiley") >= 0) {
brandingpic = "http://www.iplocationtools.com/images/branding.png";
brandColour = "#000000";
brandX = 5;
brandY = 5;
}
else {
brandingpic = "http://www.iplocationtools.com/images/branding.png";
brandColour = "#000000";
brandX = 8;
brandY = 8;
}
document.write("
IPLocationTools.com
");
}
document.write("
");
document.write("
");
type();
}
var frameA = 0;
var frameB = 0;
var totalFrames = 0;
var myarr;
var fadeTime = 2000;
var divOne = "";
var divTwo = "";
var elapsedTicks = 0;
var startTicks = 0;
var currTicks = 0;
var frameDelay = 33;
var displayDelay = 5000;
function startFade(mytext, myheight, mywidth, fadelength, div1name, div2name, imgsrc, toppadding, fontsize, lmargin, rmargin, txtcss) {
myarr = mytext.split("
")
totalFrames = myarr.length;
if (isNaN(parseFloat(myheight))) {
alert("Height must be a number!");
return;
}
else {
myheight = Math.abs(parseFloat(myheight));
}
if (isNaN(parseFloat(mywidth))) {
alert("Width must be a number!");
return;
}
else {
mywidth = Math.abs(parseFloat(mywidth));
}
if (!isNaN(parseFloat(fadelength))) {
fadeTime = Math.abs(parseFloat(fadelength));
}
if (!isNaN(parseFloat(toppadding))) {
toppadding = parseFloat(toppadding);
}
else {
toppading = 0;
}
if (!isNaN(parseFloat(fontsize))) {
fontsize = parseFloat(fontsize);
}
else {
fontsize = 12;
}
if (!isNaN(parseFloat(lmargin))) {
lmargin = parseFloat(lmargin);
}
else {
lmargin = 0;
}
if (!isNaN(parseFloat(rmargin))) {
rmargin = parseFloat(rmargin);
}
else {
rmargin = 0;
}
if (div1name == null || div1name == '') {
divOne = "myfadetext_1";
}
else {
divOne = div1name;
}
if (div2name == null || div2name == '') {
divTwo = "myfadetext_2";
}
else {
divTwo = div2name;
}
if (totalFrames > 1) {
document.write("");
if (imgsrc != "") {
document.write("
");
if (imgsrc.indexOf("paperclip") >= 0) {
brandingpic = "http://www.iplocationtools.com/images/branding.png";
brandColour = "#000000";
brandX = 35;
brandY = 8;
}
else if (imgsrc.indexOf("blue") >= 0) {
brandingpic = "http://www.iplocationtools.com/images/branding_white.png";
brandColour = "#ffffff";
brandX = 32;
brandY = 5;
}
else if (imgsrc.indexOf("tv") >= 0) {
brandingpic = "http://www.iplocationtools.com/images/branding_white.png";
brandColour = "#ffffff";
brandX = 27;
brandY = 15;
}
else if (imgsrc.indexOf("smiley") >= 0) {
brandingpic = "http://www.iplocationtools.com/images/branding.png";
brandColour = "#000000";
brandX = 5;
brandY = 5;
}
else {
brandingpic = "http://www.iplocationtools.com/images/branding.png";
brandColour = "#000000";
brandX = 8;
brandY = 8;
}
document.write("
IPLocationTools.com
");
}
document.write("
");
document.write("
");
document.write("
");
frameA = -1;
frameB = 0;
doFadeMesg();
}
else if (totalFrames == 1) {
document.write("" + myarr[0] + "
");
}
else {
return;
}
}
function findPos(obj) {
var curleft = curtop = 0;
if (obj.offsetParent) {
do {
curleft += obj.offsetLeft;
curtop += obj.offsetTop;
} while (obj = obj.offsetParent);
return [curleft,curtop];
}
else {
return [0, 0];
}
}
function doFadeMesg() {
if ((document.getElementById(divOne)) && (document.getElementById(divTwo))) {
frameA++;
frameB++;
if (frameA > (totalFrames - 1)) {
frameA = 0;
}
if (frameB > (totalFrames - 1)) {
frameB = 0;
}
document.getElementById(divOne).style.opacity = 1;
document.getElementById(divOne).style.filter = 'alpha(opacity = 100)';
doLoadMesg();
document.getElementById(divTwo).style.opacity = 0;
document.getElementById(divTwo).style.filter = 'alpha(opacity = 0)';
setTimeout("doFadeAnimation(1);", displayDelay);
}
}
function doLoadMesg() {
document.getElementById(divOne).innerHTML = myarr[frameA];
document.getElementById(divTwo).innerHTML = myarr[frameB];
}
function roundNumber(rnum, rlength) { // Arguments: number to round, number of decimal places
var newnumber = Math.round(rnum*Math.pow(10,rlength))/Math.pow(10,rlength);
return newnumber;
}
function doFadeAnimation(myopt) {
if (myopt == 1) {
startTicks = new Date().getTime();
currTicks = 0;
elapsedTicks = 0;
}
currTicks = new Date().getTime();
elapsedTicks = currTicks - startTicks;
op1 = 0;
op1a = 0;
op2 = 0;
op2a = 0;
var myTimeLeft = roundNumber(elapsedTicks / fadeTime, 2);
if ((document.getElementById(divOne)) && (document.getElementById(divTwo))) {
if ((document.getElementById(divOne).style.opacity > 0)) {
op1 = 1 - myTimeLeft;
if (op1 < 0) {
op1 = 0;
}
op1a = 100 - (myTimeLeft * 100);
if (op1a < 0) {
op1a = 0;
}
document.getElementById(divOne).style.opacity = op1;
document.getElementById(divOne).style.filter = 'alpha(opacity = ' + op1a + ')';
}
if ((document.getElementById(divTwo).style.opacity < 1)) {
op2 = myTimeLeft;
if (op2 > 1) {
op2 = 1;
}
op2a = myTimeLeft * 100;
if (op2a > 100) {
op2a = 100;
}
document.getElementById(divTwo).style.opacity = op2;
document.getElementById(divTwo).style.filter = 'alpha(opacity = ' + op2a + ')';
}
if ((document.getElementById(divOne).style.opacity == 0) && (document.getElementById(divTwo).style.opacity == 1)) {
doFadeMesg();
}
else {
setTimeout("doFadeAnimation(0)", frameDelay);
}
}
}
Gradient = function(i, e, t){
var o = this;
o.i = i, o.e = e, o.t = --t, o._ = 0, o.a = [];
o.fix = function(v){return v.length < 2 ? "0" + v : v;}
for(var x, j = 0; j < 3; j++)
o.a[j] = [((e >> (j << 3) & 0xff) - (x = (i >> (j << 3) & 0xff))) / t, x];
};
Gradient.prototype.getColorAt = function(a){
for(var o = this, a = a > o.t ? o.t : a < 0 ? 0 : a, s = "", i = 0; i < 3; i++)
s = o.fix((o.a[i][1] + o.a[i][0] * a >> 0).toString(16)) + s;
return s;
};
Gradient.prototype.next = function(){
var o = this;
return o.t >= o._ && o.getColorAt(o._++);
};
Gradient.prototype.reset = function(){
this._ = 0;
};
var myGradientObj;
var myGradientObj2;
var myCurrGradientObj = "";
function doGradientShift(myobjname) {
var myGradColour;
if (myCurrGradientObj == "") {
myCurrGradientObj = "myGradientObj";
}
if (document.getElementById(myobjname)) {
eval("myGradColour = " + myCurrGradientObj + ".next();");
if (myGradColour) {
document.getElementById(myobjname).style.color = "#" + myGradColour;
}
else {
if (myCurrGradientObj == "myGradientObj") {
myCurrGradientObj = "myGradientObj2";
}
else {
myCurrGradientObj = "myGradientObj";
}
eval(myCurrGradientObj + ".reset();");
}
setTimeout("doGradientShift('" + myobjname + "');", 20);
}
}
function doHexFormat(strToFormat) {
strToReturn = "";
myTestChar = "";
testa = "a".charCodeAt(0);
testz = "z".charCodeAt(0);
test0 = "0".charCodeAt(0);
test9 = "9".charCodeAt(0);
gotPrevZero = 0;
for (var x = 0; x < strToFormat.length; x++) {
myTestChar = strToFormat.charCodeAt(x);
if (gotPrevZero == 1 && myTestChar >= test0 && myTestChar <= test9) {
strToReturn = strToReturn + strToFormat.charAt(x);
}
else if (myTestChar >= testa && myTestChar <= testz) {
gotPrevZero = 1;
strToReturn = strToReturn + strToFormat.charAt(x);
}
}
if (strToReturn == "") {
strToReturn = "0";
}
return strToReturn;
}
function doGradientString(strGradient, startColour, endColour) {
var myobjname = "gradientStr";
strGradient = strGradient.replace(/\n/g, "
");
document.write("");
document.write("
");
document.write("" + strGradient + "");
document.write("
");
document.write("
");
startColour = startColour.toLowerCase();
endColour = endColour.toLowerCase();
startColour = doHexFormat(startColour);
endColour = doHexFormat(endColour);
eval("myGradientObj = new Gradient(\"0x\" + startColour, \"0x\" + endColour, 256);");
eval("myGradientObj2 = new Gradient(\"0x\" + endColour, \"0x\" + startColour, 256);");
setTimeout("doGradientShift('" + myobjname + "');", 3000);
}
var currZoomSize = 0;
function doStrZooming(myobjname) {
var maxSize = 20 //in pixels;
var minSize = 1 //in pixels;
if (document.getElementById(myobjname)) {
currZoomSize++;
var mything = document.getElementById(myobjname);
if (currZoomSize <= maxSize) {
mything.style.fontSize = currZoomSize + "px";
setTimeout("doStrZooming('" + myobjname + "');", 30);
}
}
}
function doZoomString(strToZoom) {
var myobjname = "zoomStr";
strToZoom = strToZoom.replace(/\n/g, "
");
document.write("");
document.write("
");
document.write("" + strToZoom + "");
document.write("
");
document.write("
");
setTimeout("doStrZooming('" + myobjname + "');", 3000);
}
function doFolderPaperMove(myobjname, totalmoves, movesleft, direction, paperTop) {
if (document.getElementById(myobjname)) {
movesleft--;
if (movesleft == 0) {
if (direction == "1") {
direction = "0";
}
else {
direction = "1";
}
setTimeout("doFolderPaperMove('" + myobjname + "', " + totalmoves + ", " + totalmoves + ", '" + direction + "', " + paperTop + ")", 3000);
}
else {
var moveOffset = "";
if (direction == "1") {
moveOffset = -(totalmoves - movesleft + paperTop) + "px";
}
else {
moveOffset = (paperTop - movesleft) + "px";
}
document.getElementById(myobjname).style.top = moveOffset;
setTimeout("doFolderPaperMove('" + myobjname + "', " + totalmoves + ", " + movesleft + ", '" + direction + "', " + paperTop + ")", 33);
}
}
}
function doFolderPaper(mytext) {
var myobjname = "folderPaper";
var myheight = 88;
var mywidth = 140;
var padtop = 10;
var paperTop = 3;
var paperLeft = 1;
document.write("");
document.write("
");
document.write("
");
document.write("
");
document.write("
");
document.write("
");
if (document.getElementById(myobjname)) {
document.getElementById(myobjname).innerHTML = mytext;
setTimeout("doFolderPaperMove('" + myobjname + "', " + (myheight - padtop - paperTop) + ", " + (myheight - padtop - paperTop) + ", '1', " + paperTop + ")", 3000);
}
}
function doFadeSample1(mytext) {
startFade(mytext, "211", "250", 2000, "myfadetext_1", "myfadetext_2", "http://www.iplocationtools.com/images/floral_w250px.jpg", "45", "12", "0", "0", "");
}
function doFadeSample2(mytext) {
startFade(mytext, "143", "142", 2000, "myfadetext_1a", "myfadetext_2a", "http://www.iplocationtools.com/images/kids_w142px.jpg", "25", "12", "0", "0", "");
}
function doFadeSample3(mytext) {
startFade(mytext, "168", "142", 2000, "myfadetext_1b", "myfadetext_2b", "http://www.iplocationtools.com/images/smiley_w142px.jpg", "20", "12", "0", "0", "font-weight: bold;");
}
function doFadeSample4(mytext) {
startFade(mytext, "99", "142", 2000, "myfadetext_1c", "myfadetext_2c", "http://www.iplocationtools.com/images/tv_w142px.png", "19", "12", "8", "6", "");
}
function doTypeSample1(mytext) {
startTyping(mytext, 100, "mytypetext_1", "142", "142", "http://www.iplocationtools.com/images/paperclip_w142px.png", "52.5", "12", "6", "6", "font-family: Comic Sans, Comic Sans MS, cursive;")
}
function doTypeSample2(mytext) {
startTyping(mytext, 100, "mytypetext_1a", "88", "140", "http://www.iplocationtools.com/images/blue_w140px.png", "20", "12", "6", "6", "color: white; font-family: courier, arial, times new roman;")
}