<!--
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//-->


// image file names go in these arrays
randImgObj.set1 = new Array("top-ban-img1.jpg", "top-ban-img2.jpg","top-ban-img3.jpg","top-ban-img4.jpg","top-ban-img5.jpg","top-ban-img6.jpg","top-ban-img7.jpg","top-ban-img8.jpg", "top-ban-img9.jpg","top-ban-img10.jpg","top-ban-img11.jpg", "top-ban-img12.jpg");

randImgObj.set2 = new Array("ellinika_banner1.jpg", "ellinika_banner2.jpg","ellinika_banner3.jpg","ellinika_banner4.jpg", "ellinika_banner5.jpg", "ellinika_banner6.jpg", "ellinika_banner7.jpg", "ellinika_banner8.jpg", "ellinika_banner9.jpg", "ellinika_banner10.jpg");

randImgObj.set3 = new Array("banner_music_img1.jpg", "banner_music_img2.jpg","banner_music_img3.jpg","banner_music_img4.jpg", "banner_music_img5.jpg", "banner_music_img6.jpg");

randImgObj.set3a = new Array("top-ban-muc-img1.jpg", "top-ban-muc-img2.jpg","top-ban-muc-img3.jpg","top-ban-muc-img4.jpg","top-ban-muc-img5.jpg");

randImgObj.set4 = new Array("top-ban-img9.jpg", "top-ban-img7.jpg","top-ban-img10.jpg","top-ban-img12.jpg");

// If all the images you wish to display are in the same location, you can specify the path here 
randImgObj.imagesPath = "http://www.schools.ac.cy/klimakio/images/";

// No need to edit code below this line 
/////////////////////////////////////////////////////////////////////
Array.prototype.shuffle = function() { 
  var i, temp, i1, i2;
  for (i=0; i<this.length; i++) { 
    i1 = Math.floor( Math.random() * this.length );
    i2 = Math.floor( Math.random() * this.length );
    temp = this[i1];
    this[i1] = this[i2];
    this[i2] = temp;
  }
}

randImgObjs = []; // holds all random rotating image objects defined
// constructor 
function randImgObj(s) {
  this.speed=s; this.ctr=0; this.timer=0;  
  this.index = randImgObjs.length; randImgObjs[this.index] = this;
  this.animString = "randImgObjs[" + this.index + "]";
}

randImgObj.prototype = {
  addImages: function(ar) { // preloads images
    this.imgObj.imgs = [];
    for (var i=0; ar[i]; i++) {
      this.imgObj.imgs[i] = new Image();
      this.imgObj.imgs[i].src = randImgObj.imagesPath + ar[i];
    }
  },

  rotate: function() { // controls rotation
    var ctr = Math.floor( Math.random() * this.imgObj.imgs.length );
    if (ctr == this.ctr) ctr = (ctr > 0)? --ctr: ++ctr;
    this.ctr = ctr;
    if ( typeof this.imgObj.filters != "undefined" ) {
   		this.imgObj.style.filter = 'blendTrans(duration=1)';
      if (this.imgObj.filters.blendTrans) this.imgObj.filters.blendTrans.Apply();
    }
    this.imgObj.src = this.imgObj.imgs[this.ctr].src;
    if ( typeof this.imgObj.filters != "undefined" && this.imgObj.filters.blendTrans )
      this.imgObj.filters.blendTrans.Play();    
  }
}

// sets up rotation for all defined randImgObjs
randImgObj.start = function() {
  for (var i=0; i<randImgObjs.length; i++) 
    randImgObjs[i].timer = setInterval(randImgObjs[i].animString + ".rotate()", randImgObjs[i].speed);                     
}

randImgObj.setUpImg = function(imgAr, sp, w, h) {
  var rotator, img, imgStr = "";
  rotator = new randImgObj(sp);
  randImgObjs[randImgObjs.length-1].imgAr = imgAr;
  imgAr.shuffle();
  img = imgAr[ Math.floor( Math.random() * imgAr.length ) ]; 
  imgStr += '<img src="' + randImgObj.imagesPath + img + '" alt="" ';
  imgStr += 'name="img' + (randImgObjs.length-1) + '" width="' + w + '" height="' + h + '">';
  document.write(imgStr); 
}

function initRandRotationqwe() {
  for (var i=0; randImgObjs[i]; i++) {
    var rotator = randImgObjs[i];
    rotator.imgObj = document.images["img" + i]; // get reference to the image object
    rotator.addImages(rotator.imgAr);
    rotator.rotate();
  }
  randImgObj.start();  
}




