function ajaxrequest(brand) {
	brand_name = "/collection/" + brand + "/select_query.asp";
	
	new Ajax.Request(brand_name, {
			method:'post',
			parameters: { brand_sex: $('brand_sex').value, brand_typ: $('brand_typ').value},
			onSuccess: function(transport){
				var response = transport.responseText || "no response text";
				$('a_gallery').innerHTML = response;
				requestProduct($('last_id').innerHTML,'0',sex,typ,brand);
			},
			onFailure: function(){ 
				alert('Something went wrong...') 
			}
		});
}
function requestProduct(parValue,parValue2,sex,typ,brand) {
	var param =  parValue;
	var param2 = parValue2;
	
	brand_name = "/collection/" + brand + "/product_show.asp";
	
	new Ajax.Request(brand_name, {
			method:'post',
			parameters: { productid: param, page_nr: param2},
			onSuccess: function(transport){
				var response = transport.responseText || "no response text";

				

				$('a_product').innerHTML = response;
				//last_id = $(last_id).value;
				//$(last_id).style.filter="Alpha(opacity=50)";
				
			},
			onFailure: function(){ 
				alert('Something went wrong...');
				//alert(parValue);
			}
		});
	
	//$(param).style.filter="Alpha(opacity=100)";
}

function nextSite(parValue,sex,typ,brand) {
	var param = parValue;
	
	brand_name = "/collection/" + brand + "/select_query.asp";
	
	new Ajax.Request(brand_name, {
			method:'post',
			parameters: { page_nr: param, brand_sex: sex, brand_typ: typ},
			onSuccess: function(transport){
				var response = transport.responseText || "no response text";
				$('a_gallery').innerHTML = response;
				requestProduct($('last_id').innerHTML,'0',sex,typ,brand);
			},
			onFailure: function(){ 
				alert('Something went wrong...');
				//alert(parValue);
			}
		});
}

function RequestSite(siteName,siteTitel) {
	new Ajax.Request(siteName, {
			method:'post',
			parameters: {},
			onSuccess: function(transport){
				document.title = siteTitel;
				var response = transport.responseText || "no response text";
				$('inhalt').innerHTML = response;
				//requestProduct($('last_id').innerHTML,'0');
				
			},
			onFailure: function(){ 
				alert('Something went wrong...');
				//alert(parValue);
			}
		});
}

function RequestSiteCollection(brand,siteName,siteTitel,sex,typ) {
	new Ajax.Request(siteName, {
			method:'post',
			parameters: {},
			onSuccess: function(transport){
				document.title = siteTitel;

				var response = transport.responseText || "no response text";
				$('inhalt').innerHTML = response;
				new Effect.Fade('brand_logo',{ duration: 2.0 });
				new Effect.Fade('brand_picture',{ queue: 'end',duration: 2.0 });
				new Effect.Appear('selectbox',{ queue: 'end', duration: 0.2});
				
				brand_name = "/collection/" + brand + "/select_query.asp";
				
				new Ajax.Request(brand_name, {
					method:'post',
					parameters: { brand_sex: sex, brand_typ: typ},
					onSuccess: function(transport){
						
						var response = transport.responseText || "no response text";
						$('a_gallery').innerHTML = response;
						
						if(sex=="m"){
							optionNR = 0;
						}else{
							optionNR = 1;
						}
						if(typ=="fashion"){
							optionNR_typ = 0;
						}else{
							optionNR_typ = 1;
						}
						document.collection.brand_sex.options[optionNR].selected = true;
						document.collection.brand_typ.options[optionNR_typ].selected = true;
						
						requestProduct($('last_id').innerHTML,'0',sex,typ,brand);
						
					},
					onFailure: function(){ 
						alert('Something went wrong...');
						//alert(parValue);
					}
				});
				
				
			},
			onFailure: function(){ 
				alert('Something went wrong...');
				//alert(parValue);
			}
		});
}

function RequestStoreSearchDriver(siteName,value1,value2) {
	
	new Ajax.Request(siteName, {
			method:'post',
			parameters: {ORT: value1, PLZ:value2},
			onSuccess: function(transport){
				var response = transport.responseText || "No Address found";
				$('address_driver').innerHTML = response;
			},
			onFailure: function(){ 
				alert('Something went wrong...');
				//alert(parValue);
			}
		});
}
function RequestStoreSearchTough(siteName,value1,value2) {
	 
	new Ajax.Request(siteName, {
			method:'post',
			parameters: {ORT_TOUGH: value1, PLZ_TOUGH:value2},
			onSuccess: function(transport){
				var response = transport.responseText || "No Address found";
				$('adresse_tough').innerHTML = response;
			},
			onFailure: function(){ 
				alert('Something went wrong...');
				//alert(parValue);
			}
		});
}
function RequestStoreSearchRifle(siteName,value1,value2) {
	new Ajax.Request(siteName, {
			method:'post',
			parameters: {ORT_RIFLE: value1, PLZ_RIFLE:value2},
			onSuccess: function(transport){
				var response = transport.responseText || "No Address found";
				$('adresse_rifle').innerHTML = response;
			},
			onFailure: function(){ 
				alert('Something went wrong...');
				//alert(parValue);
			}
		});
}
function RequestStoreSearchWestend(siteName,value1,value2) {
	new Ajax.Request(siteName, {
			method:'post',
			parameters: {ORT_WESTEND: value1, PLZ_WESTEND:value2},
			onSuccess: function(transport){
				var response = transport.responseText || "No Address found";
				$('adresse_westend').innerHTML = response;
			},
			onFailure: function(){ 
				alert('Something went wrong...');
				//alert(parValue);
			}
		});
}

function RequestNewsletterJPG(value1) {
	new Ajax.Request('/putt/news/requestJPG.asp', {
			method:'post',
			parameters: {newpng: value1},
			onSuccess: function(transport){
				var response = transport.responseText || "no response text";
				$('newsJPG').innerHTML = response;
				
			},
			onFailure: function(){ 
				alert('Something went wrong...');
				//alert(parValue);
			}
		});
}