/*----------------------------------------------------
	timer
----------------------------------------------------*/
var idTimer;
var pmTime;
var pmTime2;

function ShowClock() {
    var dNow = new Date();
    var sNow;
	var yNow;
    var sYear = dNow.getFullYear();
    var sMonth = dNow.getMonth() + 1;
    var sDate = dNow.getDate();
    var sHour = dNow.getHours();
    var sMinute = dNow.getMinutes();
    var sSecond = dNow.getSeconds();

    if (sMonth < 10) sMonth = "0" + sMonth;
    if (sDate < 10) sDate = "0" + sDate;
    if (sHour < 10) sHour = "0" + sHour;
    if (sMinute < 10) sMinute = "0" + sMinute;
    if (sSecond < 10) sSecond = "0" + sSecond;

    sNow = sHour+":"+sMinute+":"+sSecond;
	yNow = sMonth+"/"+sDate+"/"+sYear;
	DC = document.getElementById("clock");
	DC2 = document.getElementById("clock2");
 		//document.getElementById("text1").value = sNow;
	if (pmTime) DC.removeChild(pmTime);
	if (pmTime2) DC2.removeChild(pmTime2);
	pmTime = document.createTextNode(yNow);
	pmTime2 = document.createTextNode(sNow);
	DC.appendChild(pmTime);
	DC2.appendChild(pmTime2);
    idTimer = setTimeout("ShowClock()", 1000);
}


/*----------------------------------------------------
	background change
----------------------------------------------------*/

function showBG(){
	$(function() {
		$("#img2").fadeTo("slow", 0.9);
	});
}

function chBgImg(opt) {
	document.getElementById("bgimg").src =opt
}

function chengeBG(num) {
	if (num==1){
		var timer1= setTimeout("$('#img2').fadeOut()", 100);
		var timer2= setTimeout("chBgImg('common/img/design_1.jpg')", 500);
		var timer3= setTimeout("$('#img2').fadeIn()", 500);
	} else if(num==2){
		var timer1= setTimeout("$('#img2').fadeOut()", 100);
		var timer2= setTimeout("chBgImg('common/img/design_2.jpg')", 500);
		var timer3= setTimeout("$('#img2').fadeIn()", 500);
	} else if(num==3){
		var timer1= setTimeout("$('#img2').fadeOut()", 100);
		var timer2= setTimeout("chBgImg('common/img/design_3.jpg')", 500);
		var timer3= setTimeout("$('#img2').fadeIn()", 500);
	} else if(num==4){
		var timer1= setTimeout("$('#img2').fadeOut()", 100);
		var timer2= setTimeout("chBgImg('common/img/design_4.jpg')", 500);
		var timer3= setTimeout("$('#img2').fadeIn()", 500);
	} else if(num==5){
		var timer1= setTimeout("$('#img2').fadeOut()", 100);
		var timer2= setTimeout("chBgImg('common/img/design_5.jpg')", 500);
		var timer3= setTimeout("$('#img2').fadeIn()", 500);
	} else if(num==6){
		var timer1= setTimeout("$('#img2').fadeOut()", 100);
		var timer2= setTimeout("chBgImg('common/img/design_6.jpg')", 500);
		var timer3= setTimeout("$('#img2').fadeIn()", 500);

	}
}

/*----------------------------------------------------
	news change
----------------------------------------------------*/

function chengeNWS(num) {
	if (num==1){
		$("#newsframe1").fadeIn("slow");
		$('#news_area1').fbWall({
			id:'cnn',
			showGuestEntries:false,
			showComments:true,
			max:15,
			timeConversion:12
		});
	} else if(num==2){
		$("#newsframe2").fadeIn("slow");
		$('#news_area2').fbWall({
			id:'nytimes',
			showGuestEntries:false,
			showComments:true,
			max:15,
			timeConversion:12
		});
	} else if(num==3){
		$("#newsframe3").fadeIn("slow");
		$('#news_area3').fbWall({
			id:'HuffingtonPost',
			showGuestEntries:false,
			showComments:true,
			max:15,
			timeConversion:12
		});
	} else if(num==4){
		$("#newsframe4").fadeIn("slow");
		$('#news_area4').fbWall({
			id:'FRANCE24.English',
			showGuestEntries:false,
			showComments:true,
			max:15,
			timeConversion:12
		});
	} else if(num==5){
		$("#newsframe5").fadeIn("slow");
		$('#news_area5').fbWall({
			id:'abcnews',
			showGuestEntries:false,
			showComments:true,
			max:15,
			timeConversion:12
		});	
	} else if(num==6){
		$("#newsframe6").fadeIn("slow");
		$('#news_area6').fbWall({
			id:'aljazeera',
			showGuestEntries:false,
			showComments:true,
			max:15,
			timeConversion:12
		});
	} else if(num==7){
		$("#newsframe7").fadeIn("slow");
		$('#news_area7').fbWall({
			id:'Reuters',
			showGuestEntries:false,
			showComments:true,
			max:15,
			timeConversion:12
		});	
	}
}

/*----------------------------------------------------
	tech change
----------------------------------------------------*/

function chengeTECH(num) {
	if (num==1){
		$("#techframe1").fadeIn("slow");
		$('#tech_area1').fbWall({
			id:'Engadget',
			showGuestEntries:false,
			showComments:true,
			max:15,
			timeConversion:12
		});
	} else if(num==2){
		$("#techframe2").fadeIn("slow");
		$('#tech_area2').fbWall({
			id:'gizmodo',
			showGuestEntries:false,
			showComments:true,
			max:15,
			timeConversion:12
		});
	} else if(num==3){
		$("#techframe3").fadeIn("slow");
		$('#tech_area3').fbWall({
			id:'wired',
			showGuestEntries:false,
			showComments:true,
			max:15,
			timeConversion:12
		});
	} else if(num==4){
		$("#techframe4").fadeIn("slow");
		$('#tech_area4').fbWall({
			id:'8062627951',
			showGuestEntries:false,
			showComments:true,
			max:15,
			timeConversion:12
		});
	} else if(num==5){
		$("#techframe5").fadeIn("slow");
		$('#tech_area5').fbWall({
			id:'venturebeat',
			showGuestEntries:false,
			showComments:true,
			max:15,
			timeConversion:12
		});	
	} else if(num==6){
		$("#techframe6").fadeIn("slow");
		$('#tech_area6').fbWall({
			id:'cnet',
			showGuestEntries:false,
			showComments:true,
			max:15,
			timeConversion:12
		});	
	}
}

/*----------------------------------------------------
	movie change
----------------------------------------------------*/

function chengeMOV(num) {
	if (num==1){
		$("#movieframe1").fadeIn("slow");
		$('#movie_area1').fbWall({
			id:'firstshowing',
			showGuestEntries:false,
			showComments:true,
			max:15,
			timeConversion:12
		});
	} else if(num==2){
		$("#movieframe2").fadeIn("slow");
		$('#movie_area2').fbWall({
			id:'moviefone',
			showGuestEntries:false,
			showComments:true,
			max:15,
			timeConversion:12
		});
	} else if(num==3){
		$("#movieframe3").fadeIn("slow");
		$('#movie_area3').fbWall({
			id:'imdb',
			showGuestEntries:false,
			showComments:true,
			max:15,
			timeConversion:12
		});
	} else if(num==4){
		$("#movieframe4").fadeIn("slow");
		$('#movie_area4').fbWall({
			id:'hollywoodcom',
			showGuestEntries:false,
			showComments:true,
			max:15,
			timeConversion:12
		});
	} else if(num==5){
		$("#movieframe5").fadeIn("slow");
		$('#movie_area5').fbWall({
			id:'ScreenJunkies',
			showGuestEntries:false,
			showComments:true,
			max:15,
			timeConversion:12
		});
	} else if(num==6){
		$("#movieframe6").fadeIn("slow");
		$('#movie_area6').fbWall({
			id:'totalfilm',
			showGuestEntries:false,
			showComments:true,
			max:15,
			timeConversion:12
		});
	} else if(num==7){
		$("#movieframe7").fadeIn("slow");
		$('#movie_area7').fbWall({
			id:'youtube',
			showGuestEntries:false,
			showComments:true,
			max:15,
			timeConversion:12
		});
	}
}

/*----------------------------------------------------
	music change
----------------------------------------------------*/

