var ie = false;

function submitSearch(){
	var searchString = document.getElementById('search').value.toLowerCase();
	var searchType = document.getElementById('searchSelect').value;
	if(searchString !=''){
		parent.frames['content'].location.href = '/sireneweb/'+searchType+'Search?shop_id=2&search='+searchString+'&page=0&items=20';
	}
	else {alert('where do you want to search for?')}
}

function submitBandSearch(){
	var searchString = document.getElementById('bandsearch').value.toLowerCase();
	var searchType = 'Band';
	if(searchString !=''){
		parent.frames['content'].location.href = '/sireneweb/'+searchType+'Search?shop_id=2&search='+searchString+'&page=0&items=20';
	}
	else {emtpySearchString()}
}

function submitTrackSearch(){
	var searchString = document.getElementById('tracksearch').value.toLowerCase();
	var searchType = 'Track';
	if(searchString !=''){
		parent.frames['content'].location.href = '/sireneweb/'+searchType+'Search?shop_id=2&search='+searchString+'&page=0&items=20';
	}
	else {emtpySearchString()}
}

function submitLabelBrowse(){
	var browseType = 'Label';
	parent.frames['content'].location.href = '/sireneweb/'+browseType+'sShowForShop?shop_id=2';
}

function emptySearchString(){
	alert('where do you want to search for?')
}

function submitBrowse(){
	var browseType = document.getElementById('browseSelect').value;
	parent.frames['content'].location.href = '/sireneweb/'+browseType+'sShowForShop?shop_id=2';
}

function goToTrack(trackId) {
	if (trackId != undefined){
		parent.frames['content'].location.href = '/sireneweb/TrackShow?shop_id=2&track_id='+trackId;
	}
}

function goToBand(bandId) {
	if (bandId != undefined){
		parent.frames['content'].location.href = '/sireneweb/BandShow?shop_id=2&band_id=' + bandId;
	}
}

function goToFastLane(trackId) {
	if (trackId != undefined){
		parent.content.location.href = '/sireneweb/BasketTracksAdd?shop_id=2&track_id='+trackId;
	}
}

function addToCart(trackId) {
	if (trackId != undefined){
		parent.content.location.href = '/sireneweb/BasketTracksAdd?shop_id=2&track_id='+trackId;
	}
}

function browserCheck(){
	if (navigator.userAgent.toLowerCase().indexOf('msie') > 0){ie = true}
}

function initBrowsePages(){
	browserCheck();
	if (ie){
		var contentHeight = document.body.scrollHeight;
		var parentContentHeight = parent.document.body.scrollHeight;
	}
	else {
		var contentHeight = document.body.offsetHeight;
		var parentContentHeight = parent.document.body.offsetHeight;
	}
	parent.document.getElementById('browseResults').style.height = contentHeight+'px';
}
function logOut(){
	document.getElementById('noOfProducts').innerHTML = '0';
	document.getElementById('subtotal').innerHTML = '&#8364;&#160;0,00';
	clearAutoLogonCookie();
	parent.isloggedin = 'false';
}