function w(num, h){
	var size_v = document.getElementById('bdy').clientHeight;
	var size_h = document.getElementById('bdy').clientWidth;
	if (!(document.getElementById('bdy').clientHeight)){	
	var size_h = window.innerWidth;
	var size_v = window.innerHeight;	
	}
	document.getElementById('top'+num).style.left = h;
}

function resizing(){
	w(0, 245);
	w(1, 593);
}

function generate(position) {
	qty = links.length;  
	var size_v = document.getElementById('bdy').clientHeight;
	var size_h = document.getElementById('bdy').clientWidth;
	if (!(document.getElementById('bdy').clientHeight)){	
	var size_h = window.innerWidth;
	var size_v = window.innerHeight;	
	}

  for(i=0;i<qty;i++) {     
   document.write('<div id=top'+i+' onmouseover=show(\"top'+i+'\") onmouseout=hide(\"top'+i+'\") style=\"z-index:'+(i+10)+'; position:absolute; visibility:hidden;');  
   switch (i) {
    case 0 :		coordH = size_h/2 - 195; 
					document.write('top:107px; left:'+coordH+'px;\"  onmouseout=hide_all();>');
					break;
				
					case 1 : 
					coordH = size_h/2 + 273;  
					document.write('top:107px; left:'+coordH+'px;\"  onmouseout=hide_all();>');
					break;
   }  
   document.write('<div class="drop">');
   document.write(links[i]);
   document.write('</div></div>');   
   }	
 } 

function show(num) {
	resizing(); 
	document.getElementById(num).style.visibility = 'visible';
}

function hide(num) {
 document.getElementById(num).style.visibility = 'hidden';
}

function hide_all() {
for(i=0;i<2;i++){
	document.getElementById('top'+i).style.visibility = 'hidden';
}
}