function chengeMUSIC(num) {
	if (num==1){
		$("#musicframe1").fadeIn("slow");
		$('#music_area1').fbWall({
			id:'Billboard',
			showGuestEntries:false,
			showComments:true,
			max:15,
			timeConversion:12
		});
	} else if(num==2){
		$("#musicframe2").fadeIn("slow");
		$('#music_area2').fbWall({
			id:'rollingstone',
			showGuestEntries:false,
			showComments:true,
			max:15,
			timeConversion:12
		});
	} else if(num==3){
		$("#musicframe3").fadeIn("slow");
		$('#music_area3').fbWall({
			id:'MTV',
			showGuestEntries:false,
			showComments:true,
			max:15,
			timeConversion:12
		});
	} else if(num==4){
		$("#musicframe4").fadeIn("slow");
		$('#music_area4').fbWall({
			id:'cmt',
			showGuestEntries:false,
			showComments:true,
			max:15,
			timeConversion:12
		});
	} else if(num==5){
		$("#musicframe5").fadeIn("slow");
		$('#music_area5').fbWall({
			id:'nprmusic',
			showGuestEntries:false,
			showComments:true,
			max:15,
			timeConversion:12
		});
	} else if(num==6){
		WinD=window.open('http://www.pmstudio.co.jp/','pmDMC');	
 		opener=self
	}
}

/*----------------------------------------------------
	sports change
----------------------------------------------------*/

function chengeSPORTS(num) {
	if (num==1){
		$("#sportsframe1").fadeIn("slow");
		$('#sports_area1').fbWall({
			id:'MotoGP',
			showGuestEntries:false,
			showComments:true,
			max:15,
			timeConversion:12
		});
	} else if(num==2){
		$("#sportsframe2").fadeIn("slow");
		$('#sports_area2').fbWall({
			id:'Surfline',
			showGuestEntries:true,
			showComments:true,
			max:15,
			timeConversion:12
		});
	} else if(num==3){
		$("#sportsframe3").fadeIn("slow");
		$('#sports_area3').fbWall({
			id:'speed',
			showGuestEntries:false,
			showComments:true,
			max:15,
			timeConversion:12
		});
	} else if(num==4){
		$("#sportsframe4").fadeIn("slow");
		$('#sports_area4').fbWall({
			id:'nba',
			showGuestEntries:false,
			showComments:true,
			max:15,
			timeConversion:12
		});
	} else if(num==5){
		$("#sportsframe5").fadeIn("slow");
		$('#sports_area5').fbWall({
			id:'ESPN',
			showGuestEntries:false,
			showComments:true,
			max:15,
			timeConversion:12
		});
	} else if(num==6){
		$("#sportsframe6").fadeIn("slow");
		$('#sports_area6').fbWall({
			id:'XGames',
			showGuestEntries:false,
			showComments:true,
			max:15,
			timeConversion:12
		});
	}
}

/*----------------------------------------------------
	design change
----------------------------------------------------*/

function chengeDES(num) {
	if (num==1){
		$("#designframe1").fadeIn("slow");
		$('#design_area1').fbWall({
			id:'yankodesign',
			showGuestEntries:false,
			showComments:true,
			max:15,
			timeConversion:12
		});
	} else if(num==2){
		$("#designframe2").fadeIn("slow");
		$('#design_area2').fbWall({
			id:'coolhunting',
			showGuestEntries:false,
			showComments:true,
			max:15,
			timeConversion:12
		});
	} else if(num==3){
		$("#designframe3").fadeIn("slow");
		$('#design_area3').fbWall({
			id:'Inhabitat',
			showGuestEntries:false,
			showComments:true,
			max:15,
			timeConversion:12
		});
	} else if(num==4){
		$("#designframe4").fadeIn("slow");
		$('#design_area4').fbWall({
			id:'115806817249',
			showGuestEntries:false,
			showComments:true,
			max:15,
			timeConversion:12
		});
	} else if(num==5){
		$("#designframe5").fadeIn("slow");
		$('#design_area5').fbWall({
			id:'dwell',
			showGuestEntries:false,
			showComments:true,
			max:15,
			timeConversion:12
		});
	} else if(num==6){
		$("#designframe6").fadeIn("slow");
		$('#design_area6').fbWall({
			id:'cgsociety',
			showGuestEntries:false,
			showComments:true,
			max:15,
			timeConversion:12
		});
	} else if(num==7){
		$("#designframe7").fadeIn("slow");
		$('#design_area7').fbWall({
			id:'Core77',
			showGuestEntries:false,
			showComments:true,
			max:15,
			timeConversion:12
		});
	}
}

/*----------------------------------------------------
	report change
----------------------------------------------------*/

function chengeREP(num) {
	if (num==1){
		$("#reportframe1").fadeIn("slow");
		$('#report_area1').fbWall({
			id:'TED',
			showGuestEntries:false,
			showComments:true,
			max:15,
			timeConversion:12
		});
	} else if(num==2){
		$("#reportframe2").fadeIn("slow");
		$('#report_area2').fbWall({
			id:'mediastorm.org',
			showGuestEntries:false,
			showComments:true,
			max:15,
			timeConversion:12
		});
	} else if(num==3){
		$("#reportframe3").fadeIn("slow");
		$('#report_area3').fbWall({
			id:'frontlinepbs',
			showGuestEntries:false,
			showComments:true,
			max:15,
			timeConversion:12
		});
	} else if(num==4){
		$("#reportframe4").fadeIn("slow");
		$('#report_area4').fbWall({
			id:'168811439104',
			showGuestEntries:false,
			showComments:true,
			max:15,
			timeConversion:12
		});
	} else if(num==5){
		$("#reportframe5").fadeIn("slow");
		$('#report_area5').fbWall({
			id:'LIFE',
			showGuestEntries:false,
			showComments:true,
			max:15,
			timeConversion:12
		});
	} else if(num==6){
		WinD=window.open('http://www.pmstudio.com/7days/index_ie.html','7days');	
 		opener=self
	} else if(num=7){
		WinD=window.open('http://pmstudiojp.tumblr.com/','pmstudio');	
 		opener=self
	}
}

/*----------------------------------------------------
	navigation icons
----------------------------------------------------*/

jQuery(document).ready(function(){
	var dockOptions =
    	{ align: 'bottom'
    	, size: 80
		,fadeLayer: 'wrap'	
    	};

	jQuery('#bg_1').jqDock(dockOptions);
	jQuery('#newsi_1').jqDock(dockOptions);
	jQuery('#techi_1').jqDock(dockOptions);
	jQuery('#moviei_1').jqDock(dockOptions);
	jQuery('#musici_1').jqDock(dockOptions);
	jQuery('#sportsi_1').jqDock(dockOptions);
	jQuery('#designi_1').jqDock(dockOptions);
	jQuery('#reporti_1').jqDock(dockOptions);
	jQuery('#youtubei_1').jqDock(dockOptions);
});


/*----------------------------------------------------
	menu btn
----------------------------------------------------*/
var IE=/*@cc_on!@*/false
var showBgi=0;
var showNWESI=0;
var showTECHI=0;
var showMOVIE=0;
var showMUSIC=0;
var showSPORTS=0;
var showDESIGN=0;
var showREPORT=0;
var showVIDEO=0;
var showABOUT=0;
var showYOUTUBE=0

/*---CLOSE ICONS---*/
function closeICONS(){
	if (showBgi==1){
		$("#backchange_frame").fadeOut("slow");
		showBgi=0;
	}
	if (showNWESI==1){
		$("#newsicon_frame").fadeOut("slow");
		showNWESI=0;
	}
	if (showTECHI==1){
		$("#techicon_frame").fadeOut("slow");
		showTECHI=0;
	}
	if (showMOVIE==1){
		$("#movieicon_frame").fadeOut("slow");
		showMOVIE=0;
	}
	if (showMUSIC==1){
		$("#musicicon_frameb").fadeOut("slow");
		showMUSIC=0;
	}
	if (showSPORTS==1){
		$("#sportsicon_frame").fadeOut("slow");
		showSPORTS=0;
	}
	if (showDESIGN==1){
		$("#designicon_frame").fadeOut("slow");
		showDESIGN=0;
	}
	if (showREPORT==1){
		$("#reporticon_frame").fadeOut("slow");
		showREPORT=0;
	}
}

