history.navigationMode = 'compatible'; //fire jQuery ready function on back button
jQuery(function($){
	//SETTINGS

	/* IMPORT STYLESHEETS
	var CSS = [
			  // 'css/jquery.Rotator.css',
			   //'common/css/exitMsg.css'
			   //'css/coda-slider-2.0.css'
			   ];
	$.each(CSS, function(i){
		$('head').append('<link rel="stylesheet" href="'+CSS[i]+'" type="text/css" />');                
	});*/
	/* LOAD SCRIPTS*/
	//$.getScript("common/js/jquery.pager.js");
	
	//DETECT HOMEPAGE
	var isHome = false;
	if($('#sectionid_1').length > 0) 
		isHome = true;


	// :: TOPNAV SUPERFISH
	//$.getScript("common/js/hoverIntent.js",function(){
		//$.getScript("common/js/superfish.js",function(){ 
			$("#topnav ul").superfish({ 
							delay: 200, 
							animation: {height:'show'}, 
							speed: 'fast'
			});           
		//});
	//});
	if(isHome) {
		if($('#myfeeds').length > 0){
			$('.myfeeds').show().insertBefore('#rightbox');
			//$.getScript('images/xml2json.js',function(){
				//$.getScript('images/jTicker.js',function(){									 
					var jtick = new jTicker({
						rssId: 62,
						elementId: 'myfeeds',
						interval: 5000,
						date: true
					});
				//});
			//});
		}
		
		//$.getScript("images/jquery.easing.1.3.js",function(){
			//$.getScript("images/jquery.coda-slider-2.0.js",function(){
				var tabs = new Array(); 
				tabs[0] = document.getElementById("pushedid_3"); 
				tabs[1] = document.getElementById("pushedid_4"); 
				//tabs[2] = document.getElementById("pushedid_83"); 
				tabs[2] = document.getElementById("pushedid_6");
				tabs.id = "myTabs"; 
				passArray(tabs);
				var ftabs = new Array(); 
				ftabs[0] = document.getElementById("pushedid_8"); 
				ftabs[1] = document.getElementById("pushedid_9");
				ftabs.id = "tabsRight"; passArray(ftabs); 
			
			
				//$('#myTabs li.tab3 a').click(function(){
				/*$('#myTabs .tab3 a').click(function(){
				
				
				if($('.galleryloaded').length == 0) {
					$.getScript("common/js/galleria.js", function(){	
						Galleria.loadTheme('common/js/galleria.classic.js');										  
						$.ajax({
								type: "GET",
								url: "../common/rss/?rss=20",
								//url: "common/rss=381.xml",
								dataType: "rss",
								success: function (rss) {
									var json = $.xml2json(rss);
									var jItem = json.channel.item,
										rssOutput = "";
									$(jItem).each(function (index) {
										if(this.link.substr((this.link.indexOf('photogallery/')+13))== "")
										rssOutput = rssOutput;
										else
										rssOutput += "<img src='" + this.link + "' alt='" + this.title + "' title='" + this.title + "' />";
									});
									$('#galleria').html(rssOutput);
									
									
										$('#galleria').galleria({
											show_imagenav: true, // remove the prev/next arrows
											transition: 'fade', // crossfade photos
											image_crop: true,
											transition_speed: 700, // slow down the crossfade
											extend: function() {
												var gallery = this; // save the scope
												$('#nav a').click(function(e) {
													e.preventDefault(); // prevent default actions on the links
												})
												// attach gallery methods to links:
												$('#g_prev').click(function() {
													gallery.prev();
												});
												$('#g_next').click(function() {
													gallery.next();
												});
												$('#g_play').click(function() {
													gallery.play();
												});
												$('#g_pause').click(function() {
													gallery.pause();
												});
												$('#g_fullscreen').click(function() {
													gallery.enterFullscreen();
												});
											}
										});
									
						
								},
								error: function (XMLHttpRequest, textStatus, errorThrown) {
									$('#galleria').html(XMLHttpRequest.responseText);
								}
							});
						});
					$(this).addClass('galleryloaded');
				}
			 });*/// end on click

			
			
		//	});
		//});
	
	}
});
var textsize = 12;
function changetextsize(up){
	if(up){
		textsize = parseFloat(textsize)+2;
	}else{
		textsize =parseFloat(textsize)-2;
	}
}
function fsize(size,unit,id){
	var vfontsize = document.getElementById(id);
	if(vfontsize){
		vfontsize.style.fontSize = size + unit;
		createCookie("textsizestyle", textsize, 365);
	}
}
function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}
function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}
/*:::::::::: END FONT SIZE CONTROL :::::::::: */

function iFocus(e) {
    if (e.value == e.defaultValue) {
        e.value = "";
        e.style.color = "#000";
    }
}
function iBlur(e) {
    if (e.value == "") {
        e.value = e.defaultValue;
        e.style.color = "#444";
    }
}

/*:::::::::: BOTTOM TABS :::::::::: */
function toggleTab1() {
			document.getElementById("tabsBottom").className = "btab1";
			document.getElementById("btab1").className = "current";
			document.getElementById("btab2").className = "";
	}
	function toggleTab2() {
			document.getElementById("tabsBottom").className = "btab2";
			document.getElementById("btab1").className = "";
			document.getElementById("btab2").className = "current";
	}