BlankImage=new Image();
BlankImage.src="blank.gif";
var Opera=(navigator.userAgent.indexOf("Opera")!=-1)?1:0;
var Opera6=(navigator.userAgent.indexOf("Opera 6")!=-1)?1:0;
var Konqueror=(navigator.userAgent.indexOf("Konqueror")!=-1)?1:0;
var NS4=(document.layers)?1:0;
var IEMac=0;
if ((navigator.appVersion.indexOf("Mac") != -1) && !NS4)
	IEMac=1;
var IEver4=0;
if (document.all)
{
	var vers=navigator.appVersion;
	if (vers.substring(0,1)=="4")
		IEver4=1;
}
var IEMac4=0;
if ((IEMac==1) && (IEver4==1))
	IEMac4=1;
var NS6=0;
var NS7=0;
if (!NS4 && !IEver4)
	NS6=(document.getElementsByTagName("*") && !document.all)?1:0;
	NS7=(document.getElementsByTagName("*") && !document.all)?1:0;
var EnableDMenu=(NS4||NS6||IEver4||Opera6);
var _tempStr_="<scrip";
_tempStr_+="t type=\"";
_tempStr_+="text/javascript\" src=\"";
if(Opera6)
	_tempStr_+="stm30op6.js";
else if(NS6)
	_tempStr_+="stm30nn6.js";
else if(IEver4)
	_tempStr_+="stm30ie4.js";
else
	_tempStr_+="stm30uns.js";
_tempStr_+="\"></scr";
_tempStr_+="ipt>";
document.write(_tempStr_);




var win=null;
function NewWindow(mypage,myname,w,h,scroll,pos){
if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
win=window.open(mypage,myname,settings);}
// -->


//The scripts below are for the hide and expand of content
var enablepersist="on" //Enable saving state of content structure using session cookies? (on/off)
var collapseprevious="no" //Collapse previously open content when opening present? (yes/no)

if (document.getElementById){
document.write('<style type="text/css">')
document.write('.switchcontent{display:none;}')
document.write('</style>')
}

function getElementbyClass(classname){
ccollect=new Array()
var inc=0
var alltags=document.all? document.all : document.getElementsByTagName("*")
for (i=0; i<alltags.length; i++){
if (alltags[i].className==classname)
ccollect[inc++]=alltags[i]
}
}

function contractcontent(omit){
var inc=0
while (ccollect[inc]){
if (ccollect[inc].id!=omit)
ccollect[inc].style.display="none"
inc++
}
}

function expandcontent(cid){
if (typeof ccollect!="undefined"){
if (collapseprevious=="yes")
contractcontent(cid)
document.getElementById(cid).style.display=(document.getElementById(cid).style.display!="block")? "block" : "none"
}
}

function revivecontent(){
contractcontent("omitnothing")
selectedItem=getselectedItem()
selectedComponents=selectedItem.split("|")
for (i=0; i<selectedComponents.length-1; i++)
document.getElementById(selectedComponents[i]).style.display="block"
}

function get_cookie(Name) { 
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) { 
offset += search.length
end = document.cookie.indexOf(";", offset);
if (end == -1) end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}

function getselectedItem(){
if (get_cookie(window.location.pathname) != ""){
selectedItem=get_cookie(window.location.pathname)
return selectedItem
}
else
return ""
}

function saveswitchstate(){
var inc=0, selectedItem=""
while (ccollect[inc]){
if (ccollect[inc].style.display=="block")
selectedItem+=ccollect[inc].id+"|"
inc++
}

document.cookie=window.location.pathname+"="+selectedItem
}

function do_onload(){
uniqueidn=window.location.pathname+"firsttimeload"
getElementbyClass("switchcontent")
if (enablepersist=="on" && typeof ccollect!="undefined"){
document.cookie=(get_cookie(uniqueidn)=="")? uniqueidn+"=1" : uniqueidn+"=0" 
firsttimeload=(get_cookie(uniqueidn)==1)? 1 : 0 //check if this is 1st page load
if (!firsttimeload)
revivecontent()
}
}


if (window.addEventListener)
window.addEventListener("load", do_onload, false)
else if (window.attachEvent)
window.attachEvent("onload", do_onload)
else if (document.getElementById)
window.onload=do_onload

if (enablepersist=="on" && document.getElementById)
window.onunload=saveswitchstate