/*---CLOSE YOUTUBEWINDOW---*/
function closeYOUWIN(){
	if (showYOUTUBE==1){
		closeYOUTUBE();
	}
}

$(document).ready(function(){
	/*---menu btn---*/

	$("#menubtn0").click(function () {
		if (showBgi==0){
			closeICONS();
			$("#backchange_frame:hidden:first").fadeIn("slow");
			if(IE==false){  
				$("#pm_logo_m").fadeTo("slow", 0.3);
			} else {
				$("#img_white").fadeIn("slow");
			}
			$("#img2").fadeTo("slow", 0.5);
			showBgi=1;
			closeYOUWIN();
			return false;
		} else {
			$("#backchange_frame").fadeOut("slow");
			if(IE==false){ 
				$("#pm_logo_m").fadeTo("slow", 1);
			} else {
				$("#img_white").fadeOut("slow");
			}
			$("#img2").fadeTo("slow", 1);
			showBgi=0;
			return false;
		}
	});

	
	$("#menubtn1").click(function () {
		if (showNWESI==0){
			closeICONS();
			$("#newsicon_frame").fadeIn("slow");
			showNWESI=1;
			closeYOUWIN();
			return false;
		} else{
			$("#newsicon_frame").fadeOut("slow");
			showNWESI=0;
			return false;
		}
	});


	$("#menubtn2").click(function () {
		if (showTECHI==0){
			closeICONS();
			$("#techicon_frame").fadeIn("slow");
			showTECHI=1;
			closeYOUWIN();
			return false;
		} else{
			$("#techicon_frame").fadeOut("slow");
			showTECHI=0;
			return false;
		}
	});

	$("#menubtn3").click(function () {
		if (showMOVIE==0){
			closeICONS();
			$("#movieicon_frame").fadeIn("slow");
			showMOVIE=1;
			closeYOUWIN();
			return false;
		} else{
			$("#movieicon_frame").fadeOut("slow");
			showMOVIE=0;
			return false;
		}
	});

	$("#menubtn4").click(function () {
		if (showMUSIC==0){
			closeICONS();
			$("#musicicon_frameb").fadeIn("slow");
			showMUSIC=1;
			closeYOUWIN();
			return false;
		} else{
			$("#musicicon_frameb").fadeOut("slow");
			showMUSIC=0;
			return false;
		}
	});

	$("#menubtn5").click(function () {
		if (showSPORTS==0){
			closeICONS();
			$("#sportsicon_frame").fadeIn("slow");
			showSPORTS=1;
			closeYOUWIN();
			return false;
		} else{
			$("#sportsicon_frame").fadeOut("slow");
			showSPORTS=0;
			return false;
		}
	});

	$("#menubtn6").click(function () {
		if (showDESIGN==0){
			closeICONS();
			$("#designicon_frame").fadeIn("slow");
			showDESIGN=1;
			closeYOUWIN();
			return false;
		} else{
			$("#designicon_frame").fadeOut("slow");
			showDESIGN=0;
			return false;
		}
		
	});

	$("#menubtn7").click(function () {
		if (showREPORT==0){
			closeICONS();
			$("#reporticon_frame").fadeIn("slow");
			showREPORT=1;
			closeYOUWIN();
			return false;
		} else{
			$("#reporticon_frame").fadeOut("slow");
			showREPORT=0;
			return false;
		}
	});

	/*---header btn---*/

	$("#support").click(function () {
		var options = {};
		$("#mail_frame").toggle( 'fade', options, 500);
		$('#mailWin')[0].contentWindow.rePage();
		return false;
	});

/*---IE version---*/
function msieversion(){
	var ua = window.navigator.userAgent
	var msie = ua.indexOf ( "MSIE " )
     if ( msie > 0 ){ 
         return parseInt (ua.substring (msie+5, ua.indexOf (".", msie )))
     }
 }


	$("#fb_message").click(function() {
		showBrow()
		var options = {};
		$("#pmn_frame").fadeOut("slow");
		$("#pmnewsnavi").fadeOut("slow");
		$("#comment_frame").fadeOut("slow");
		$("#commentnavi").fadeOut("slow");
		if (broName=="IE"){
			if (msieversion()==7){
				$("#fbcomment_frame").toggle( 'fade', options, 500);
			} else if (msieversion()>=8){
				$("#fbcomment_frame").toggle( 'slide', options, 500);
			}
		} else {
			$("#fbcomment_frame").toggle( 'slide', options, 500);
		}
		$("#fbcommentnavi").toggle( 'fade', options, 500);
		//return false;
	});


	$("#pm_message").click(function() {
		showBrow()
		var options = {};
		$("#pmn_frame").fadeOut("slow");
		$("#pmnewsnavi").fadeOut("slow");
		$("#fbcomment_frame").fadeOut("slow");
		$("#fbcommentnavi").fadeOut("slow");
		if (broName=="IE"){
			if (msieversion()==7){
				$("#comment_frame").toggle( 'fade', options, 500);
			} else if (msieversion()>=8){
				$("#comment_frame").toggle( 'slide', options, 500);
			}
		} else {
			$("#comment_frame").toggle( 'slide', options, 500);
		}
		$("#commentnavi").toggle( 'fade', options, 500);
		//return false;
	});

	$("#pmnews").click(function() {
		var options = {};
		$("#comment_frame").fadeOut("slow");
		$("#commentnavi").fadeOut("slow");
		$("#fbcomment_frame").fadeOut("slow");
		$("#fbcommentnavi").fadeOut("slow");
		$("#pmn_frame").toggle( 'slide', options, 500);
		$("#pmnewsnavi").toggle( 'fade', options, 500);
		$('#pm_news')[0].contentWindow.rePage();
		//return false;
	});

	$("#about").click(function () {
		showBrow();
		if (showABOUT==0){
			//$('.projekktor').css('backgroundColor', '#eceaec');
			$('.projekktor').css('backgroundColor', '#fff');
			if (broName=="Chrome" || broName=="IE"){
				$("#about_frame").fadeIn("slow");
			} else if (broName=="Safari"){
				$("#about_frame2").fadeIn("slow");
 			} else {
				$("#about_frame").fadeIn("slow");
			}
			showABOUT=1;
			closeYOUWIN();
			return false;
		} else {
			if (broName=="IE" || broName=="Chrome"){	
				$("#about_frame").fadeOut("slow");
				projekktor('player_c').setStop();
			} else if (broName=="Safari"){
				if (isMobile==false){
					$("#about_frame2").delay(100).fadeOut("slow");
					projekktor('player_d').setStop();
				} else{
					$("#about_frame2").fadeOut("slow");
					projekktor('player_d').setPause();
				}
 			} else {
				$("#about_frame").fadeOut("slow");
				projekktor('player_c').setStop();
			}
			showABOUT=0;
			return false;
		}
	});

	$("#vevo").click(function () {
		if (showYOUTUBE==0){
			$("#youtubeicon_frame").fadeIn("slow");
			$("#youtube_frame").fadeIn("slow");
			$('#youtubeMovie')[0].contentWindow.restartVideo();
			showYOUTUBE=1;
			return false;
		} else {
			closeYOUTUBE();
		}
	});


	/*---close btn---*/
	$("#close_1").click(function () {
		$("#backchange_frame").fadeOut("slow");
		if(IE==false){ 
			$("#pm_logo_m").fadeTo("slow", 1);
		} else{
			$("#img_white").fadeOut("slow");
		}
		$("#img2").fadeTo("slow", 1);
		showBgi=0;
		return false;
	});

	$("#closenewsi").click(function () {
		$("#newsicon_frame").fadeOut("slow");
		showNWESI=0;
		return false;
	});

	$("#closetechi").click(function () {
		$("#techicon_frame").fadeOut("slow");
		showTECHI=0;
		return false;
	});

	$("#closemoviei").click(function () {
		$("#movieicon_frame").fadeOut("slow");
		showMOVIE=0;
		return false;
	});

	$("#closemusici").click(function () {
		$("#musicicon_frameb").fadeOut("slow");
		showMUSIC=0;
		return false;
	});

	$("#closesportsi").click(function () {
		$("#sportsicon_frame").fadeOut("slow");
		showSPORTS=0;
		return false;
	});

	$("#closedesigni").click(function () {
		$("#designicon_frame").fadeOut("slow");
		showDESIGN=0;
		return false;
	});

	$("#closereporti").click(function () {
		$("#reporticon_frame").fadeOut("slow");
		showREPORT=0;
		return false;
	});

	$("#closeyoutubei").click(function () {
		closeYOUTUBE();
	});

	/*news*/
	$("#close_3").click(function () {
		$("#newsframe1").fadeOut("slow");
		return false;
	});

	$("#close_4").click(function () {
		$("#newsframe2").fadeOut("slow");
		return false;
	});

	$("#close_5").click(function () {
		$("#newsframe3").fadeOut("slow");
		return false;
	});

	$("#close_6").click(function () {
		$("#newsframe4").fadeOut("slow");
		return false;
	});

	$("#close_7").click(function () {
		$("#newsframe5").fadeOut("slow");
		return false;
	});

	$("#close_8").click(function () {
		$("#newsframe6").fadeOut("slow");
		return false;
	});

	$("#close_43").click(function () {
		$("#newsframe7").fadeOut("slow");
		return false;
	});

	/*tech*/
	$("#close_9").click(function () {
		$("#techframe1").fadeOut("slow");
		return false;
	});

	$("#close_10").click(function () {
		$("#techframe2").fadeOut("slow");
		return false;
	});

	$("#close_11").click(function () {
		$("#techframe3").fadeOut("slow");
		return false;
	});

	$("#close_12").click(function () {
		$("#techframe4").fadeOut("slow");
		return false;
	});

	$("#close_13").click(function () {
		$("#techframe5").fadeOut("slow");
		return false;
	});

	$("#close_14").click(function () {
		$("#techframe6").fadeOut("slow");
		return false;
	});

	/*movie*/
	$("#close_15").click(function () {
		$("#movieframe1").fadeOut("slow");
		return false;
	});

	$("#close_16").click(function () {
		$("#movieframe2").fadeOut("slow");
		return false;
	});

	$("#close_17").click(function () {
		$("#movieframe3").fadeOut("slow");
		return false;
	});

	$("#close_37").click(function () {
		$("#movieframe4").fadeOut("slow");
		return false;
	});

	$("#close_38").click(function () {
		$("#movieframe5").fadeOut("slow");
		return false;
	});

	$("#close_39").click(function () {
		$("#movieframe6").fadeOut("slow");
		return false;
	});

	$("#close_46").click(function () {
		$("#movieframe7").fadeOut("slow");
		return false;
	});

	/*music*/
	$("#close_18").click(function () {
		$("#musicframe1").fadeOut("slow");
		return false;
	});

	$("#close_19").click(function () {
		$("#musicframe2").fadeOut("slow");
		return false;
	});

	$("#close_36").click(function () {
		$("#musicframe3").fadeOut("slow");
		return false;
	});

	$("#close_40").click(function () {
		$("#musicframe4").fadeOut("slow");
		return false;
	});

	$("#close_42").click(function () {
		$("#musicframe5").fadeOut("slow");
		return false;
	});

	/*sports*/
	$("#close_20").click(function () {
		$("#sportsframe1").fadeOut("slow");
		return false;
	});

	$("#close_21").click(function () {
		$("#sportsframe2").fadeOut("slow");
		return false;
	});

	$("#close_22").click(function () {
		$("#sportsframe3").fadeOut("slow");
		return false;
	});

	$("#close_23").click(function () {
		$("#sportsframe4").fadeOut("slow");
		return false;
	});

	$("#close_24").click(function () {
		$("#sportsframe5").fadeOut("slow");
		return false;
	});

	$("#close_41").click(function () {
		$("#sportsframe6").fadeOut("slow");
		return false;
	});

	/*design*/
	$("#close_25").click(function () {
		$("#designframe1").fadeOut("slow");
		return false;
	});

	$("#close_26").click(function () {
		$("#designframe2").fadeOut("slow");
		return false;
	});

	$("#close_27").click(function () {
		$("#designframe3").fadeOut("slow");
		return false;
	});

	$("#close_28").click(function () {
		$("#designframe4").fadeOut("slow");
		return false;
	});

	$("#close_29").click(function () {
		$("#designframe5").fadeOut("slow");
		return false;
	});

	$("#close_30").click(function () {
		$("#designframe6").fadeOut("slow");
		return false;
	});

	$("#close_45").click(function () {
		$("#designframe7").fadeOut("slow");
		return false;
	});

	/*report*/
	$("#close_31").click(function () {
		$("#reportframe1").fadeOut("slow");
		return false;
	});

	$("#close_32").click(function () {
		$("#reportframe2").fadeOut("slow");
		return false;
	});

	$("#close_33").click(function () {
		$("#reportframe3").fadeOut("slow");
		return false;
	});

	$("#close_34").click(function () {
		$("#reportframe4").fadeOut("slow");
		return false;
	});

	$("#close_44").click(function () {
		$("#reportframe5").fadeOut("slow");
		return false;
	});

	/*about*/
	$("#close_35c").click(function () {
		$("#about_frame").fadeOut("slow");
		projekktor('player_c').setStop();
		showABOUT=0;
		return false;
	});

	$("#close_35d").click(function () {
		if (isMobile==false){
			$("#about_frame2").delay(100).fadeOut("slow");
			projekktor('player_d').setStop();
			showABOUT=0;
			return false;
		} else {
			$("#about_frame2").fadeOut("slow");
			projekktor('player_d').setPause();
			showABOUT=0;
			return false;
		}
	});

	/*video*/
	$("#close_35").click(function () {
		$("#video_frame").fadeOut("slow");
		projekktor('player_a').setStop();
		showVIDEO=0;
		return false;
	});

	$("#close_35b").click(function () {
		if (isMobile==false){
			$("#video_frame2").delay(100).fadeOut("slow");
			projekktor('player_b').setStop();
			showVIDEO=0;
			return false;
		} else {
			$("#video_frame2").fadeOut("slow");
			projekktor('player_b').setPause();
			showVIDEO=0;
			return false;
		}
	});

	/*youtube*/
	$("#close_47").click(function () {
		closeYOUTUBE();
	});

	/*mail*/
	$("#close_48").click(function () {
		var options = {};
		$("#mail_frame").toggle( 'fade', options, 500);
		$('#mailWin')[0].contentWindow.rePage();
		return false;
	});

});


