function opensound(str)
{
    myWin = window.open(str,'Sound','width=780,height=540,left=10,top=10,resizable=yes,titlebar=yes,scrollbars=yes,menubar=no');
}
	
function tracks(id,cd)
{
    myWin = window.open('tracks.php?asin='+id+'&cd='+cd,'Trackliste','width=550,height=365,left=50,top=50,resizable=yes,titlebar=yes,scrollbars=yes,menubar=no');
}
	
function notiz(id)
{
        myWin = window.open('notiz.php?medium_id='+id,'Notiz','width=450,height=310,left=50,top=50,resizable=yes,titlebar=yes,scrollbars=no,menubar=no');
}

function notiz2(id)
{
        myWin = window.open('notiz2.php?medium_id='+id,'Notiz','width=450,height=310,left=50,top=50,resizable=yes,titlebar=yes,scrollbars=no,menubar=no');
}

function stat(id)
{
        myWin = window.open('statistik.php?Asin='+id,'Statistik','width=417,height=266,left=50,top=50,resizable=yes,titlebar=yes,scrollbars=no,menubar=no');
}

function gstat(id)
{
        myWin = window.open('gstatistik.php?Asin='+id,'Statistik','width=417,height=266,left=50,top=50,resizable=yes,titlebar=yes,scrollbars=no,menubar=no');
}
function wp(id)
{
        myWin = window.open('wishprice.php?Asin='+id,'Wunschpreis','width=450,height=355,left=50,top=50,resizable=yes,titlebar=yes,scrollbars=yes,menubar=no');
}

function goabsenden()
{
        document.myform.asin.value='';
        document.myform.rubrik.value=1;
        document.myform.mode.value=document.myform.akt2.value;
        //alert(document.myform.akt2.value);
        document.myform.submit();
}
function goabsenden3()
{
        document.myform.asin.value='';
        document.myform.rubrik.value=3;
        document.myform.mode.value=document.myform.akt2.value;
        document.myform.submit();
}
function goabsenden5()
{
        document.myform.rubrik.value=2;
        document.myform.page.value=1;
        document.myform.submit();
}

function amabuyit()
{
        document.myform.asin.value='';
        document.myform.rubrik.value=1;
        document.myform.mode.value='amabuy';
        document.myform.submit();
}

function goabsenden2()
{
        document.myform.asin.value='';
        document.myform.rubrik.value=1;
        document.myform.mode.value='buy';
        document.myform.submit();
}
function disit()
{
        document.amaform.submit();
        window.location.href='wishlist.php?mode=update';
}
function deli(dasin,anz) {
    if (anz.value == 0) {
        document.amaform.action = "wishlist.php";
        document.amaform.target = "_top";
        document.amaform.mode.value='bestupd';
        document.amaform.asin.value=dasin;
        document.amaform.submit();
    }
}
function absenden(lasin,lrubrik,lmode)
{
        document.myform.asin.value=lasin;
        document.myform.rubrik.value=lrubrik;
        document.myform.mode.value=lmode;
        document.myform.submit();
}



function getWW() {
 var de = document.documentElement;
 return window.innerWidth || self.innerWidth || (de&&de.clientWidth) || document.body.clientWidth;
}
function getHH() {
 var de = document.documentElement;
 return window.innerHeight || self.innerHeight || (de&&de.clientHeight) || document.body.clientHeight;
}
	

function getURLParam(strParamName,strHref) {
	  var strReturn = "";
	  //var strHref = window.location.href;
	  var bFound=false;
	  var cmpstring = strParamName + "=";
	  var cmplen = cmpstring.length;
	  if ( strHref.indexOf("?") > -1 ){
	    var strQueryString = strHref.substr(strHref.indexOf("?")+1);
	    var aQueryString = strQueryString.split("&");
	    for ( var iParam = 0; iParam < aQueryString.length; iParam++ ){
	      if (aQueryString[iParam].substr(0,cmplen)==cmpstring){
	        var aParam = aQueryString[iParam].split("=");
	        strReturn = aParam[1];
	        bFound=true;
	        break;
	      }
	      
	    }
	  }
	  if (bFound==false) return null;
	  return strReturn;
}



$(function(){


$('.menuline').mouseover(function() {
    jQuery(this).css('color','#f00');
}).mouseout(function() {
    jQuery(this).css('color','#000');
});

$('.boxhead').click(function() {
 $('.boxbody').slideToggle();
});


$('.box-header').click(function () {
$(this).next().toggle();
$(this).next().next().toggle();
});


$('#plc').click(function() {
    var ww = getWW();
    var hh = getHH();
    ww = ww/2-210;
    hh = hh/2-170;
    $('#pl').show();
    $('#pg').hide();
    $('#pl').load($('#plc').attr('href'));
    $('#pl').css('left',ww);
    $('#pl').css('top',hh);
    $('#plc').removeClass("tablelines");
    $('#plc').addClass("tablefirst");
    $('#pgc').removeClass("tablefirst");
    $('#pgc').addClass("tablelines");
    return false;
});
$('#pgc').click(function() {
    var ww = getWW();
    var hh = getHH();
    ww = ww/2-210;
    hh = hh/2-170;
    $('#pg').show();
    $('#pl').hide();
    $('#pg').load($('#pgc').attr('href'));
    $('#pg').css('left',ww);
    $('#pg').css('top',hh);
    $('#pgc').removeClass("tablelines");
    $('#pgc').addClass("tablefirst");
    $('#plc').removeClass("tablefirst");
    $('#plc').addClass("tablelines");
    return false;
});

$('.close').click(function() {
    $('#pg').hide();
    $('#pl').hide();
});



$('.rev').click(function() {
    var param = getURLParam('no',$(this).attr('href'));
    myWin = window.open('review.php?no='+param,'Review','width=450,height=300,left=50,top=50,resizable=yes,titlebar=no,scrollbars=no,menubar=no');
    return false;
});


$('#suchfeld').focus(function() {
 if ($('#suchfeld').val() == "Search...")
  $('#suchfeld').val('');
}).blur(function() {
 if ($('#suchfeld').val() == "")
  $('#suchfeld').val('Search...');
});

$('#suchfeld2').focus(function() {
 if ($('#suchfeld2').val() == "Search...")
  $('#suchfeld2').val('');
}).blur(function() {
 if ($('#suchfeld2').val() == "")
  $('#suchfeld2').val('Search...');
});

$('#suchfeld3').focus(function() {
 if ($('#suchfeld3').val() == "Search...")
  $('#suchfeld3').val('');
}).blur(function() {
 if ($('#suchfeld3').val() == "")
  $('#suchfeld3').val('Search...');
});

});
