	var id=1;
	var last_id = 1;
	var xtime = new Date();
	var lastclicktime = 0;
	var status_change_image = 1;
	function changeimage(id){
		lastclicktime = xtime.getTime();
		
		var image_rotator = $(".image_rotator");
		
		if(status_change_image == 1){
			status_change_image = 0;
			$("#st_img"+last_id).css("display","none");
			$("#clist_"+last_id).removeClass('active');
			$("#featured_info_bg").css("display","none");
			
			f_title = $("#feature_title_"+id).html();
			f_text = $("#feature_link_"+id).html();
			$("#f_info_1").html(f_title);
			$("#f_info_2").html(f_text);

			$("#st_img"+id).css("display","block");
			$("#featured_info_bg").css("display","block");
			status_change_image = 1;
			//$("#st_img"+id).animate({"opacity": "show"}, 600);
			//$("#featured_info_bg").animate({"opacity": "show"}, 600, function(){status_change_image = 1;});
			$("#clist_"+id).addClass('active');
			last_id = id;		
			
		}
		
		//$("#st_img"+id).animate({"opacity": "show"}, "slow");

		/*for(i=1;i<=image_rotator.length;i++){
				$("#st_img"+i).css("display","none");
				$("#clist_"+i).removeClass('active');
		}*/
		
		/*$("#clist_"+id).addClass('active');
		$("#st_img"+id).animate({"opacity": "show"}, "slow");*/
	}
	
	$(document).ready(function(){
		setInterval(update_image,10000);
	});

	function update_image(){
		nowtime = xtime.getTime();
		if(nowtime-lastclicktime<10000){
		}
		else{
			//var image_rotator = document.getElementsByClassName('image_rotator');  
			var image_rotator = $(".image_rotator");
			image_max = image_rotator.length;
			/*for(i=1;i<=image_rotator.length;i++){
				$("#st_img"+i).css("display","none");
				$("#clist_"+i).removeClass('active');
			}*/
			
			id++;
			random_image = id;

			if(random_image>image_max){
				random_image=1;
				id=1;
			}
		
		$("#st_img"+last_id).css("display","none");
		$("#clist_"+last_id).removeClass('active');
		$("#featured_info_bg").css("display","none");
		
		f_title = $("#feature_title_"+id).html();
		f_text = $("#feature_link_"+id).html();
		$("#f_info_1").html(f_title);
		$("#f_info_2").html(f_text);

		
		$("#st_img"+random_image).animate({"opacity": "show"}, 600);
		$("#featured_info_bg").animate({"opacity": "show"}, 600);
		$("#clist_"+random_image).addClass('active');
		last_id = random_image;		
		
			/*$("#st_img"+random_image).animate({"opacity": "show"}, "slow");
			$("#clist_"+random_image).addClass('active');*/
		}
		
	}
	
	/*$(function(){
		$('a.tip').hover(function(){
			htm = $(this).find("div").html();
			$("#easyTooltip").html(htm);
			var offset = $(this).offset();
			$("#easyTooltip").offset({top:offset.top+120, left:offset.left+80});
			$('#easyTooltip').css("display","block");
		},function(){
			$('#easyTooltip').css("display","none");
		});
	});*/
	
	/*$(function(){
    $('a.tip').hover(function(){
		//$('a.tip div').animate({"opacity": "show"}, "fast");
		//htm = $('a.tip div').html();
		htm = $(this).find("div").html();
		$("#easyTooltip").html(htm);
		var offset = $(this).offset();
		$("#easyTooltip").offset({top:offset.top+120, left:offset.left+80});
		//$('#easyTooltip').animate({"opacity": "show"}, "fast");
		$('#easyTooltip').css("display","block");
    },function(){
		$('#easyTooltip').css("display","none");
    });
	
	});*/
	
	function show_tip(obj){
			htm = $(obj).find("div").html();
			$("#easyTooltip").html(htm);
			var offset = obj.offset();
			$("#easyTooltip").offset({top:offset.top, left:offset.left+80});
			$('#easyTooltip').css("display","block");
			$("#easyTooltip").offset({top:offset.top, left:offset.left+80});
			
			
	}
	function hide_tip(){
			$('#easyTooltip').css("display","none");
	}

		/*$(document).ready(function(){	
			$("a").easyTooltip();
			
	});*/

		
        function formatText(index, panel) {
		  return index + "";
	    }
    
        $(function () {
        
           $('.anythingSlider').anythingSlider({
                easing: "easeInOutExpo",        // Anything other than "linear" or "swing" requires the easing plugin
                autoPlay: false,                 // This turns off the entire FUNCTIONALY, not just if it starts running or not.
                delay: 3000,                    // How long between slide transitions in AutoPlay mode
                startStopped: false,            // If autoPlay is on, this can force it to start stopped
                animationTime: 900,             // How long the slide transition takes
                hashTags: true,                 // Should links change the hashtag in the URL?
                buildNavigation: true,          // If true, builds and list of anchor links to link to each slide
        		pauseOnHover: true,             // If true, and autoPlay is enabled, the show will pause on hover
        		startText: "Go",             // Start text
		        stopText: "Stop",               // Stop text
		        navigationFormatter: formatText       // Details at the top of the file on this use (advanced use)
            });
            
            /*$("#slide-jump").click(function(){
                $('.anythingSlider').anythingSlider(100);
            });*/
            
        });
		
		$(function () {
        
            $('.anythingSlider2').anythingSlider({
                easing: "easeInOutExpo",        // Anything other than "linear" or "swing" requires the easing plugin
                autoPlay: false,                 // This turns off the entire FUNCTIONALY, not just if it starts running or not.
                delay: 3000,                    // How long between slide transitions in AutoPlay mode
                startStopped: false,            // If autoPlay is on, this can force it to start stopped
                animationTime: 900,             // How long the slide transition takes
                hashTags: true,                 // Should links change the hashtag in the URL?
                buildNavigation: true,          // If true, builds and list of anchor links to link to each slide
        		pauseOnHover: true,             // If true, and autoPlay is enabled, the show will pause on hover
        		startText: "Go",             // Start text
		        stopText: "Stop",               // Stop text
		        navigationFormatter: formatText       // Details at the top of the file on this use (advanced use)
            });
            
            $("#slide-jump").click(function(){
                $('.anythingSlider').anythingSlider(100);
            });
            
        });
		