/*----------------------------------------------------
	scroll
----------------------------------------------------*/

var movedownvar
var moveupvar
var gIDNUM
function moveDivTo(nam){
	clearTimeout(moveupvar)
	var objDiv = document.getElementById(gIDNUM);
	var h=objDiv.scrollHeight
	document.getElementById("y").value=h
	pm=objDiv.scrollHeight
	if (objDiv.scrollTop>=(h-200)){
		objDiv.scrollTop=h
		clearTimeout(movedownvar)
	} else {
		objDiv.scrollTop += 20
		document.getElementById("y").value=objDiv.scrollTop
		movedownvar=setTimeout("moveDivTo()",20);
	}
}

function moveDivTo2(nam){
	clearTimeout(movedownvar)
	var objDiv = document.getElementById(gIDNUM);
	var h=objDiv.scrollHeight
 	if (objDiv.scrollTop<=0){
		objDiv.scrollTop=0
		clearTimeout(moveupvar)
	} else {
		objDiv.scrollTop -= 20
		document.getElementById("y").value=objDiv.scrollTop
		moveupvar=setTimeout("moveDivTo2()",20);
	}
}

$(function(){
	/*-------news-------*/
	$("#cnn_up").mouseup(function(){
      clearTimeout(moveupvar)
    }).mousedown(function(){
		gIDNUM='face_area1'
     	moveDivTo2()
    });

	$("#cnn_down").mouseup(function(){
      clearTimeout(movedownvar)
    }).mousedown(function(){
		gIDNUM='face_area1'
     	moveDivTo()
    });

	$("#nyt_up").mouseup(function(){
      clearTimeout(moveupvar)
    }).mousedown(function(){
		gIDNUM='face_area2'
     	moveDivTo2()
    });

	$("#nyt_down").mouseup(function(){
      clearTimeout(movedownvar)
    }).mousedown(function(){
		gIDNUM='face_area2'
     	moveDivTo()
    });

	$("#huf_up").mouseup(function(){
      clearTimeout(moveupvar)
    }).mousedown(function(){
		gIDNUM='face_area3'
     	moveDivTo2()
    });

	$("#huf_down").mouseup(function(){
      clearTimeout(movedownvar)
    }).mousedown(function(){
		gIDNUM='face_area3'
     	moveDivTo()
    });

	$("#f24_up").mouseup(function(){
      clearTimeout(moveupvar)
    }).mousedown(function(){
		gIDNUM='face_area4'
     	moveDivTo2()
    });

	$("#f24_down").mouseup(function(){
      clearTimeout(movedownvar)
    }).mousedown(function(){
		gIDNUM='face_area4'
     	moveDivTo()
    });

	$("#abc_up").mouseup(function(){
      clearTimeout(moveupvar)
    }).mousedown(function(){
		gIDNUM='face_area5'
     	moveDivTo2()
    });

	$("#abc_down").mouseup(function(){
      clearTimeout(movedownvar)
    }).mousedown(function(){
		gIDNUM='face_area5'
     	moveDivTo()
    });

	$("#alj_up").mouseup(function(){
      clearTimeout(moveupvar)
    }).mousedown(function(){
		gIDNUM='face_area6'
     	moveDivTo2()
    });

	$("#alj_down").mouseup(function(){
      clearTimeout(movedownvar)
    }).mousedown(function(){
		gIDNUM='face_area6'
     	moveDivTo()
    });

	$("#reut_up").mouseup(function(){
      clearTimeout(moveupvar)
    }).mousedown(function(){
		gIDNUM='face_area7'
     	moveDivTo2()
    });

	$("#reut_down").mouseup(function(){
      clearTimeout(movedownvar)
    }).mousedown(function(){
		gIDNUM='face_area7'
     	moveDivTo()
    });


	/*-------tech--------*/
	$("#eng_up").mouseup(function(){
      clearTimeout(moveupvar)
    }).mousedown(function(){
		gIDNUM='tface_area1'
     	moveDivTo2()
    });

	$("#eng_down").mouseup(function(){
      clearTimeout(movedownvar)
    }).mousedown(function(){
		gIDNUM='tface_area1'
     	moveDivTo()
    });

	$("#giz_up").mouseup(function(){
      clearTimeout(moveupvar)
    }).mousedown(function(){
		gIDNUM='tface_area2'
     	moveDivTo2()
    });

	$("#giz_down").mouseup(function(){
      clearTimeout(movedownvar)
    }).mousedown(function(){
		gIDNUM='tface_area2'
     	moveDivTo()
    });

	$("#wir_up").mouseup(function(){
      clearTimeout(moveupvar)
    }).mousedown(function(){
		gIDNUM='tface_area3'
     	moveDivTo2()
    });

	$("#wir_down").mouseup(function(){
      clearTimeout(movedownvar)
    }).mousedown(function(){
		gIDNUM='tface_area3'
     	moveDivTo()
    });

	$("#tcr_up").mouseup(function(){
      clearTimeout(moveupvar)
    }).mousedown(function(){
		gIDNUM='tface_area4'
     	moveDivTo2()
    });

	$("#tcr_down").mouseup(function(){
      clearTimeout(movedownvar)
    }).mousedown(function(){
		gIDNUM='tface_area4'
     	moveDivTo()
    });

	$("#vb_up").mouseup(function(){
      clearTimeout(moveupvar)
    }).mousedown(function(){
		gIDNUM='tface_area5'
     	moveDivTo2()
    });

	$("#vb_down").mouseup(function(){
      clearTimeout(movedownvar)
    }).mousedown(function(){
		gIDNUM='tface_area5'
     	moveDivTo()
    });

	$("#cnet_up").mouseup(function(){
      clearTimeout(moveupvar)
    }).mousedown(function(){
		gIDNUM='tface_area6'
     	moveDivTo2()
    });

	$("#cnet_down").mouseup(function(){
      clearTimeout(movedownvar)
    }).mousedown(function(){
		gIDNUM='tface_area6'
     	moveDivTo()
    });

	/*-------movie--------*/
	$("#fir_up").mouseup(function(){
      clearTimeout(moveupvar)
    }).mousedown(function(){
		gIDNUM='mface_area1'
     	moveDivTo2()
    });

	$("#fir_down").mouseup(function(){
      clearTimeout(movedownvar)
    }).mousedown(function(){
		gIDNUM='mface_area1'
     	moveDivTo()
    });

	$("#mfo_up").mouseup(function(){
      clearTimeout(moveupvar)
    }).mousedown(function(){
		gIDNUM='mface_area2'
     	moveDivTo2()
    });

	$("#mfo_down").mouseup(function(){
      clearTimeout(movedownvar)
    }).mousedown(function(){
		gIDNUM='mface_area2'
     	moveDivTo()
    });

	$("#imd_up").mouseup(function(){
      clearTimeout(moveupvar)
    }).mousedown(function(){
		gIDNUM='mface_area3'
     	moveDivTo2()
    });

	$("#imd_down").mouseup(function(){
      clearTimeout(movedownvar)
    }).mousedown(function(){
		gIDNUM='mface_area3'
     	moveDivTo()
    });

	$("#holl_up").mouseup(function(){
      clearTimeout(moveupvar)
    }).mousedown(function(){
		gIDNUM='mface_area4'
     	moveDivTo2()
    });

	$("#holl_down").mouseup(function(){
      clearTimeout(movedownvar)
    }).mousedown(function(){
		gIDNUM='mface_area4'
     	moveDivTo()
    });

	$("#scre_up").mouseup(function(){
      clearTimeout(moveupvar)
    }).mousedown(function(){
		gIDNUM='mface_area5'
     	moveDivTo2()
    });

	$("#scre_down").mouseup(function(){
      clearTimeout(movedownvar)
    }).mousedown(function(){
		gIDNUM='mface_area5'
     	moveDivTo()
    });

	$("#tofi_up").mouseup(function(){
      clearTimeout(moveupvar)
    }).mousedown(function(){
		gIDNUM='mface_area6'
     	moveDivTo2()
    });

	$("#tofi_down").mouseup(function(){
      clearTimeout(movedownvar)
    }).mousedown(function(){
		gIDNUM='mface_area6'
     	moveDivTo()
    });

	$("#you_up").mouseup(function(){
      clearTimeout(moveupvar)
    }).mousedown(function(){
		gIDNUM='mface_area7'
     	moveDivTo2()
    });

	$("#you_down").mouseup(function(){
      clearTimeout(movedownvar)
    }).mousedown(function(){
		gIDNUM='mface_area7'
     	moveDivTo()
    });

	/*-------music-------*/
	$("#bil_up").mouseup(function(){
      clearTimeout(moveupvar)
    }).mousedown(function(){
		gIDNUM='muface_area1'
     	moveDivTo2()
    });

	$("#bil_down").mouseup(function(){
      clearTimeout(movedownvar)
    }).mousedown(function(){
		gIDNUM='muface_area1'
     	moveDivTo()
    });

	$("#roll_up").mouseup(function(){
      clearTimeout(moveupvar)
    }).mousedown(function(){
		gIDNUM='muface_area2'
     	moveDivTo2()
    });

	$("#roll_down").mouseup(function(){
      clearTimeout(movedownvar)
    }).mousedown(function(){
		gIDNUM='muface_area2'
     	moveDivTo()
    });

	$("#mtv_up").mouseup(function(){
      clearTimeout(moveupvar)
    }).mousedown(function(){
		gIDNUM='muface_area3'
     	moveDivTo2()
    });

	$("#mtv_down").mouseup(function(){
      clearTimeout(movedownvar)
    }).mousedown(function(){
		gIDNUM='muface_area3'
     	moveDivTo()
    });

	$("#cmt_up").mouseup(function(){
      clearTimeout(moveupvar)
    }).mousedown(function(){
		gIDNUM='muface_area4'
     	moveDivTo2()
    });

	$("#cmt_down").mouseup(function(){
      clearTimeout(movedownvar)
    }).mousedown(function(){
		gIDNUM='muface_area4'
     	moveDivTo()
    });

	$("#nprm_up").mouseup(function(){
      clearTimeout(moveupvar)
    }).mousedown(function(){
		gIDNUM='muface_area5'
     	moveDivTo2()
    });

	$("#nprm_down").mouseup(function(){
      clearTimeout(movedownvar)
    }).mousedown(function(){
		gIDNUM='muface_area5'
     	moveDivTo()
    });

	/*-------sports-------*/
	$("#sp_up").mouseup(function(){
      clearTimeout(moveupvar)
    }).mousedown(function(){
		gIDNUM='sface_area1'
     	moveDivTo2()
    });

	$("#sp_down").mouseup(function(){
      clearTimeout(movedownvar)
    }).mousedown(function(){
		gIDNUM='sface_area1'
     	moveDivTo()
    });

	$("#surf_up").mouseup(function(){
      clearTimeout(moveupvar)
    }).mousedown(function(){
		gIDNUM='sface_area2'
     	moveDivTo2()
    });

	$("#surf_down").mouseup(function(){
      clearTimeout(movedownvar)
    }).mousedown(function(){
		gIDNUM='sface_area2'
     	moveDivTo()
    });

	$("#speed_up").mouseup(function(){
      clearTimeout(moveupvar)
    }).mousedown(function(){
		gIDNUM='sface_area3'
     	moveDivTo2()
    });

	$("#speed_down").mouseup(function(){
      clearTimeout(movedownvar)
    }).mousedown(function(){
		gIDNUM='sface_area3'
     	moveDivTo()
    });

	$("#nba_up").mouseup(function(){
      clearTimeout(moveupvar)
    }).mousedown(function(){
		gIDNUM='sface_area4'
     	moveDivTo2()
    });

	$("#nba_down").mouseup(function(){
      clearTimeout(movedownvar)
    }).mousedown(function(){
		gIDNUM='sface_area4'
     	moveDivTo()
    });

	$("#espn_up").mouseup(function(){
      clearTimeout(moveupvar)
    }).mousedown(function(){
		gIDNUM='sface_area5'
     	moveDivTo2()
    });

	$("#espn_down").mouseup(function(){
      clearTimeout(movedownvar)
    }).mousedown(function(){
		gIDNUM='sface_area5'
     	moveDivTo()
    });

	$("#xgame_up").mouseup(function(){
      clearTimeout(moveupvar)
    }).mousedown(function(){
		gIDNUM='sface_area6'
     	moveDivTo2()
    });

	$("#xgame_down").mouseup(function(){
      clearTimeout(movedownvar)
    }).mousedown(function(){
		gIDNUM='sface_area6'
     	moveDivTo()
    });

	/*-------design-------*/
	$("#yd_up").mouseup(function(){
      clearTimeout(moveupvar)
    }).mousedown(function(){
		gIDNUM='dface_area1'
     	moveDivTo2()
    });

	$("#yd_down").mouseup(function(){
      clearTimeout(movedownvar)
    }).mousedown(function(){
		gIDNUM='dface_area1'
     	moveDivTo()
    });

	$("#cool_up").mouseup(function(){
      clearTimeout(moveupvar)
    }).mousedown(function(){
		gIDNUM='dface_area2'
     	moveDivTo2()
    });

	$("#cool_down").mouseup(function(){
      clearTimeout(movedownvar)
    }).mousedown(function(){
		gIDNUM='dface_area2'
     	moveDivTo()
    });

	$("#inh_up").mouseup(function(){
      clearTimeout(moveupvar)
    }).mousedown(function(){
		gIDNUM='dface_area3'
     	moveDivTo2()
    });

	$("#inh_down").mouseup(function(){
      clearTimeout(movedownvar)
    }).mousedown(function(){
		gIDNUM='dface_area3'
     	moveDivTo()
    });

	$("#tui_up").mouseup(function(){
      clearTimeout(moveupvar)
    }).mousedown(function(){
		gIDNUM='dface_area4'
     	moveDivTo2()
    });

	$("#tui_down").mouseup(function(){
      clearTimeout(movedownvar)
    }).mousedown(function(){
		gIDNUM='dface_area4'
     	moveDivTo()
    });

	$("#dwe_up").mouseup(function(){
      clearTimeout(moveupvar)
    }).mousedown(function(){
		gIDNUM='dface_area5'
     	moveDivTo2()
    });

	$("#dwe_down").mouseup(function(){
      clearTimeout(movedownvar)
    }).mousedown(function(){
		gIDNUM='dface_area5'
     	moveDivTo()
    });

	$("#cg_up").mouseup(function(){
      clearTimeout(moveupvar)
    }).mousedown(function(){
		gIDNUM='dface_area6'
     	moveDivTo2()
    });

	$("#cg_down").mouseup(function(){
      clearTimeout(movedownvar)
    }).mousedown(function(){
		gIDNUM='dface_area6'
     	moveDivTo()
    });

	$("#core_up").mouseup(function(){
      clearTimeout(moveupvar)
    }).mousedown(function(){
		gIDNUM='dface_area7'
     	moveDivTo2()
    });

	$("#core_down").mouseup(function(){
      clearTimeout(movedownvar)
    }).mousedown(function(){
		gIDNUM='dface_area7'
     	moveDivTo()
    });

	/*-------report-------*/
	$("#ted_up").mouseup(function(){
      clearTimeout(moveupvar)
    }).mousedown(function(){
		gIDNUM='rface_area1'
     	moveDivTo2()
    });

	$("#ted_down").mouseup(function(){
      clearTimeout(movedownvar)
    }).mousedown(function(){
		gIDNUM='rface_area1'
     	moveDivTo()
    });

	$("#med_up").mouseup(function(){
      clearTimeout(moveupvar)
    }).mousedown(function(){
		gIDNUM='rface_area2'
     	moveDivTo2()
    });

	$("#med_down").mouseup(function(){
      clearTimeout(movedownvar)
    }).mousedown(function(){
		gIDNUM='rface_area2'
     	moveDivTo()
    });

	$("#fro_up").mouseup(function(){
      clearTimeout(moveupvar)
    }).mousedown(function(){
		gIDNUM='rface_area3'
     	moveDivTo2()
    });

	$("#fro_down").mouseup(function(){
      clearTimeout(movedownvar)
    }).mousedown(function(){
		gIDNUM='rface_area3'
     	moveDivTo()
    });

	$("#ale_up").mouseup(function(){
      clearTimeout(moveupvar)
    }).mousedown(function(){
		gIDNUM='rface_area4'
     	moveDivTo2()
    });

	$("#ale_down").mouseup(function(){
      clearTimeout(movedownvar)
    }).mousedown(function(){
		gIDNUM='rface_area4'
     	moveDivTo()
    });

	$("#life_up").mouseup(function(){
      clearTimeout(moveupvar)
    }).mousedown(function(){
		gIDNUM='rface_area5'
     	moveDivTo2()
    });

	$("#life_down").mouseup(function(){
      clearTimeout(movedownvar)
    }).mousedown(function(){
		gIDNUM='rface_area5'
     	moveDivTo()
    });

});


