/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

function homePage(){
    window.location.reload();
    $('div#homepage').show();
    $('div#content').hide();
    $('div#question').hide();
    $('div#message').hide();

    $('ul#home_menu').show();
    $('ul#content_menu').hide();
    $('ul#question_menu').hide();
    $('ul#message_menu').hide();
    $('ul#member_menu').hide();
	$('ul#obj_menu').hide();
	$('ul#news_menu').hide();
}
function contentPage(){
    $('div#homepage').hide();
    $('div#content').show();
    $('div#question').hide();
    $('div#message').hide();

    $('ul#home_menu').hide();
    $('ul#content_menu').show();
    $('ul#question_menu').hide();
    $('ul#message_menu').hide();
    $('ul#member_menu').hide();
	$('ul#obj_menu').hide();
	$('ul#news_menu').hide();
}
function questionPage(){
    $('div#homepage').hide();
    $('div#content').hide();
    $('div#question').show();
    $('div#message').hide();

    $('ul#home_menu').hide();
    $('ul#content_menu').hide();
    $('ul#question_menu').show();
    $('ul#message_menu').hide();
    $('ul#member_menu').hide();
	$('ul#obj_menu').hide();
	$('ul#news_menu').hide();
}
function messagePage(){
    $('div#homepage').hide();
    $('div#content').hide();
    $('div#question').hide();
    $('div#message').show();

    $('ul#home_menu').hide();
    $('ul#content_menu').hide();
    $('ul#question_menu').hide();
    $('ul#message_menu').show();
    $('ul#member_menu').hide();
	$('ul#obj_menu').hide();
	$('ul#news_menu').hide();
}

function blackBackground(obj){
    obj.style.background="black";
}
function noneBackground(obj){
    obj.style.background="none";
}

function test(){
    alert("this is test");
}

function showOpening(){
    $('ul#opening').toggle();
}

function showConsole(){
    $('ul#console').toggle();
}

function showProduct(web_name, web_id, obj_id){
    var link = "goProduct.action?web_name="+web_name+"&web_id="+web_id+"&obj_id="+obj_id;
    window.open(link, "", "toolbar=no, width=900px,height=1000px, left=300px, top=50px, resizable=yes, scrollbars=yes, toolbar=yes, location=yes,menubar=yes");
//    document.form3.obj_id.value=obj_id;
//    document.form3.submit();
}
function goMessageBox(web_id, obj_id){
    var link = "goMessageBox.action?web_id="+web_id+"&obj_id="+obj_id;
    window.open(link, "", "toolbar=no, width=400px,height=500px, left=300px, top=50px");
}

function goBlog(web_id, obj_id, web_name){
    var link = "goblog.jsp?web_id="+web_id+"&obj_id="+obj_id+"&web_name="+web_name;
    window.open(link, "", "toolbar=no, width=800px,height=1000px, left=300px, top=50px, resizable=yes, scrollbars=yes");
}

function goAdjustobject(web_id, obj_id, web_name){
    var link = "goAdjustobject.action?web_id="+web_id+"&obj_id="+obj_id+"&web_name="+web_name;
    window.open(link, "", "toolbar=no, width=800px,height=1000px, left=300px, top=50px, resizable=yes, scrollbars=yes");
}
function goQuestion_Box(web_id){
    var link = "goQuestion_Box.action?web_id="+web_id;
    window.open(link, "", "toolbar=no, width=400px,height=500px, left=300px, top=50px, resizable=yes, scrollbars=yes");
}
function goEditorQA(web_id){
    var link="goEditorQA.action?web_id="+web_id;
    window.open(link,"","toolbar=no, width=800px,height=650px, left=300px, top=50px, resizable=yes, scrollbars=yes");
}
function goAddobj(web_name, web_id){
    var link="goAddobj.action?web_name="+web_name+"&web_id="+web_id;
    window.location.href(link);
}
function goAdjust(web_name, web_id){
    var link="goAdjust.action?web_name="+web_name+"&web_id="+web_id;
    window.location.href(link);
}
function goManager_mess(web_name, web_id){
    var link="goManager_mess.action?web_name="+web_name+"&web_id="+web_id;
    window.location.href(link);
}
function goManager_member(web_name, web_id){
    var link="goManager_member.action?web_name="+web_name+"&web_id="+web_id;
    window.location.href(link);
}
function goCirculate(web_name, web_id){
    var link="goCirculate.action?web_name="+web_name+"&web_id="+web_id+"&page=1";
    window.location.href(link);
}
function goCreateUser(web_name, web_id){
    var link="goCreateUser.action?web_name="+web_name+"&web_id="+web_id+"&page=1";
    window.open(link,"","toolbar=no, width=800px,height=650px, left=300px, top=50px, resizable=yes, scrollbars=yes");
}

function moreObject(web_name){
    var link="moreObject.action?web_name="+web_name+"&page=2";
    location.href(link);
}
function nextPage(web_name, page){
    var link="moreObject.action?web_name="+web_name+"&page="+(page+1);
    location.href(link);
}
function prevPage(web_name, page){
    var link="moreObject.action?web_name="+web_name+"&page="+(page-1);
    location.href(link);
}
function chooseObj(){
    document.getElementById("mainobj").style.display="none";
    document.getElementById("chooseobj").style.display="";
    document.iForm.submit();
}
function changePage(page){
    document.form1.page.value=page;
    document.form1.submit();
}
function changePage2(page){
    document.iForm.page.value=page;
    document.iForm.submit();
}
function nextPagetimes(){
    document.iForm.pagetimes.value=parseInt(document.iForm.pagetimes.value)+1;
    document.iForm.page.value = parseInt(document.iForm.pagetimes.value-1)*10+1;
    document.iForm.submit();
}
function prevPagetimes(){
    document.iForm.pagetimes.value=parseInt(document.iForm.pagetimes.value)-1;
    document.iForm.page.value = parseInt(document.iForm.pagetimes.value-1)*10+1;
    document.iForm.submit();
}
function nextPagetimes2(){
    document.form1.pagetimes.value=parseInt(document.form1.pagetimes.value)+1;
    document.form1.page.value = parseInt(document.form1.pagetimes.value-1)*10+1;
    document.form1.submit();
}
function prevPagetimes2(){
    document.form1.pagetimes.value=parseInt(document.form1.pagetimes.value)-1;
    document.form1.page.value = parseInt(document.form1.pagetimes.value-1)*10+1;
    document.form1.submit();
}



function showPics(){
   $('div#photos').cycle({
    fx: 'fade',
    speed:700
    });
}

function showPics2() {
    $('#pause').click(function() { $('#slides').cycle('pause'); return false; });
    $('#play').click(function() { $('#slides').cycle('resume'); return false; });

    $('#slideshow').hover(
        function() { $('#controls').fadeIn(); },
        function() { $('#controls').fadeOut(); }
    );

    $('#slides').cycle({
        fx:     'shuffle',
        shuffle: {
        top:  -230,
        left:  230
         },
        speed:   800,
        timeout: 3000,
        next:   '#next',
        prev:   '#prev'
    });
}


