

var nowpart;
var nowmode;



function popfile(mode){


	if(typeof(openFile)!='object'){
		   openFile=window.open('file_manager.php?mode='+mode,'filemanager','top=50,left=200,toolbar=no,location=no,status=yes,menubar=no,scrollbars=no,resizable=yes,width=520,height=500');      
    }else{
		
		if(openFile.closed){

          openFile=window.open('file_manager.php?mode='+mode,'filemanager','top=50,left=200,toolbar=no,location=no,status=yes,menubar=no,scrollbars=no,resizable=yes,width=520,height=500');

		}else{

           openFile.focus();
		}

	}


}






function directColor(name,color){
	if(color.length>=6){
		nowpart=name;
		changeColorNow(color,'');
	}
}


function checkBrowserTheme(){

	 if(navigator.appName == "Microsoft Internet Explorer") return true;
	 else return false;

}



function changeFlash(part,color,mode,data){

   if(color=="transparent" && mode==1){

   }else{

		 if(checkBrowserTheme()){
			var obj = document.getElementById(part);
            if(obj){
				obj.setVariable("mode",mode);
				obj.setVariable("color",color);
				obj.setVariable("data",'');
				obj.TCallFrame("_root",9);
			}
		 }

   }

}


 //* change menu*///


  function changeMenu(value){


  }


 //* change bg images*///

function changeBG(path,bg){


				var splitValues=bg.split(",");
				bg=splitValues[0];
				position=splitValues[1];
				repeat=splitValues[2];

				if(path=="background"){

					  document.body.style.backgroundImage="url("+bg+")";
					  document.body.style.backgroundPosition=position;
					  document.body.style.backgroundRepeat=repeat;

				}else{

                    var obj = document.getElementById(path);
                    if(obj){
						 obj.style.backgroundImage="url("+bg+")";
						 obj.style.backgroundPosition=position;
						 obj.style.backgroundRepeat=repeat;
					}

				}


}




 //* change color *///

function changeColorPath(path,value){

      if(value=="transparent") more="";
	  else more="#";

	   if(path=="fontcolor"){
			document.body.style.color=more+value;			
	   }else if(path=="background"){
			document.body.style.backgroundColor=more+value;  
	   }else{

			 if(path.indexOf('border')>1){
				  if(value!="transparent"){

					    newname=path.replace('_border','');
						var obj = document.getElementById(newname);
						if(obj) obj.style.borderColor=more+value;  


				  }else{
                       alert('äÁèãÊè bg ¢Í§ border äÁèä´é¤ÃÑº');
				  }
			 }else{
                        var obj = document.getElementById(path);
						if(obj) obj.style.backgroundColor=more+value;
			 }


	  }

}






function changeColorNow(value,bg){


   if(nowpart=="fontcolor"){
	    if(bg.length>1){
             
		}else{
			changeColorPath("fontcolor",value);
		}
	
   }



   if(nowpart=="background"){
       	 if(bg.length>1){
             changeBG("background",bg);
		}else{
            changeColorPath("background",value);
		}
   }



   if(nowpart=="header"){
	    if(bg.length>1){
             changeBG("header",bg);
		}else{
			
			changeColorPath("header",value);
		}

   }




   if(nowpart=="header_border"){
	   if(bg.length>1){
             
		}else{
			changeColorPath("header_border",value);
		}
		
   }



   if(nowpart=="main"){
	    if(bg.length>1){
             changeBG("main",bg);
		}else{
			changeColorPath("main",value);
			changeFlash('flash_top',value,0,'');
			changeFlash('flash_bottom',value,0,'');
		}
   }



   if(nowpart=="main_border"){
	    if(bg.length>1){
             
		}else{
			changeColorPath("main_border",value);
			changeFlash('flash_top',value,1,'');
			changeFlash('flash_bottom',value,1,'');
		}
   }



   if(nowpart=="left_data"){
	    if(bg.length>1){
             changeBG("left_data",bg);
		}else{
			changeColorPath("left_data",value);
			changeFlash('flash_left',value,0,'');
			changeFlash('flash_left_bottom',value,0,'');
		}
   }



   if(nowpart=="left_data_border"){
        if(bg.length>1){
           
		}else{
			changeColorPath("left_data_border",value);
			changeFlash('flash_left',value,1,'');
			changeFlash('flash_left_bottom',value,1,'');
		}
   }



   if(nowpart=="club_detail"){
	     if(bg.length>1){
             changeBG("club_detail",bg);
		}else{
			changeColorPath("club_detail",value);
		}

   }

   if(nowpart=="club_contact"){
	     if(bg.length>1){
             changeBG("club_contact",bg);
		}else{
			changeColorPath("club_contact",value);
		}
		
   }


   if(nowpart=="club_webboard_cate"){
	     if(bg.length>1){
             changeBG("club_webboard_cate",bg);
		}else{
			changeColorPath("club_webboard_cate",value);
		}
   }


   if(nowpart=="club_content"){
	     if(bg.length>1){
             changeBG("club_content",bg);
		}else{
			changeColorPath("club_content",value);
		}

   }

    if(nowpart=="club_user_online"){
		  if(bg.length>1){
             changeBG("club_user_online",bg);
		}else{
			changeColorPath("club_user_online",value);
		}

   }


   if(nowpart=="right_data"){
	     if(bg.length>1){
             changeBG("right_data",bg);
		}else{
			changeColorPath("right_data",value);
			changeFlash('flash_right',value,0,'');
		}
   }


  if(nowpart=="hotnew_data1"){
	    if(bg.length>1){
             changeBG("hotnew_data1",bg);
		}else{
			changeColorPath("hotnew_data1",value);
			changeFlash('flash_hotnew1',value,0,'');
		}
  }

  if(nowpart=="hotnew_data2"){
	    if(bg.length>1){
             changeBG("hotnew_data2",bg);
		}else{
			changeColorPath("hotnew_data2",value);
			changeFlash('flash_hotnew2',value,0,'');
		}
  }

    if(nowpart=="hotnew_data3"){
		  if(bg.length>1){
             changeBG("hotnew_data3",bg);
		}else{
			changeColorPath("hotnew_data3",value);
			changeFlash('flash_hotnew3',value,0,'');
		}
  }

    if(nowpart=="hotnew_data4"){
		 if(bg.length>1){
             changeBG("hotnew_data4",bg);
		}else{
			changeColorPath("hotnew_data4",value);
			changeFlash('flash_hotnew4',value,0,'');
		}
  }
  
   
    if(nowpart=="right_gallery_data"){
		 if(bg.length>1){
             changeBG("right_gallery_data",bg);
		}else{
			changeColorPath("right_gallery_data",value);
			changeFlash('flash_gallery',value,0,'');
		}
  }

   
    if(nowpart=="right_webboard_data"){
		 if(bg.length>1){
             changeBG("right_webboard_data",bg);
		}else{
			changeColorPath("right_webboard_data",value);
			changeFlash('flash_webboard',value,0,'');
		}
   }
 
    if(nowpart=="webboard_topic1"){
		 if(bg.length>1){
             changeBG("webboard_topic1",bg);
		}else{
			changeColorPath("webboard_topic1",value);
		}


   }

    if(nowpart=="webboard_topic2"){
		 if(bg.length>1){
             changeBG("webboard_topic2",bg);
		}else{
			changeColorPath("webboard_topic2",value);
		}

   }


}