$(function() {
	   // var iframe = $('#forum_iframe', parent.document.body);
	   // iframe.height($(document.body).height());
	});

var store_position=2;
function load_store_position(pos){
	newpos = store_position + pos*1;
	if((newpos>0)&&(newpos<4)){
	store_position = newpos;
	if (newpos == 1){
		load_samples()
	}
	else if(newpos == 2){
		load_music()
	}
	else if(newpos == 3){
		load_caraoke()
	}
	}
}

function load_samples(){
$("#shop_controls").removeClass("active1");
$("#shop_controls").addClass("active0");

$("#shop_c_samples").addClass("active");
$("#shop_c_music").removeClass("active");
$("#shop_c_caraoke").removeClass("active");
$("#shop_content").load("load_shop_content.php", {act: "samples"}, function(){
$('.anythingSlider').anythingSlider({
                easing: "easeInOutExpo",        // Anything other than "linear" or "swing" requires the easing plugin
                autoPlay: false,                 // This turns off the entire FUNCTIONALY, not just if it starts running or not.
                delay: 3000,                    // How long between slide transitions in AutoPlay mode
                startStopped: false,            // If autoPlay is on, this can force it to start stopped
                animationTime: 900,             // How long the slide transition takes
                hashTags: true,                 // Should links change the hashtag in the URL?
                buildNavigation: true,          // If true, builds and list of anchor links to link to each slide
        		pauseOnHover: true,             // If true, and autoPlay is enabled, the show will pause on hover
        		startText: "Go",             // Start text
		        stopText: "Stop",               // Stop text
		        navigationFormatter: formatText       // Details at the top of the file on this use (advanced use)
            });
});
store_position = 1;
}

