// set global variables
var teller=0;
var anim_time=4000;
var anim_fade=4;
var msg_timer;
var hlp_string='';
//--------------------------------------------------------------------------
//--------------------------------------------------------------------------
function test_frames(v,m,sm){
if (!parent.mmenu){
var winl=(screen.width-300)/2;
var wint=(screen.height-50)/2;
winprops="height=50,width=400,top="+wint+",left="+winl;
wissel=window.open("../change.html","lovasc",winprops);
setTimeout("wait()",100);
}
else if (!parent.mmenu.load_fin){
setTimeout("test_frames(v,m,sm)",2000);
}
else{
parent.mmenu.restoremenu(v,m,sm);
}}
function wait(){
if (wissel.load_end){
wissel.docurl=this.location.href;
wissel.startindex =true;
wissel.focus();
}
else{
teller++;
setTimeout("wait()",1000);
}}
//-------------------------------------------------------------------------
//-------------------------------------------------------------------------
function anim(){
img_nr=img_nr==img_last? 0: img_nr+1;
swap_img('anim','animsg',img_nr);
t=setTimeout('anim()', anim_time);
}
function slides(im,ms,n){
m=i[n].pntr==(i[n].size - 1)? 0: i[n].pntr+1;
if (document.all){
document.images[im].style.filter="blendTrans(duration=2)";
document.images[im].style.filter="blendTrans(duration=anim_fade)";
document.images[im].filters.blendTrans.Apply();
}
if (!parent.mmenu.isN4) document.images[im].src=i[n].img[m].iurl;
if (parent.mmenu.isN4) document.layers['slideswin'].document.images[im].src=i[n].img[m].iurl;
if (document.all){
document.images[im].filters.blendTrans.Play();
}
msgstring=i[n].img[m].txt;
if (parent.mmenu.isNN4)msgstring="<div class='aniwindow'>"+msgstring+"</div>";
loadmsg(msgstring,ms);
i[n].pntr=m;
}
function swap_img(im,ms,n){
if (document.all){
document.images[im].style.filter="blendTrans(duration=2)";
document.images[im].style.filter="blendTrans(duration=anim_fade)";
document.images[im].filters.blendTrans.Apply();
}
if (!parent.mmenu.isN4) document.images[im].src=img[n].src;
if (parent.mmenu.isN4) document.layers['slideswin'].document.images[im].src=img[n].src;
if (document.all){
document.images[im].filters.blendTrans.Play();
}
msgstring=txt[n];
if (parent.mmenu.isNN4)msgstring="<div class='aniwindow'>"+msgstring+"</div>";
loadmsg(msgstring,ms);
}
//------------------------------------------------------------------------
//-------------------------------------------------------------------------
function msg_click(){
document.location.href=msg_list[imsg].msgurl;
}
function msg_mouse(current){
window.status=msg_list[imsg].msgtip;
main_over(current,event,msg_list[imsg].msgtip,msg_list[imsg].msgtype,'');
clearTimeout(msg_timer);
}
function msg_out(){
window.status="";
hide("linktips");
clearTimeout(msg_timer);
msg_timer=setTimeout("changecolor()",fade);
}
//--------------------------------------------------------------------
//--------------------------------------------------------------------
function main_over(current,e,msg,type,img_url){
var x_off=10, y_off=20;
var bg_color="#9FCFFF";
var hlpstr="";
switch (type){
case "onpage": hlpstr="<center>Go to location (this page).</center>";
bg_color="#9DCEFF";
break;
case "page": hlpstr="<center>Go to other page (this section).</center>";
bg_color="#5EAEFF";
break;
case "section": hlpstr="<center>Go to other page (other section).</center>";
bg_color="#0080FF";
break;
case "site": hlpstr="<center>Open site in new window.</center>";
bg_color="#00FF00";
break;
case "pdf": hlpstr="<center>Open pdf document in new window.</center>";
bg_color="#FF952B";
break;
case "photo": hlpstr="<center>See picture in new window.</center>";
bg_color="#FF952B";
break;
case "note": hlpstr="<center>See details in new window.</center>";
bg_color="#FF952B";
break;
case "video": hlpstr="<center>See (streaming) video.</center>";
bg_color="#FF952B";
break;
default:  bg_color="#9FCFFF";
}
if (!msg=="" && type !="none") hlpstr+="<hr class='linkbox'>"+msg;
else if (!msg=="") hlpstr+=msg;
if (img_url !=""){
hlpstr+="<img src='"+img_url+"' align='left'>";
}
if (parent.mmenu.isNN4)msg="<div class='ttip'>"+msg+"</div>";
loadmsg(hlpstr,"linktips");
var set_x=set_x_position(current,e,x_off);
var set_y=set_y_position(e,y_off);
shiftTo("linktips",set_x,set_y);
setBGColor("linktips",bg_color);
show("linktips");
}
//--------------------------------------------------------------------
//--------------------------------------------------------------------
function head_over(current,e,msg){
var x_off=10, y_off=10;
with (window.parent.main){
loadmsg(msg,"linktips");
var set_x=set_x_position(current,e,x_off);
var set_y=y_off+getScrollY();
shiftTo("linktips",set_x,set_y);
setBGColor("linktips","#9FCFFF");
show("linktips");
}}
//--------------------------------------------------------------------
//--------------------------------------------------------------------
function menu_over(current,e,msg){
var x_off=10, y_off=10;
var set_y=set_y_position(e,y_off);
with (window.parent.main){
loadmsg(msg,"linktips");
set_y=set_y+window.parent.main.getScrollY();
shiftTo("linktips",x_off,set_y);
setBGColor("linktips","#9FCFFF");
show("linktips");
}}
//--------------------------------------------------------------------
//--------------------------------------------------------------------
function mmenu_over(current,e,msg){
var x_off=30, y_off=30;
with (window.parent.main){
loadmsg(msg,"linktips");
shiftTo("linktips",x_off,y_off);
setBGColor("linktips","#9FCFFF");
show("linktips");
}}
//--------------------------------------------------------------------
//--------------------------------------------------------------------
function hidetip(){
window.parent.main.hide("linktips");
}
//--------------------------------------------------------------------
//--------------------------------------------------------------------
function set_x_position(l_obj,evt,x_off){
var set_x=x_off;
var win_width=getInsideWindowWidth();
var obj=getRawObject("linktips");
var obj_w=getObjectWidth("linktips");
var l_obj_x=getObjectLeft(l_obj);
var l_obj_w=getObjectWidth(l_obj);
evt=(evt) ? evt: ((event)? event: null);
if (evt){
if (obj_w <(win_width - l_obj_x - l_obj_w)){
set_x=l_obj_x+l_obj_w+x_off;
}else if (obj_w <l_obj_x){
set_x=l_obj_x - obj_w - x_off;
}else{
set_x=(evt.pageX)? evt.pageX: evt.clientX;
set_x=((set_x+x_off+obj_w)> win_width )? (win_width - obj_w - x_off): (set_x+x_off);
}}
return set_x;
}
//--------------------------------------------------------------------
//--------------------------------------------------------------------
function set_y_position(evt, y_off){
var set_y=0;
var win_height=getInsideWindowHeight();
var scroll_y=getScrollY();
var obj=getRawObject("linktips");
evt=(evt) ? evt: ((event)? event: null);
if (evt){
set_y=(evt.pageY)? evt.pageY: evt.clientY;
set_y=((set_y+y_off+obj.scrollHeight)> win_height)? (win_height+scroll_y - y_off - obj.scrollHeight): (set_y+scroll_y+y_off);
}
return set_y;
}
//----------------------------------------------------------------------
//----------------------------------------------------------------------
function win_other(page){
otherwin=this.open(page, "CtrlWindow", "width=800, height=400, toolbar=yes,menubar=yes,location=yes,scrollbars=yes,resizable=yes");
otherwin.focus();
}
function win_image(img_url){
winimg=window.open(img_url, "imgwin", "width=530, height=400, toolbar=no, menubar=no, location=no, scrollbars=no, resizable=yes");
window.winimg.focus();
}
function win_pdf(ds_url){
dswin=window.open(ds_url, "datawin", "width=400, height=600, toolbar=no, menubar=no, location=no, scrollbars=no, resizable=yes");
window.dswin.focus();
}
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
//----- functions for retrieving window, document and object attributes------
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
function getInsideWindowWidth(){
if (window.innerWidth){
return window.innerWidth;
}else if (parent.mmenu.isIE6CSS){
return document.body.parentElement.clientWidth;
}else if (document.body && document.body.clientWidth){
return document.body.clientWidth;
}
return 0;
}
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
function getInsideWindowHeight(){
if (window.innerHeight){
return window.innerHeight;
}else if (parent.mmenu.isIE6CSS){
return document.body.parentElement.clientHeight;
}else if (document.body && document.body.clientHeight){
return document.body.clientHeight;
}
return 0;
}
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
function getScrollX(){
if( typeof( window.pageXOffset )=='number' ){
return window.pageXOffset;
}
else{
if( document.body && document.body.scrollLeft){
return document.body.scrollLeft;
}
else{
if( document.documentElement && document.documentElement.scrollLeft ){
return document.documentElement.scrollLeft;
}}}
return 0;
}
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
function getScrollY(){
if( typeof( window.pageYOffset )=='number' ){
return window.pageYOffset;
}
else{
if( document.body && document.body.scrollTop){
return document.body.scrollTop;
}
else{
if( document.documentElement && document.documentElement.scrollTop){
return document.documentElement.scrollTop;
}}}
return 0;
}
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
function getObjectTop(obj){
var elem=getRawObject(obj);
var result=0;
if (document.defaultView){
var style=document.defaultView;
var cssDecl=style.getComputedStyle(elem,"");
result=cssDecl.getPropertyValue("top");
}else if (elem.currentStyle){
result=elem.currentStyle.top;
}else if (elem.style){
result=elem.style.top;
}else if (parent.mmenu.isNN4){
result=elem.top;
}
return parseInt(result);
}
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
function getObjectLeft(obj){
var elem=getRawObject(obj);
var result=0;
if (document.defaultView){
var style=document.defaultView;
var cssDecl=style.getComputedStyle(elem,"");
result=cssDecl.getPropertyValue("left");
}else if (elem.currentStyle){
result=elem.currentStyle.left;
if (typeof(result) !='number' ){
result=elem.offsetLeft;
}}else if (elem.style){
result=elem.style.left;
}else if (parent.mmenu.isNN4){
result=elem.left;
}
return parseInt(result);
}
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
function getObjectWidth(obj){
var elem=getRawObject(obj);
var result=0;
if (elem.offsetWidth){
if (elem.scrollWidth && (elem.offsetWidth !=elem.scrollWidth)){
result=elem.scrollWidth;
}else{
result=elem.offsetWidth;
}}else if (elem.clip && elem.clip.width){
result=elem.clip.width;
}else if (elem.style && elem.style.pixelWidth){
result=elem.style.pixelWidth;
}
return parseInt(result);
}
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
function getObjectHeight(obj){
var elem=getRawObject(obj);
var result=0;
if (elem.offsetHeight){
result=elem.offsetHeight;
}else if (elem.clip && elem.clip.height){
result=elem.clip.height;
}else if (elem.style && elem.style.pixelHeight){
result=elem.style.pixelHeight;
}
return parseInt(result);
}
//-------------------------------------------------------------------------
//---------------- functions for changing objects attributes---------------
//-------------------------------------------------------------------------
//--------------------------------------------------------------------
//--------------------------------------------------------------------
function loadmsg(msg,obj){
var theObj=getRawObject(obj);
if (document.layers){
theObj.document.write(thestring);
theObj.document.close();
}else{
theObj.innerHTML=msg;
}}
//-------------------------------------------------------------------------
//-------------------------------------------------------------------------
function show(obj){
var theObj=getObject(obj);
if (theObj){
theObj.visibility="visible";
}}
//-------------------------------------------------------------------------
//-------------------------------------------------------------------------
function hide(obj){
var theObj=getObject(obj);
if (theObj){
theObj.visibility="hidden";
}}
//-------------------------------------------------------------------------
//-------------------------------------------------------------------------
function setBGColor(obj,color){
var theObj=getObject(obj);
if (theObj){
if (parent.mmenu.isNN4){
theObj.bgColor=color;
}else if (parent.mmenu.isCSS){
theObj.backgroundColor=color;
}}}
//-------------------------------------------------------------------------
//-------------------------------------------------------------------------
function setFGColor(obj,color){
var theObj=getObject(obj);
if (theObj){
theObj.color=color;
}}
//-------------------------------------------------------------------------
//change objects position ( top and left attributes)
//-------------------------------------------------------------------------
function shiftTo(obj,x,y){
var theObj=getObject(obj);
if (theObj){
if (parent.mmenu.isCSS){
var units=(typeof theObj.left=="string")? "px": 0;
theObj.left=x+units;
theObj.top=y+units;
}else if (parent.mmenu.isNN4){
theObj.moveTo(x,y);
}}}
//-------------------------------------------------------------------------
//change objects size ( width and height attributes)
//-------------------------------------------------------------------------
function sizeTo(obj,h,w){
var theObj=getObject(obj);
if (theObj){
if (parent.mmenu.isCSS){
var units=(typeof theObj.height=="string")? "px": 0;
theObj.height=h+units;
}else if (parent.mmenu.isNN4){
;
}}}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
function seekLayer(doc, name){
var theObj;
for (var i=0;i<doc.layers.length;i++){
if (doc.layers[i].name==name){
theObj=doc.layers[i];
break;
}
if (doc.layers[i].document.layers.length> 0){
theObj=seekLayer(document.layers[i].document, name);
}}
return theObj;
}
//into a valid element object reference
function getRawObject(obj){
var theObj;
if (typeof obj=="string"){
if (parent.mmenu.isW3C){
theObj=document.getElementById(obj);
}else if (parent.mmenu.isIE4){
theObj=document.all(obj);
}else if (parent.mmenu.isNN4){
theObj=seekLayer(document, obj);
}}else{
theObj=obj;
}
return theObj;
}
function getObject(obj){
var theObj=getRawObject(obj);
if (theObj && parent.mmenu.isCSS){
theObj=theObj.style;
}
return theObj;
}
