/*=========================================================


	Site Name   Sony T2
	File Name   function.js

	Create Date 2007/08/22
	Update Date 2007/08/22


==========================================================*/

/*========================================================*/
/*                                                        */
/*                                                        */
/*		1. Fullscreen Function                    */
/*                                                        */
/*		2. Pop Up Window Function                 */
/*                                                        */
/*		3. RollOver Images Function*              */
/*                                                        */
/*		4. External Link Function*                */
/*                                                        */
/*		5. Bact To Top Scroll Function*           */
/*                                                        */
/*		6. Zebra Background Function*             */
/*                                                        */
/*		7. Fade Effect Function*                  */
/*                                                        */
/*		8. CSS Selector Function*                 */
/*                                                        */
/*		* Require jquery.js                       */
/*                                                        */
/*                                                        */
/*========================================================*/

/*----------------------------------------------------------

	1. Fullscreen Function

-----------------------------------------------------------*/

function getFullscreen(thePage){
	var winWidth = screen.availWidth;
	var winHeight = screen.availHeight;
	window.open(thePage,"title","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=no,resizable=no,left=0,top=0,width="+winWidth+",height="+winHeight);
}

/*----------------------------------------------------------

	2. Pop Up Window Function

-----------------------------------------------------------*/

/*popup baseClass*/
function openBrWindow(url, name, myW, myH, ans) {
	posX = (screen.availWidth - myW) / 2;
	posY = (screen.availHeight - myH) / 2;
	newWin = window.open(url, name, "left="+posX+", top="+posY+",width="+myW+", height="+myH+", scrollbars="+ans+", resizable="+ans);
}

/*----------------------------------------------------------

	3. RollOver Images Function (require jquery.js)

-----------------------------------------------------------*/

$(function(){
	var image_cache = new Object(); //preload images
	$("img.btn").each(function(i){
	var imgsrc = this.src;
	var dot = this.src.lastIndexOf('.');
	var imgsrc_on = this.src.substr(0, dot) + '_o' + this.src.substr(dot, 4);
	image_cache[this.src] = new Image();
	image_cache[this.src].src = imgsrc_on;
	$(this).hover(
		function(){ this.src = imgsrc_on; },
		function(){ this.src = imgsrc; });
	});
})

/*----------------------------------------------------------

	4. External Link Function (require jquery.js)

-----------------------------------------------------------*/

/*
$(function(){
	var popupEvent = function(event){
		window.open(this.href);
		event.preventDefault();
		event.stopPropagation();
	}
	$("a.externalLink").each(function(i) {
		$(this).click(popupEvent);
		$(this).keypress(popupEvent);
	});
})
*/

/*----------------------------------------------------------

	5. Back To Top Scroll Function (require jquery.js and interface.js)

-----------------------------------------------------------*/

$(function(){
	$('p.pageTopLink a').click(function(){
		$('div#container').ScrollTo(300, 'easeout');
		return false; // neccesary
	});
})

$(function(){
        $('td#tab1Link').click(function(){
		$('a#tab1').ScrollTo(300, 'easeout');
	       	return false; // neccesary
    	});
    	
    	$('td#tab2Link').click(function(){
		$('a#tab2').ScrollTo(300, 'easeout');
	       	return false; // neccesary
    	});
    	
    	$('td#tab3Link').click(function(){
		$('a#tab3').ScrollTo(300, 'easeout');
	       	return false; // neccesary
    	});
    	
    	$('td#tab4Link').click(function(){
		$('a#tab4').ScrollTo(300, 'easeout');
	       	return false; // neccesary
    	});
    	
    	$('td#tab5Link').click(function(){
		$('a#tab5').ScrollTo(300, 'easeout');
	       	return false; // neccesary
    	});
    	
    	$('td#tab6Link').click(function(){
		$('a#tab6').ScrollTo(300, 'easeout');
	       	return false; // neccesary
    	});
    	
    	$('td#tab7Link').click(function(){
		$('a#tab7').ScrollTo(300, 'easeout');
	       	return false; // neccesary
    	});
})

/*----------------------------------------------------------

	6. Zebra Background Function (require jquery.js)

-----------------------------------------------------------*/

$(function(){
	$("body.secondDir.specifications div#container div#content table.section01 tr:even").addClass("zebra");
});

/*----------------------------------------------------------

	7. Fade Effect Function (require jquery.js)

-----------------------------------------------------------*/

/*
$(function(){
	$("img.fadeImg").hover(
		function(){$(this).fadeTo(300, 0.9);},
		function(){$(this).fadeTo(300, 1);}
	);
});
*/

/*----------------------------------------------------------

	8. CSS Selector Function (require jquery.js)

-----------------------------------------------------------*/

/*Top Content Navi*/

$(function(){
	$("body.top div#container div#content ul li")
	.css("margin","0 8px 0 0")
	$("body.top div#container div#content ul li:last-child")
	.css("margin","0")
})

/*Second Directory Section*/

$(function(){
	$("body.secondDir div#container div#content div.section:last")
	.css("margin-bottom","0")
})
