// JS Compilation Effects


// Site Menu Effect
$(function() {
	$("#menuSlider").lavaLamp({
		fx: "backout", 
		speed: 700,
		click: function(event, menuItem) {
			return true;
		}
	});
});

// Inner product list 
$(function() {
	$(".product_list a").each(function(){
		$(this).click(function(){
			id=this.id;
			arr=id.split("_");
			ident=arr[arr.length-1];
			//content=$('#about_content_'+ident).html();
			$('.product_content_holder').each(function(){
				$(this).show();
			});
			$('.product_content_holder').each(function(){
				if(this.id!='content_'+ident){
					$(this).hide();
				}else{
					$(this).hide().fadeIn();
				}
			});
		});
	});
});


// Current Project Slider
function slider() {
	$("#slider").easySlider({
		auto: true, 
		continuous: true,
		numeric: true
	});
}

function cufon_conf() {
	Cufon.set('fontFamily', 'Optima LT Std')
		 .replace
			('h1')('h2')
			//('h1, h2, div.services_teaser_panel h2, div.nl-content h2, div.nl-content p, a.link3')
		 ;
	Cufon.replace('h1', {fontSize: '20px'});
	Cufon.replace('div.floatbar-content h1', {fontSize: '24px'});
	Cufon.replace('.menuslider li a', {fontSize: '19px', hover: {textShadow: '0px 0px #b69015', color: '-linear-gradient(#f36f24, #f36f24)'}});
	Cufon.replace('h2.headingTxt', {fontSize: '26px'});
	Cufon.replace('div.productlist h3, span.product-title, li.rightcontentarea h2', {fontSize: '18px'});
	Cufon.replace('ul.product_list li p, div.product_desc h3', {fontSize: '16px'});
	Cufon.replace('div.textcontent h3, div.product_desc h2, div.product_content h2', {fontSize: '22px'});
}

/* Newsticker */


// General
$(document).ready(function(){	

	var initValue;
	$(':text').each(function(){
		$(this).focus(function(){
			initValue = $(this).attr('value');
			$(this).val('');
		});
		$(this).blur(function(){
			if($(this).val() == ''){
				$(this).val(initValue);
			}
		});
	});

	cufon_conf();
	
	// Tae ni wala ko kahibalo naunsa ni..
	// If naa other solution pwede nimo ibutang but for now gistatic nako oi sakit ang akoagn ulo.
	// 04.06.2011
	// LCP
	var pageid = $('#pageId').val();
	var left = $('.back').css("left");
	var mylength = left.length; 
	var myStr = left.slice(0,mylength-2); 
	
	if (pageid==6){
		myStr=parseInt(myStr)+10;			
	}else if (pageid==8){
		myStr=parseInt(myStr)+19;			
	}else if (pageid==11){
		myStr=parseInt(myStr)+28;			
	}else if (pageid==13){
		myStr=parseInt(myStr)+35;			
	}else if (pageid==15){
		myStr=parseInt(myStr)+53;			
	}

	$('.back').css("left",myStr+"px");
		
});	












