//var hasProductInstall = DetectFlashVer(6, 0, 65);
// Version check based upon the values defined in globals
//var hasRequestedVersion = DetectFlashVer(10, 0, 12);

var $j = jQuery;
function $adjustLayout() {
	$j("img.full").each($resizeImage);
}
function $resizeImage() {
	if (debug) alert('loading image')
	this.width = $j(this.parentNode).width();
	if ($j.browser.msie) {
		$j('#v_'+this.id).css({width:this.width,height:this.height});
	}
}
var debug = document.location.hash.toString() == "#debug";
var mininav = null;
var lastOffset = 20;
function $findElmByHash(hash) {
	var id = hash.toString().replace('#','');
	var elm = document.getElementById(id);
	if (!elm) elm = document.getElementById('post-'+id);
	return elm;
}
(function($j) {
	$j(document).ready(function() {
		$j('a.scrollto').each(function() {
			$j(this).click(function(){
				if (this.hash == '') return false;
				var elm = $findElmByHash(this.hash);
				if (!elm) return true;
				var elm = $j(elm);
				$j('html, body').animate({scrollTop: elm.offset().top}, 1000);
				return false;
			})
		});		
		document.observe('lightview:opened', function(event) {
		  $j("#lightviewContent").attr("src", event.target.href)		  
		});				
	});
})(jQuery);
if (DetectFlashVer(6, 0, 65) && !DetectFlashVer(10, 0, 12)) {
document.observe('lightview:opened', function(event) {
  if (/PurePlayer.swf/.test(event.target.href)) {
  	var MMPlayerType = (isIE == true) ? "ActiveX" : "PlugIn";
	var MMredirectURL = window.location;
    document.title = document.title.slice(0, 47) + " - Flash Player Installation";
    var MMdoctitle = document.title;
  	document.getElementById('lightviewContent').parentNode.innerHTML = 
	AC_FL_GetContent(
		"src", "playerProductInstall",
		"FlashVars", "MMredirectURL="+MMredirectURL+'&MMplayerType='+MMPlayerType+'&MMdoctitle='+MMdoctitle+"",
		"width", "100%",
		"height", "100%",
		"align", "middle",
		"id", "PurePlayer",
		"quality", "high",
		"bgcolor", "#000000",
		"name", "PurePlayer",
		"allowScriptAccess","sameDomain",
		"type", "application/x-shockwave-flash",
		"pluginspage", "http://www.adobe.com/go/getflashplayer");
  }
});
}


function focusParent(elm) {
	jQuery(elm.parentNode).toggleClass('focus');
}
var old_cforms_validate = cforms_validate;
var cforms_validate = function(a,b) {
	var f = document.getElementById('cf_field_1');
	if (f && f.value == 'Name') f.value = '';
	f = document.getElementById('cf_field_4');
	if (f && f.value == 'Message') f.value = '';
	try {
		f = document.getElementById('cauthor');
		if (f && f.value == 'Name') f.value = '';
		f = document.getElementById('comment');
		if (f && f.value == 'Comment') f.value = '';
	} catch(e) {}
	//alert(f.value)
	old_cforms_validate(a,b);
}

