// global script 

// init document
$(document).ready(function(){					   			   
	//admin					   
	if(drupalData.user=="1"){
		
	}
	
	browserQuirksGlobal();
	// avoid html flash
	$("body").css("visibility" , "visible");
	// bugfix: swftools bottom line quirck
	$("[id^=swfobject]").each(function(i){					   	   
		var params = Drupal.parseJson($(this).attr("swftools"));
		$(this).parent().css("height", params["height"]+"px");
		$(this).parent().parent().parent().parent().css("height", params["height"]+"px");
	});
	requiredMajorVersion = appSettings.flashVersion;
	requiredMinorVersion = 0;
	requiredRevision = 0;
	var hasReqestedVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
	if (hasReqestedVersion) {

	}	
});

// browser specific adjustments
function browserQuirksGlobal(){
	if($.browser.msie) { 
 		$( function() { 
			fixEmptyImageCache()
			// ie 6
			if($.browser.version.substr(0,1)<7){
			
			}
	} );
	}
	if($.browser.mozilla) { 
		$( function() { 
			fixEmptyImageCache()
	} );
	}
	if($.browser.safari) { 
		$( function() { 
			fixEmptyImageCache()
	} );
	}
}

// bugfix: imagecache empty image hide
function fixEmptyImageCache(){
	$(".field-item img").each(function(i){
			// check for image extension
			var ext = $(this).attr("src").split(".");
			if(ext[ext.length-1].length > 5){
				$(this).hide();
			}
		});
		$(".view-field img").each(function(i){
			// check for image extension
			var ext = $(this).attr("src").split(".");
			if(ext[ext.length-1].length > 5){
				$(this).hide();
			}
		});
}


/*FlashGallery = function(swf,div,tid,w,h){
	//	http://www.studiostoute.nl/sites/extern/index.html?tid=46&swf=components/gallery_scroll.swf&mode=iframe_embedded&bg=&drupalDomain=http://www.fun-key.nl/
	var url = drupalData.baseURL+drupalData.app_dir+'components/'+swf+'?tid='+tid;
	var swf = new SWFObject(url, div+'_'+tid, w, h, requiredMajorVersion, appSettings.flashBackgroundColor);
	swf.addParam("wmode", "transparent");
	swf.write(div);
}*/

// Drupal Menu test
DrupalMenu = function(mid) {

}
node_full_flash_global = function(){
	
}

