// JavaScript Document
if (top.location != self.location ) {
	top.location.replace(document.location);
}




$(document).ready(function() {
						   
	// flash content
	goFlash('#flash_guitar_chords', 0 , 1 , '8.0.0');
	goFlash('#flash_guitar_scales', 0 , 1 , '8.0.0');
	goFlash('#flash_guitar_tuner', 0 , 1 , '8.0.0');
	goFlash('#flash_guitar_jamsession', 0 , 1 , '8.0.0');
	
	// user buttons
	$("#btnlogin").click(function() {	document.location.href='/login';	});
	$("#btnsignup").click(function() {	document.location.href='/signup';	});
	$("#btnlogout").click(function() {	document.location.href='/logout';	});
	$("#btnprofile").click(function() {	document.location.href='/profile';	});
	
	// TMP
	$("#tempmsg").html('Server Move - update Tue 20th July 2010<br/>Forum is delayed a little longer<br/>but hope to have it up soon - Strat');
	$("#tempmsg").css('font-size','12px');
	$("#uname").css('margin','0').css('padding','0');
	
	
	// aesthetics
	var zh=$(".zone-left").height(); if(zh<300) { $(".zone-left").height('300px').css('background','#ff9900'); }
						   
	// language switcher					   
    $("#lang").change(function() {
			 document.langform.submit();
		});
	
	var agent=navigator.userAgent.toLowerCase();
	var is_iphone = (agent.indexOf('iphone')!=-1);
	if (is_iphone) {  // alter footer
		$("#footer").css('position','relative').css('left','0').css('top','0').css('background','none');
		$("#bkmk").css('display','none'); $(".copyright").css('display','block').css('float','none').css('margin-left','10px');
	}
	
	
	
});


function goFlash(id,subNum,xCache,flashVer) 
{
	if($(id).length!==0) {
		var containerWidth=$(id).width();
		var containerHeight=$(id).height();
		var mov='/fmov/'+id.substr(7)+'/'+subNum+'/'+xCache+'/';
		var idx=id.substr(1);

			var flashvars = { fvxcache:xCache };
			var params = {
			menu: "false",
			loop: "false",
			quality: "high",
			wmode: "opaque",
			bgcolor: "#FFF"
			};
			var attributes = {};
		
		swfobject.embedSWF(mov, idx, containerWidth, containerHeight, flashVer, "/cb/2.0/js/swfobject/expressInstall.swf", flashvars, params, attributes);
	}
}

function otherMov(id,fullpath,width,height) 
{
	
			flashVer='8.0.0';
			var flashvars = { };
			var params = {
			menu: "false",
			loop: "false",
			quality: "high",
			wmode: "opaque",
			bgcolor: "#FFF"
			};
			var attributes = {};
		
		swfobject.embedSWF(fullpath, id, width, height, flashVer, "/cb/2.0/js/swfobject/expressInstall.swf", flashvars, params, attributes);
 
}