$(function() {
	/*news*/
	$("#face_area1").scrollable({ vertical: true, mousewheel: true });
	$("#face_area2").scrollable({ vertical: true, mousewheel: true });
	$("#face_area3").scrollable({ vertical: true, mousewheel: true });
	$("#face_area4").scrollable({ vertical: true, mousewheel: true });
	$("#face_area5").scrollable({ vertical: true, mousewheel: true });
	$("#face_area6").scrollable({ vertical: true, mousewheel: true });
	$("#face_area7").scrollable({ vertical: true, mousewheel: true });
	/*tech*/
	$("#tface_area1").scrollable({ vertical: true, mousewheel: true });
	$("#tface_area2").scrollable({ vertical: true, mousewheel: true });
	$("#tface_area3").scrollable({ vertical: true, mousewheel: true });
	$("#tface_area4").scrollable({ vertical: true, mousewheel: true });
	$("#tface_area5").scrollable({ vertical: true, mousewheel: true });
	$("#tface_area6").scrollable({ vertical: true, mousewheel: true });
	/*movie*/
	$("#mface_area1").scrollable({ vertical: true, mousewheel: true });
	$("#mface_area2").scrollable({ vertical: true, mousewheel: true });
	$("#mface_area3").scrollable({ vertical: true, mousewheel: true });
	$("#mface_area4").scrollable({ vertical: true, mousewheel: true });
	$("#mface_area5").scrollable({ vertical: true, mousewheel: true });
	$("#mface_area6").scrollable({ vertical: true, mousewheel: true });
	$("#mface_area7").scrollable({ vertical: true, mousewheel: true });
	/*music*/
	$("#muface_area1").scrollable({ vertical: true, mousewheel: true });
	$("#muface_area2").scrollable({ vertical: true, mousewheel: true });
	$("#muface_area3").scrollable({ vertical: true, mousewheel: true });
	$("#muface_area4").scrollable({ vertical: true, mousewheel: true });
	$("#muface_area5").scrollable({ vertical: true, mousewheel: true });
	/*spoerts*/
	$("#sface_area1").scrollable({ vertical: true, mousewheel: true });
	$("#sface_area2").scrollable({ vertical: true, mousewheel: true });
	$("#sface_area3").scrollable({ vertical: true, mousewheel: true });
	$("#sface_area4").scrollable({ vertical: true, mousewheel: true });
	$("#sface_area5").scrollable({ vertical: true, mousewheel: true });
	$("#sface_area6").scrollable({ vertical: true, mousewheel: true });
	/*design*/
	$("#dface_area1").scrollable({ vertical: true, mousewheel: true });
	$("#dface_area2").scrollable({ vertical: true, mousewheel: true });
	$("#dface_area3").scrollable({ vertical: true, mousewheel: true });
	$("#dface_area4").scrollable({ vertical: true, mousewheel: true });
	$("#dface_area5").scrollable({ vertical: true, mousewheel: true });
	$("#dface_area6").scrollable({ vertical: true, mousewheel: true });
	$("#dface_area7").scrollable({ vertical: true, mousewheel: true });
	/*report*/
	$("#rface_area1").scrollable({ vertical: true, mousewheel: true });
	$("#rface_area2").scrollable({ vertical: true, mousewheel: true });
	$("#rface_area3").scrollable({ vertical: true, mousewheel: true });
	$("#rface_area4").scrollable({ vertical: true, mousewheel: true });
	$("#rface_area5").scrollable({ vertical: true, mousewheel: true });
});

