Vasilis Daloukas
9 years ago
18 changed files with 632 additions and 1483 deletions
@ -1,40 +1,37 @@ |
|||||
.nodis |
.nodis |
||||
{ |
{ |
||||
list-style-type:none; |
list-style-type:none; |
||||
} |
} |
||||
|
|
||||
#cont |
#cont |
||||
{ |
{ |
||||
position:relative; |
position:relative; |
||||
display:none; |
display:none; |
||||
} |
} |
||||
|
|
||||
|
|
||||
|
|
||||
.img1 |
.img1 |
||||
{ |
{ |
||||
position:absolute; |
position:absolute; |
||||
display:none; |
display:none; |
||||
|
} |
||||
} |
|
||||
|
|
||||
|
#dicecont |
||||
|
{ |
||||
#dicecont |
float:right; |
||||
{ |
width:250px; |
||||
float:right; |
background-image: url(../images/meter.png); |
||||
width:250px; |
background-repeat: repeat; |
||||
background-image: url(../images/meter.png); |
font-family: Arial, Helvetica, sans-serif; |
||||
background-repeat: repeat; |
font-weight: normal; |
||||
font-family: Arial, Helvetica, sans-serif; |
/*font-variant: small-caps;*/ |
||||
font-weight: normal; |
color: #FFFFFF; |
||||
/*font-variant: small-caps;*/ |
border: 0.5em solid #333333; |
||||
color: #FFFFFF; |
top: 30px; |
||||
border: 0.5em solid #333333; |
position: absolute; |
||||
top: 30px; |
left: 500px; |
||||
position: absolute; |
font-size: 14px; |
||||
left: 500px; |
padding: 10px; |
||||
font-size: 14px; |
} |
||||
padding: 10px; |
|
||||
} |
|
||||
|
|
||||
|
@ -1,41 +1,39 @@ |
|||||
@charset "utf-8"; |
@charset "utf-8"; |
||||
#fade { /*--Transparent background layer--*/ |
#fade { /*--Transparent background layer--*/ |
||||
display: none; /*--hidden by default--*/ |
display: none; /*--hidden by default--*/ |
||||
background: #000; |
background: #000; |
||||
position: fixed; left: 0; top: 0; |
position: fixed; left: 0; top: 0; |
||||
width: 100%; height: 100%; |
width: 100%; height: 100%; |
||||
opacity: .80; |
opacity: .80; |
||||
z-index: 9999; |
z-index: 9999; |
||||
} |
} |
||||
.popup_block{ |
.popup_block{ |
||||
display: none; /*--hidden by default--*/ |
display: none; /*--hidden by default--*/ |
||||
background: #fff; |
background: #fff; |
||||
padding: 20px; |
padding: 20px; |
||||
border: 20px solid #ddd; |
border: 20px solid #ddd; |
||||
float: left; |
float: left; |
||||
font-size: 1.2em; |
font-size: 1.2em; |
||||
position: fixed; |
position: fixed; |
||||
top: 50%; left: 50%; |
top: 50%; left: 50%; |
||||
z-index: 99999; |
z-index: 99999; |
||||
/*--CSS3 Box Shadows--*/ |
/*--CSS3 Box Shadows--*/ |
||||
-webkit-box-shadow: 0px 0px 20px #000; |
-webkit-box-shadow: 0px 0px 20px #000; |
||||
-moz-box-shadow: 0px 0px 20px #000; |
-moz-box-shadow: 0px 0px 20px #000; |
||||
box-shadow: 0px 0px 20px #000; |
box-shadow: 0px 0px 20px #000; |
||||
/*--CSS3 Rounded Corners--*/ |
/*--CSS3 Rounded Corners--*/ |
||||
-webkit-border-radius: 10px; |
-webkit-border-radius: 10px; |
||||
-moz-border-radius: 10px; |
-moz-border-radius: 10px; |
||||
border-radius: 10px; |
border-radius: 10px; |
||||
} |
} |
||||
img.btn_close { |
img.btn_close { |
||||
float: right; |
float: right; |
||||
margin: -55px -55px 0 0; |
margin: -55px -55px 0 0; |
||||
} |
} |
||||
/*--Making IE6 Understand Fixed Positioning--*/ |
/*--Making IE6 Understand Fixed Positioning--*/ |
||||
*html #fade { |
*html #fade { |
||||
position: absolute; |
position: absolute; |
||||
} |
} |
||||
*html .popup_block { |
*html .popup_block { |
||||
position: absolute; |
position: absolute; |
||||
} |
} |
||||
|
|
||||
|
|
||||
|
@ -1,134 +1,131 @@ |
|||||
/*This Code is a sole propritary of |
/*This Code is a sole propritary of |
||||
Husain Limdiyawala(MSc IT DA-IICT) |
Husain Limdiyawala(MSc IT DA-IICT) |
||||
Any Duplication of this code should be avoided*/ |
Any Duplication of this code should be avoided*/ |
||||
|
|
||||
|
|
||||
|
.blocks |
||||
.blocks |
{ |
||||
{ |
font-family: Arial, Helvetica, sans-serif; |
||||
font-family: Arial, Helvetica, sans-serif; |
/*color: #FFFFFF;*/ |
||||
/*color: #FFFFFF;*/ |
margin-left: 5px; |
||||
margin-left: 5px; |
margin-top:2px; |
||||
margin-top:2px; |
margin-bottom:2px; |
||||
margin-bottom:2px; |
padding: 0px; |
||||
padding: 0px; |
float:left; |
||||
float:left; |
height: 52px; |
||||
height: 52px; |
width: 52px; |
||||
width: 52px; |
display:block; |
||||
display:block; |
position:relative; |
||||
position:relative; |
background-image: url(../square52.png); |
||||
background-image: url(../square52.png); |
} |
||||
} |
|
||||
|
.nodis |
||||
.nodis |
{ |
||||
{ |
list-style-type:none; |
||||
list-style-type:none; |
} |
||||
} |
|
||||
|
#cont |
||||
#cont |
{ |
||||
{ |
position:relative; |
||||
position:relative; |
display:none; |
||||
display:none; |
} |
||||
} |
|
||||
|
#diceimg |
||||
#diceimg |
{ |
||||
{ |
display:none; |
||||
display:none; |
width:45px; |
||||
width:45px; |
height:44px; |
||||
height:44px; |
} |
||||
|
|
||||
} |
.img1 |
||||
|
{ |
||||
.img1 |
position:absolute; |
||||
{ |
display:none; |
||||
position:absolute; |
} |
||||
display:none; |
|
||||
|
body |
||||
} |
{ |
||||
|
background:#CCCCCC; |
||||
body |
} |
||||
{ |
|
||||
background:#CCCCCC; |
#player |
||||
} |
{ |
||||
|
display:none; |
||||
#player |
z-index:5; |
||||
{ |
position:absolute; |
||||
display:none; |
} |
||||
z-index:5; |
|
||||
position:absolute; |
#players |
||||
} |
{ |
||||
|
margin-top: 0.3em; |
||||
#players |
margin-bottom: 1em; |
||||
{ |
} |
||||
margin-top: 0.3em; |
|
||||
margin-bottom: 1em; |
#dicecont |
||||
} |
{ |
||||
|
float:right; |
||||
#dicecont |
width:170px; |
||||
{ |
background-image: url(../images/meter.png); |
||||
float:right; |
background-repeat: repeat; |
||||
width:170px; |
font-family: Arial, Helvetica, sans-serif; |
||||
background-image: url(../images/meter.png); |
font-weight: bold; |
||||
background-repeat: repeat; |
/*font-variant: small-caps;*/ |
||||
font-family: Arial, Helvetica, sans-serif; |
color: #FFFFFF; |
||||
font-weight: bold; |
border: 0.5em solid #333333; |
||||
/*font-variant: small-caps;*/ |
top: 30px; |
||||
color: #FFFFFF; |
position: absolute; |
||||
border: 0.5em solid #333333; |
right: 880px; |
||||
top: 30px; |
} |
||||
position: absolute; |
|
||||
right: 880px; |
#playbtn |
||||
} |
{ |
||||
|
margin-left:0.5em; |
||||
#playbtn |
font-family: Arial, Helvetica, sans-serif; |
||||
{ |
font-weight: bold; |
||||
margin-left:0.5em; |
/*font-variant: small-caps;*/ |
||||
font-family: Arial, Helvetica, sans-serif; |
color: #000000; |
||||
font-weight: bold; |
background-color: #FC0; |
||||
/*font-variant: small-caps;*/ |
padding: 1em; |
||||
color: #000000; |
} |
||||
background-color: #FC0; |
|
||||
padding: 1em; |
/*-- from modal window coding --*/ |
||||
} |
|
||||
|
#fade { /*--Transparent background layer--*/ |
||||
/*-- from modal window coding --*/ |
display: none; /*--hidden by default--*/ |
||||
|
background: #000; |
||||
#fade { /*--Transparent background layer--*/ |
position: fixed; left: 0; top: 0; |
||||
display: none; /*--hidden by default--*/ |
width: 100%; height: 100%; |
||||
background: #000; |
opacity: .80; |
||||
position: fixed; left: 0; top: 0; |
z-index: 9999; |
||||
width: 100%; height: 100%; |
} |
||||
opacity: .80; |
.popup_block{ |
||||
z-index: 9999; |
display: none; /*--hidden by default--*/ |
||||
} |
background: #fff; |
||||
.popup_block{ |
padding: 20px; |
||||
display: none; /*--hidden by default--*/ |
border: 20px solid #ddd; |
||||
background: #fff; |
float: left; |
||||
padding: 20px; |
font-size: 1.2em; |
||||
border: 20px solid #ddd; |
position: fixed; |
||||
float: left; |
top: 50%; left: 50%; |
||||
font-size: 1.2em; |
z-index: 99999; |
||||
position: fixed; |
/*--CSS3 Box Shadows--*/ |
||||
top: 50%; left: 50%; |
-webkit-box-shadow: 0px 0px 20px #000; |
||||
z-index: 99999; |
-moz-box-shadow: 0px 0px 20px #000; |
||||
/*--CSS3 Box Shadows--*/ |
box-shadow: 0px 0px 20px #000; |
||||
-webkit-box-shadow: 0px 0px 20px #000; |
/*--CSS3 Rounded Corners--*/ |
||||
-moz-box-shadow: 0px 0px 20px #000; |
-webkit-border-radius: 10px; |
||||
box-shadow: 0px 0px 20px #000; |
-moz-border-radius: 10px; |
||||
/*--CSS3 Rounded Corners--*/ |
border-radius: 10px; |
||||
-webkit-border-radius: 10px; |
} |
||||
-moz-border-radius: 10px; |
img.btn_close { |
||||
border-radius: 10px; |
float: right; |
||||
} |
margin: -55px -55px 0 0; |
||||
img.btn_close { |
border: 0; |
||||
float: right; |
} |
||||
margin: -55px -55px 0 0; |
/*--Making IE6 Understand Fixed Positioning--*/ |
||||
border: 0; |
*html #fade { |
||||
} |
position: absolute; |
||||
/*--Making IE6 Understand Fixed Positioning--*/ |
} |
||||
*html #fade { |
*html .popup_block { |
||||
position: absolute; |
position: absolute; |
||||
} |
} |
||||
*html .popup_block { |
|
||||
position: absolute; |
|
||||
} |
|
||||
|
@ -1,69 +1,69 @@ |
|||||
/** |
/** |
||||
* POPUP CONTAINER STYLES |
* POPUP CONTAINER STYLES |
||||
*/ |
*/ |
||||
#popupMask { |
#popupMask { |
||||
position: absolute; |
position: absolute; |
||||
z-index: 200; |
z-index: 200; |
||||
top: 0px; |
top: 0px; |
||||
left: 0px; |
left: 0px; |
||||
width: 100%; |
width: 100%; |
||||
height: 100%; |
height: 100%; |
||||
opacity: .4; |
opacity: .4; |
||||
filter: alpha(opacity=50); |
filter: alpha(opacity=50); |
||||
/* this hack is so it works in IE |
/* this hack is so it works in IE |
||||
* I find setting the color in the css gives me more flexibility |
* I find setting the color in the css gives me more flexibility |
||||
* than the PNG solution. |
* than the PNG solution. |
||||
*/ |
*/ |
||||
background-color:transparent !important; |
background-color:transparent !important; |
||||
background-color: #333333; |
background-color: #333333; |
||||
/* this hack is for opera support |
/* this hack is for opera support |
||||
* you can uncomment the background-image if you don't care about opera. |
* you can uncomment the background-image if you don't care about opera. |
||||
* this gives you the flexibility to use any bg color that you want, instead of the png |
* this gives you the flexibility to use any bg color that you want, instead of the png |
||||
*/ |
*/ |
||||
background-image/**/: url("../images/maskBG.png") !important; // For browsers Moz, Opera, etc. |
background-image/**/: url("../images/maskBG.png") !important; // For browsers Moz, Opera, etc. |
||||
background-image:none; |
background-image:none; |
||||
background-repeat: repeat; |
background-repeat: repeat; |
||||
display:none; |
display:none; |
||||
} |
} |
||||
#popupContainer { |
#popupContainer { |
||||
position: absolute; |
position: absolute; |
||||
z-index: 201; |
z-index: 201; |
||||
top: 0px; |
top: 0px; |
||||
left: 0px; |
left: 0px; |
||||
display:none; |
display:none; |
||||
padding: 0px; |
padding: 0px; |
||||
} |
} |
||||
#popupInner { |
#popupInner { |
||||
border: 2px solid #000000; |
border: 2px solid #000000; |
||||
background-color: #ffffff; |
background-color: #ffffff; |
||||
} |
} |
||||
|
|
||||
#popupFrame { |
#popupFrame { |
||||
margin: 0px; |
margin: 0px; |
||||
width: 100%; |
width: 100%; |
||||
height: 100%; |
height: 100%; |
||||
position: relative; |
position: relative; |
||||
z-index: 202; |
z-index: 202; |
||||
} |
} |
||||
#popupTitleBar { |
#popupTitleBar { |
||||
background-color: #090; |
background-color: #090; |
||||
color: # 000; |
color: # 000; |
||||
font-weight: bold; |
font-weight: bold; |
||||
height: 1.3em; |
height: 1.3em; |
||||
padding: 5px; |
padding: 5px; |
||||
border-bottom: 2px solid #000000; |
border-bottom: 2px solid #000000; |
||||
border-top: 1px solid #78A3F2; |
border-top: 1px solid #78A3F2; |
||||
border-left: 1px solid #78A3F2; |
border-left: 1px solid #78A3F2; |
||||
border-right: 1px solid #204095; |
border-right: 1px solid #204095; |
||||
position: relative; |
position: relative; |
||||
z-index: 203; |
z-index: 203; |
||||
} |
} |
||||
#popupTitle { |
#popupTitle { |
||||
float:left; |
float:left; |
||||
font-size: 1.1em; |
font-size: 1.1em; |
||||
} |
} |
||||
#popupControls { |
#popupControls { |
||||
float: right; |
float: right; |
||||
cursor: pointer; |
cursor: pointer; |
||||
cursor: hand; |
cursor: hand; |
||||
} |
} |
||||
|
@ -1,78 +0,0 @@ |
|||||
function addEvent(obj, evType, fn){ |
|
||||
if (obj.addEventListener){ |
|
||||
obj.addEventListener(evType, fn, false); |
|
||||
return true; |
|
||||
} else if (obj.attachEvent){ |
|
||||
var r = obj.attachEvent("on"+evType, fn); |
|
||||
return r; |
|
||||
} else { |
|
||||
return false; |
|
||||
} |
|
||||
} |
|
||||
function removeEvent(obj, evType, fn, useCapture){ |
|
||||
if (obj.removeEventListener){ |
|
||||
obj.removeEventListener(evType, fn, useCapture); |
|
||||
return true; |
|
||||
} else if (obj.detachEvent){ |
|
||||
var r = obj.detachEvent("on"+evType, fn); |
|
||||
return r; |
|
||||
} else { |
|
||||
alert("Handler could not be removed"); |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* Code below taken from - http://www.evolt.org/article/document_body_doctype_switching_and_more/17/30655/
|
|
||||
* |
|
||||
* Modified 4/22/04 to work with Opera/Moz (by webmaster at subimage dot com) |
|
||||
* |
|
||||
* Gets the full width/height because it's different for most browsers. |
|
||||
*/ |
|
||||
function getViewportHeight() { |
|
||||
if (window.innerHeight!=window.undefined) return window.innerHeight; |
|
||||
if (document.compatMode=='CSS1Compat') return document.documentElement.clientHeight; |
|
||||
if (document.body) return document.body.clientHeight; |
|
||||
|
|
||||
return window.undefined; |
|
||||
} |
|
||||
function getViewportWidth() { |
|
||||
var offset = 17; |
|
||||
var width = null; |
|
||||
if (window.innerWidth!=window.undefined) return window.innerWidth; |
|
||||
if (document.compatMode=='CSS1Compat') return document.documentElement.clientWidth; |
|
||||
if (document.body) return document.body.clientWidth; |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* Gets the real scroll top |
|
||||
*/ |
|
||||
function getScrollTop() { |
|
||||
if (self.pageYOffset) // all except Explorer
|
|
||||
{ |
|
||||
return self.pageYOffset; |
|
||||
} |
|
||||
else if (document.documentElement && document.documentElement.scrollTop) |
|
||||
// Explorer 6 Strict
|
|
||||
{ |
|
||||
return document.documentElement.scrollTop; |
|
||||
} |
|
||||
else if (document.body) // all other Explorers
|
|
||||
{ |
|
||||
return document.body.scrollTop; |
|
||||
} |
|
||||
} |
|
||||
function getScrollLeft() { |
|
||||
if (self.pageXOffset) // all except Explorer
|
|
||||
{ |
|
||||
return self.pageXOffset; |
|
||||
} |
|
||||
else if (document.documentElement && document.documentElement.scrollLeft) |
|
||||
// Explorer 6 Strict
|
|
||||
{ |
|
||||
return document.documentElement.scrollLeft; |
|
||||
} |
|
||||
else if (document.body) // all other Explorers
|
|
||||
{ |
|
||||
return document.body.scrollLeft; |
|
||||
} |
|
||||
} |
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Binary file not shown.
@ -1,473 +1,317 @@ |
|||||
/*This code was originally based on code by |
/*This code was originally based on code by |
||||
Husain Limdiyawala(MSc IT DA-IICT)*/ |
Husain Limdiyawala(MSc IT DA-IICT)*/ |
||||
|
|
||||
|
$(document).ready(function () { |
||||
|
|
||||
$(document).ready(function () { |
}); |
||||
|
|
||||
|
|
||||
}); |
//Global Variables
|
||||
|
var totblocks = 0; |
||||
|
var data = ""; |
||||
//Global Variables
|
var currentblock = 0; |
||||
var totblocks=0; |
var position = 0; |
||||
var data=""; |
var lastposition = new Array(); |
||||
var currentblock=0; |
var randomno = 0; |
||||
var position=0; |
var tots = new Array(); |
||||
var lastposition = new Array(); |
var l = 0; |
||||
var randomno=0; |
var srcsnake = new Array(4); |
||||
var tots= new Array(); |
var destsnake = new Array(4); |
||||
var l=0; |
|
||||
var srcsnake=new Array(4); |
var ladsrc = new Array(3); |
||||
var destsnake=new Array(4); |
var laddest = new Array(3); |
||||
|
var quest = new Array(); //available questions along with multiple answers
|
||||
var ladsrc = new Array(3); |
var COR_answered = new Array(); //record all questions (along with answers) the user responded CORRECTLY
|
||||
var laddest = new Array(3); |
var WRO_answered = new Array(); //record all questions (along with answers) the user responded WRONGLY
|
||||
var quest = new Array(); //available questions along with multiple answers
|
var user = new Array(); |
||||
var COR_answered = new Array(); //record all questions (along with answers) the user responded CORRECTLY
|
|
||||
var WRO_answered = new Array(); //record all questions (along with answers) the user responded WRONGLY
|
//Constract table with questions and answers and pick question to display
|
||||
|
|
||||
|
quest[0] = "Spell 1"; |
||||
|
quest[1] = "one"; |
||||
//var door = new Array(1)
|
quest[2] = "two"; |
||||
|
quest[3] = "three"; |
||||
var user = new Array(); |
quest[4] = "Spell 2"; |
||||
|
quest[5] = "two"; |
||||
//var pythons = new Array(1);
|
quest[6] = "three"; |
||||
|
quest[7] = "four"; |
||||
//Constract table with questions and answers and pick question to display
|
quest[8] = "Spell 3"; |
||||
|
quest[9] = "three"; |
||||
quest[0]="Spell 1"; |
quest[10] = "two"; |
||||
quest[1]="one"; |
quest[11] = "four"; |
||||
quest[2]="two"; |
quest[12] = "Spell 4"; |
||||
quest[3]="three"; |
quest[13] = "four"; |
||||
quest[4]="Spell 2"; |
quest[14] = "three"; |
||||
quest[5]="two"; |
quest[15] = "one"; |
||||
quest[6]="three"; |
z = 0; |
||||
quest[7]="four"; |
for (z = 0; quest[z] != null; z++) { |
||||
quest[8]="Spell 3"; |
// Do nothing
|
||||
quest[9]="three"; |
} |
||||
quest[10]="two"; |
allQuest = z / 4; |
||||
quest[11]="four"; |
|
||||
quest[12]="Spell 4"; |
function selectQuest(all) |
||||
quest[13]="four"; |
{ |
||||
quest[14]="three"; |
pickOne = Math.floor((Math.random() * all)); |
||||
quest[15]="one"; |
return pickOne; |
||||
z=0; |
} |
||||
for (z=0;quest[z]!=null;z++); |
|
||||
allQuest=z/4; |
//The Below Function will hide all the snakes
|
||||
|
|
||||
|
function hideAll() { |
||||
function selectQuest(all) |
document.getElementById("img1").style.display = "none"; |
||||
{ |
document.getElementById("img2").style.display = "none"; |
||||
pickOne = Math.floor((Math.random() * all)); |
document.getElementById("img3").style.display = "none"; |
||||
return pickOne; |
document.getElementById("img4").style.display = "none"; |
||||
} |
|
||||
|
document.getElementById("lad1").style.display = "none"; |
||||
|
document.getElementById("lad2").style.display = "none"; |
||||
|
document.getElementById("lad3").style.display = "none"; |
||||
|
} |
||||
//The Below Function will hide all the snakes
|
|
||||
|
//The Below Function will Render The Main Board
|
||||
function hideAll() |
|
||||
{ |
function paintBoard(a) { |
||||
document.getElementById("img1").style.display = "none"; |
totblocks = (a * a); |
||||
document.getElementById("img2").style.display = "none"; |
if ((a * a) % 2 == 0) { |
||||
document.getElementById("img3").style.display = "none"; |
currentblock = (a * a) - a + 1; |
||||
document.getElementById("img4").style.display = "none"; |
for (j = 0; j < (a / 2); j++) { |
||||
|
for (i = 0; i < a; i++) { |
||||
document.getElementById("lad1").style.display = "none"; |
data += "<div class='blocks' id='" + currentblock + "'>" + currentblock + "</div>"; |
||||
document.getElementById("lad2").style.display = "none"; |
currentblock++; |
||||
document.getElementById("lad3").style.display = "none"; |
} |
||||
} |
currentblock -= (a + 1); |
||||
|
|
||||
|
for (i = 0; i < a; i++) { |
||||
//The Below Function will Render The Main Board
|
data += "<div id='" + currentblock + "' class ='blocks'>" + currentblock + "</div>"; |
||||
|
currentblock--; |
||||
function paintBoard(a) |
} |
||||
{ |
currentblock -= (a - 1); |
||||
totblocks = (a*a); |
} |
||||
if((a*a) % 2 == 0) |
} else { |
||||
{ |
currentblock = (a * a); |
||||
currentblock = (a*a) - a + 1; |
for (j = 0; j < (a / 2); j++) { |
||||
for(j=0;j<(a/2);j++) |
for (i = 0; i < a; i++) { |
||||
{ |
data += "<div class='blocks' id='" + currentblock + "'>" + currentblock + "</div>"; |
||||
|
currentblock--; |
||||
for(i=0;i<a;i++) |
} |
||||
{ |
|
||||
data += "<div class='blocks' id='" + currentblock + "'>" + currentblock + "</div>"; |
currentblock -= (a - 1); |
||||
currentblock++; |
|
||||
} |
if (currentblock < 2) { |
||||
currentblock -= (a+1); |
break; |
||||
|
} |
||||
for(i=0;i<a;i++) |
|
||||
{ |
for (i = 0; i < a; i++) { |
||||
data += "<div id='" + currentblock + "' class ='blocks'>" + currentblock + "</div>"; |
data += "<div id='" + currentblock + "' class ='blocks'>" + currentblock + "</div>"; |
||||
currentblock--; |
currentblock++; |
||||
} |
} |
||||
currentblock -= (a-1); |
currentblock -= (a + 1); |
||||
} |
} |
||||
} |
} |
||||
else |
document.getElementById("cont").style.width = (a * 52 + 52) + "px" |
||||
{ |
|
||||
|
document.getElementById("cont").innerHTML = data; |
||||
currentblock = (a*a); |
$("#cont").slideDown("slow"); |
||||
for(j=0;j<(a/2);j++) |
$("#cont").effect("shake",3000); |
||||
{ |
$("img:hidden").fadeIn(5000); |
||||
|
|
||||
|
if (a == 6) { |
||||
for(i=0;i<a;i++) |
registerSnake(158, 196, "img1", 14, 3, 0); |
||||
{ |
registerSnake(62, 183, "img2", 27, 24, 1); |
||||
data += "<div class='blocks' id='" + currentblock + "'>" + currentblock + "</div>"; |
registerSnake(175, 18, "img3", 18, 4, 2); |
||||
currentblock--; |
registerSnake(10, 45, "img4", 32, 23, 3); |
||||
} |
|
||||
|
registerLadder(27, 132, "lad1", 28, 34, 0); |
||||
currentblock -= (a-1); |
registerLadder(90, 22, "lad2", 19, 30, 1); |
||||
|
registerLadder(179, 137, "lad3", 2, 16, 2); |
||||
if(currentblock < 2) |
} else if (a == 8) { |
||||
break; |
registerSnake(300, 380, "img1", 44, 29, 0); |
||||
|
registerSnake(180, 550, "img2", 51, 46, 1); |
||||
for(i=0;i<a;i++) |
registerSnake(290, 50, "img3", 41, 40, 2); |
||||
{ |
registerSnake(500, 280, "img4", 27, 22, 3); |
||||
data += "<div id='" + currentblock + "' class ='blocks'>" + currentblock + "</div>"; |
|
||||
currentblock++; |
registerLadder(350, 515, "lad1", 19, 35, 0); |
||||
} |
registerLadder(180, 230, "lad2", 43, 54, 1); |
||||
currentblock -= (a+1); |
registerLadder(80, 350, "lad3", 53, 60, 2); |
||||
} |
} |
||||
} |
} |
||||
document.getElementById("cont").style.width = (a*52+52) + "px" |
|
||||
|
//The below Function will simulate throwing of a dice
|
||||
|
function throwDice(i) { |
||||
document.getElementById("cont").innerHTML = data; |
randomno = Math.floor((Math.random() * 6)) + 1; |
||||
$("#cont").slideDown("slow"); |
document.getElementById("diceimg").src = "images/dice_" + randomno + ".PNG"; |
||||
$("#cont").effect("shake",3000); |
document.getElementById("diceimg").style.display = "block"; |
||||
$("img:hidden").fadeIn(5000); |
if (lastposition[i] > 0) { |
||||
|
document.getElementById(lastposition[i]).style.background = "url(images/square52.png)"; |
||||
if(a == 6) |
} |
||||
{ |
tots[i] += randomno; |
||||
|
|
||||
|
if (totblocks - tots[i] >= 0) { |
||||
registerSnake(158,196,"img1",14,3,0); |
lastposition[i] = tots[i]; |
||||
registerSnake(62,183,"img2",27,24,1); |
document.getElementById(tots[i]).style.background = "url(images/pawn1.png)"; |
||||
registerSnake(175,18,"img3",18,4,2); |
} else { |
||||
registerSnake(10,45,"img4",32,23,3); |
tots[i] -= randomno; |
||||
|
document.getElementById(tots[i]).style.background = "url(images/pawn1.png)"; |
||||
registerLadder(27,132,"lad1",28,34,0); |
} |
||||
registerLadder(90,22,"lad2",19,30,1); |
} |
||||
registerLadder(179,137,"lad3",2,16,2); |
|
||||
|
// The below Function Checks The Snake Biting for a user.
|
||||
//registerDoor("5",5,0);
|
function snakescheck(k) { |
||||
//registerDoor("21",21,1)
|
i = 0; |
||||
|
|
||||
//registerPython("15",15,0)
|
for(i = 0; i <= srcsnake.length; i++) { |
||||
} |
if (srcsnake[i] == tots[k]) { |
||||
|
alert("Ωχ! Σε τσίμπησε φίδι στο τετράγωνο " + srcsnake[i] + " και θα πρέπει να γυρίσεις στο τετράγωνο " + destsnake[i] + ", εκτός κι αν απαντήσεις σωστά στην ερώτηση που ακολουθεί."); |
||||
|
document.getElementById(destsnake[i]).style.background = "url(images/pawn1.png)"; |
||||
else if(a == 8) |
document.getElementById(tots[k]).style.background = "url(images/square52.png)"; |
||||
{ |
lastposition[k] = destsnake[i]; |
||||
|
tots[k] = destsnake[i]; |
||||
|
break; |
||||
registerSnake(300,380,"img1",44,29,0); |
} |
||||
registerSnake(180,550,"img2",51,46,1); |
} |
||||
registerSnake(290,50,"img3",41,40,2); |
|
||||
registerSnake(500,280,"img4",27,22,3); |
if (!checkWin(k)) { |
||||
|
alert("???d?se?!S???a??t???a!"); |
||||
registerLadder(350,515,"lad1",19,35,0); |
} |
||||
registerLadder(180,230,"lad2",43,54,1); |
} |
||||
registerLadder(80,350,"lad3",53,60,2); |
|
||||
|
//The below function checks the ladders for a user
|
||||
//registerDoor("14",14,0);
|
function laddercheck(k) { |
||||
//registerDoor("26",26,1)
|
i = 0; |
||||
|
|
||||
//registerPython("32",32,0)
|
for(i = 0; i <= ladsrc.length; i++) { |
||||
} |
if (ladsrc[i] == tots[k]) { |
||||
|
alert("Υπάρχει μια σκάλα στο τετράγωνο " + ladsrc[i] + " και θα σας οδηγήσει κατευθείαν στο τετράγωνο " + laddest[i] + "αν απαντήσεις σωστά στην ερώτηση που ακολουθεί."); |
||||
|
document.getElementById(laddest[i]).style.background = "url(images/pawn1.png)"; |
||||
} |
document.getElementById(tots[k]).style.background = "url(images/square52.png)"; |
||||
|
lastposition[k] = laddest[i]; |
||||
//The below Function will simulate throwing of a dice
|
tots[k] = laddest[i]; |
||||
|
break; |
||||
function throwDice(i) |
} |
||||
{ |
} |
||||
|
if(!checkWin(k)) { |
||||
randomno = Math.floor((Math.random() * 6)) + 1; |
alert("You have won!"); |
||||
document.getElementById("diceimg").src = "images/dice_" + randomno + ".PNG"; |
} |
||||
document.getElementById("diceimg").style.display = "block"; |
} |
||||
if(lastposition[i]>0) |
|
||||
{ |
//The below Function checks for pythons
|
||||
document.getElementById(lastposition[i]).style.background = "url(images/square52.png)"; |
|
||||
|
function pythoncheck(k) { |
||||
} |
i = 0; |
||||
tots[i] += randomno; |
|
||||
|
for (i = 0; i < pythons.length; i++) { |
||||
if(totblocks - tots[i] >= 0) |
|
||||
{ |
if (pythons[i] == tots[k]) { |
||||
|
alert("You have been eaten up by a python.Your game is over"); |
||||
lastposition[i] = tots[i]; |
document.getElementById(tots[k]).style.background = "url(images/csnake.gif) #000000"; |
||||
document.getElementById(tots[i]).style.background = "url(images/pawn1.png)"; |
lastposition[k] = null; |
||||
} |
tots[k] = null; |
||||
else |
break; |
||||
{ |
} |
||||
|
} |
||||
tots[i] -= randomno; |
} |
||||
document.getElementById(tots[i]).style.background = "url(images/pawn1.png)"; |
|
||||
} |
// The below function will register a snake.
|
||||
|
function registerSnake(tp, lft, dv, src, dest, i) { |
||||
} |
document.getElementById(dv).style.top = tp + "px"; |
||||
|
document.getElementById(dv).style.left = lft + "px"; |
||||
//The below Function Checks The Snake Biting for a user
|
srcsnake[i] = src; |
||||
|
destsnake[i] = dest; |
||||
function snakescheck(k) |
} |
||||
{ |
|
||||
i=0; |
// The below function will register a ladder..
|
||||
|
function registerLadder(tp, lft, dv, src, dest, i) { |
||||
for(i=0;i<=srcsnake.length;i++) |
document.getElementById(dv).style.top = tp + "px"; |
||||
{ |
document.getElementById(dv).style.left = lft + "px"; |
||||
|
ladsrc[i] = src; |
||||
if(srcsnake[i] == tots[k]) |
laddest[i] = dest; |
||||
{ |
} |
||||
alert("Ωχ! Σε τσίμπησε φίδι στο τετράγωνο " + srcsnake[i] + " και θα πρέπει να γυρίσεις στο τετράγωνο " + destsnake[i] + ", εκτός κι αν απαντήσεις σωστά στην ερώτηση που ακολουθεί."); |
|
||||
document.getElementById(destsnake[i]).style.background = "url(images/pawn1.png)"; |
//The below function checks the change in the boardtype selection combobox
|
||||
document.getElementById(tots[k]).style.background = "url(images/square52.png)"; |
function selectBoard() { |
||||
lastposition[k] = destsnake[i]; |
totblocks = 0; |
||||
tots[k] = destsnake[i]; |
data = ""; |
||||
break; |
currentblock = 0; |
||||
} |
position = 0; |
||||
} |
|
||||
|
hideAll(); |
||||
if(!checkWin(k)) |
if (document.getElementById("boardtype").value != null) { |
||||
alert("???d?se?!S???a??t???a!"); |
paintBoard(parseInt(document.getElementById("boardtype").value)); |
||||
} |
} |
||||
|
} |
||||
//The below function checks the ladders for a user
|
|
||||
|
// The below function checks the change in the player selection combobox.
|
||||
function laddercheck(k) |
function selectPlayer() { |
||||
{ |
if (document.getElementById("players").value != null) { |
||||
i=0; |
user[document.getElementById("players").value - 1] = 0; |
||||
|
tots[document.getElementById("players").value - 1] = 0; |
||||
for(i=0;i<=ladsrc.length;i++) |
lastposition[document.getElementById("players").value - 1] = 0; |
||||
{ |
for(var j = 0; j < lastposition.length; j++) { |
||||
|
lastposition[j] = 0; |
||||
if(ladsrc[i] == tots[k]) |
tots[j] = 0; |
||||
{ |
} |
||||
alert("Υπάρχει μια σκάλα στο τετράγωνο " + ladsrc[i] + " και θα σας οδηγήσει κατευθείαν στο τετράγωνο " + laddest[i] +"αν απαντήσεις σωστά στην ερώτηση που ακολουθεί."); |
} |
||||
document.getElementById(laddest[i]).style.background = "url(images/pawn1.png)"; |
} |
||||
document.getElementById(tots[k]).style.background = "url(images/square52.png)"; |
|
||||
lastposition[k] = laddest[i]; |
// The below function starts the play.
|
||||
tots[k] = laddest[i]; |
function play() { |
||||
break; |
if (tots[l] != null) { |
||||
} |
disableField(); |
||||
} |
document.getElementById("status").innerHTML = "<ul class='nodis'><li>O Paiktis " + (l + 1) + " </li><li>brisketai sto tetragwno " + tots[l] + "</li><li></li></ul>"; |
||||
if(!checkWin(k)) |
|
||||
alert("You have won!"); |
Question(); |
||||
} |
document.getElementById("status").innerHTML = "<ul class='nodis'><li>O Paiktis " + (l + 1) + " </li><li>vrisketai sto tetragwno " + tots[l] + "</li></ul>"; |
||||
|
} else { |
||||
//The below function checks the existence of doors
|
document.getElementById("status").innerHTML = "<ul class='nodis'><li>Molis exases...</li></ul>"; |
||||
|
} |
||||
/*function doorcheck(k) |
|
||||
{ |
if( l == lastposition.length - 1) { |
||||
i=0; |
l = 0; |
||||
|
} else { |
||||
for(i=0;i<=door.length;i++) |
l++; |
||||
{ |
} |
||||
|
} |
||||
if(door[i] == tots[k]) |
|
||||
{ |
// The below function regulates the play.
|
||||
|
function doit(i) { |
||||
|
throwDice(i); |
||||
var randomdoor = Math.floor((Math.random() * totblocks)) + 1; |
if (checkWin(i)) { |
||||
alert("Magic Door Entered!! You are redirected to " + randomdoor); |
snakescheck(i); |
||||
document.getElementById(randomdoor).style.background = "url(images/pawn.png) #000000"; |
laddercheck(i); |
||||
document.getElementById(tots[k]).style.background = "url(images/door.png) #000000"; |
} else { |
||||
lastposition[k] = randomdoor; |
alert("ÏëïêëÞñùóåò ôçí ðßóôá, óõã÷áñçôÞñéá!!!"); |
||||
tots[k] = randomdoor; |
} |
||||
|
} |
||||
} |
|
||||
} |
// The below function checks whether the player has won or not.
|
||||
if(!checkWin(k)) |
function checkWin(i) { |
||||
alert("You Have Won!!"); |
if( tots[i] == totblocks) { |
||||
} */ |
return false; |
||||
|
} else { |
||||
//The below Function checks for pythons
|
return true; |
||||
|
} |
||||
function pythoncheck(k) |
} |
||||
{ |
|
||||
i=0; |
// The below function will disable both the combobox .
|
||||
|
function disableField() { |
||||
for(i=0;i<pythons.length;i++) |
document.getElementById("players").disabled = "disabled"; |
||||
{ |
document.getElementById("boardtype").disabled = "disabled"; |
||||
|
} |
||||
if(pythons[i] == tots[k]) |
|
||||
{ |
function Question() { |
||||
|
picked = selectQuest(allQuest); |
||||
|
alert("Randomly selected number:" + picked); |
||||
alert("You have been eaten up by a python.Your game is over"); |
Q1 = prompt(quest[picked * 4], "Απάντηση"); |
||||
document.getElementById(tots[k]).style.background = "url(images/csnake.gif) #000000"; |
if (Q1 == quest[picked * 4 + 1]) { |
||||
lastposition[k] = null; |
alert("Σωστά!") |
||||
tots[k] = null; |
doit(l); |
||||
break; |
|
||||
} |
COR_answered.concat(quest.splice(picked * 4, 4)); |
||||
} |
} else { |
||||
|
alert("Η απάντηση δεν ήταν σωστή. Χάνεις τη σειρά σου για αυτό το γύρο!") |
||||
} |
WRO_answered.concat(quest.splice(picked * 4, 4)); |
||||
|
} |
||||
//The below function will register a snake
|
|
||||
|
// Remove question and answers from available questions - (thus not allowing to have a Repeated question) ---XOXOXO
|
||||
function registerSnake(tp,lft,dv,src,dest,i) |
allQuest--; |
||||
{ |
} |
||||
document.getElementById(dv).style.top = tp + "px"; |
|
||||
document.getElementById(dv).style.left = lft + "px"; |
|
||||
srcsnake[i] = src; |
|
||||
destsnake[i] = dest; |
|
||||
} |
|
||||
|
|
||||
//The below function will register a ladder.
|
|
||||
|
|
||||
function registerLadder(tp,lft,dv,src,dest,i) |
|
||||
{ |
|
||||
document.getElementById(dv).style.top = tp + "px"; |
|
||||
document.getElementById(dv).style.left = lft + "px"; |
|
||||
ladsrc[i] = src; |
|
||||
laddest[i] = dest; |
|
||||
} |
|
||||
|
|
||||
//The below function will register a door.
|
|
||||
|
|
||||
/*function registerDoor(dv,srcc,i) |
|
||||
{ |
|
||||
document.getElementById(dv).style.background = "url(images/door.png) #000000"; |
|
||||
door[i] = srcc; |
|
||||
|
|
||||
} |
|
||||
|
|
||||
//The below function will register a python.
|
|
||||
function registerPython(dv,srcc,i) |
|
||||
{ |
|
||||
document.getElementById(dv).style.background = "url(images/csnake.gif) #000000"; |
|
||||
pythons[i] = srcc; |
|
||||
|
|
||||
} |
|
||||
*/ |
|
||||
|
|
||||
|
|
||||
//The below function checks the change in the boardtype selection combobox
|
|
||||
|
|
||||
function selectBoard() |
|
||||
{ |
|
||||
totblocks=0; |
|
||||
data=""; |
|
||||
currentblock=0; |
|
||||
position=0; |
|
||||
|
|
||||
hideAll(); |
|
||||
if(document.getElementById("boardtype").value != null) |
|
||||
{ |
|
||||
paintBoard(parseInt(document.getElementById("boardtype").value)); |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
//The below function checks the change in the player selection combobox
|
|
||||
|
|
||||
function selectPlayer() |
|
||||
{ |
|
||||
|
|
||||
if(document.getElementById("players").value != null) |
|
||||
{ |
|
||||
|
|
||||
user[document.getElementById("players").value-1] = 0; |
|
||||
tots[document.getElementById("players").value-1] = 0; |
|
||||
lastposition[document.getElementById("players").value-1] = 0; |
|
||||
for(var j=0;j < lastposition.length;j++) |
|
||||
{ |
|
||||
lastposition[j] = 0; |
|
||||
tots[j] = 0; |
|
||||
} |
|
||||
|
|
||||
|
|
||||
} |
|
||||
} |
|
||||
|
|
||||
//The below function starts the play
|
|
||||
|
|
||||
function play() |
|
||||
{ |
|
||||
if(tots[l] != null) |
|
||||
{ |
|
||||
//...&&(quest[0]!=NULL)
|
|
||||
disableField(); |
|
||||
document.getElementById("status").innerHTML = "<ul class='nodis'><li>O Paiktis " + (l+1) + " </li><li>brisketai sto tetragwno " + tots[l] + "</li><li></li></ul>"; |
|
||||
//
|
|
||||
Question(); |
|
||||
document.getElementById("status").innerHTML = "<ul class='nodis'><li>O Paiktis " + (l+1) + " </li><li>vrisketai sto tetragwno " + tots[l] + "</li></ul>"; |
|
||||
} |
|
||||
else |
|
||||
document.getElementById("status").innerHTML = "<ul class='nodis'><li>Molis exases...</li></ul>"; |
|
||||
|
|
||||
if(l == lastposition.length-1) |
|
||||
l = 0; |
|
||||
else |
|
||||
l++; |
|
||||
|
|
||||
|
|
||||
} |
|
||||
|
|
||||
//The below function regulates the play
|
|
||||
|
|
||||
function doit(i) |
|
||||
{ |
|
||||
|
|
||||
throwDice(i); |
|
||||
|
|
||||
if(checkWin(i)) |
|
||||
{ |
|
||||
|
|
||||
//doorcheck(i);
|
|
||||
snakescheck(i); |
|
||||
laddercheck(i); |
|
||||
//pythoncheck(i);
|
|
||||
} |
|
||||
else |
|
||||
alert("ÏëïêëÞñùóåò ôçí ðßóôá, óõã÷áñçôÞñéá!!!"); |
|
||||
} |
|
||||
|
|
||||
//The below function checks whether the player has won or not
|
|
||||
|
|
||||
function checkWin(i) |
|
||||
{ |
|
||||
if(tots[i] == totblocks) |
|
||||
return false; |
|
||||
else |
|
||||
return true; |
|
||||
|
|
||||
} |
|
||||
|
|
||||
//The below function will disable both the combobox
|
|
||||
|
|
||||
function disableField() |
|
||||
{ |
|
||||
document.getElementById("players").disabled = "disabled"; |
|
||||
document.getElementById("boardtype").disabled = "disabled"; |
|
||||
|
|
||||
} |
|
||||
|
|
||||
function Question() |
|
||||
{ |
|
||||
picked=selectQuest(allQuest); |
|
||||
alert("Randomly selected number:" +picked); |
|
||||
Q1=prompt(quest[picked*4],"Απάντηση"); |
|
||||
if (Q1==quest[picked*4+1]) |
|
||||
{ |
|
||||
alert("Σωστά!") |
|
||||
doit(l); |
|
||||
|
|
||||
COR_answered.concat(quest.splice(picked*4,4)); |
|
||||
} |
|
||||
else |
|
||||
{ |
|
||||
alert("Η απάντηση δεν ήταν σωστή. Χάνεις τη σειρά σου για αυτό το γύρο!") |
|
||||
//document.getElementById("playbtn").disabled = "disabled";
|
|
||||
WRO_answered.concat(quest.splice(picked*4,4)); |
|
||||
} |
|
||||
//remove question and answers from available questions - (thus not allowing to have a Repeated question) ---XOXOXO
|
|
||||
allQuest--; |
|
||||
} |
|
||||
|
@ -1,295 +0,0 @@ |
|||||
var gPopupMask = null; |
|
||||
var gPopupContainer = null; |
|
||||
var gPopFrame = null; |
|
||||
var gReturnFunc; |
|
||||
var gPopupIsShown = false; |
|
||||
var gDefaultPage = "/loading.html"; |
|
||||
var gHideSelects = false; |
|
||||
var gReturnVal = null; |
|
||||
|
|
||||
var gTabIndexes = new Array(); |
|
||||
// Pre-defined list of tags we want to disable/enable tabbing into
|
|
||||
var gTabbableTags = new Array("A","BUTTON","TEXTAREA","INPUT","IFRAME"); |
|
||||
|
|
||||
// If using Mozilla or Firefox, use Tab-key trap.
|
|
||||
if (!document.all) { |
|
||||
document.onkeypress = keyDownHandler; |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* Initializes popup code on load. |
|
||||
*/ |
|
||||
function initPopUp() { |
|
||||
// Add the HTML to the body
|
|
||||
theBody = document.getElementsByTagName('BODY')[0]; |
|
||||
popmask = document.createElement('div'); |
|
||||
popmask.id = 'popupMask'; |
|
||||
popcont = document.createElement('div'); |
|
||||
popcont.id = 'popupContainer'; |
|
||||
popcont.innerHTML = '' + |
|
||||
'<div id="popupInner">' + |
|
||||
'<div id="popupTitleBar">' + |
|
||||
'<div id="popupTitle"></div>' + |
|
||||
'<div id="popupControls">' + |
|
||||
'<img src="close.gif" onclick="hidePopWin(false);" id="popCloseBox" />' + |
|
||||
'</div>' + |
|
||||
'</div>' + |
|
||||
'<iframe src="'+ gDefaultPage +'" style="width:100%;height:100%;background-color:transparent;" scrolling="auto" frameborder="0" allowtransparency="true" id="popupFrame" name="popupFrame" width="100%" height="100%"></iframe>' + |
|
||||
'</div>'; |
|
||||
theBody.appendChild(popmask); |
|
||||
theBody.appendChild(popcont); |
|
||||
|
|
||||
gPopupMask = document.getElementById("popupMask"); |
|
||||
gPopupContainer = document.getElementById("popupContainer"); |
|
||||
gPopFrame = document.getElementById("popupFrame"); |
|
||||
|
|
||||
// check to see if this is IE version 6 or lower. hide select boxes if so
|
|
||||
// maybe they'll fix this in version 7?
|
|
||||
var brsVersion = parseInt(window.navigator.appVersion.charAt(0), 10); |
|
||||
if (brsVersion <= 6 && window.navigator.userAgent.indexOf("MSIE") > -1) { |
|
||||
gHideSelects = true; |
|
||||
} |
|
||||
|
|
||||
// Add onclick handlers to 'a' elements of class submodal or submodal-width-height
|
|
||||
var elms = document.getElementsByTagName('a'); |
|
||||
for (i = 0; i < elms.length; i++) { |
|
||||
if (elms[i].className.indexOf("submodal") == 0) { |
|
||||
// var onclick = 'function (){showPopWin(\''+elms[i].href+'\','+width+', '+height+', null);return false;};';
|
|
||||
// elms[i].onclick = eval(onclick);
|
|
||||
elms[i].onclick = function(){ |
|
||||
// default width and height
|
|
||||
var width = 400; |
|
||||
var height = 200; |
|
||||
// Parse out optional width and height from className
|
|
||||
params = this.className.split('-'); |
|
||||
if (params.length == 3) { |
|
||||
width = parseInt(params[1]); |
|
||||
height = parseInt(params[2]); |
|
||||
} |
|
||||
showPopWin(this.href,width,height,null); return false; |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
addEvent(window, "load", initPopUp); |
|
||||
|
|
||||
/** |
|
||||
* @argument width - int in pixels |
|
||||
* @argument height - int in pixels |
|
||||
* @argument url - url to display |
|
||||
* @argument returnFunc - function to call when returning true from the window. |
|
||||
* @argument showCloseBox - show the close box - default true |
|
||||
*/ |
|
||||
function showPopWin(url, width, height, returnFunc, showCloseBox) { |
|
||||
// show or hide the window close widget
|
|
||||
if (showCloseBox == null || showCloseBox == true) { |
|
||||
document.getElementById("popCloseBox").style.display = "block"; |
|
||||
} else { |
|
||||
document.getElementById("popCloseBox").style.display = "none"; |
|
||||
} |
|
||||
gPopupIsShown = true; |
|
||||
disableTabIndexes(); |
|
||||
gPopupMask.style.display = "block"; |
|
||||
gPopupContainer.style.display = "block"; |
|
||||
// calculate where to place the window on screen
|
|
||||
centerPopWin(width, height); |
|
||||
|
|
||||
var titleBarHeight = parseInt(document.getElementById("popupTitleBar").offsetHeight, 10); |
|
||||
|
|
||||
|
|
||||
gPopupContainer.style.width = width + "px"; |
|
||||
gPopupContainer.style.height = (height+titleBarHeight) + "px"; |
|
||||
|
|
||||
setMaskSize(); |
|
||||
|
|
||||
// need to set the width of the iframe to the title bar width because of the dropshadow
|
|
||||
// some oddness was occuring and causing the frame to poke outside the border in IE6
|
|
||||
gPopFrame.style.width = parseInt(document.getElementById("popupTitleBar").offsetWidth, 10) + "px"; |
|
||||
gPopFrame.style.height = (height) + "px"; |
|
||||
|
|
||||
// set the url
|
|
||||
gPopFrame.src = url; |
|
||||
|
|
||||
gReturnFunc = returnFunc; |
|
||||
// for IE
|
|
||||
if (gHideSelects == true) { |
|
||||
hideSelectBoxes(); |
|
||||
} |
|
||||
|
|
||||
window.setTimeout("setPopTitle();", 600); |
|
||||
} |
|
||||
|
|
||||
//
|
|
||||
var gi = 0; |
|
||||
function centerPopWin(width, height) { |
|
||||
if (gPopupIsShown == true) { |
|
||||
if (width == null || isNaN(width)) { |
|
||||
width = gPopupContainer.offsetWidth; |
|
||||
} |
|
||||
if (height == null) { |
|
||||
height = gPopupContainer.offsetHeight; |
|
||||
} |
|
||||
|
|
||||
//var theBody = document.documentElement;
|
|
||||
var theBody = document.getElementsByTagName("BODY")[0]; |
|
||||
//theBody.style.overflow = "hidden";
|
|
||||
var scTop = parseInt(getScrollTop(),10); |
|
||||
var scLeft = parseInt(theBody.scrollLeft,10); |
|
||||
|
|
||||
setMaskSize(); |
|
||||
|
|
||||
//window.status = gPopupMask.style.top + " " + gPopupMask.style.left + " " + gi++;
|
|
||||
|
|
||||
var titleBarHeight = parseInt(document.getElementById("popupTitleBar").offsetHeight, 10); |
|
||||
|
|
||||
var fullHeight = getViewportHeight(); |
|
||||
var fullWidth = getViewportWidth(); |
|
||||
|
|
||||
gPopupContainer.style.top = (scTop + ((fullHeight - (height+titleBarHeight)) / 2)) + "px"; |
|
||||
gPopupContainer.style.left = (scLeft + ((fullWidth - width) / 2)) + "px"; |
|
||||
//alert(fullWidth + " " + width + " " + gPopupContainer.style.left);
|
|
||||
} |
|
||||
} |
|
||||
addEvent(window, "resize", centerPopWin); |
|
||||
addEvent(window, "scroll", centerPopWin); |
|
||||
window.onscroll = centerPopWin; |
|
||||
|
|
||||
|
|
||||
/** |
|
||||
* Sets the size of the popup mask. |
|
||||
* |
|
||||
*/ |
|
||||
function setMaskSize() { |
|
||||
var theBody = document.getElementsByTagName("BODY")[0]; |
|
||||
|
|
||||
var fullHeight = getViewportHeight(); |
|
||||
var fullWidth = getViewportWidth(); |
|
||||
|
|
||||
// Determine what's bigger, scrollHeight or fullHeight / width
|
|
||||
if (fullHeight > theBody.scrollHeight) { |
|
||||
popHeight = fullHeight; |
|
||||
} else { |
|
||||
popHeight = theBody.scrollHeight; |
|
||||
} |
|
||||
|
|
||||
if (fullWidth > theBody.scrollWidth) { |
|
||||
popWidth = fullWidth; |
|
||||
} else { |
|
||||
popWidth = theBody.scrollWidth; |
|
||||
} |
|
||||
|
|
||||
gPopupMask.style.height = popHeight + "px"; |
|
||||
gPopupMask.style.width = popWidth + "px"; |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* @argument callReturnFunc - bool - determines if we call the return function specified |
|
||||
* @argument returnVal - anything - return value |
|
||||
*/ |
|
||||
function hidePopWin(callReturnFunc) { |
|
||||
gPopupIsShown = false; |
|
||||
var theBody = document.getElementsByTagName("BODY")[0]; |
|
||||
theBody.style.overflow = ""; |
|
||||
restoreTabIndexes(); |
|
||||
if (gPopupMask == null) { |
|
||||
return; |
|
||||
} |
|
||||
gPopupMask.style.display = "none"; |
|
||||
gPopupContainer.style.display = "none"; |
|
||||
if (callReturnFunc == true && gReturnFunc != null) { |
|
||||
// Set the return code to run in a timeout.
|
|
||||
// Was having issues using with an Ajax.Request();
|
|
||||
gReturnVal = window.frames["popupFrame"].returnVal; |
|
||||
window.setTimeout('gReturnFunc(gReturnVal);', 1); |
|
||||
} |
|
||||
gPopFrame.src = gDefaultPage; |
|
||||
// display all select boxes
|
|
||||
if (gHideSelects == true) { |
|
||||
displaySelectBoxes(); |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* Sets the popup title based on the title of the html document it contains. |
|
||||
* Uses a timeout to keep checking until the title is valid. |
|
||||
*/ |
|
||||
function setPopTitle() { |
|
||||
return; |
|
||||
if (window.frames["popupFrame"].document.title == null) { |
|
||||
window.setTimeout("setPopTitle();", 10); |
|
||||
} else { |
|
||||
document.getElementById("popupTitle").innerHTML = window.frames["popupFrame"].document.title; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
// Tab key trap. iff popup is shown and key was [TAB], suppress it.
|
|
||||
// @argument e - event - keyboard event that caused this function to be called.
|
|
||||
function keyDownHandler(e) { |
|
||||
if (gPopupIsShown && e.keyCode == 9) return false; |
|
||||
} |
|
||||
|
|
||||
// For IE. Go through predefined tags and disable tabbing into them.
|
|
||||
function disableTabIndexes() { |
|
||||
if (document.all) { |
|
||||
var i = 0; |
|
||||
for (var j = 0; j < gTabbableTags.length; j++) { |
|
||||
var tagElements = document.getElementsByTagName(gTabbableTags[j]); |
|
||||
for (var k = 0 ; k < tagElements.length; k++) { |
|
||||
gTabIndexes[i] = tagElements[k].tabIndex; |
|
||||
tagElements[k].tabIndex="-1"; |
|
||||
i++; |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
function returnRefresh() |
|
||||
{ |
|
||||
//alert("I am active!");
|
|
||||
window.location.reload(); |
|
||||
} |
|
||||
|
|
||||
// For IE. Restore tab-indexes.
|
|
||||
function restoreTabIndexes() { |
|
||||
if (document.all) { |
|
||||
var i = 0; |
|
||||
for (var j = 0; j < gTabbableTags.length; j++) { |
|
||||
var tagElements = document.getElementsByTagName(gTabbableTags[j]); |
|
||||
for (var k = 0 ; k < tagElements.length; k++) { |
|
||||
tagElements[k].tabIndex = gTabIndexes[i]; |
|
||||
tagElements[k].tabEnabled = true; |
|
||||
i++; |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
|
|
||||
/** |
|
||||
* Hides all drop down form select boxes on the screen so they do not appear above the mask layer. |
|
||||
* IE has a problem with wanted select form tags to always be the topmost z-index or layer |
|
||||
* |
|
||||
* Thanks for the code Scott! |
|
||||
*/ |
|
||||
function hideSelectBoxes() { |
|
||||
var x = document.getElementsByTagName("SELECT"); |
|
||||
|
|
||||
for (i=0;x && i < x.length; i++) { |
|
||||
x[i].style.visibility = "hidden"; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* Makes all drop down form select boxes on the screen visible so they do not |
|
||||
* reappear after the dialog is closed. |
|
||||
* |
|
||||
* IE has a problem with wanting select form tags to always be the |
|
||||
* topmost z-index or layer. |
|
||||
*/ |
|
||||
function displaySelectBoxes() { |
|
||||
var x = document.getElementsByTagName("SELECT"); |
|
||||
|
|
||||
for (i=0;x && i < x.length; i++){ |
|
||||
x[i].style.visibility = "visible"; |
|
||||
} |
|
||||
} |
|
@ -1,14 +1,18 @@ |
|||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
||||
<html xmlns="http://www.w3.org/1999/xhtml"> |
<html xmlns="http://www.w3.org/1999/xhtml"> |
||||
<head> |
<head> |
||||
<meta http-equiv="Content-Type" content="text/html; charset=windows-1253" /> |
<meta http-equiv="Content-Type" content="text/html; charset=windows-1253" /> |
||||
<title>ÏëïêëÞñùóç ðáé÷íéäéïý</title> |
<title>ÏëïêëÞñùóç ðáé÷íéäéïý</title> |
||||
<link rel="stylesheet" type="text/css" href="style.css" /> |
<link rel="stylesheet" type="text/css" href="style.css" /> |
||||
<link rel="stylesheet" type="text/css" href="css/subModal.css" /> |
<link rel="stylesheet" type="text/css" href="css/subModal.css" /> |
||||
|
|
||||
</head> |
</head> |
||||
<body bgcolor="#CCFF66" style="font-family: Arial, Helvetica, sans-serif; font-weight: normal; font-size:13px;"> |
<body bgcolor="#CCFF66" style="font-family: Arial, Helvetica, sans-serif; font-weight: normal; font-size:13px;"> |
||||
<h2>Óõã÷áñçôÞñéá! </h2>Ìüëéò ïëïêëÞñùóåò ìå åðéôõ÷ßá ôï ðáé÷íßäé.<p>Ôï óêïñ óïõ äåß÷íåé ôï <strong>ðïóïóôü % ôùí óùóôþí áðáíôÞóåùí</strong>, óôï óýíïëï ôùí åñùôÞóåùí ðïõ óïõ Ýãéíáí.</p><p>Èá Þèåëåò íá îáíáäïêéìÜóåéò;</p> <button onclick="window.top.hidePopWin(true)">Íáé, èá ðáßîù îáíÜ!</button> <button onclick="window.top.hidePopWin()">¼÷é, åõ÷áñéóôþ</button> |
<h2>Óõã÷áñçôÞñéá! </h2>Ìüëéò ïëïêëÞñùóåò ìå åðéôõ÷ßá ôï ðáé÷íßäé. |
||||
|
<p>Ôï óêïñ óïõ äåß÷íåé ôï <strong>ðïóïóôü % ôùí óùóôþí áðáíôÞóåùí</strong>, óôï óýíïëï ôùí åñùôÞóåùí ðïõ óïõ Ýãéíáí.</p> |
||||
</body> |
<p>Èá Þèåëåò íá îáíáäïêéìÜóåéò;</p> |
||||
</html> |
<button onclick="window.top.hidePopWin(true)">Íáé, èá ðáßîù îáíÜ!</button> |
||||
|
<button onclick="window.top.hidePopWin()">¼÷é, åõ÷áñéóôþ</button> |
||||
|
|
||||
|
</body> |
||||
|
</html> |
||||
|
@ -1,3 +1,3 @@ |
|||||
encoding=el_utf8 |
encoding=el_utf8 |
||||
exit=Έξοδος |
exit=Έξοδος |
||||
keyboardletters=2:ΑΒΓ#3:ΔΕΖ#4:ΗΘΙ#5:ΚΛΜ#6:ΝΞΟ#7:ΠΡΣ#8:ΤΥΦ#9:ΧΨΩ# |
keyboardletters=2:ΑΒΓ#3:ΔΕΖ#4:ΗΘΙ#5:ΚΛΜ#6:ΝΞΟ#7:ΠΡΣ#8:ΤΥΦ#9:ΧΨΩ# |
||||
|
@ -1,4 +1,3 @@ |
|||||
encoding=en_utf8 |
encoding=en_utf8 |
||||
exit=Exit |
exit=Exit |
||||
keyboardletters=2:ABC#3:DEF#4:GHI#5:JKL#6:MNO#7:PQRS#8:TUV#9:WXYZ# |
keyboardletters=2:ABC#3:DEF#4:GHI#5:JKL#6:MNO#7:PQRS#8:TUV#9:WXYZ# |
||||
|
|
||||
|
@ -1,4 +1,3 @@ |
|||||
encoding=es_utf8 |
encoding=es_utf8 |
||||
exit=Salir |
exit=Salir |
||||
keyboardletters=2:ABC2ÁªÀÇ#3:DEF3ÉÈ#4:GHI4ÍÌ#5:JKL5#6:MNÑO6ÓÒº#7:PQRS7#8:TUV8ÚÜÙ#9:WXYZ9# |
keyboardletters=2:ABC2ÁªÀÇ#3:DEF3ÉÈ#4:GHI4ÍÌ#5:JKL5#6:MNÑO6ÓÒº#7:PQRS7#8:TUV8ÚÜÙ#9:WXYZ9# |
||||
|
|
||||
|
@ -1,3 +1,3 @@ |
|||||
encoding=el_utf8 |
encoding=el_utf8 |
||||
exit=Έξοδος |
exit=Έξοδος |
||||
keyboardletters=2:ΑΒΓ#3:ΔΕΖ#4:ΗΘΙ#5:ΚΛΜ#6:ΝΞΟ#7:ΠΡΣ#8:ΤΥΦ#9:ΧΨΩ# |
keyboardletters=2:ΑΒΓ#3:ΔΕΖ#4:ΗΘΙ#5:ΚΛΜ#6:ΝΞΟ#7:ΠΡΣ#8:ΤΥΦ#9:ΧΨΩ# |
||||
|
@ -1,4 +1,3 @@ |
|||||
encoding=en_utf8 |
encoding=en_utf8 |
||||
exit=Exit |
exit=Exit |
||||
keyboardletters=2:ABC#3:DEF#4:GHI#5:JKL#6:MNO#7:PQRS#8:TUV#9:WXYZ# |
keyboardletters=2:ABC#3:DEF#4:GHI#5:JKL#6:MNO#7:PQRS#8:TUV#9:WXYZ# |
||||
|
|
||||
|
@ -1,4 +1,3 @@ |
|||||
encoding=es_utf8 |
encoding=es_utf8 |
||||
exit=Salir |
exit=Salir |
||||
keyboardletters=2:ABC2ÁªÀÇ#3:DEF3ÉÈ#4:GHI4ÍÌ#5:JKL5#6:MNÑO6ÓÒº#7:PQRS7#8:TUV8ÚÜÙ#9:WXYZ9# |
keyboardletters=2:ABC2ÁªÀÇ#3:DEF3ÉÈ#4:GHI4ÍÌ#5:JKL5#6:MNÑO6ÓÒº#7:PQRS7#8:TUV8ÚÜÙ#9:WXYZ9# |
||||
|
|
||||
|
Loading…
Reference in new issue