	function getArgs() {
		var args = new Object();
		var query = location.search.substring(1);
		var pairs = query.split("&");
		for(var i = 0; i < pairs.length; i++) {
		var pos = pairs[i].indexOf('=');
		if (pos == -1) continue;
		var argname = pairs[i].substring(0,pos);
		var value = pairs[i].substring(pos+1);
		args[argname] = unescape(value);
		}
		return args;
	}
	function GoToBasket(idpr){
	 // var x = screen.width/1.8;
	 // var y = screen.height/1.8;
	  var x = 650;
	  var y = 400;
	  var strWindowFeatures = "menubar=yes,location=yes,resizable=yes,scrollbars=yes,status=yes,height="+ y +",width="+ x + ", top=0, left=0,fullscreen=no";
	  var newwindow = window.open('basketb.php?id=' + idpr,"Basket",strWindowFeatures);
	  
	  if (window.focus) {newwindow.focus()}
	  return;
  }
  function GoToBasketGr(idpr){
	//  var x = screen.width/1.8;
	//  var y = screen.height/1.8;
	  var x = 650;
	  var y = 400;
	  var strWindowFeatures = "menubar=yes,location=yes,resizable=yes,scrollbars=yes,status=yes,height="+ y +",width="+ x + ", top=0, left=0,fullscreen=no";
	  var newwindow = window.open('basket.php?id=' + idpr,"Basket",strWindowFeatures);
	  
	  if (window.focus) {newwindow.focus()}
	  return;
  }
  function ViewDetailsSmall(prid,prdesc){
		var x = screen.width/3;
		var y = screen.height/1.3;
		  
		var strWindowFeatures = "menubar=yes,location=yes,resizable=yes,scrollbars=yes,status=yes,height="+ y +",width="+ x + ", top=0, left=0,fullscreen=no";
		var newwindow = window.open('viewProductDetailsSmallb.php?id=' + prid + "&product=" + prdesc,"ProductDetails",strWindowFeatures);
		if (window.focus) {newwindow.focus()}
		return;
  }
  function ViewDetailsSmallGr(prid,prdesc){
		var x = screen.width/3;
		var y = screen.height/1.3;
		  
		var strWindowFeatures = "menubar=yes,location=yes,resizable=yes,scrollbars=yes,status=yes,height="+ y +",width="+ x + ", top=0, left=0,fullscreen=no";
		var newwindow = window.open('viewProductDetailsSmall.php?id=' + prid + "&product=" + prdesc,"ProductDetails",strWindowFeatures);
		if (window.focus) {newwindow.focus()}
		return;
  }
  function ViewDetailsSmallBasket(prid,prdesc){
		var x = screen.width/3;
		var y = screen.height/1.3;
		  
		var strWindowFeatures = "menubar=yes,location=yes,resizable=yes,scrollbars=yes,status=yes,height="+ y +",width="+ x + ", top=0, left=0,fullscreen=no";
		var newwindow = window.open('viewProductDetailsBasketSmallb.php?id=' + prid + "&product=" + prdesc,"ProductDetails",strWindowFeatures);
		if (window.focus) {newwindow.focus()}
		return;
  }
  function ViewDetailsSmallBasketGr(prid,prdesc){
		var x = screen.width/3;
		var y = screen.height/1.3;
		  
		var strWindowFeatures = "menubar=yes,location=yes,resizable=yes,scrollbars=yes,status=yes,height="+ y +",width="+ x + ", top=0, left=0,fullscreen=no";
		var newwindow = window.open('viewProductDetailsBasketSmall.php?id=' + prid + "&product=" + prdesc,"ProductDetails",strWindowFeatures);
		if (window.focus) {newwindow.focus()}
		return;
	} 
  function ViewDetails(idpr,product){

	var x = screen.width/1.4;
	var y = screen.height/1.2;
	  
	var strWindowFeatures = "menubar=yes,location=yes,resizable=yes,scrollbars=yes,status=yes,height="+ y +",width="+ x + ", top=0, left=0,fullscreen=no";
	var newwindow = window.open('viewProductDetailsb.php?id=' + idpr + '&product=' + product,"ProductDetails",strWindowFeatures);
	if (window.focus) {newwindow.focus()}
	return;
  }
  function ViewDetailsGr(idpr,product){
	var x = screen.width/1.4;
	var y = screen.height/1.2;
	
	var strWindowFeatures = "menubar=yes,location=yes,resizable=yes,scrollbars=yes,status=yes,height="+ y +",width="+ x + ", top=0, left=0,fullscreen=no";
	var newwindow = window.open('viewProductDetails.php?id=' + idpr + '&product=' + product,"ProductDetails",strWindowFeatures);
	if (window.focus) {newwindow.focus()}

	return;
  }
  
  function ViewAccDetails(idpr,product){
	var x = screen.width/1.8;
	var y = screen.height/1.2;
	var strWindowFeatures = "menubar=yes,toolbar=yes,location=yes,resizable=yes,scrollbars=yes,status=yes,height="+ y +",width="+ x + ", top=0, left=0,fullscreen=no";
	var newwindow = window.open('viewProductDetailsb.php?id=' + idpr + '&product=' + product,"ProductDetailsMore",strWindowFeatures);
	if (window.focus) {newwindow.focus()}
	return;
  }
  function ViewAccDetailsGr(idpr,product){
	var x = screen.width/1.8;
	var y = screen.height/1.2;
	
	var strWindowFeatures = "menubar=yes,toolbar=yes,location=yes,resizable=yes,scrollbars=yes,status=yes,height="+ y +",width="+ x + ", top=0, left=0,fullscreen=no";
	var newwindow = window.open('viewProductDetails.php?id=' + idpr + '&product=' + product,"ProductDetailsMore",strWindowFeatures);
	if (window.focus) {newwindow.focus()}

	return;
  }
  
  function OpenPdfWindow(trade,pdf){
  	window.open(pdf,"PDF", "menubar=yes,location=yes,resizable=yes,scrollbars=yes,status=yes,height=900px,width=1100px,left=60%,top=10%");
  }
  function ShowVideo(videoname){
	window.open(videoname,
		  "ShowVideo", "menubar=yes,location=yes,resizable=yes,scrollbars=yes,status=yes,height=550px,width=650px,left=60%,top=10%");
  }

  //start photo fade
  	function currentOpac(id, opacEnd, millisec) {
		//standard opacity is 100
		var currentOpac = 100;

		//if the element has an opacity set, get it
		if(document.getElementById(id).style.opacity < 100) {
			currentOpac = document.getElementById(id).style.opacity * 100;
		}
	
		//call for the function that changes the opacity
		opacity(id, currentOpac, opacEnd, millisec)
	}
	
  	function opacity(id, opacStart, opacEnd, millisec) {
		//speed for each frame
		var speed = Math.round(millisec / 100);
		var timer = 0;
	
		//determine the direction for the blending, if start and end are the same nothing happens
		if(opacStart > opacEnd) {
			for(i = opacStart; i >= opacEnd; i--) {
				setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
				timer++;
			}
		} else if(opacStart < opacEnd) {
			for(i = opacStart; i <= opacEnd; i++)
				{
				setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
				timer++;
			}
		}
	}
	
	//change the opacity for different browsers
	function opacity(id, opacStart, opacEnd, millisec) {
		//speed for each frame
		var speed = Math.round(millisec / 100);
		var timer = 0;
	
		//determine the direction for the blending, if start and end are the same nothing happens
		if(opacStart > opacEnd) {
			for(i = opacStart; i >= opacEnd; i--) {
				setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
				timer++;
			}
		} else if(opacStart < opacEnd) {
			for(i = opacStart; i <= opacEnd; i++)
				{
				setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
				timer++;
			}
		}
	}
	
	//change the opacity for different browsers
	function changeOpac(opacity, id) {
		var object = document.getElementById(id).style; 
		object.opacity = (opacity / 100);
		object.MozOpacity = (opacity / 100);
		object.KhtmlOpacity = (opacity / 100);
		object.filter = "alpha(opacity=" + opacity + ")";
	}
	
	function shiftOpacity(id, millisec) {
		//if an element is invisible, make it visible, else make it ivisible
		if(document.getElementById(id).style.opacity == 0) {
			opacity(id, 0, 100, millisec);
		} else {
			opacity(id, 100, 0, millisec);
		}
	}
	
	function blendimage(divid, imageid, imagefile, millisec) {
		var speed = Math.round(millisec / 100);
		var timer = 0;
		
		//set the current image as background
		document.getElementById(divid).style.backgroundImage = "url(" + document.getElementById(imageid).src + ")";
		
		//make image transparent
		changeOpac(0, imageid);
		
		//make new image
		document.getElementById(imageid).src = imagefile;
	
		//fade in image
		for(i = 0; i <= 100; i++) {
			setTimeout("changeOpac(" + i + ",'" + imageid + "')",(timer * speed));
			timer++;
		}
	}
	
	function printCurrent(text){
		if(text != ''){
			var prtContent = document.getElementById(text);
			var WinPrint =window.open('','','left=0,top=0,width=1,height=1,t oolbar=0,scrollbars=0,status=0');
			WinPrint.document.write(prtContent.innerHTML);
			WinPrint.document.close();
			WinPrint.focus();
			WinPrint.print();
			WinPrint.close();
			//prtContent.innerHTML=strOldOne;
		}
		else{
			text=document;
			print(text);
		}
	}