/*----------------------------------------------------
	dragg
----------------------------------------------------*/

var isMobile = WebKitDetect.isMobile();

/*---dragg window---*/
$(document).ready(function() {
	/*news*/
	$("#newsframe1").draggable();
	$("#newsframe2").draggable();
	$("#newsframe3").draggable();
	$("#newsframe4").draggable();
	$("#newsframe5").draggable();
	$("#newsframe6").draggable();
	$("#newsframe7").draggable();
	/*tech*/
	$("#techframe1").draggable();
	$("#techframe2").draggable();
	$("#techframe3").draggable();
	$("#techframe4").draggable();
	$("#techframe5").draggable();
	$("#techframe6").draggable();
	/*movie*/
	$("#movieframe1").draggable();
	$("#movieframe2").draggable();
	$("#movieframe3").draggable();
	$("#movieframe4").draggable();
	$("#movieframe5").draggable();
	$("#movieframe6").draggable();
	$("#movieframe7").draggable();
	/*music*/
	$("#musicframe1").draggable();
	$("#musicframe2").draggable();
	$("#musicframe3").draggable();
	$("#musicframe4").draggable();
	$("#musicframe5").draggable();
	/*spors*/
	$("#sportsframe1").draggable();
	$("#sportsframe2").draggable();
	$("#sportsframe3").draggable();
	$("#sportsframe4").draggable();
	$("#sportsframe5").draggable();
	$("#sportsframe6").draggable();
	/*design*/
	$("#designframe1").draggable();
	$("#designframe2").draggable();
	$("#designframe3").draggable();
	$("#designframe4").draggable();
	$("#designframe5").draggable();
	$("#designframe6").draggable();
	$("#designframe7").draggable();
	/*report*/
	$("#reportframe1").draggable();
	$("#reportframe2").draggable();
	$("#reportframe3").draggable();
	$("#reportframe4").draggable();
	$("#reportframe5").draggable();
	/*about*/
	$("#about_frame").draggable();
	$("#about_frame2").draggable();
	/*video*/
	$("#video_frame").draggable();
	$("#video_frame2").draggable();
	/*youtube*/
	$("#youtube_frame").draggable();
	/*icon frames*/
	if (isMobile==false){
		$("#newsicon_frame").draggable();
		$("#techicon_frame").draggable();
		$("#movieicon_frame").draggable();
		$("#musicicon_frameb").draggable();
		$("#sportsicon_frame").draggable();
		$("#designicon_frame").draggable();
		$("#reporticon_frame").draggable();
		$("#youtubeicon_frame").draggable();
	}
	/*pmnews scroll btn*/
	$("#pmnewsnavi").draggable();

	/*comment scroll btn*/
	$("#commentnavi").draggable();

	/*fbcomment scroll btn*/
	$("#fbcommentnavi").draggable();

	/*mail frame*/
	$("#mail_frame").draggable();
});


