

function setPng24(obj) { 
    obj.width=obj.height=1; 
	obj.style.width = obj.width + "px"; 
    obj.style.height = obj.height + "px"; 
    obj.className=obj.className.replace(/\bpng24\b/i,''); 
    obj.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+ obj.src +"',sizingMethod='image');" ;
    obj.src='/images/blank.gif';  
    return ''; 
} 
			
function flashObj(URL,SizeX,SizeY,LnkId,param) // quick
{
    document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ');
    document.write('codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" ');
    document.write('width="'+SizeX+'" height="'+SizeY+'"  id="'+LnkId+'" align="middle">');
    document.write('<param name="movie"     value="'+URL+'" />');
    document.write('<param name="quality"   value="high" />');
    document.write('<param name="wmode"     value="transparent"/>');
	document.write('<param name="allowScriptAccess" value="always"/> ');
	document.write('<param name="base" value="." />');
	document.write('<param name="flashvars" value="' + param + '"/>');
	document.write('<embed base="." src="'+URL+'" quality="high" width="'+SizeX+'" height="'+SizeY+'"  align="middle" ');
	document.write('wmode="transparent" ');
	document.write('type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" allowScriptAccess="always" swLiveConnect=true name="'+LnkId+'"  />');
	document.write('</embed></object>');
}
function printSWF(id, flashUri, vWidth, vHeight, winMode, bgColor, param) {
	var _obj_ = "";
	_obj_ = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,115,0" width="' + vWidth + '" height="' + vHeight + '" id="' + id + '" align="middle">';
	_obj_ += '<param name="allowScriptAccess" value="always" />';
	_obj_ += '<param name="allowFullScreen" value="true" />';
	_obj_ += '<param name="movie" value="' + flashUri + '" />';
	_obj_ += '<param name="quality" value="high" />';
	_obj_ += '<param name="wmode" value="' + winMode + '" />';
	_obj_ += '<param name="bgcolor" value="' + bgColor + '" />';
	_obj_ += '<param name="flashvars" value="' + param + '"/>';
	_obj_ += '<embed src="' + flashUri + '" quality="high" wmode="' + winMode + '" bgcolor="' + bgColor + '" width="' + vWidth +'" height="' + vHeight + '" id="' + id + '" align="middle" allowScriptAccess="always" allowFullScreen="true" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></embed>    ';
	_obj_ += '</object>';
	document.writeln( _obj_ );

	eval("window." + id + " = document.getElementById('" + id + "');");
}


function getDocHeight() {
    var D = document;
    return Math.max(
        Math.max(D.body.scrollHeight, D.documentElement.scrollHeight),
        Math.max(D.body.offsetHeight, D.documentElement.offsetHeight),
        Math.max(D.body.clientHeight, D.documentElement.clientHeight)
    )-4;
}


function popsn(url,trgt,w,h,l,t) { 
    window.open(url,trgt,'width='+w+',height='+h+',left='+l+',top='+t+',scrollbars=no,resizable=no,copyhistory=no,toolbar=no,status=no'); 
}

function popsy(url,trgt,w,h) { 
    window.open(url,trgt,'width='+w+',height='+h+',scrollbars=yes,resizable=no,copyhistory=no,toolbar=no,status=no,left=0,top=0'); 
}



