
function closeSearch(){
var cover = document.getElementById('searchcover');
 cover.style.display = 'none';
 changeOpac(0, 'searchcover');
var el = document.getElementById('searchDiv');
 el.style.display = 'none';
 //changeOpac(0, 'searchDiv');
}







function callSearch(){
var cover = document.getElementById('searchcover');

opacity('searchcover', '0', '40','250');
cover.style.display='block';
SelectFields(true);
var arrayPageSizeS=getPageSizeS();
var el = document.getElementById('searchDiv');
//changeOpac(0, 'searchDiv');
el.style.display = 'block';
//opacity('searchDiv', '0', '100','250');
var arrayPageSizeS = getPageSizeS();
var arrayPageScrolls = getPageScrolls();
el.style.top =  (arrayPageSizeS[3]-el.offsetHeight)/2+ 'px';
el.style.left =  (arrayPageSizeS[0] - el.offsetWidth)/2 + 'px';
}



window.onresize=function(){
var arrayPageSizeS=getPageSizeS()
var arrayPageScrolls=getPageScrolls()
var add=document.getElementById('searchDiv');
var cover = document.getElementById('searchcover');
add.style.top =  (arrayPageSizeS[3]-add.offsetHeight)/2+ 'px';
add.style.left=(arrayPageSizeS[0]-add.offsetWidth)/2+'px';
cover.style.height='100%';
cover.style.width='100%';
}

window.onscroll=function(){
var cover = document.getElementById('searchcover');
cover.style.height=arrayPageSizeS[1]+'px';
}

function SelectFields(v){
var f=document.getElementsByTagName('select')
for(var i=0;i<f.length;i++){
if(v==false){f[i].style.visibility='visible';}else{f[i].style.visibility='hidden';}
}
}

function getPageScrolls(){
var yScroll
if(self.pageYOffset){
yScroll=self.pageYOffset
}else if(document.documentElement&&document.documentElement.scrollTop){
yScroll=document.documentElement.scrollTop
}else if(document.body){
yScroll=document.body.scrollTop}
arrayPageScrolls=new Array('',yScroll)
return arrayPageScrolls}
function getPageSizeS(){
var xScroll,yScroll
if(window.innerHeight&&window.scrollMaxY){
xScroll=document.body.scrollWidth
yScroll=window.innerHeight+window.scrollMaxY
}else if(document.body.scrollHeight>document.body.offsetHeight){
xScroll=document.body.scrollWidth
yScroll=document.body.scrollHeight
}else{
xScroll=document.body.offsetWidth
yScroll=document.body.offsetHeight}
var windowWidth,windowHeight
if(self.innerHeight){
windowWidth=self.innerWidth
windowHeight=self.innerHeight
}else if(document.documentElement&&document.documentElement.clientHeight){
windowWidth=document.documentElement.clientWidth
windowHeight=document.documentElement.clientHeight
}else if(document.body){
windowWidth=document.body.clientWidth
windowHeight=document.body.clientHeight}
if(yScroll<windowHeight){
pageHeight=windowHeight
}else{
pageHeight=yScroll}
if(xScroll<windowWidth){
pageWidth=windowWidth
}else{
pageWidth=xScroll}
arrayPageSizeS=new Array(pageWidth,pageHeight,windowWidth,windowHeight)
return arrayPageSizeS}
var _bMyAlert=true
function MyAlert(sAlert){
if(_bMyAlert){
callAlert('',sAlert)}}
if(us==1) window.alert=MyAlert