/*----------------------------------------------------
	Layer Change
----------------------------------------------------*/

var newsFrame=["newsframe1","newsframe2","newsframe3","newsframe4","newsframe5","newsframe6","newsframe7"];
var techFrame=["techframe1","techframe2","techframe3","techframe4","techframe5","techframe6"];
var movieFrame=["movieframe1","movieframe2","movieframe3","movieframe4","movieframe5","movieframe6","movieframe7"];
var musicFrame=["musicframe1","musicframe2","musicframe3","musicframe4","musicframe5"];
var sportsFrame=["sportsframe1","sportsframe2","sportsframe3","sportsframe4","sportsframe5","sportsframe6"];
var designFrame=["designframe1","designframe2","designframe3","designframe4","designframe5","designframe6","designframe7"];
var reportFrame=["reportframe1","reportframe2","reportframe3","reportframe4","reportframe5"];

$(document).ready(function() {

	function changeLAYER(){
		$(newsFrame).each(function(){
			$("#"+this).css('zIndex', 60);
		});
		
		$(techFrame).each(function(){
			$("#"+this).css('zIndex', 60);
		});

		$(movieFrame).each(function(){
			$("#"+this).css('zIndex', 60);
		});
		
		$(musicFrame).each(function(){
			$("#"+this).css('zIndex', 60);
		});

		$(sportsFrame).each(function(){
			$("#"+this).css('zIndex', 60);
		});

		$(designFrame).each(function(){
			$("#"+this).css('zIndex', 60);
		});

		$(reportFrame).each(function(){
			$("#"+this).css('zIndex', 60);
		});

	}

	/*news*/
	$("#newsframe1").click(function () {
		changeLAYER();
		$('#newsframe1').css('zIndex', 70);
	});

	$("#newsframe2").click(function () {
		changeLAYER();
		$('#newsframe2').css('zIndex', 70);
	});

	$("#newsframe3").click(function () {
		changeLAYER();
		$('#newsframe3').css('zIndex', 70);
	});

	$("#newsframe4").click(function () {
		changeLAYER();
		$('#newsframe4').css('zIndex', 70);
	});

	$("#newsframe5").click(function () {
		changeLAYER();
		$('#newsframe5').css('zIndex', 70);
	});

	$("#newsframe6").click(function () {
		changeLAYER();
		$('#newsframe6').css('zIndex', 70);
	});

	$("#newsframe7").click(function () {
		changeLAYER();
		$('#newsframe7').css('zIndex', 70);
	});


	/*tech*/
	$("#techframe1").click(function () {
		changeLAYER();
		$('#techframe1').css('zIndex', 70);
	});

	$("#techframe2").click(function () {
		changeLAYER();
		$('#techframe2').css('zIndex', 70);
	});

	$("#techframe3").click(function () {
		changeLAYER();
		$('#techframe3').css('zIndex', 70);
	});

	$("#techframe4").click(function () {
		changeLAYER();
		$('#techframe4').css('zIndex', 70);
	});

	$("#techframe5").click(function () {
		changeLAYER();
		$('#techframe5').css('zIndex', 70);
	});

	$("#techframe6").click(function () {
		changeLAYER();
		$('#techframe6').css('zIndex', 70);
	});

	/*movie*/
	$("#movieframe1").click(function () {
		changeLAYER();
		$('#movieframe1').css('zIndex', 70);
	});

	$("#movieframe2").click(function () {
		changeLAYER();
		$('#movieframe2').css('zIndex', 70);
	});

	$("#movieframe3").click(function () {
		changeLAYER();
		$('#movieframe3').css('zIndex', 70);
	});

	$("#movieframe4").click(function () {
		changeLAYER();
		$('#movieframe4').css('zIndex', 70);
	});

	$("#movieframe5").click(function () {
		changeLAYER();
		$('#movieframe5').css('zIndex', 70);
	});

	$("#movieframe6").click(function () {
		changeLAYER();
		$('#movieframe6').css('zIndex', 70);
	});

	$("#movieframe7").click(function () {
		changeLAYER();
		$('#movieframe7').css('zIndex', 70);
	});

	/*music*/
	$("#musicframe1").click(function () {
		changeLAYER();
		$('#musicframe1').css('zIndex', 70);
	});

	$("#musicframe2").click(function () {
		changeLAYER();
		$('#musicframe2').css('zIndex', 70);
	});

	$("#musicframe3").click(function () {
		changeLAYER();
		$('#musicframe3').css('zIndex', 70);
	});

	$("#musicframe4").click(function () {
		changeLAYER();
		$('#musicframe4').css('zIndex', 70);
	});

	$("#musicframe5").click(function () {
		changeLAYER();
		$('#musicframe5').css('zIndex', 70);
	});

	/*sports*/
	$("#sportsframe1").click(function () {
		changeLAYER();
		$('#sportsframe1').css('zIndex', 70);
	});

	$("#sportsframe2").click(function () {
		changeLAYER();
		$('#sportsframe2').css('zIndex', 70);
	});

	$("#sportsframe3").click(function () {
		changeLAYER();
		$('#sportsframe3').css('zIndex', 70);
	});

	$("#sportsframe4").click(function () {
		changeLAYER();
		$('#sportsframe4').css('zIndex', 70);
	});

	$("#sportsframe5").click(function () {
		changeLAYER();
		$('#sportsframe5').css('zIndex', 70);
	});

	$("#sportsframe6").click(function () {
		changeLAYER();
		$('#sportsframe6').css('zIndex', 70);
	});

	/*design*/
	$("#designframe1").click(function () {
		changeLAYER();
		$('#designframe1').css('zIndex', 70);
	});

	$("#designframe2").click(function () {
		changeLAYER();
		$('#designframe2').css('zIndex', 70);
	});

	$("#designframe3").click(function () {
		changeLAYER();
		$('#designframe3').css('zIndex', 70);
	});

	$("#designframe4").click(function () {
		changeLAYER();
		$('#designframe4').css('zIndex', 70);
	});

	$("#designframe5").click(function () {
		changeLAYER();
		$('#designframe5').css('zIndex', 70);
	});

	$("#designframe6").click(function () {
		changeLAYER();
		$('#designframe6').css('zIndex', 70);
	});

	$("#designframe7").click(function () {
		changeLAYER();
		$('#designframe7').css('zIndex', 70);
	});

	/*report*/
	$("#reportframe1").click(function () {
		changeLAYER();
		$('#reportframe1').css('zIndex', 70);
	});

	$("#reportframe2").click(function () {
		changeLAYER();
		$('#reportframe2').css('zIndex', 70);
	});

	$("#reportframe3").click(function () {
		changeLAYER();
		$('#reportframe3').css('zIndex', 70);
	});

	$("#reportframe4").click(function () {
		changeLAYER();
		$('#reportframe4').css('zIndex', 70);
	});

	$("#reportframe5").click(function () {
		changeLAYER();
		$('#reportframe5').css('zIndex', 70);
	});

});