function over(imgName) {
	imgName.getElementsByTagName("img").item(0).src = imgName.getElementsByTagName("img").item(0).src.replace(/(_on.gif|.gif)$/i, "_on.gif");
	imgName.getElementsByTagName("img").item(0).src = imgName.getElementsByTagName("img").item(0).src.replace(/(_on.jpg|.jpg)$/i, "_on.jpg");
	imgName.getElementsByTagName("img").item(0).src = imgName.getElementsByTagName("img").item(0).src.replace(/(_on.png|.png)$/i, "_on.png");
}
function out(imgName) {
	imgName.getElementsByTagName("img").item(0).src = imgName.getElementsByTagName("img").item(0).src.replace(/(_on.gif|.gif)$/i, ".gif");
	imgName.getElementsByTagName("img").item(0).src = imgName.getElementsByTagName("img").item(0).src.replace(/(_on.jpg|.jpg)$/i, ".jpg");
	imgName.getElementsByTagName("img").item(0).src = imgName.getElementsByTagName("img").item(0).src.replace(/(_on.png|.png)$/i, ".png");
}
function gnb(n){
	
	$("#gnb li > ul").hide();
	for (k=1;k <= $(".gnbmenu > img").length ; k++ )
	{
		var img_name = $(".gnbmenu > img").eq(k-1).attr("src");
		if (k == n)
		{
			img_name = "../images/gnb_0"+k+"_on.gif";
			$(".gnbmenu > img").eq(k-1).attr("src",img_name);
		}else{
			img_name = "../images/gnb_0"+k+".gif";
			$(".gnbmenu > img").eq(k-1).attr("src",img_name);
		}
		
	}	
	$("#submenu"+n).show();
}

function chg_color_recruit(color){

	if (color == "white_recruit")
	{
		$("body").removeClass("black_recruit");
		$("body").addClass("white_recruit");
		$("#bg_patt").removeClass("black_bg_patt");
		$("#bg_patt").addClass("white_bg_patt");

		
		$.ajax({
			  type: "POST",
			  url: "/front/chg_body.jsp",
			  data: "color="+color
			});
		
	}else{
		$("body").removeClass("white_recruit");
		$("body").addClass("black_recruit");
		$("#bg_patt").removeClass("white_bg_patt");
		$("#bg_patt").addClass("black_bg_patt");

		$.ajax({
			  type: "POST",
			  url: "/front/chg_body.jsp",
			  data: "color="+color
			});
	}
}

function chg_color(color){

	if (color == "white")
	{
		$("body").removeClass("black");
		$("body").addClass("white");
		
		$.ajax({
			  type: "POST",
			  url: "/front/chg_body.jsp",
			  data: "color="+color
			});
		
	}else{
		$("body").removeClass("white");
		$("body").addClass("black");

		$.ajax({
			  type: "POST",
			  url: "/front/chg_body.jsp",
			  data: "color="+color
			});
	}
}

function chg_view(str){

	if (str == "img")
	{
		$("#news_list_img").removeClass("news_list_img");
		$("#news_list_img").addClass("news_list_img_view");
		$(".news_list_on").hide();
		$('#img2').attr({src: '/images/front/list_tab_01.gif'});
		$('#img1').attr({src: '/images/front/list_tab_02_on.gif'});
		$(".news_list_img_obj").show();
		$.ajax({
			  type: "POST",
			  url: "/front/chg_view.jsp",
			  data: "str="+str
			});
		
	}else{
		$("#news_list_img").removeClass("news_list_img_view");
		$("#news_list_img").addClass("news_list_img");
		$(".news_list_on").show();
		$('#img2').attr({src: '/images/front/list_tab_01_on.gif'});
		$('#img1').attr({src: '/images/front/list_tab_02.gif'});
		$(".news_list_img_obj").hide();
		$.ajax({
			  type: "POST",
			  url: "/front/chg_view.jsp",
			  data: "str="+str
			});
	}
}

var dbClick = false;

