// JavaScript Document
// (c) Thinkcyber.com

var valume = '';
//var currentVolume = -1



var myFlash = "";
myFlash = $.flash({   swf: 'player.swf',
					width: 290,
					height: 24,
					flashvars: { soundFile: "/marinakamen/includes/mp3/1.mp3,/marinakamen/includes/mp3/2.mp3,/marinakamen/includes/mp3/3.mp3",titles: "Walk On,You are Everything,Last Christmas",artists:"U2,Mary J. Blye,George Michael",autostart: "no", text: '0xE40D8A' }  });


$.fn.showIf = function( show, arg ) {
   return this[ show ? 'show' : 'hide' ]( arg );

};
			jQuery(document).ready(function() {
				
					$(function() {
					$('#pane1')
					.jScrollPane(
						{
							showArrows:true
						}
					);
					});

			//$('#pane1').jScrollPane({showArrows:true});

				$('#audioplayer_1').html(myFlash);
				$("#wrappermp3").hide();
				$('#songtitle').hide();
				$('#add_to_cart').hide();
				$('#buyf').hide();
				$('#buyf1').hide();
				$('#buyf2').hide();
				$('.click_on_each').fadeOut(800).fadeIn(800).fadeOut(800).fadeIn(800).fadeOut(800).fadeIn(800);


				listensound = function(id,pt,subcat,mp3,artist,title,myImage,myPrice,myPrice1,myPrice2,itunes){
				//alert("MP3 File" +mp3)
					$('#click_play').hide();
					function convertQuotes(string){
							return string.replace(/##/g,"'");
							return string.replace(/###/g,"\"");
							return string.replace(/%%/g,"(");
							return string.replace(/%%%/g,")");
					}
					 
					var myImageindex = (myImage.indexOf(".jpg"));
					//alert("Hello " + myImageindex);
					var titlenew = '';
					titlenew = convertQuotes(title);
					var map3new = convertQuotes(mp3);
					$('#audioplayer_1')
					
					.flash({   swf: 'player.swf',
										width: 290,
										height: 24,
										flashvars: { soundFile: mp3, artists: artist, titles: titlenew, autostart: 'no', text: '0xE40D8A' }
						  });

	
	
					var myImag = myImage;
					
					if (myImag != "") {
						if (myImageindex > 0) {
						
						var myImagecover = '<img src="/marinakamen/audioimages/' + myImag + '" width="130" height="130" border="0" alt="" />';
						//alert(+myImage+);
						} else {
						
							var myImagesrc = "<img src='/marinakamen/images/icons/icon130/";
							var myImagesrc1 = ".gif' width='130' height='130' border='0'>";
							var myImagecover = myImagesrc + subcat + myImagesrc1;
						}
					//alert("Image File " +myImagecover)
					
	
					$('#coverholder').hide(myImagecover);
					$('#songtitle').html(titlenew);
					$('#songtitle').show();
					
					$('#buyf').show();
					$('#add_to_cart').show();
					$('#buyf1').hide();
					$('#buyf2').hide();

					$('#myPrice').html("$" + myPrice);
					$('.product_id').val(id);
					$('.product_type').val(pt);
					$('.product_subtype').val(subcat);
	
					
					if(myPrice1 != ""){
						$('#myPrice1').html("$" + myPrice1);
						$('#buyf1').show();
					}
					
					if(myPrice2 != ""){
						$('#myPrice2').html("$" + myPrice2);
						$('#buyf2').show();
					}
					
					switch(pt)
						{
						case "1":
							var fileid = "/marinakamen/marina_video01.php?id="+id;
							break;
						case "2":
							var fileid = "/marinakamen/marina_video02.php?id="+id;
							break;
						case "3":
							var fileid = "/marinakamen/marina_video03.php?id="+id;
							break;
						case "4":
							var fileid = "/marinakamen/marina_video04.php?id="+id;
							break;
						default:
							var fileid = "/marinakamen/marina_video01.php?id="+id;
							break;
						}

					$("#loading").html('<p><img src="images/ajax-loader.gif" width="100" height="19" alt="Please wait.." /></p>');
					
					ajaxify(fileid);
					}
					//<img src="audiocdimages/pro_7.jpg" width="90" height="90" class="field" border="0">
				
				
				}
				
				//@ ajax function get page content
				function ajaxify(file){
						//@ loading message
						//$('<div id="loading"></div>').html("Loading Content: "+file+" ...").appendTo('#wrapper').fadeIn();
						//$("#loading").html('<p><img src="images/ajax-loader.gif" width="100" height="19" alt="Please wait.." /></p>');
						//@ http GET request
						
						$.get(file,function(data) {
							//@ add data to wrapper div, fade it slowly
							$('#wrapper').hide();
							$("#wrappermp3").slideDown('medium',function(){
								
								$(this).html(data).fadeIn('slow',function(){
									$('#loading').fadeOut('slow',function(){$(this).remove();});
								});
							});
						});
					}
				$(".stripeMe>tbody>tr")
					   //.not(":first,:last")
				
				.hover( function() {
				$(this).addClass("over");
					   },function() {
						   $(this).removeClass("over");
					   })
				.click( function(e) {
					$(this).addClass('highlight');
					$(this).removeClass("alt");
					   //alert("Amount: " + $(this).find("td:nth-child(4)").text());
				})
				.filter(":even")
				.addClass("alt");
	
				//$("a[@rel]").click(function() {
				
				//$("#container_shop").load("http://www.marinaonline.com/marinakamen/cart_output.php", {thread_count: this.rel});
				
				//return false; ?product_id=201&product_type=4&without=Buy
				
				//});
				$(".buyform").submit(function() {
				var product_idval = $(".product_id:eq(0)").val();
				var ptval = $(".product_type:eq(0)").val();
				var psubval = $(".product_subtype:eq(0)").val();
				var withoutval = "with";
				//alert("Buyform " +withoutval);
				$.get("add_product.php", { product_id: product_idval, 
				product_type: ptval, withone: withoutval, product_subtype: psubval}, function(data) {
				//alert("Amount: " + product_idval)
					$("#container_shop").html(data);
					});
				return false;
				});
	
				$(".buyform1").submit(function() {
				var product_idval = $(".product_id:eq(1)").val();
				var ptval = $(".product_type:eq(1)").val();
				var psubval = $(".product_subtype:eq(1)").val();
				//var downloadval = $(".product_downloadonly:eq(1)").val();
				var withoutval = "without";
				//alert("buyform1 " +withoutval);
				$.get("add_product.php", { product_id: product_idval, 
				product_type: ptval, without: withoutval, product_subtype: psubval}, function(data) {
				//alert("Amount: " + product_idval)
					$("#container_shop").html(data);
					});
				return false;
				});
	
				$(".buyform2").submit(function() {
				var product_idval = $(".product_id:eq(2)").val();
				var ptval = $(".product_type:eq(2)").val();
				var psubval = $(".product_subtype:eq(2)").val();
				var withoutval = "both";
				//alert("buyform2 " +withoutval);
				$.get("add_product.php", { product_id: product_idval, 
				product_type: ptval, both: withoutval, product_subtype: psubval}, function(data) {
				//alert("Amount: " + product_idval)
					$("#container_shop").html(data);
					});
				return false;
				});
	
				function buynow(file){
						//@ loading message
						//$('<div id="loading"></div>').html("Loading Content: "+file+" ...").appendTo('body').fadeIn();
						//@ http GET request
						$.get(file,function(data) {	
							//@ add data to wrapper div, fade it slowly
							$("#wrappermp3").slideUp('slow',function(){
								$(this).html(data).slideDown('slow',function(){
									$('#loading').fadeOut('slow',function(){$(this).remove();});
								});
							});
						});
					}
				/*function example_ajax_request() {
					$('#example-placeholder').html('<p><img src="/images/ajax-loader.gif" width="220" height="19" /></p>');
					$('#example-placeholder').load("/examples/ajax-loaded.html");
				}
				
				$("#clickme").click( function() {
							  $('#example-placeholder').html('<p><img src="images/ajax-loader.gif" width="220" height="19" /></p>');
							  setTimeout('example_ajax_request_go()', 2000);

							function example_ajax_request_go() {
							  $('#example-placeholder').html('<p>We are done.</p>');
							}
				});
				
				
							$("#bill_to_co").is(":checked") 
				$("#shipping_fieldset input, #shipping_fieldset select").each(function() {
				    var elem = $(this);
				    $("#billing_fieldset #"+ 
				        elem.attr("id").replace(/shipping/, "billing")).val(elem.val());
				});

				*/


	});	