function ChangePage(id){
    // save the page number clicked to the hidden field
    document.all._ctl0_fieldPageNumber.value = id;
    // call the __doPostBack function to post back 
    // the form and execute the PageClick event
    __doPostBack('btnPaging','');
}

function OpenPopup(url, w, h, scroll){
  window.open(url, 'Popup', 'resizable=0, scrollbars='+ scroll + ', width='+ w +', height='+ h);
}

function OpenPopupName(url, name, w, h, scroll){
  window.open(url, name, 'resizable=0, scrollbars='+ scroll + ', width='+ w +', height='+ h);
}

function swapImage(imageName, imageFile){
  //imageName.src = imageFile;
  //alert(document.getElementsByName(imageName)[0].src)
  document.getElementsByName(imageName)[0].src = imageFile;
}

function swapImageBySrc(imageName, imageFile){
  imageName.src = imageFile;
  //alert(document.getElementsByName(imageName)[0].src)
  //document.getElementsByName(imageName)[0].src = imageFile;
}

function LoadParent(targetUri){
  opener.parent.location.href = targetUri;
}

function LoadParentClose(targetUri){
	top.opener.parent.location.href = targetUri;
}

function FullScreenPopup(url){
	var w = window.screen.availWidth;
	var h = window.screen.availHeight;
	w -= 6;
	h -= 32;
	window.open(url,'maxwin','toolbar=0,menubar=0,location=0,directories=0,status=1,resizable=1,scrollbars=0,top=0,left=0,width='+ w +',height=' + h );
}

//helper function for martini.de popup
function getCoords(w, h) {
	if (screen == null){
	  return '';
	}
	if (screen.width == null){
	  return '';
	}
	
	return ',left=' + (screen.width / 2 - w / 2) + ',top=' +(screen.height / 2 - h / 2);
}

//martini.de popup
function OpenPopupBanner(url) {
	window.open(url, 'Popup', 'width=1024, height=701' + getCoords(1024, 701) );
  //openMartiniFullscreen();
}

var agt     = navigator.userAgent.toLowerCase();
var is_mac  = (agt.indexOf("mac")!=-1);
var is_ie   = (agt.indexOf("msie")!=-1);

//martini shop popup
function OpenShop(url){  
  // START adjust window-size for different os/browser; t.bethe
	if(is_mac){ 
		if(is_ie){ // IE on mac
			myWinWidth  = 1024;
			myWinHeight = 768;
		}
		else{ // anything else on mac
			myWinWidth  = 1009;
			myWinHeight = 715;
		}
	}
	else{ // Windows, all other OS
		myWinWidth  = 1014;
		myWinHeight = 713;
		}
  // END adjust window-size for different os/browser; t.bethe
  if(screen.availWidth < 1024 && !screen.availHeight > 800){
    alert(
          "\n\n\n" +
          "Diese Site ist optimiert fuer eine minimale Bildschirmaufloesung von 1024x768 Pixeln.\n" +
          "Mit deiner Bildschirmaufloesung kannst du MARTINI.de leider nicht in voller Schoenheit erleben.\n\n\n"
    )
    myWinWidth  = screen.availWidth;
    myWinHeight = screen.availHeight;
  }
  // Fullscreen-/kioskmode is just supported by MSIE
  window.open(url, 'Shop', "width="+myWinWidth+",height="+myWinHeight+",left=0,top=0,resizable=yes");
	//return false;
}