/*----------------------------------------------------
	video
----------------------------------------------------*/
/*---header logo video---*/
var broName;
function showBrow(){
	if(navigator.userAgent.indexOf("Chrome") != -1){
		broName="Chrome"
	} else if (navigator.userAgent.indexOf("Safari") != -1){
		broName="Safari"
	} else if (navigator.userAgent.indexOf("Firefox") != -1){
		broName="Firefox"
	} else if (navigator.userAgent.indexOf("Opera") != -1){
		broName="Opera"
	} else {
		broName="IE"
	}
}


function sVIDEO(){
	showBrow()
	if (broName=="IE"){
		if (showVIDEO==0){
			$("#video_frame").fadeIn("slow");
			$('.projekktor').css('backgroundColor', '#000');
			init('player_a','#video_frame');
			closeYOUWIN();
			showVIDEO=1;
 		} else {	
			$("#video_frame").fadeOut("slow");
			projekktor('player_a').setStop();
			showVIDEO=0;
		}
	} else {
		if (showVIDEO==0){
			$("#video_frame2").fadeIn("slow");
			$('.projekktor').css('backgroundColor', '#000');
			init('player_b','#video_frame2');
			showVIDEO=1;
			closeYOUWIN();
 		} else {
			if (isMobile==false){
				$("#video_frame2").delay(100).fadeOut("slow");
				projekktor('player_b').setStop();
				showVIDEO=0;
				closeYOUWIN();
			} else {
				$("#video_frame2").fadeOut("slow");
				projekktor('player_b').setPause();
				showVIDEO=0;
			}
		}
	}
}


$(document).ready(function() {
    projekktor('#player_a', {
    		controls: true,
			autoplay: false,
    		playlist: [{0:{src:'http://www.youtube.com/watch?v=0shgfN2GZbQ', type: 'video/youtube'}}]
	});

	projekktor('#player_b', {
    		controls: true,
			autoplay: false,
    		playlist: [{0:{src:'http://www.pmstudio.com/movie/miyuta.mp4', type: 'video/mp4'}}]
	});

    projekktor('#player_c', {
    		controls: true,
			autoplay: true,
    		playlist: [{0:{src:'http://www.youtube.com/watch?v=yMulzan_Liw', type: 'video/youtube'}}]
	});

	projekktor('#player_d', {
    		controls: true,
			autoplay: true,
    		playlist: [{0:{src:'http://www.pmstudio.com/movie/miyuta_run.mp4', type: 'video/mp4'}}]
	});
});

var video;
function init(pnum,winnam) {
	if (IE==false){
  		video = document.getElementById(pnum);
  		video.addEventListener("ended", function() {
    		$(winnam).fadeOut("slow");
				showVIDEO=0;
  		}, true);
	}
}

/*----------------------------------------------------
	youtube change
----------------------------------------------------*/

function chengeYOU(num) {
	$('#youtubeMovie')[0].contentWindow.changeVideo(num);
}

function closeYOUTUBE(){
	showYOUTUBE=0;	
	$("#youtubeicon_frame").fadeOut("slow");
	$("#youtube_frame").fadeOut("slow");
	$('#youtubeMovie')[0].contentWindow.stopVIDEO();
}


/*----------------------------------------------------
	pmnews_scroll
----------------------------------------------------*/
$(function(){

	$("#p_up").mouseup(function(){
		$('#pm_news')[0].contentWindow.mUP();
    }).mousedown(function(){
		$('#pm_news')[0].contentWindow.moveDivTo2();
	});

	$("#p_down").mouseup(function(){
		$('#pm_news')[0].contentWindow.mDown();
    }).mousedown(function(){
     	$('#pm_news')[0].contentWindow.moveDivTo();
	});

	
});

/*----------------------------------------------------
	comment_scroll
----------------------------------------------------*/
$(function(){

	$("#p_up2").mouseup(function(){
		$('#pm_com')[0].contentWindow.mUP();
    }).mousedown(function(){
		$('#pm_com')[0].contentWindow.moveDivTo2();
	});

	$("#p_down2").mouseup(function(){
		$('#pm_com')[0].contentWindow.mDown();
    }).mousedown(function(){
     	$('#pm_com')[0].contentWindow.moveDivTo();
	});

	
});

/*----------------------------------------------------
	fbcomment_scroll
----------------------------------------------------*/
$(function(){

	$("#p_up3").mouseup(function(){
		$('#pm_fbcom')[0].contentWindow.mUP();
    }).mousedown(function(){
		$('#pm_fbcom')[0].contentWindow.moveDivTo2();
	});

	$("#p_down3").mouseup(function(){
		$('#pm_fbcom')[0].contentWindow.mDown();
    }).mousedown(function(){
     	$('#pm_fbcom')[0].contentWindow.moveDivTo();
	});

	
});

/*----------------------------------------------------
	pmnews_page_reload
----------------------------------------------------*/

$(document).ready(function() {
	$("#pmnews_t").click(function () {
		$('#pm_news')[0].contentWindow.rePage();
	});

});

/*----------------------------------------------------
	facebook
----------------------------------------------------*/

$(function() {
	document.getElementById("fbcode").value="access_token=128045363943026|kvlxBAz4yzviyq9-VqUg8LkqjHE";
});
