function SwapImg(id,src){if(img2swap=document.getElementById(id)){swapped_src=img2swap.src;img2swap.src=src;}}
function ReSwapImg(){if(img2swap)img2swap.src=swapped_src;}
function MM_preloadImages(){var d=document;if(d.images){if(!d.MM_p)d.MM_p=new Array();var i,j=d.MM_p.length,a=MM_preloadImages.arguments;for(i=0;i<a.length;i++)
if(a[i].indexOf("#")!=0){d.MM_p[j]=new Image;d.MM_p[j++].src=a[i];}}}
function getMouseX(e){var IE=document.all?true:false
if(!IE)document.captureEvents(Event.MOUSEMOVE);if(IE)tempX=event.clientX+document.body.scrollLeft;else tempX=e.pageX;if(tempX<0)tempX=0;return tempX;}
function getMouseY(e){var IE=document.all?true:false
if(!IE)document.captureEvents(Event.MOUSEMOVE);if(IE)tempY=event.clientY+document.body.scrollTop;else tempY=e.pageY;if(tempY<0)tempY=0;return tempY;}
function findOffset(obj){var curleft=curtop=0;if(obj.offsetParent){curleft=obj.offsetLeft
curtop=obj.offsetTop
while(obj=obj.offsetParent){curleft+=obj.offsetLeft
curtop+=obj.offsetTop}}
return[curleft,curtop];}
function WindowW(){var winW=630;if(parseInt(navigator.appVersion)>3){if(navigator.appName=="Netscape")winW=window.innerWidth;if(navigator.appName.indexOf("Microsoft")!=-1)winW=document.body.offsetWidth;}
return winW;}
function getWindowH(){var winH=460;if(parseInt(navigator.appVersion)>3){if(navigator.appName=="Netscape")winH=window.innerHeight;if(navigator.appName.indexOf("Microsoft")!=-1)winH=document.body.offsetHeight;}
return winH;}
function obj_pos_abs(obj,top,left){obj.style.position='absolute';obj.style.top=top+'px';obj.style.left=left+'px';}
function obj_pos_abs_B(obj,top,right){obj.style.position='absolute';obj.style.top=top+'px';obj.style.right=right+'px';}
function addslashes(str){str=str.replace(/\\/g,'\\\\');str=str.replace(/\'/g,'\\\'');str=str.replace(/\"/g,'\\"');str=str.replace(/\0/g,'\\0');return str;}
function stripslashes(str){str=str.replace(/\\'/g,'\'');str=str.replace(/\\"/g,'"');str=str.replace(/\\0/g,'\0');str=str.replace(/\\\\/g,'\\');return str;}
function Left(str,n){if(n<=0)
return"";else if(n>String(str).length)
return str;else
return String(str).substring(0,n);}
function Right(str,n){if(n<=0)
return"";else if(n>String(str).length)
return str;else{var iLen=String(str).length;return String(str).substring(iLen,iLen-n);}}
function openNew(el,x,y){if(!x)x='800';if(!y)y='600';if(x.substr(x.length-1,1)=='x')x=x.substr(0,x.length-2);if(y.substr(y.length-1,1)=='x')y=y.substr(0,y.length-2);if(x.substr(x.length-1,1)=='%')x=screen.width/100*x.substr(0,x.length-1);if(y.substr(y.length-1,1)=='%')y=screen.height/100*y.substr(0,y.length-1);window.open(el.href,el.title,'width='+x+',height='+y+',screenx='+(screen.width-x)/2+',screeny='+(screen.height-y));return false;}
function dialog_1(el,question,answer,action,e){var cont=0,pop=document.getElementById(el);pop.style.display='block';obj_pos_abs_B(pop,getMouseY(e),WindowW()-getMouseX(e)+15);pop.innerHTML='<p>'+question+'</p>';while(answer[cont]){pop.innerHTML=pop.innerHTML+'<button style="margin: 5px" onClick="document.getElementById(\''+el+'\').style.display= \'none\'; '+action[cont]+'">'+answer[cont]+'</button>';cont++}}
function el_desc(ev,text){var desc_obj=document.getElementById('Floatting_Desc');desc_obj.style.display='inline';obj_pos_abs_B(desc_obj,getMouseY(ev)-30,WindowW()-getMouseX(ev)+10);desc_obj.innerHTML=text;}