function tomail(){

	
	Name = $("#Name_mail").val();
	ComPany = $("#ComPany_mail").val();
	eMail = $("#eMail_mail").val();
	
    if(!eMail) {
    	
    	$("#mailto_no").show();
       return;
    } 

    if(!Name) {
    	$("#mailto_no").show();
        return;
     } 

    
    if(eMail !=""){

      if(!check_mail(eMail)) {
    	  alert("Mail format does not fit.");
    	if(dbClick == false){
      	$("#mailto_div").css('width', $("#mailto_div").width()+220);
		$("#mailto_no").show();
        //$("#eMail").focus();
		
		
		
		dbClick = true;
        return; 
    	}

      } else{
    	  /*
    	  $.ajax({
    		  type: "post",
    		  url: "/front/senddata.jsp",
    		  data: "name="+escape(Name)+"&ComPany="+escape(ComPany)+"&email="+eMail+""
    		});
    	  */
  		//$.post("/front/senddata.jsp", {'name' : Name, 'ComPany' : ComPany, 'email' : eMail}, true);
/*
    	  $.ajax({
    		   type: "post",
    		   url: "/front/senddata.jsp",
    		   //data: "name="+escape(encodeURIComponent(Name))+"&ComPany="+escape(encodeURIComponent(ComPany))+"&email="+eMail+"",
    		   data : {
	    		  name : encodeURIComponent(Name),
	    		  Company : escape(ComPany),
	    		  email : eMail
	    	  },
    		   //data: "name="+Name+"&ComPany="+ComPany+"&email="+eMail+"",
    		   success: function(msg){
    		   //  alert( "Data Saved: " + msg );
    		   }
    		 });
    	  
  */
    	
    	  document.f.action = "/front/senddata.jsp"; 
    	  document.f.submit();
    	  
    	  if(dbClick == true){
    	  	$("#mailto_div").css('width', $("#mailto_div").width()-220);
    	  }
    		$("#mailto_on").hide();
    		$("#mailto_no").hide();
    		$("#mailto_off").show();
        return;      

      }

    }

}

//##################################################################################
//## FORM SUBMIT WITH AJAX                                                        ##
//## @Author: Simone Rodriguez aka Pukos <http://www.SimoneRodriguez.com>         ##
//## @Version: 1.2                                                                ##
//## @Released: 28/08/2007                                                        ##
//## @License: GNU/GPL v. 2 <http://www.gnu.org/copyleft/gpl.html>                ##
//##################################################################################


function xmlhttpPost(strURL,formname,responsediv,responsemsg) {
  var xmlHttpReq = false;
  var self = this;
  // Xhr per Mozilla/Safari/Ie7
  if (window.XMLHttpRequest) {
      self.xmlHttpReq = new XMLHttpRequest();
  }
  // per tutte le altre versioni di IE
  else if (window.ActiveXObject) {
      self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
  }
  self.xmlHttpReq.open('POST', strURL, true);
  self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
  self.xmlHttpReq.onreadystatechange = function() {
      if (self.xmlHttpReq.readyState == 4) {
			// Quando pronta, visualizzo la risposta del form
          updatepage(self.xmlHttpReq.responseText,responsediv);
      }
		else{
			// In attesa della risposta del form visualizzo il msg di attesa
			updatepage(responsemsg,responsediv);

		}
  }
  self.xmlHttpReq.send(getquerystring(formname));
}

function getquerystring(formname) {
  var form = document.forms[formname];
	var qstr = "";

  function GetElemValue(name, value) {
      qstr += (qstr.length > 0 ? "&" : "")
          + escape(name).replace(/\+/g, "%2B") + "="
          + escape(value ? value : "").replace(/\+/g, "%2B");
			//+ escape(value ? value : "").replace(/\n/g, "%0D");
  }
	
	var elemArray = form.elements;
  for (var i = 0; i < elemArray.length; i++) {
      var element = elemArray[i];
      var elemType = element.type.toUpperCase();
      var elemName = element.name;
      if (elemName) {
          if (elemType == "TEXT"
                  || elemType == "TEXTAREA"
                  || elemType == "PASSWORD"
					|| elemType == "BUTTON"
					|| elemType == "RESET"
					|| elemType == "SUBMIT"
					|| elemType == "FILE"
					|| elemType == "IMAGE"
                  || elemType == "HIDDEN")
              GetElemValue(elemName, element.value);
          else if (elemType == "CHECKBOX" && element.checked)
              GetElemValue(elemName, 
                  element.value ? element.value : "On");
          else if (elemType == "RADIO" && element.checked)
              GetElemValue(elemName, element.value);
          else if (elemType.indexOf("SELECT") != -1)
              for (var j = 0; j < element.options.length; j++) {
                  var option = element.options[j];
                  if (option.selected)
                      GetElemValue(elemName,
                          option.value ? option.value : option.text);
              }
      }
  }
  return qstr;
}
function updatepage(str,responsediv){
  document.getElementById(responsediv).innerHTML = str;
}