function load_caraoke(){
$("#shop_controls").removeClass("active0");
$("#shop_controls").addClass("active1");

$("#shop_c_caraoke").addClass("active");
$("#shop_c_music").removeClass("active");
$("#shop_c_samples").removeClass("active");
$("#shop_content").load("load_shop_content.php", {act: "caraoke"}, function(){
$('.anythingSlider').anythingSlider({
                easing: "easeInOutExpo",        // Anything other than "linear" or "swing" requires the easing plugin
                autoPlay: false,                 // This turns off the entire FUNCTIONALY, not just if it starts running or not.
                delay: 3000,                    // How long between slide transitions in AutoPlay mode
                startStopped: false,            // If autoPlay is on, this can force it to start stopped
                animationTime: 900,             // How long the slide transition takes
                hashTags: true,                 // Should links change the hashtag in the URL?
                buildNavigation: true,          // If true, builds and list of anchor links to link to each slide
        		pauseOnHover: true,             // If true, and autoPlay is enabled, the show will pause on hover
        		startText: "Go",             // Start text
		        stopText: "Stop",               // Stop text
		        navigationFormatter: formatText       // Details at the top of the file on this use (advanced use)
            });
});
store_position=3;
}

function load_music(){
$("#shop_controls").removeClass("active0");
$("#shop_controls").removeClass("active1");
$("#shop_c_music").addClass("active");
$("#shop_c_caraoke").removeClass("active");
$("#shop_c_samples").removeClass("active");

$("#shop_content").load("load_shop_content.php", {act: "music"}, function(){
$('.anythingSlider').anythingSlider({
                easing: "easeInOutExpo",        // Anything other than "linear" or "swing" requires the easing plugin
                autoPlay: false,                 // This turns off the entire FUNCTIONALY, not just if it starts running or not.
                delay: 3000,                    // How long between slide transitions in AutoPlay mode
                startStopped: false,            // If autoPlay is on, this can force it to start stopped
                animationTime: 900,             // How long the slide transition takes
                hashTags: true,                 // Should links change the hashtag in the URL?
                buildNavigation: true,          // If true, builds and list of anchor links to link to each slide
        		pauseOnHover: true,             // If true, and autoPlay is enabled, the show will pause on hover
        		startText: "Go",             // Start text
		        stopText: "Stop",               // Stop text
		        navigationFormatter: formatText       // Details at the top of the file on this use (advanced use)
            });
});
store_position = 2;
}

function reload_ipad_image(path){
	$("#ipad_bg img").attr("src",path);
}

function reload_video(id){
	$("#video_main").load("load_video.php", {id: id});
}



function resize_iframe(){
	//$("forum_iframe",top.document).contents().height();
	
	 iframe = document.getElementById("forum_iframe").document.body.scrollHeight;
	//this.contentWindow.document.body.offsetHeight + 'px';

}

/*$('#forum_iframe').load(function() {
        alert(this.contentWindow.document.body.offsetHeight);
		this.style.height = this.contentWindow.document.body.offsetHeight + 'px';
    }
);*/


    function getElement(aID)
    {
        return (document.getElementById) ?
            document.getElementById(aID) : 

document.all[aID];
    }

    function getIFrameDocument(aID){ 
        var rv = null; 
        var frame=getElement(aID);
        // if contentDocument exists, W3C 

		//compliant (e.g. Mozilla) 
        if (frame.contentDocument)
            rv = frame.contentDocument;
        else // bad Internet Explorer  ;)
            rv = document.frames[aID].document;
        return rv;
    }

    function adjustMyFrameHeight()
    {
        var frame = getElement("forum_iframe");
        var frameDoc = getIFrameDocument("forum_iframe");
        frame.height = frameDoc.body.offsetHeight+50;
    }


