
function openWindow(url,w,h,tb,stb,l,mb,sb,rs,x,y){
	var pos=(document.layers)? ',screenX='+x+',screenY='+y: ',left='+x+',top='+y;
	tb=(tb)?'yes':'no';
	stb=(stb)?'yes':'no';
	l=(l)?'yes':'no';
	mb=(mb)?'yes':'no';
	sb=(sb)?'yes':'no';
	rs=(rs)?'yes':'no';
	var txt='';
	txt+='scrollbars='+sb;
	txt+=',width='+w;
	txt+=',height='+h;
	txt+=',toolbar='+tb;
	txt+=',status='+stb;
	txt+=',menubar='+mb;
	txt+=',links='+l;
	txt+=',resizable='+rs;
	var x=window.open(url, 'newWin', txt+pos);
	x.focus();
}
 
 

 
//here you place the ids of every element you want.
var ids=new Array('payPalTable','bankTransferTable','cashOnDeliveryTable');
 
function switchid(id){	
	hideallids();
	showdiv(id);
}
function hideallids(){
	//loop through the array and hide each element by id
	for (var i=0;i<ids.length;i++){
		hidediv(ids[i]);
	}		  
}
 
function hidediv(id) {
	//safe function to hide an element with a specified id
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'none';
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.display = 'none';
		}
		else { // IE 4
			document.all.id.style.display = 'none';
		}
	}
}
 
function showdiv(id) {
	//safe function to show an element with a specified id
		  
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'block';
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.display = 'block';
		}
		else { // IE 4
			document.all.id.style.display = 'block';
		}
	}
}
 
 


// swap_div

function tabButtonClicked(t, b) {
  var lis=document.body.getElementsByTagName('li');
  for (var i=0; i<lis.length; i++) {
    if (lis[i].id==t+'_'+b+'_button') {
			lis[i].className='ac';
    } else if (lis[i].id.match('^'+t+'_.*_button$')) {
			lis[i].className='ia';        
    }
  }
  var divs=document.body.getElementsByTagName('div');
  for (var i=0; i<divs.length; i++) {
    if (divs[i].id==t+'_'+b+'_content') {
			divs[i].style.display='block';
    } else if (divs[i].id.match('^'+t+'_.*_content$')) {
			divs[i].style.display='none';
    }
  }
  if (typeof createCookie == 'function')	createCookie('top_box_select_'+ t, b, 365);
}
// swap_div - END