function check_mail(cg){

    mail01 = /[^@]+@[A-Za-z0-9_-]+[.]+[A-Za-z]+/;
    mail02 =/[^@]+@[A-Za-z0-9_-]+[.]+[A-Za-z0-9_-]+[.]+[A-Za-z]+/;
    mail03 =/[^@]+@[A-Za-z0-9_-]+[.]+[A-Za-z0-9_-]+[.]+[A-Za-z0-9_-]+[.]+[A-Za-z]+/;

    if(mail01.test(cg))return true;;
    if(mail02.test(cg)) return true;
    if(mail03.test(cg)) return true;

    return false;

} 


function down(){

		  location.href="/upload/down_"+$("#pad_r2_down").val()+".zip";
}
function down_ch(ch){

	$("#pad_r2_down").val(ch);
}

function work_view(key,on){
	if (on==0)
	{
		$("#pop_work_view_"+key).show();
		$(".works_blank").show();
		$(".works_blank").css('height', $(".wrap").height()+120);
		$(".works_list2").css('height', $(".works_list2").height()+100);
		$("#pop_work_view_"+key).css('top', $(window).scrollTop());
	}else{		
		$("#pop_work_view_"+key).hide();
		$(".works_blank").hide();
		$(".works_blank").css('height', $(".wrap").height()-120);
		$(".works_list2").css('height', $(".works_list2").height()-100);
	}
	
}

function hover_layrer(n){
	if ($("."+n).css("display") == "none")
	{
		$("."+n).show();
	}else{		
		$("."+n).hide();
	}
}

function more_map(n){	
	$(".map_more img").attr("src","/images/front/black/"+n+".jpg");
	$(".map_more").show();
}

function print(n){	
	if (n == 1){window.open('/front/print/print01.html','newin','resizable=no, scrollbars=yes, width=690, height=600');return false;}
	if (n == 2){window.open('/front/print/print01.html','newin','resizable=no, scrollbars=yes, width=690, height=600');return false;}
	if (n == 3){window.open('/front/print/print01.html','newin','resizable=no, scrollbars=yes, width=690, height=600');return false;}
	if (n == 4){window.open('/front/print/print01.html','newin','resizable=no, scrollbars=yes, width=690, height=600');return false;}
	if (n == 5){window.open('/front/print/print01.html','newin','resizable=no, scrollbars=yes, width=690, height=600');return false;}
	
}
function map_view(n){
	if (n == 1)
	{
		$(".contact_right .menu a").removeClass("on");
		$("#menu1").addClass("on");
		$("#print_01").show();
		$("#print_02").hide();
		$("#print_03").hide();
		$("#print_04").hide();

		
	}
	if (n == 2)
	{
		$(".contact_right .menu a").removeClass("on");
		$("#menu2").addClass("on");
		$("#print_01").hide();
		$("#print_02").show();
		$("#print_03").hide();
		$("#print_04").hide();

	}
	if (n == 3)
	{
		$(".contact_right .menu a").removeClass("on");
		$("#menu3").addClass("on");
		$("#menu3_1").addClass("on");
		$("#print_01").hide();
		$("#print_02").hide();
		$("#print_03").show();
		$("#print_04").hide();

	}
	if (n == 4)
	{
		$(".contact_right .menu a").removeClass("on");
		$("#menu3").addClass("on");
		$("#menu4").addClass("on");
		$("#print_01").hide();
		$("#print_02").hide();
		$("#print_03").hide();
		$("#print_04").show();

	}
	$(".map_img").hide();
	$(".map_img").eq(n-1).show();
}


