<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page contentType="text/html; charset=UTF-8"%>
<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://"
+ request.getServerName() + ":" + request.getServerPort()
+ path + "/";
%>
<html:html lang="true">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=8" />
<title></title>
<meta http-equiv="pragma" content="no-cache"/>
<meta http-equiv="cache-control" content="no-cache"/>
<meta http-equiv="expires" content="0"/>
<link type="text/css" rel="stylesheet" href="./css/common.css"></link>
<link type="text/css" rel="stylesheet" href="./css/screen.css"></link>
<link rel="stylesheet" type="text/css" href="./css/jquery.multiselect.css" />
<link rel="stylesheet" type="text/css" href="./css/jquery-ui.css"/>
<script type="text/javascript" src="./js/jquery.js"></script>
<script type="text/javascript" src="./js/jquery-ui.min.js"></script>
<script type="text/javascript" src="./js/jquery.multiselect.min.js"></script>
<script type="text/javascript" src="./js/prettify.js"></script>
<script type="text/javascript" src="./js/common.js"></script>
<script type="text/javascript" src="./js/ajaxupload.js"></script>
<script type="text/javascript" src="./js/jquery/jquery.validate.js"></script>
<script type="text/javascript" src="<%=path%>/js/jquery/additional-methods.min.js"></script>
<script type="text/javascript" src="<%=path%>/js/jquery/jquery.metadata.js"></script>
<script type="text/javascript">
var menuDoFlg = false;
$(document).ready(function(){
//add confirm flag start
$("#confirmFlg").val("true");
$("body").find("input,select,textarea").live('change', function(){
//do flag
menuDoFlg = true;
});
//add confirm flag end
//advancedBtn button show additional information
$("#advancedBtn").click(function(){
$("#advancedTog").slideToggle("fast");
});
/* ico update delete 3
//Publisher ajax request company's ico
$("#companyID").change(function(){
var url = $("#urlrequest").val()+"/searchICOURLinfoAction.do?companyID="+$("#companyID").val();
$.ajax({
url: url,
type:'post',
dataType:"json",
success:function (data){
if(data.message=="success"){
$("#iconURL").val(data.companyICOURLinfo.iconURL);
$("#iconURLS").val(data.companyICOURLinfo.iconurls);
$("#iconURLU").val(data.companyICOURLinfo.iconurlu);
}
}
});
});
*/
//decide flag for new.jsp(preview)\reuse.jsp(preview)\edit.jsp
if($("#neworeditFlag").val()=="new"){
$("#pageid").text("New Ads");
$("title").val("New Ads");
document.title="New Ads";
$("#adsNametxt").removeAttr("readonly");
$("#adsNametxt").bind("keydown");
$("#accessState").val("first");
//do flag
menuDoFlg = true;
}else if($("#neworeditFlag").val()=="reuse"){
$("#pageid").text("Reuse Ads");
$("title").val("Reuse Ads");
document.title="Reuse Ads";
$("#adsNametxt").removeAttr("readonly");
$("#adsNametxt").bind("keydown");
//do flag
menuDoFlg = true;
}else{
$("#pageid").text("Edit Ads");
$("title").val("Edit Ads");
document.title="Edit Ads";
$("#neworeditFlag").val("edit");
$("#adsNametxt").attr("readonly","readonly");
$("#adsNametxt").keydown(function(){
return false;
});
}
var newItem = $('#newItem');
//Line up multiselect
var elLineUp= $("#targetLineUpCheckBox").multiselect({
header: true,
minWidth: 146,
height: 100,
Options:true,
noneSelectedText: 'Line Up',
selectedText: 'Line Up',
checkAll:function(event){
//do flag
menuDoFlg = true;
//check all models of Line up by clicked
//$.each(event.target.options,function(i,item){
var linestr = $.map(elModels.multiselect("getChecked"), function( input ){
return input.title;
});
//ajax request models target function parameter1: selected parameter2: short model(0) or full model(1)
chageLevel2fn(linestr,$("#modelType").val()=="0"?"short":"full");
//});
},
uncheckAll:function(event){
//do flag
menuDoFlg = true;
//disabled
elModels.empty();
elModels.multiselect('refresh');
elModels.multiselect('disable');
},
click: function(event, ui){
//do flag
menuDoFlg = true;
//get models by clicked
var linestr = $.map(elModels.multiselect("getChecked"), function( input ){
return input.title;
});
//ajax request models target function parameter1: selected parameter2: short model(0) or full model(1)
chageLevel2fn(linestr,$("#modelType").val()=="0"?"short":"full");
}
});
//Models multiselect
var elModels= $("#targetModelsCheckBox").multiselect({
header: true,
minWidth: 146,
height: 100,
noneSelectedText: 'Models',
selectedText: 'Models'
});
//Country multiselect
var elCountry= $("#targetCountryCheckBox").multiselect({
header: true,
minWidth: 146,
height: 100,
noneSelectedText: 'Country',
selectedText: 'Country',
checkAll:function(event){
//do flag
menuDoFlg = true;
//check all languages of Country by clicked
//$.each(event.target.options,function(i,item){
var selstr = $.map(elLanguage.multiselect("getChecked"), function( input ){
return input.title;
});
//get blue language value
$("#"+$(".Button_langblue").val()+"_title").val($("#titleTxt1").val());
$("#"+$(".Button_langblue").val()+"_message").val($("#messageTxt1").val());
$("#"+$(".Button_langblue").val()+"_pictureshow").val($("#uploadpictureShow").val());
$("#"+$(".Button_langblue").val()+"_action").val($("#actionTxt1").val());
$("#"+$(".Button_langblue").val()+"_targetOperations").val($("#targetOperationCheckBox").val());
$("#"+$(".Button_langblue").val()+"_targetParameters").val($("#targetParameters").val());
$("#"+$(".Button_langblue").val()+"_targetDirectory").val($("#targetDirectory").val());
$("#"+$(".Button_langblue").val()+"_targetDisplay").val($("#targetDisplayCheckBox").val());
$("#"+$(".Button_langblue").val()+"_regKeyDisplay").val($("#regKeyDisplay").val());
$("#"+$(".Button_langblue").val()+"_regKeyDoNotDisplay").val($("#regKeyDoNotDisplay").val());
//ajax request language target function parameter1: selected
chageLevel4fn(selstr,false);
//});
//remove disabled
$("#titleTxt1").removeAttr("disabled").css({background: "#FFFFFF"});
$("#advancedBtn").removeAttr("disabled");
$("#messageTxt1").removeAttr("disabled").css({background: "#FFFFFF"});
$("#actionTxt1").removeAttr("disabled").css({background: "#FFFFFF"});
$("#uploadpictureShow").css({background: "#FFFFFF"});
$("#uploadpicture").css('display','block');
},
uncheckAll:function(event){
//do flag
menuDoFlg = true;
//disabled
elLanguage.empty();
elLanguage.multiselect('refresh');
elLanguage.multiselect('disable');
$("#hiddenshow").empty();
$("#langButtonDiv").empty();
$("#titleTxt1").attr('disabled',"true").css({background: "#f0f0f0"}).val("");
$("#advancedBtn").attr('disabled',"true");
$("#messageTxt1").attr('disabled',"true").css({background: "#f0f0f0"}).val("");
$("#actionTxt1").attr('disabled',"true").css({background: "#f0f0f0"}).val("");
$("#uploadpictureShow").css({background: "#f0f0f0"}).val("");
$("#uploadpicture").css('display','none');
$("#targetOperationCheckBox").val("open");
$("#targetParameters").val("");
$("#targetDirectory").val("");
$("#targetDisplayCheckBox").val("1");
$("#RegKeyDisplay").val("");
$("#regKeyDoNotDisplay").val("");
$("#languageStr").val("");
$("#deldiv").empty();
//validate331 empty error
$("#titleTxt1").removeClass("error").parent().next().next().empty();
$("#messageTxt1").removeClass("error").parent().next().next().empty();
$("#actionTxt1").removeClass("error").parent().next().next().empty();
//default 8 start
$("#defaultPictureU").val("");
$("#defaultPictureS").val("");
$("#defaultAction").val("");
$("#defaultFlag").val("0");
//default 8 end
//disabled advancedBtn 1
$("#advancedTog").hide();
},
click: function(event, ui){
//do flag
menuDoFlg = true;
$("#"+$(".Button_langblue").val()+"_title").val($("#titleTxt1").val());
$("#"+$(".Button_langblue").val()+"_message").val($("#messageTxt1").val());
$("#"+$(".Button_langblue").val()+"_pictureshow").val($("#uploadpictureShow").val());
$("#"+$(".Button_langblue").val()+"_action").val($("#actionTxt1").val());
$("#"+$(".Button_langblue").val()+"_targetOperations").val($("#targetOperationCheckBox").val());
$("#"+$(".Button_langblue").val()+"_targetParameters").val($("#targetParameters").val());
$("#"+$(".Button_langblue").val()+"_targetDirectory").val($("#targetDirectory").val());
$("#"+$(".Button_langblue").val()+"_targetDisplay").val($("#targetDisplayCheckBox").val());
$("#"+$(".Button_langblue").val()+"_regKeyDisplay").val($("#regKeyDisplay").val());
$("#"+$(".Button_langblue").val()+"_regKeyDoNotDisplay").val($("#regKeyDoNotDisplay").val());
//get Country clicked
var counstr = $.map(elCountry.multiselect("getChecked"), function( input ){
return input.title;
});
//get Language clicked
var selstr = $.map(elLanguage.multiselect("getChecked"), function( input ){
return input.title;
});
if(ui.checked){
//remove disabled
$("#titleTxt1").removeAttr("disabled").css({background: "#FFFFFF"});
$("#advancedBtn").removeAttr("disabled");
$("#messageTxt1").removeAttr("disabled").css({background: "#FFFFFF"});
$("#actionTxt1").removeAttr("disabled").css({background: "#FFFFFF"});
$("#uploadpictureShow").css({background: "#FFFFFF"});
$("#uploadpicture").css('display','block');
}
//country target is not selected, initialize page
if(counstr==""||counstr==null){
$("#hiddenshow").empty();
$("#langButtonDiv").empty();
elLanguage.empty();
elLanguage.multiselect('refresh');
$("#titleTxt1").attr('disabled',"true").css({background: "#f0f0f0"}).val("");
$("#advancedBtn").attr('disabled',"true");
$("#messageTxt1").attr('disabled',"true").css({background: "#f0f0f0"}).val("");
$("#actionTxt1").attr('disabled',"true").css({background: "#f0f0f0"}).val("");
$("#uploadpictureShow").css({background: "#f0f0f0"}).val("");
$("#uploadpicture").css('display','none');
$("#targetOperationCheckBox").val("open");
$("#targetParameters").val("");
$("#targetDirectory").val("");
$("#targetDisplayCheckBox").val("1");
$("#RegKeyDisplay").val("");
$("#regKeyDoNotDisplay").val("");
$("#languageStr").val("");
$("#deldiv").empty();
//validate332 empty error
$("#titleTxt1").removeClass("error").parent().next().next().empty();
$("#messageTxt1").removeClass("error").parent().next().next().empty();
$("#actionTxt1").removeClass("error").parent().next().next().empty();
//default 5 default information
$("#defaultPictureU").val("");
$("#defaultPictureS").val("");
$("#defaultAction").val("");
$("#defaultFlag").val("0");
//default 5 end
//disabled advancedBtn 2
$("#advancedTog").hide();
}
//ajax request language target function parameter1: selected
chageLevel4fn(selstr,false);
}
});
//Language multiselect
var elLanguage= $("#targetLanguageCheckBox").multiselect({
header: true,
minWidth: 146,
height: 100,
noneSelectedText: 'Language',
selectedText: 'Language',
checkAll:function(event){
//do flag
menuDoFlg = true;
var selstr = $.map(elLanguage.multiselect("getChecked"), function( input ){
return input.title;
});
//get blue language value
$("#"+$(".Button_langblue").val()+"_title").val($("#titleTxt1").val());
$("#"+$(".Button_langblue").val()+"_message").val($("#messageTxt1").val());
$("#"+$(".Button_langblue").val()+"_pictureshow").val($("#uploadpictureShow").val());
$("#"+$(".Button_langblue").val()+"_action").val($("#actionTxt1").val());
$("#"+$(".Button_langblue").val()+"_targetOperations").val($("#targetOperationCheckBox").val());
$("#"+$(".Button_langblue").val()+"_targetParameters").val($("#targetParameters").val());
$("#"+$(".Button_langblue").val()+"_targetDirectory").val($("#targetDirectory").val());
$("#"+$(".Button_langblue").val()+"_targetDisplay").val($("#targetDisplayCheckBox").val());
$("#"+$(".Button_langblue").val()+"_regKeyDisplay").val($("#regKeyDisplay").val());
$("#"+$(".Button_langblue").val()+"_regKeyDoNotDisplay").val($("#regKeyDoNotDisplay").val());
//ajax request language target function parameter1: selected
chageLevel4fn(selstr,false);
//remove disabled
$("#titleTxt1").removeAttr("disabled").css({background: "#FFFFFF"});
$("#advancedBtn").removeAttr("disabled");
$("#messageTxt1").removeAttr("disabled").css({background: "#FFFFFF"});
$("#actionTxt1").removeAttr("disabled").css({background: "#FFFFFF"});
$("#uploadpictureShow").css({background: "#FFFFFF"});
$("#uploadpicture").css('display','block');
},
uncheckAll:function(event){
//do flag
menuDoFlg = true;
//disabled
$("#hiddenshow").empty();
$("#langButtonDiv").empty();
$("#titleTxt1").attr('disabled',"true").css({background: "#f0f0f0"}).val("");
$("#advancedBtn").attr('disabled',"true");
$("#messageTxt1").attr('disabled',"true").css({background: "#f0f0f0"}).val("");
$("#actionTxt1").attr('disabled',"true").css({background: "#f0f0f0"}).val("");
$("#uploadpictureShow").css({background: "#f0f0f0"}).val("");
$("#uploadpicture").css('display','none');
$("#targetOperationCheckBox").val("open");
$("#targetParameters").val("");
$("#targetDirectory").val("");
$("#targetDisplayCheckBox").val("1");
$("#RegKeyDisplay").val("");
$("#regKeyDoNotDisplay").val("");
$("#languageStr").val("");
$("#deldiv").empty();
//validate333 empty error
$("#titleTxt1").removeClass("error").parent().next().next().empty();
$("#messageTxt1").removeClass("error").parent().next().next().empty();
$("#actionTxt1").removeClass("error").parent().next().next().empty();
//default 8 start
$("#defaultPictureU").val("");
$("#defaultPictureS").val("");
$("#defaultAction").val("");
$("#defaultFlag").val("0");
//default 8 end
//disabled advancedBtn 3
$("#advancedTog").hide();
},
click:function(event, ui){
//do flag
menuDoFlg = true;
//validate1 empty error
$("#titleTxt1").removeClass("error").parent().next().next().empty();
$("#messageTxt1").removeClass("error").parent().next().next().empty();
$("#actionTxt1").removeClass("error").parent().next().next().empty();
$("#"+$(".Button_langblue").val()+"_title").val($("#titleTxt1").val());
$("#"+$(".Button_langblue").val()+"_message").val($("#messageTxt1").val());
$("#"+$(".Button_langblue").val()+"_pictureshow").val($("#uploadpictureShow").val());
$("#"+$(".Button_langblue").val()+"_action").val($("#actionTxt1").val());
$("#"+$(".Button_langblue").val()+"_targetOperations").val($("#targetOperationCheckBox").val());
$("#"+$(".Button_langblue").val()+"_targetParameters").val($("#targetParameters").val());
$("#"+$(".Button_langblue").val()+"_targetDirectory").val($("#targetDirectory").val());
$("#"+$(".Button_langblue").val()+"_targetDisplay").val($("#targetDisplayCheckBox").val());
$("#"+$(".Button_langblue").val()+"_regKeyDisplay").val($("#regKeyDisplay").val());
$("#"+$(".Button_langblue").val()+"_regKeyDoNotDisplay").val($("#regKeyDoNotDisplay").val());
//validate1 end
//default 9 set default start
if($("#defaultFlag").val()=="0"&&($("#titleTxt1").val()!=""||$("#messageTxt1").val()!=""||$("#actionTxt1").val()!=""||$("#uploadpictureShow").val()!="")){
$("#defaultPictureU").val($("#"+$(".Button_langblue").val()+"_pictureshow").val());
$("#defaultPictureS").val($("#"+$(".Button_langblue").val()+"_picture").val());
$("#defaultAction").val($("#"+$(".Button_langblue").val()+"_action").val());
$("#defaultFlag").val("1");
}
//default 9 set default end
$("#langButtonDiv").empty();
//get selected languages
var array_of_checked_values = $("#targetLanguageCheckBox").multiselect("getChecked").map(function(){return $(this).parent().children("span").text();}).get();
var i=0;
var targetFlg = false;
var content;
var languageStr="";
//each language create button and value
for(i in array_of_checked_values){
if (i == 0){//first language
$("#langButtonDiv").append("<input type='button' class='Button_langblue' id='"+array_of_checked_values[i]+"' name='"+array_of_checked_values[i]+"' value='"+array_of_checked_values[i]+"'/> ");
targetFlg = true;
$("#titleTxt1").val($("#"+$(".Button_langblue").val()+"_title").val());
$("#messageTxt1").val($("#"+$(".Button_langblue").val()+"_message").val());
$("#uploadpictureShow").val($("#"+$(".Button_langblue").val()+"_pictureshow").val());
$("#actionTxt1").val($("#"+$(".Button_langblue").val()+"_action").val());
$("#targetOperationCheckBox").attr("value",$("#"+$(".Button_langblue").val()+"_targetOperations").val());
$("#targetParameters").val($("#"+$(".Button_langblue").val()+"_targetParameters").val());
$("#targetDirectory").val($("#"+$(".Button_langblue").val()+"_targetDirectory").val());
$("#targetDisplayCheckBox").val($("#"+$(".Button_langblue").val()+"_targetDisplay").val());
$("#regKeyDisplay").val($("#"+$(".Button_langblue").val()+"_regKeyDisplay").val());
$("#regKeyDoNotDisplay").val($("#"+$(".Button_langblue").val()+"_regKeyDoNotDisplay").val());
} else {
$("#langButtonDiv").append("<input type='button' class='Button_langwhite' id='"+array_of_checked_values[i]+"' name='"+array_of_checked_values[i]+"' value='"+array_of_checked_values[i]+"'/> ");
}
//produce string
languageStr+=array_of_checked_values[i]+",";
//attaching event for language buttons
$("#"+array_of_checked_values[i]).click(function(){
$("#langButtonDiv").find("input").each(function () {
if($(this).attr('class')=="Button_langblue"){
//validate2 start
if($("#titleTxt1").val()==""||$("#titleTxt1").val()==null){
$(this).css({"background-color": "#FF0000"});
}
if($("#messageTxt1").val()==""||$("#messageTxt1").val()==null){
$(this).css({"background-color": "#FF0000"});
}
if($("#actionTxt1").val()==""||$("#actionTxt1").val()==null){
$(this).css({"background-color": "#FF0000"});
}
//validate2 end
$("#"+$(this).val()+"_title").val($("#titleTxt1").val());
$("#"+$(this).val()+"_message").val($("#messageTxt1").val());
$("#"+$(this).val()+"_pictureshow").val($("#uploadpictureShow").val());
$("#"+$(this).val()+"_action").val($("#actionTxt1").val());
$("#"+$(this).val()+"_targetOperations").val($("#targetOperationCheckBox").val());
$("#"+$(this).val()+"_targetParameters").val($("#targetParameters").val());
$("#"+$(this).val()+"_targetDirectory").val($("#targetDirectory").val());
$("#"+$(this).val()+"_targetDisplay").val($("#targetDisplayCheckBox").val());
$("#"+$(this).val()+"_regKeyDisplay").val($("#regKeyDisplay").val());
$("#"+$(this).val()+"_regKeyDoNotDisplay").val($("#regKeyDoNotDisplay").val());
//default 1 start
if($("#defaultFlag").val()=="0"){
$("#defaultPictureU").val($("#"+$(this).val()+"_pictureshow").val());
$("#defaultPictureS").val($("#"+$(this).val()+"_picture").val());
$("#defaultAction").val($("#"+$(this).val()+"_action").val());
$("#defaultFlag").val("1");
}
//default 1 end
$(this).removeClass("Button_langblue").addClass("Button_langwhite");
return false;
}
});
$(this).removeClass("Button_langwhite").addClass("Button_langblue");
if($("#"+$(this).attr("id")+"_targetOperations").val()!=""){
$("#targetOperationCheckBox").attr("value",$("#"+$(this).attr("id")+"_targetOperations").val());
}else{
$("#targetOperationCheckBox").attr("value","open");
}
if($("#"+$(this).attr("id")+"_targetOperations").val()!=""){
$("#targetDisplayCheckBox").val($("#"+$(this).attr("id")+"_targetDisplay").val());
}else{
$("#targetDisplayCheckBox").val("1");
}
//default 3 start
if($("#"+$(this).attr("id")+"_pictureshow").val()!=null&&$("#"+$(this).attr("id")+"_pictureshow").val()!=""){
$("#uploadpictureShow").val($("#"+$(this).attr("id")+"_pictureshow").val());
}else if($("#"+$(this).attr("id")+"_title").val()==""&&$("#"+$(this).attr("id")+"_message").val()==""&&$("#"+$(this).attr("id")+"_action").val()==""&&$("#"+$(this).attr("id")+"_pictureshow").val()==""){
$("#uploadpictureShow").val($("#defaultPictureU").val());
$("#"+$(this).attr("id")+"_picture").val($("#defaultPictureS").val())
}else{
$("#uploadpictureShow").val("");
}
if($("#"+$(this).attr("id")+"_action").val()!=null&&$("#"+$(this).attr("id")+"_action").val()!=""){
$("#actionTxt1").val($("#"+$(this).attr("id")+"_action").val());
}else if($("#"+$(this).attr("id")+"_title").val()==""&&$("#"+$(this).attr("id")+"_message").val()==""&&$("#"+$(this).attr("id")+"_action").val()==""&&$("#"+$(this).attr("id")+"_pictureshow").val()==""){
$("#actionTxt1").val($("#defaultAction").val());
}else{
$("#actionTxt1").val("");
}
//default 3 end
$("#titleTxt1").val($("#"+$(this).attr("id")+"_title").val());
$("#messageTxt1").val($("#"+$(this).attr("id")+"_message").val());
$("#targetParameters").val($("#"+$(this).attr("id")+"_targetParameters").val());
$("#targetDirectory").val($("#"+$(this).attr("id")+"_targetDirectory").val());
$("#regKeyDisplay").val($("#"+$(this).attr("id")+"_regKeyDisplay").val());
$("#regKeyDoNotDisplay").val($("#"+$(this).attr("id")+"_regKeyDoNotDisplay").val());
if($("#"+$(".Button_langblue").val()+"_picture").val()!=null&&$("#"+$(".Button_langblue").val()+"_picture").val()!=""){
$("#deldiv").empty().append(" "+"<input type='button' class='delbotton' id='"+$(".Button_langblue").val()+"_delbutton' name = '"+$(".Button_langblue").val()+"_delbutton' value='Delete'/> ");
$("#"+$(".Button_langblue").val()+"_delbutton").click(function(){
//do flag
menuDoFlg = true;
$("#deldiv").empty();
$("#uploadpictureShow").val("");
$("#"+$(".Button_langblue").val()+"_picture").val("");
$("#"+$(".Button_langblue").val()+"_pictureshow").val("");
});
}else{
$("#deldiv").empty();
}
//validate3 start
if($(this).css("background-color")=="RGB\(255, 0, 0\)"||$(this).css("background-color")=="rgb\(255, 0, 0\)"||$(this).css("background-color")=="#ff0000"||$(this).css("background-color")=="#FF0000"){
$("#titleTxt1").trigger("focusout");
$("#messageTxt1").trigger("focusout");
$("#actionTxt1").trigger("focusout");
}else{
$("#titleTxt1").removeClass("error").parent().next().next().empty();
$("#messageTxt1").removeClass("error").parent().next().next().empty();
$("#actionTxt1").removeClass("error").parent().next().next().empty();
}
//validate3 end
});
}
//language empty
if(i==0&&$("#languageStr").val().split(",").length==1){
$("#titleTxt1").val($("#"+array_of_checked_values[0]+"_title").val());
$("#messageTxt1").val($("#"+array_of_checked_values[0]+"_message").val());
$("#actionTxt1").val($("#"+array_of_checked_values[0]+"_action").val());
$("#uploadpictureShow").val($("#"+array_of_checked_values[0]+"_pictureshow").val());
//disabled
$("#titleTxt1").attr('disabled',"true").css({background: "#f0f0f0"}).val("");
$("#advancedBtn").attr('disabled',"true");
$("#messageTxt1").attr('disabled',"true").css({background: "#f0f0f0"}).val("");
$("#actionTxt1").attr('disabled',"true").css({background: "#f0f0f0"}).val("");
$("#uploadpictureShow").css({background: "#f0f0f0"}).val("");
$("#uploadpicture").css('display','none');
$("#targetOperationCheckBox").val("open");
$("#targetParameters").val("");
$("#targetDirectory").val("");
$("#targetDisplayCheckBox").val("1");
$("#RegKeyDisplay").val("");
$("#regKeyDoNotDisplay").val("");
$("#languageStr").val("");
$("#deldiv").empty();
//validate334 empty error
$("#titleTxt1").removeClass("error").parent().next().next().empty();
$("#messageTxt1").removeClass("error").parent().next().next().empty();
$("#actionTxt1").removeClass("error").parent().next().next().empty();
//default 6 start
$("#defaultPictureU").val("");
$("#defaultPictureS").val("");
$("#defaultAction").val("");
$("#defaultFlag").val("0");
//default 6 end
//disabled advancedBtn 4
$("#advancedTog").hide();
}
languageStr = languageStr.substring(0,languageStr.length-1);
$("#languageStr").val(languageStr);
if(!ui.checked){//cancel checked
$("#hiddenshow").children().each(function () {
if(ui.text==$(this).attr("id").substring(0,$(this).attr("id").indexOf("_"))){
$(this).remove();
}
});
//default 7 start
if($("#uploadpictureShow").val()==""||$("#uploadpictureShow").val()==null){
$("#deldiv").empty();
}
if($("#"+$(".Button_langblue").val()+"_picture").val()!=null&&$("#"+$(".Button_langblue").val()+"_picture").val()!=""){
$("#deldiv").empty().append(" "+"<input type='button' class='delbotton' id='"+$(".Button_langblue").val()+"_delbutton' name = '"+$(".Button_langblue").val()+"_delbutton' value='Delete'/> ");
$("#"+$(".Button_langblue").val()+"_delbutton").click(function(){
//do flag
menuDoFlg = true;
$("#deldiv").empty();
$("#uploadpictureShow").val("");
$("#"+$(".Button_langblue").val()+"_picture").val("");
$("#"+$(".Button_langblue").val()+"_pictureshow").val("");
});
}else{
$("#deldiv").empty();
}
//default 7 end
}else if(ui.checked){//checked
if(i==0){
$("#hiddenshow").empty();
};
var lanFlag = true;
$("#hiddenshow").children().each(function () {
if(ui.text==$(this).attr("id").substring(0,$(this).attr("id").indexOf("_"))){
$(this).empty();
lanFlag=false;
}
});
content=
"<input type='hidden' name='"+ui.text+"_title' id='"+ui.text+"_title' />"+
"<input type='hidden' name='"+ui.text+"_message' id='"+ui.text+"_message' />"+
"<input type='hidden' name='"+ui.text+"_picture' id='"+ui.text+"_picture' value='"+$("#defaultPictureS").val()+"' />"+
"<input type='hidden' name='"+ui.text+"_pictureshow' id='"+ui.text+"_pictureshow' value='"+$("#defaultPictureU").val()+"' />"+
"<input type='hidden' name='"+ui.text+"_action' id='"+ui.text+"_action' value='"+$("#defaultAction").val()+"' />"+
"<input type='hidden' name='"+ui.text+"_targetOperations' id='"+ui.text+"_targetOperations' />"+
"<input type='hidden' name='"+ui.text+"_targetParameters' id='"+ui.text+"_targetParameters' />"+
"<input type='hidden' name='"+ui.text+"_targetDirectory' id='"+ui.text+"_targetDirectory' />"+
"<input type='hidden' name='"+ui.text+"_targetDisplay' id='"+ui.text+"_targetDisplay' />"+
"<input type='hidden' name='"+ui.text+"_regKeyDisplay' id='"+ui.text+"_regKeyDisplay' />"+
"<input type='hidden' name='"+ui.text+"_regKeyDoNotDisplay' id='"+ui.text+"_regKeyDoNotDisplay' />";
//default 10 start
if(ui.text==$(".Button_langblue").val()){
if($("#defaultFlag").val()=="1"){
if($("#"+ui.text+"_pictureshow").val()!=null&&$("#"+ui.text+"_pictureshow").val()!=""){
$("#uploadpictureShow").val($("#"+ui.text+"_pictureshow").val());
}else{
$("#uploadpictureShow").val($("#defaultPictureU").val());
$("#"+ui.text+"_picture").val($("#defaultPictureS").val())
}
if($("#"+ui.text+"_action").val()!=null&&$("#"+ui.text+"_action").val()!=""){
$("#actionTxt1").val($("#"+ui.text+"_action").val());
}else{
$("#actionTxt1").val($("#defaultAction").val());
}
}
}
//default 10 end
if(lanFlag){
$("#hiddenshow").append(content);
}
}
if (targetFlg) {
$("#titleTxt1").removeAttr("disabled").css({background: "#FFFFFF"});
$("#advancedBtn").removeAttr("disabled");
$("#messageTxt1").removeAttr("disabled").css({background: "#FFFFFF"});
$("#actionTxt1").removeAttr("disabled").css({background: "#FFFFFF"});
$("#uploadpictureShow").css({background: "#FFFFFF"});
$("#uploadpicture").css('display','block');
}
}
});
//language function
function chageLevel4fn(val,firstFlg){
var url = $("#urlrequest").val()+"/changeComboxAction.do";
var dataStr = 'selectedValLan='+$.map(elCountry.multiselect("getChecked"), function( input ){
return input.value;
});
if ('selectedValLan='==dataStr) {
elLanguage.multiselect('disable');
} else {
elCountry.multiselect('disable');
elLanguage.multiselect('disable');
$.ajax({
url: url,
type:'post',
data:dataStr,
success:function (data){
elLanguage.empty();
elLanguage.multiselect('refresh');
var obj = jQuery.parseJSON(data);
var tarParam = obj.items;
var key = val+"";
var languageChange = "";
$.each(tarParam,function(i,item){
var optionVal = item.id;
var optionLabel = item.label;
var optionflag = false;
if(firstFlg){
if(key.indexOf(item.label)>-1){
optionflag = true;
}
}else{
optionflag = true;
}
var v = newItem.val(), opt = $('<option />', {
value: optionVal,
text: optionLabel,
selected:optionflag
});
if(optionflag){
languageChange +=item.label+",";
}
opt.appendTo(elLanguage);
});
elLanguage.multiselect('refresh');
if(languageChange!=""){
languageChange = languageChange.substring(0,languageChange.length-1);
}
if(languageChange.length>0){
//all sign end 2
if($("#defaultFlag").val()=="0"&&($("#titleTxt1").val()!=""||$("#messageTxt1").val()!=""||$("#actionTxt1").val()!=""||$("#uploadpictureShow").val()!="")){
$("#defaultPictureU").val($("#"+$(".Button_langblue").val()+"_pictureshow").val());
$("#defaultPictureS").val($("#"+$(".Button_langblue").val()+"_picture").val());
$("#defaultAction").val($("#"+$(".Button_langblue").val()+"_action").val());
$("#defaultFlag").val("1");
}
//all sign end 2
$("#langButtonDiv").empty();
$.each(languageChange.split(","),function(i,item){
//all sign start 1
var content1=
"<input type='hidden' name='"+item+"_title' id='"+item+"_title' />"+
"<input type='hidden' name='"+item+"_message' id='"+item+"_message' />"+
"<input type='hidden' name='"+item+"_picture' id='"+item+"_picture' value='"+$("#defaultPictureS").val()+"' />"+
"<input type='hidden' name='"+item+"_pictureshow' id='"+item+"_pictureshow' value='"+$("#defaultPictureU").val()+"' />"+
"<input type='hidden' name='"+item+"_action' id='"+item+"_action' value='"+$("#defaultAction").val()+"' />"+
"<input type='hidden' name='"+item+"_targetOperations' id='"+item+"_targetOperations' />"+
"<input type='hidden' name='"+item+"_targetParameters' id='"+item+"_targetParameters' />"+
"<input type='hidden' name='"+item+"_targetDirectory' id='"+item+"_targetDirectory' />"+
"<input type='hidden' name='"+item+"_targetDisplay' id='"+item+"_targetDisplay' />"+
"<input type='hidden' name='"+item+"_regKeyDisplay' id='"+item+"_regKeyDisplay' />"+
"<input type='hidden' name='"+item+"_regKeyDoNotDisplay' id='"+item+"_regKeyDoNotDisplay' />";
if($("#languageStr").val()!=null&&$("#languageStr").val()!=""){
if(!($("#languageStr").val().indexOf(item)>-1)){
$("#hiddenshow").append(content1);
}
}else{
$("#hiddenshow").append(content1);
}
//all sign end 1
if(i==0){
$("#langButtonDiv").append("<input type='button' class='Button_langblue' id='"+item+"' name='"+item+"' value='"+item+"'/> ");
$("#titleTxt1").val($("#"+$(".Button_langblue").val()+"_title").val());
$("#messageTxt1").val($("#"+$(".Button_langblue").val()+"_message").val());
$("#uploadpictureShow").val($("#"+$(".Button_langblue").val()+"_pictureshow").val());
$("#actionTxt1").val($("#"+$(".Button_langblue").val()+"_action").val());
$("#targetOperationCheckBox").attr("value",$("#"+$(".Button_langblue").val()+"_targetOperations").val());
$("#targetParameters").val($("#"+$(".Button_langblue").val()+"_targetParameters").val());
$("#targetDirectory").val($("#"+$(".Button_langblue").val()+"_targetDirectory").val());
$("#targetDisplayCheckBox").val($("#"+$(".Button_langblue").val()+"_targetDisplay").val());
$("#regKeyDisplay").val($("#"+$(".Button_langblue").val()+"_regKeyDisplay").val());
$("#regKeyDoNotDisplay").val($("#"+$(".Button_langblue").val()+"_regKeyDoNotDisplay").val());
if($("#"+$(".Button_langblue").val()+"_pictureshow").val()!=null&&$("#"+$(".Button_langblue").val()+"_pictureshow").val()!=""){
$("#deldiv").empty().append(" "+"<input type='button' class='delbotton' id='"+$(".Button_langblue").val()+"_delbutton' name = '"+$(".Button_langblue").val()+"_delbutton' value='Delete'/> ");
$("#"+$(".Button_langblue").val()+"_delbutton").click(function(){
//do flag
menuDoFlg = true;
$("#deldiv").empty();
$("#uploadpictureShow").val("");
$("#"+$(".Button_langblue").val()+"_picture").val("");
$("#"+$(".Button_langblue").val()+"_pictureshow").val("");
});
}
}else{
$("#langButtonDiv").append("<input type='button' class='Button_langwhite' id='"+item+"' name='"+item+"' value='"+item+"'/> ");
}
$("#"+item).click(function(){
$("#langButtonDiv").find("input").each(function () {
if($(this).attr('class')=="Button_langblue"){
//validate21 start
if($("#titleTxt1").val()==""||$("#titleTxt1").val()==null){
$(this).css({"background-color": "#FF0000"});
}
if($("#messageTxt1").val()==""||$("#messageTxt1").val()==null){
$(this).css({"background-color": "#FF0000"});
}
if($("#actionTxt1").val()==""||$("#actionTxt1").val()==null){
$(this).css({"background-color": "#FF0000"});
}
//validate21 end
$("#"+$(this).val()+"_title").val($("#titleTxt1").val());
$("#"+$(this).val()+"_message").val($("#messageTxt1").val());
$("#"+$(this).val()+"_pictureshow").val($("#uploadpictureShow").val());
$("#"+$(this).val()+"_action").val($("#actionTxt1").val());
$("#"+$(this).val()+"_targetOperations").val($("#targetOperationCheckBox").val());
$("#"+$(this).val()+"_targetParameters").val($("#targetParameters").val());
$("#"+$(this).val()+"_targetDirectory").val($("#targetDirectory").val());
$("#"+$(this).val()+"_targetDisplay").val($("#targetDisplayCheckBox").val());
$("#"+$(this).val()+"_regKeyDisplay").val($("#regKeyDisplay").val());
$("#"+$(this).val()+"_regKeyDoNotDisplay").val($("#regKeyDoNotDisplay").val());
//show click button value
if($("#defaultFlag").val()=="0"){
$("#defaultPictureU").val($("#"+$(this).val()+"_pictureshow").val());
$("#defaultPictureS").val($("#"+$(this).val()+"_picture").val());
$("#defaultAction").val($("#"+$(this).val()+"_action").val());
$("#defaultFlag").val("1");
}
$(this).removeClass("Button_langblue").addClass("Button_langwhite");
return false;
}
});
$(this).removeClass("Button_langwhite").addClass("Button_langblue");
if($("#"+$(this).attr("id")+"_targetOperations").val()!=""){
$("#targetOperationCheckBox").attr("value",$("#"+$(this).attr("id")+"_targetOperations").val());
}else{
$("#targetOperationCheckBox").attr("value","open");
}
if($("#"+$(this).attr("id")+"_targetOperations").val()!=""){
$("#targetDisplayCheckBox").val($("#"+$(this).attr("id")+"_targetDisplay").val());
}else{
$("#targetDisplayCheckBox").val("1");
}
//default 4
if($("#"+$(this).attr("id")+"_pictureshow").val()!=null&&$("#"+$(this).attr("id")+"_pictureshow").val()!=""){
$("#uploadpictureShow").val($("#"+$(this).attr("id")+"_pictureshow").val());
}else if($("#"+$(this).attr("id")+"_title").val()==""&&$("#"+$(this).attr("id")+"_message").val()==""&&$("#"+$(this).attr("id")+"_action").val()==""&&$("#"+$(this).attr("id")+"_pictureshow").val()==""){
$("#uploadpictureShow").val($("#defaultPictureU").val());
$("#"+$(this).attr("id")+"_picture").val($("#defaultPictureS").val())
}else{
$("#uploadpictureShow").val("");
}
if($("#"+$(this).attr("id")+"_action").val()!=null&&$("#"+$(this).attr("id")+"_action").val()!=""){
$("#actionTxt1").val($("#"+$(this).attr("id")+"_action").val());
}else if($("#"+$(this).attr("id")+"_title").val()==""&&$("#"+$(this).attr("id")+"_message").val()==""&&$("#"+$(this).attr("id")+"_action").val()==""&&$("#"+$(this).attr("id")+"_pictureshow").val()==""){
$("#actionTxt1").val($("#defaultAction").val());
}else{
$("#actionTxt1").val("");
}
$("#titleTxt1").val($("#"+$(this).attr("id")+"_title").val());
$("#messageTxt1").val($("#"+$(this).attr("id")+"_message").val());
$("#targetParameters").val($("#"+$(this).attr("id")+"_targetParameters").val());
$("#targetDirectory").val($("#"+$(this).attr("id")+"_targetDirectory").val());
$("#regKeyDisplay").val($("#"+$(this).attr("id")+"_regKeyDisplay").val());
$("#regKeyDoNotDisplay").val($("#"+$(this).attr("id")+"_regKeyDoNotDisplay").val());
if($("#"+$(".Button_langblue").val()+"_picture").val()!=null&&$("#"+$(".Button_langblue").val()+"_picture").val()!=""){
$("#deldiv").empty().append(" "+"<input type='button' class='delbotton' id='"+$(".Button_langblue").val()+"_delbutton' name = '"+$(".Button_langblue").val()+"_delbutton' value='Delete'/> ");
$("#"+$(".Button_langblue").val()+"_delbutton").click(function(){
//do flag
menuDoFlg = true;
$("#deldiv").empty();
$("#uploadpictureShow").val("");
$("#"+$(".Button_langblue").val()+"_picture").val("");
$("#"+$(".Button_langblue").val()+"_pictureshow").val("");
});
}else{
$("#deldiv").empty();
}
//validate31
if($(this).css("background-color")=="RGB\(255, 0, 0\)"||$(this).css("background-color")=="rgb\(255, 0, 0\)"||$(this).css("background-color")=="#ff0000"||$(this).css("background-color")=="#FF0000"){
$("#titleTxt1").trigger("focusout");
$("#messageTxt1").trigger("focusout");
$("#actionTxt1").trigger("focusout");
}else{
$("#titleTxt1").removeClass("error").parent().next().next().empty();
$("#messageTxt1").removeClass("error").parent().next().next().empty();
$("#actionTxt1").removeClass("error").parent().next().next().empty();
}
//validate31
});
});
}
$("#languageStr").val(languageChange);
elCountry.multiselect('enable');
elLanguage.multiselect('enable');
$("#hiddenshow").children().each(function () {
if($("#targetLanguageCheckBox").text().indexOf($(this).attr("id").substring(0,$(this).attr("id").indexOf("_")))<0){
$(this).remove();
}
});
}
});
}
}
function chageLevel2fn(val,modelType){
var url = $("#urlrequest").val()+"/changeComboxAction.do";
//add by liuyan start
if(modelType!=null){
//short to full
var selectedShortVal;
if ("full"==modelType) {
selectedShortVal = $.map(elModels.multiselect("getChecked"), function( input ){return input.value;});
}
var dataStr = "selectedShortVal="+selectedShortVal+"&langButton="+modelType+'&selectedVal='+$.map(elLineUp.multiselect("getChecked"), function( input ){
return input.value;
});
}else{
var dataStr = 'selectedVal='+$.map(elLineUp.multiselect("getChecked"), function( input ){
return input.value;
});
}
//add by liuyan end
if ('selectedVal='==dataStr) {
elModels.multiselect('disable');
} else {
elLineUp.multiselect('disable');
elModels.multiselect('disable');
$.ajax({
url: url,
type:'post',
data:dataStr,
success:function(data){
elModels.empty();
elModels.multiselect('refresh');
var obj = jQuery.parseJSON(data);
var tarParam = obj.items;
var chagekey = val+"";
if(tarParam!=null&&tarParam!=""){
$.each(tarParam,function(i,item){
var optionVal = item.id;
var optionLabel = item.label;
var optionFlg = item.flg;
var chageoptionflag = false;
if(chagekey.indexOf(item.label)>-1){
chageoptionflag = true;
}
//short to full
if(optionFlg=="1"){
chageoptionflag = true;
}
var v = newItem.val(), opt = $('<option />', {
value: optionVal,
text: optionLabel,
selected:chageoptionflag
});
opt.appendTo(elModels);
});
elModels.multiselect('refresh');
elModels.multiselect('enable');
}
elLineUp.multiselect('enable');
}
});
}
}
//add short button full button click event start liuyan
if($("#modelType").val()=="0"){
$("#shortButton").attr("class","Button_Model_Light");
$("#fullButton").attr("class","Button_Model_Yet");
}else if($("#modelType").val()=="1"){
$("#shortButton").attr("class","Button_Model_Yet");
$("#fullButton").attr("class","Button_Model_Light");
}
$("#shortButton").click(
function(){
$("#shortButton").attr("class","Button_Model_Light");
$("#fullButton").attr("class","Button_Model_Yet");
if($("#modelType").val()=="1"){
//do flag
menuDoFlg = true;
chageLevel2fn(null,"short");
}
$("#modelType").val("0");//short
}
);
$("#fullButton").click(
function(){
$("#shortButton").attr("class","Button_Model_Yet");
$("#fullButton").attr("class","Button_Model_Light");
if($("#modelType").val()=="0"){
//do flag
menuDoFlg = true;
chageLevel2fn(null,"full");
}
$("#modelType").val("1");//full
}
);
//add short button full button click event end
//edit.jsp Initialization assignment
if($("#languageStr").val()!=null&&$("#languageStr").val()!=""&&$("#languageStr").val()!="null"){
chageLevel4fn($("#languageStr").val(),true);
$("#titleTxt1").removeAttr("disabled").css({background: "#FFFFFF"});
$("#advancedBtn").removeAttr("disabled");
$("#messageTxt1").removeAttr("disabled").css({background: "#FFFFFF"});
$("#actionTxt1").removeAttr("disabled").css({background: "#FFFFFF"});
$("#uploadpictureShow").css({background: "#FFFFFF"});
$("#uploadpicture").css('display','block');
}
if($("#modelType").val()!=null&&$("#modelType").val()!=""){
chageLevel2fn($("#modelStr").val(),$("#modelType").val()=="0"?"short":"full");
}
});
$(document).ready(function(){
/* ico update delete 2
//upload ico/png
new AjaxUpload('#uploadicon', {
action: $("#urlrequest").val()+'/fileUploadAction.do?type=changeImg',
name: 'myfile1',
onSubmit:function(file, extension){
if (!(extension && /^(ico|png)$/i.test(extension)))
{
alert("Please upload ico or png format file!");
return false;
}else{
$("#iconURLU").removeClass("error").parent().next().next().empty();
}
},
onComplete : function(file, response){
if(response=="error1"){
alert("The image file must be smaller than 1MB!");
return false;
//}else if(response=="error2"){
// alert("Upload image file error!");
// return false;
}else{
//do flag
menuDoFlg = true;
$("#iconURL").val(response.substring(0,response.indexOf("|")));
$("#iconURLU").val(file);
$("#iconURLS").val(response.substring(response.indexOf("|")+1,response.length));
}
}
});
*/
//upload picture png|jpg|gif|bmp|jpeg
new AjaxUpload('#uploadpicture', {
action: $("#urlrequest").val()+'/fileUploadAction.do?type=picture',
name: 'myfile2',
onSubmit:function(file, extension){
if (!(extension && /^(png|jpg|gif|bmp|jpeg)$/i.test(extension)))
{
alert("Pictures only support format of png, jpg, gif, bmp and jpeg!");
return false;
}
},
onComplete : function(file, response){
if(response=="error1"){
alert("The image file must be smaller than 1MB!");
return false;
}else{
//do flag
menuDoFlg = true;
$("#"+$(".Button_langblue").val()+"_picture").val(response.substring(0,response.indexOf("|")));
$("#"+$(".Button_langblue").val()+"_pictureshow").val(file);
$("#uploadpictureShow").val(file);
$("#deldiv").empty().append(" "+"<input type='button' class='delbotton' id='"+$(".Button_langblue").val()+"_delbutton' name = '"+$(".Button_langblue").val()+"_delbutton' value='Delete'/> ");
$("#"+$(".Button_langblue").val()+"_delbutton").click(function(){
//do flag
menuDoFlg = true;
$("#deldiv").empty();
$("#uploadpictureShow").val("");
$("#"+$(".Button_langblue").val()+"_picture").val("");
$("#"+$(".Button_langblue").val()+"_pictureshow").val("");
});
}
}
});
});
//validate start
$(document).ready(function(){
//validate URL
$.validator.addMethod("url", function(value, element) {
return this.optional(element) || /(\w+):\/\/([^/:]+)(:\d*)?([^# ]*)/.test(value);
}, "url pattern is not correct!");
//validate char
$.validator.addMethod("escapeString", function(value, element) {
return this.optional(element) || !/[/\\:?*"<>|.]+/.test(value);
}, "Ads name can't contain any of following characters: /\:?*\"<>|.");
$.validator.addMethod("twoInteger", function(value, element) {
return this.optional(element) || /^[0-9]{2}$/.test(value);
}, "Please input two and only two digits!");
//validate Display Interval writer: liuyan 2011-08-23
$.validator.addMethod("IntervalValidate", function(value, element) {
var success=true;
var isDigit=true;
// intervalValue=[weekValue,datValue,HourValue,MinValue]
var intervalValue=[$("#displayInternalWeeks").val(),$("#displayInternalDays").val(),$("#displayInternalHours").val(),$("#displayInternalMins").val()];
for(var m in intervalValue){
//the value must be two integer
if(!/^[0-9]{2}$/.test(intervalValue[m])){
isDigit=false;
break;
}
}
if(isDigit){
var interval=[parseInt($("#displayInternalWeeks").val(),10),parseInt($("#displayInternalDays").val(),10),parseInt($("#displayInternalHours").val(),10),parseInt($("#displayInternalMins").val(),10)];
var timeCirle=[7,24,60];
var intervalIndex=-1;
//day 7,hour 24,min 60
for(var i in interval){
if(interval[i]>0){
intervalIndex=i;
break;
}
}
if(intervalIndex!=-1){
//success==true if week is not '00' ,the day <7, hour <24,min <60 and if week and day are not '00' ,the hour<20 ,min <60 and so on.
for(var j=parseInt(intervalIndex,10)+1;j<interval.length;j++ ){
if(interval[j]>=timeCirle[j-1]){
success=false;
break;
}
}
}
if(success){
// remove error class
var intervalID=["displayInternalWeeks","displayInternalDays","displayInternalHours","displayInternalMins"];
for(var k in intervalID){
if(element.id!=intervalID[k]){
$("#"+intervalID[k]).removeClass("error");
//$("#"+intervalID[k]).trigger("focusout");
}
}
$("#displayInternalMins").parent().next().next().children("label").remove();
}
}
return this.optional(element) || (/^[0-9]{2}$/.test(value)&&isDigit&&success);
}, "Please input correct format of time period!");
//validate Display Interval writer: liuyan 2011-08-23
// add by liu yan 2011-09-27 start
function disabledButtons() {
$("#submitBotton").attr("disabled",true);
$("#saveBotton").attr("disabled",true);
$("#previewBotton").attr("disabled",true);
$("#cancelBotton").attr("disabled",true);
}
function enabledButtons() {
$("#submitBotton").attr("disabled",false);
$("#saveBotton").attr("disabled",false);
$("#previewBotton").attr("disabled",false);
$("#cancelBotton").attr("disabled",false);
}
var ignoreEndDateValidate=false;
var ignoreAdsNameValidate=false;
$("#endDatetxt").focusout(function(evt){
//console.log(evt.target.value+"===="+$("#adsNametxt").val());
if($.trim($("#endDatetxt").val())){
$.ajax({
type : "post",
url : $("#urlrequest").val()+"/checkDateAction.do",
data : {endDatetxt:$("#endDatetxt").val()},
dataType : "json",
success : function(data) {
if(true==data){
//remove error class
}else{
validator.showErrors({"endDatetxt":"End date must be greater than current date"});
}
}
});
}
});
// add by liu yan 2011-09-27 end
if($("#neworeditFlag").val()=="new"||$("#neworeditFlag").val()=="reuse"){
//add by liuyan 2011-09-27 start
$("#adsNametxt").focusout(function(evt){
//console.log(evt.target.value+"===="+$("#adsNametxt").val());
if($.trim($("#adsNametxt").val()).length>0&&!/[/\\:?*"<>|.]+/.test($.trim($("#adsNametxt").val()))){
$.ajax({
type : "post",
url : $("#urlrequest").val()+"/checkAdsNameAction.do",
data : {adsNametxt:$("#adsNametxt").val()},
dataType : "json",
success : function(data) {
if(true==data){
//remove error class
}else{
validator.showErrors({"adsNametxt":"This Ads is already in use"});
}
}
});
}
});
//add by liuyan 2011-09-27 end
var validator=$("form").validate({
submitHandler: function(form) {
//validate ads name and end date;
//ignoreEndDateValidate=ture,ignore end date validate;ignoreAdsNameValidate=ture,ignore ads name validate
if(ignoreEndDateValidate&&ignoreAdsNameValidate){
form.submit();
}else if(ignoreEndDateValidate){
$.when(
$.ajax({
type : "post",
url : $("#urlrequest").val()+"/checkAdsNameAction.do",
data : {adsNametxt:$("#adsNametxt").val()},
dataType : "json"
})
).done(function(adsName){
if(adsName){
form.submit();
}else{
validator.showErrors({"adsNametxt":"This Ads is already in use"});
enabledButtons();
}
});
}else{
$.when(
$.ajax({
type : "post",
url : $("#urlrequest").val()+"/checkAdsNameAction.do",
data : {adsNametxt:$("#adsNametxt").val()},
dataType : "json"
})
,$.ajax({
type : "post",
url : $("#urlrequest").val()+"/checkDateAction.do",
data : {endDatetxt:$("#endDatetxt").val()},
dataType : "json"
})
).done(function(adsName,endDate){
if(adsName[0]&&endDate[0]){
form.submit();
}else{
if(!adsName[0]){
validator.showErrors({"adsNametxt":"This Ads is already in use"});
}
if(!endDate[0]){
validator.showErrors({"endDatetxt":"End date must be greater than current date"});
}
if(!adsName[0]){
$("#adsNametxt").addClass(validator.settings.errorClass);
}
enabledButtons();
}
});
}
},
success:function(element){//validate5 start
var submitflag = true;
if($("#titleTxt1").val()==""||$("#titleTxt1").val()==null){
submitflag = false;
}else{
element.parent().next().next().empty();
}
if($("#messageTxt1").val()==""||$("#messageTxt1").val()==null){
submitflag = false;
}else{
element.parent().next().next().empty();
}
if($("#actionTxt1").val()==""||$("#actionTxt1").val()==null){
submitflag = false;
}else{
element.parent().next().next().empty();
}
if(submitflag){
$(".Button_langblue").removeAttr("style").addClass("Button_langblue");
}
},//validate5 end
errorPlacement:function(error, element) {
if(/^displayInternal\w*/i.test(element.attr("name"))){
$("#displayInternalMins").parent().next().next().children("label").remove();
error.appendTo( $("#displayInternalMins").parent().next().next() );
/*if($("input[name='displayInternalMins']").parent().next().next().children("label").length<=0){
error.appendTo( $("input[name='displayInternalMins']").parent().next().next() );
}*/
}else if(element.attr("name")=="targetLineUpCheckBox"){
$("#targetLanguageCheckBox").parent().next().next().empty();
error.appendTo($("#targetLanguageCheckBox").parent().next().next());
}else if(element.attr("name")=="targetModelsCheckBox"){
$("#targetLanguageCheckBox").parent().next().next().empty();
error.appendTo($("#targetLanguageCheckBox").parent().next().next());
}else if(element.attr("name")=="targetCountryCheckBox"){
$("#targetLanguageCheckBox").parent().next().next().empty();
error.appendTo($("#targetLanguageCheckBox").parent().next().next());
}else if(element.attr("name")=="targetLanguageCheckBox"){
$("#targetLanguageCheckBox").parent().next().next().empty();
error.appendTo($("#targetLanguageCheckBox").parent().next().next());
}else if(element.attr("name")=="titleTxt1"){
if($("#targetModelsCheckBox").val()!=null&&$("#targetLanguageCheckBox").val()!=null){
$("#targetLanguageCheckBox").parent().next().next().empty();
}
element.parent().next().next().empty();
error.appendTo( element.parent().next().next() );
}else{
element.parent().next().next().empty();
error.appendTo( element.parent().next().next() );
}
}
});
}else{
var validator=$("form").validate({
submitHandler: function(form) {
//validate ads name and end date;
//ignoreEndDateValidate=ture,ignore end date validate;ignoreAdsNameValidate=ture,ignore ads name validate
if(ignoreEndDateValidate){
form.submit();
}else{
$.when(
$.ajax({
type : "post",
url : $("#urlrequest").val()+"/checkDateAction.do",
data : {endDatetxt:$("#endDatetxt").val()},
dataType : "json"
})
).done(function(endDate){
if(endDate){
form.submit();
}else{
validator.showErrors({"endDatetxt":"End date must be greater than current date"});
enabledButtons();
}
});
}
},
success:function(element){//validate5
var submitflag = true;
if($("#titleTxt1").val()==""||$("#titleTxt1").val()==null){
submitflag = false;
}else{
element.parent().next().next().empty();
}
if($("#messageTxt1").val()==""||$("#messageTxt1").val()==null){
submitflag = false;
}else{
element.parent().next().next().empty();
}
if($("#actionTxt1").val()==""||$("#actionTxt1").val()==null){
submitflag = false;
}else{
element.parent().next().next().empty();
}
if(submitflag){
$(".Button_langblue").removeAttr("style").addClass("Button_langblue");
}
},//validate5
errorPlacement:function(error, element) {
if(/^displayInternal\w*/i.test(element.attr("name"))){
$("#displayInternalMins").parent().next().next().children("label").remove();
error.appendTo( $("input[name='displayInternalMins']").parent().next().next() );
}else if(element.attr("name")=="targetLineUpCheckBox"){
$("#targetLanguageCheckBox").parent().next().next().empty();
error.appendTo($("#targetLanguageCheckBox").parent().next().next());
}else if(element.attr("name")=="targetModelsCheckBox"){
$("#targetLanguageCheckBox").parent().next().next().empty();
error.appendTo($("#targetLanguageCheckBox").parent().next().next());
}else if(element.attr("name")=="targetCountryCheckBox"){
$("#targetLanguageCheckBox").parent().next().next().empty();
error.appendTo($("#targetLanguageCheckBox").parent().next().next());
}else if(element.attr("name")=="targetLanguageCheckBox"){
$("#targetLanguageCheckBox").parent().next().next().empty();
error.appendTo($("#targetLanguageCheckBox").parent().next().next());
}else if(element.attr("name")=="titleTxt1"){
if($("#targetModelsCheckBox").val()!=null&&$("#targetLanguageCheckBox").val()!=null){
$("#targetLanguageCheckBox").parent().next().next().empty();
}
element.parent().next().next().empty();
error.appendTo( element.parent().next().next() );
}else{
element.parent().next().next().empty();
error.appendTo( element.parent().next().next() );
}
}
});
}
//add date event
var dates = $( "#beginDateTxt, #endDatetxt" ).datepicker({
//defaultDate: "+1w",
showOn: "button",
buttonImage: $("#urlrequest").val()+"/images/calender.png",
buttonImageOnly: true,
buttonText:"",
dateFormat:'dd/mm/yy',
changeMonth: true,
changeYear: true,
onSelect: function( selectedDate ) {
var option = this.id == "beginDateTxt" ? "minDate" : "maxDate",
instance = $( this ).data( "datepicker" ),
date = $.datepicker.parseDate(
instance.settings.dateFormat ||
$.datepicker._defaults.dateFormat,
selectedDate, instance.settings );
dates.not( this ).datepicker( "option", option, date );
},
onClose: function(dateText, inst) {
$( this ).trigger("focusout");
//do flag
menuDoFlg = true;
}
});
// add datepicker constraints liuyan 2011-08-18 start
var instance,date;
<logic:notEmpty name="editActionForm" property="beginDateTxt">
instance = $( "#beginDateTxt" ).data( "datepicker" ),
date = $.datepicker.parseDate(instance.settings.dateFormat ||$.datepicker._defaults.dateFormat,"${editActionForm.beginDateTxt}", instance.settings );
$( "#endDatetxt" ).datepicker( "option", "minDate", date );
</logic:notEmpty>
<logic:notEmpty name="editActionForm" property="endDatetxt">
instance = $( "#endDatetxt" ).data( "datepicker" ),
date = $.datepicker.parseDate(instance.settings.dateFormat ||$.datepicker._defaults.dateFormat,"${editActionForm.endDatetxt}", instance.settings );
$( "#beginDateTxt" ).datepicker( "option", "maxDate", date );
</logic:notEmpty>
// add datepicker constraints liuyan 2011-08-18 end
// add click event
//preview botton
$("#previewBotton").click(function(){
disabledButtons();
//add ignore
ignoreEndDateValidate=true;
ignoreAdsNameValidate=false;
validator.settings.ignore="#beginDateTxt,#endDatetxt,#displayInternalWeeks,#displayInternalDays,"+
"#displayInternalHours,#displayInternalMins,#targetLineUpCheckBox,#targetModelsCheckBox,#targetCountryCheckBox,"+
"#targetLanguageCheckBox,#titleTxt1,#messageTxt1,#actionTxt1";
validator.hideErrors();
validator.elements().removeClass( validator.settings.errorClass );
$("#"+$(".Button_langblue").val()+"_title").val($("#titleTxt1").val());
$("#"+$(".Button_langblue").val()+"_message").val($("#messageTxt1").val());
$("#"+$(".Button_langblue").val()+"_pictureshow").val($("#uploadpictureShow").val());
$("#"+$(".Button_langblue").val()+"_action").val($("#actionTxt1").val());
$("#"+$(".Button_langblue").val()+"_targetOperations").val($("#targetOperationCheckBox").val());
$("#"+$(".Button_langblue").val()+"_targetParameters").val($("#targetParameters").val());
$("#"+$(".Button_langblue").val()+"_targetDirectory").val($("#targetDirectory").val());
$("#"+$(".Button_langblue").val()+"_targetDisplay").val($("#targetDisplayCheckBox").val());
$("#"+$(".Button_langblue").val()+"_regKeyDisplay").val($("#regKeyDisplay").val());
$("#"+$(".Button_langblue").val()+"_regKeyDoNotDisplay").val($("#regKeyDoNotDisplay").val());
$("#adverStatus").val("9");
$("#submitForm").attr("action",$("#urlrequest").val()+"/savedShowPreviewAction.do?pageInfo="+$("#pageInfo").val());
/*
if($("#neworeditFlag").val()=="new"||$("#neworeditFlag").val()=="reuse"){
validator.previousValue(document.getElementById("adsNametxt")).old=null;
}
$("#submitForm").submit();
*/
if(validator.form()){
$("#submitForm").submit();
}else{
if($("#neworeditFlag").val()=="new"||$("#neworeditFlag").val()=="reuse"){
$("#adsNametxt").trigger("focusout");
}
enabledButtons();
}
});
//save botton
$("#saveBotton").click(function(){
disabledButtons();
//add ignore
ignoreEndDateValidate=true;
ignoreAdsNameValidate=false;
//$("#endDatetxt").removeClass("error");
validator.settings.ignore="#beginDateTxt,#endDatetxt,#displayInternalWeeks,#displayInternalDays,"+
"#displayInternalHours,#displayInternalMins,#targetLineUpCheckBox,#targetModelsCheckBox,#targetCountryCheckBox,"+
"#targetLanguageCheckBox,#titleTxt1,#messageTxt1,#actionTxt1";
if(!($("#neworeditFlag").val()=="new"||$("#neworeditFlag").val()=="reuse")){
validator.settings.ignore="#adsNametxt,"+validator.settings.ignore;
}
validator.hideErrors();
validator.elements().removeClass( validator.settings.errorClass );
$("#"+$(".Button_langblue").val()+"_title").val($("#titleTxt1").val());
$("#"+$(".Button_langblue").val()+"_message").val($("#messageTxt1").val());
$("#"+$(".Button_langblue").val()+"_pictureshow").val($("#uploadpictureShow").val());
$("#"+$(".Button_langblue").val()+"_action").val($("#actionTxt1").val());
$("#"+$(".Button_langblue").val()+"_targetOperations").val($("#targetOperationCheckBox").val());
$("#"+$(".Button_langblue").val()+"_targetParameters").val($("#targetParameters").val());
$("#"+$(".Button_langblue").val()+"_targetDirectory").val($("#targetDirectory").val());
$("#"+$(".Button_langblue").val()+"_targetDisplay").val($("#targetDisplayCheckBox").val());
$("#"+$(".Button_langblue").val()+"_regKeyDisplay").val($("#regKeyDisplay").val());
$("#"+$(".Button_langblue").val()+"_regKeyDoNotDisplay").val($("#regKeyDoNotDisplay").val());
$("#adverStatus").val("1");
$("#submitForm").attr("action",$("#urlrequest").val()+"/editAction.do");
/*if($("#neworeditFlag").val()=="new"||$("#neworeditFlag").val()=="reuse"){
validator.previousValue(document.getElementById("adsNametxt")).old=null;
}
$("#submitForm").submit();
*/
if(validator.form()){
$("#submitForm").submit();
}else{
if($("#neworeditFlag").val()=="new"||$("#neworeditFlag").val()=="reuse"){
$("#adsNametxt").trigger("focusout");
}
enabledButtons();
}
});
//submit botton
$("#submitBotton").click(function(){
disabledButtons();
ignoreEndDateValidate=false;
ignoreAdsNameValidate=false;
$("#publishertxt").val($("#companyID").find("option:selected").text());
validator.settings.ignore=[];
$("#"+$(".Button_langblue").val()+"_title").val($("#titleTxt1").val());
$("#"+$(".Button_langblue").val()+"_message").val($("#messageTxt1").val());
$("#"+$(".Button_langblue").val()+"_pictureshow").val($("#uploadpictureShow").val());
$("#"+$(".Button_langblue").val()+"_action").val($("#actionTxt1").val());
$("#"+$(".Button_langblue").val()+"_targetOperations").val($("#targetOperationCheckBox").val());
$("#"+$(".Button_langblue").val()+"_targetParameters").val($("#targetParameters").val());
$("#"+$(".Button_langblue").val()+"_targetDirectory").val($("#targetDirectory").val());
$("#"+$(".Button_langblue").val()+"_targetDisplay").val($("#targetDisplayCheckBox").val());
$("#"+$(".Button_langblue").val()+"_regKeyDisplay").val($("#regKeyDisplay").val());
$("#"+$(".Button_langblue").val()+"_regKeyDoNotDisplay").val($("#regKeyDoNotDisplay").val());
$.each($("#languageStr").val().split(","),function(i,item){
var submitflag = true;
if($("#"+item+"_title").val()==""||$("#"+item+"_title").val()==null){
$("#"+item).css({"background-color": "#FF0000"});
submitflag = false;
}
if($("#"+item+"_message").val()==""||$("#"+item+"_message").val()==null){
$("#"+item).css({"background-color": "#FF0000"});
submitflag = false;
}
if($("#"+item+"_action").val()==""||$("#"+item+"_action").val()==null){
$("#"+item).css({"background-color": "#FF0000"});
submitflag = false;
}
if(submitflag){
if($("#"+item).attr('class')=="Button_langblue"){
$("#"+item).removeAttr("style").addClass("Button_langblue");
}else{
$("#"+item).removeAttr("style").addClass("Button_langwhite");
}
}else{
$("#"+item).click();
}
});
$("#targetLineUpCheckBox").addClass("required");
$("#targetModelsCheckBox").addClass("required");
$("#targetCountryCheckBox").addClass("required");
$("#targetLanguageCheckBox").addClass("required");
$("#adverStatus").val("2");
$("#submitForm").attr("action",$("#urlrequest").val()+"/editAction.do");
/*if($("#neworeditFlag").val()=="new"||$("#neworeditFlag").val()=="reuse"){
validator.previousValue(document.getElementById("adsNametxt")).old=null;
}
$("#submitForm").submit();
*/
if(validator.form()){
$("#submitForm").submit();
}else{
if($("#neworeditFlag").val()=="new"||$("#neworeditFlag").val()=="reuse"){
$("#adsNametxt").trigger("focusout");
if($.trim($("#endDatetxt").val())){
$("#endDatetxt").trigger("focusout");
}
}else{
$("#endDatetxt").trigger("focusout");
}
enabledButtons();
}
});
//cancel botton
$("#cancelBotton").click(function(){
//add ignore
ignoreEndDateValidate=true;
ignoreAdsNameValidate=true;
validator.settings.ignore="#adsNametxt,#beginDateTxt,#endDatetxt,#displayTxt,#displayInternalWeeks,#displayInternalDays,"+
"#displayInternalHours,#displayInternalMins,#targetLineUpCheckBox,#targetModelsCheckBox,#targetCountryCheckBox,"+
"#targetLanguageCheckBox,#titleTxt1,#messageTxt1,#actionTxt1";
//validator.hideErrors();
//validator.elements().removeClass( validator.settings.errorClass );
if(confirm("You are about to exit this page with unsaved data.\nClick OK to proceed or Cancel to first save your data.")){
$("#submitForm").attr("action",$("#urlrequest").val()+"/initAdvertisementsAction.do?pageInfo="+$("#pageInfo").val()+"&menuchildFlg="+$("#menuchildFlg").val());
$("#submitForm").submit();
}
});
// add by liuyan for send email to request new ads 2011-08-31 start
$("#requestNewBotton").click(function(e){
$.ajax({
type : "post",
url : "<%=request.getContextPath()%>/adminEmailAction.do",
dataType : "json",
timeout:10000,
success : function(data) {
if(data.message=="success"){
// window.location.href='mailto:'+data.adminEmail+'?subject=[OnlineAds]%20Please%20reset%20my%20account&body=I%20fogot%20the%20password!'
var subject="[AvisOnlineAds] Request for new Publisher account";
var body="Hi,%0D%0DCould you please create a new Publisher account: %0D%0DPublisher Name: [Enter Publisher name here]%0D"+
"Icon: [Enclose with this email the .ICO or PNG file]%0D%0DThank you,";
window.location.href="mailto:"+data.adminEmail+"?subject="+subject+"&body="+body;
}else{
alert(data.message);
}
},
error : function(data) {
}
});
});
// add by liuyan 2011-08-31 end
});
//validate end
</script>
</head>
<body>
<bean:define id="form" name="editActionForm"/>
<bean:define id="textboxnewlong" value="Text_newlong {required:true,escapeString:true,maxlength:150}"/>
<bean:define id="textselectnewlong" value="Text_selectlong required"/>
<logic:present name="errorAdsName" scope="request">
<bean:define id="textboxnewlong" value="Text_error"/>
</logic:present>
<bean:define id="textboxnewshort" value="Text_newshort {required:true}"/>
<logic:present name="errorAdsName" scope="request">
<bean:define id="textboxnewlong" value="Text_error"/>
</logic:present>
<bean:define id="displayTxt" value="Text_newlong {digits:true,maxlength:9}"/>
<logic:present name="errorAdsName" scope="request">
<bean:define id="textboxnewlong" value="Text_error"/>
</logic:present>
<bean:define id="displayInternal" value="Text_box {required:true,IntervalValidate:true}"/>
<logic:present name="errorAdsName" scope="request">
<bean:define id="textboxnewlong" value="Text_error"/>
</logic:present>
<bean:define id="form" name="editActionForm" />
<%@include file="common/menu.jsp"%>
<div id="content">
<h1 class="h1-view" style="margin-left: -30px;" id="pageid"></h1>
<html:form action="/showEditAction" styleId="submitForm" method="post" >
<input type="hidden" id="urlrequest" name="urlrequest" value = "<%=path %>"/>
<table border = "0" >
<tr style="width: 1078px;height: 30px;">
<td class="td1" style="width: 20px;height: 25px;"></td>
<td class="td1" style="width: 150px;height: 25px;">Publisher</td>
<td class="td1" style="width: 100px;height: 25px;" colspan="4">
<html:select tabindex="1" name="editActionForm" styleId = "companyID" property="companyID" styleClass="<%=textselectnewlong %>">
<html:optionsCollection name="editActionForm" property="publisherList" />
</html:select>
<input tabindex="2" id="requestNewBotton" type="button" value="Request new" style="cursor: pointer; background-color: #9f9f9f; border: 1px solid #666; width: 103px; height: 19px; border: none;" class="Button_submit" />
<html:hidden property="publishertxt" styleId="publishertxt"/>
</td>
<td class="td1" style="width: 20px;height: 25px;">
<img src="<%=path%>/images/question.gif" title="Company which creates this advertisement."/>
</td>
<td class="td1" style="width: 250px;height: 25px;">
<div id="publishertxtErrDiv" style="display:none">
<img src="../images/message.png"/>
<html:errors bundle="error" property="errorPublisher"/>
</div>
</td>
</tr>
<tr style="width: 1078px;height: 30px;">
<td class="td1" style="width: 20px;height: 25px;"></td>
<td class="td1" style="width: 150px;height: 25px;">Ads Name</td>
<td class="td1" style="width: 100px;height: 25px;" colspan="4">
<html:text tabindex="-2" property="adsNametxt" styleId = "adsNametxt" styleClass="<%=textboxnewlong %>" />
</td>
<td class="td1" style="width: 20px;height: 25px;">
<img src="<%=path%>/images/question.gif" title="Please fill in the name of this advertisement (must be unique)."/>
</td>
<td class="td1" style="width: 250px;height: 25px;">
<div id="adsNametxtErrDiv" style="display:none">
<img src="../images/message.png"/>
<html:errors bundle="error" property="errorAdsName"/>
</div>
</td>
</tr>
<!-- ico update delete 1
<tr style="width: 1078px;height: 30px;">
<td class="td1" style="width: 20px;height: 25px;"></td>
<td class="td1" style="width: 150px;height: 25px;">Icon</td>
<td class="td1" style="width: 100px;height: 25px;" colspan="4">
<input type="text" class="{required:true}" value="<bean:write name="editActionForm" property="iconURLU"/>" name="iconURLU" onkeydown= "javascript:return false; " readonly="true" id="iconURLU" />
<input tabindex="3" type="button" name="uploadicon" value="Browse" id="uploadicon" style="cursor: pointer; background-color: #9f9f9f; border: 1px solid #666; width: 103px; height: 19px; border: none;" />
<input type="hidden" name="iconURL" id="iconURL" value="<bean:write name="editActionForm" property="iconURL"/>" />
<input type="hidden" name="iconURLS" id="iconURLS" value="<bean:write name="editActionForm" property="iconURLS"/>" />
</td>
<td class="td1" style="width: 20px;height: 25px;">
<img src="<%=path%>/images/question.gif" title="Please update the icon of your company (not requried)."/>
</td>
<td class="td1" style="width: 250px;height: 25px;">
<div id="iconUpLoadBottonErrDiv" style="display:none">
<img src="<%=path%>/images/message.png"/>
<html:errors bundle="error" property="errorIcon"/>
</div>
</td>
</tr>
-->
<tr style="width: 1078px;height: 30px;" >
<td class="td1" style="width: 20px;height: 25px;"></td>
<td class="td1" style="width: 150px;height: 25px;">Begin Date</td>
<td class="td1" style="width: 100px;height: 25px;" colspan="4">
<html:text tabindex="-4" property="beginDateTxt" styleId="beginDateTxt" styleClass="<%=textboxnewshort %>" readonly="true" onkeydown= "javascript:return false; "/>
</td>
<td class="td1" style="width: 20px;height: 25px;">
<img src="<%=path%>/images/question.gif" title="Please specify begin date of this advertisement."/>
</td>
<td class="td1" style="width: 250px;height: 25px;">
<div id="beginDateTxtErrDiv" style="display:none">
<img src="<%=path%>/images/message.png"/>
<html:errors bundle="error" property="errorBeginDate"/>
</div>
</td>
</tr>
<tr style="width: 1078px;height: 30px;" >
<td class="td1" style="width: 20px;height: 25px;"></td>
<td class="td1" style="width: 150px;height: 25px;">End Date</td>
<td class="td1" style="width: 100px;height: 25px;" colspan="4">
<html:text tabindex="-5" property="endDatetxt" styleId="endDatetxt" styleClass="<%=textboxnewshort %>" readonly="true" onkeydown= "javascript:return false; "/>
</td>
<td class="td1" style="width: 20px;height: 25px;">
<img src="<%=path%>/images/question.gif" title="Please specify end date of this advertisement."/>
</td>
<td class="td1" style="width: 250px;height: 25px;">
<div id="endDatetxtErrDiv" style="display:none">
<img src="<%=path%>/images/message.png"/>
<html:errors bundle="error" property="errorEndDate"/>
</div>
</td>
</tr>
<tr style="width: 1078px;height: 30px;">
<td class="td1" style="width: 20px;height: 25px;"></td>
<td class="td1" style="width: 150px;height: 25px;">Max Display#</td>
<td class="td1" style="width: 100px;height: 25px;" colspan="4">
<html:text tabindex="6" property="displayTxt" styleId="displayTxt" styleClass="<%=displayTxt %>"/>
</td>
<td class="td1" style="width: 20px;height: 25px;">
<img src="<%=path%>/images/question.gif" title="Please enter the maximum number of times of displaying this advertisement."/>
</td>
<td class="td1" style="width: 250px;height: 25px;">
<div id="displayTxtErrDiv" style="display:none">
<img src="<%=path%>/images/message.png"/>
<html:errors bundle="error" property="errorDisplay"/>
</div>
</td>
</tr>
<tr style="width: 1078px;height: 30px;">
<td class="td1" style="width: 20px;height: 25px;"></td>
<td class="td1" style="width: 150px;height: 25px;">Weight</td>
<td class="td1" style="width: 100px;height: 25px;" colspan="4">
<html:select tabindex="7" property="weightSelectBox">
<html:optionsCollection property="optionsWeightArr" label="label" value="value"/>
</html:select>
</td>
<td class="td1" style="width: 20px;height: 25px;">
<img src="<%=path%>/images/question.gif" title="Please select the relative importance of the advertisement."/>
</td>
<td class="td1" style="width: 250px;height: 25px;">
<div id="weightTxtErrDiv" style="display:none">
<img src="../images/message.png"/>
<html:errors bundle="error" property="errorWeight"/>
</div>
</td>
</tr>
<tr style="width: 1078px;height: 30px;">
<td class="td1" style="width: 20px;height: 25px;"></td>
<td class="td1" style="width: 150px;height: 25px;">Display Interval</td>
<td class="td1" style="width: 100px;height: 25px;">
<html:text tabindex="8" property="displayInternalWeeks" styleId="displayInternalWeeks" styleClass="<%=displayInternal %>"/><label for="displayInternalWeeks">Weeks</label>
</td>
<td class="td1" style="width: 100px;height: 25px;">
<html:text tabindex="9" property="displayInternalDays" styleId="displayInternalDays" styleClass="<%=displayInternal %>"/><label for="displayInternalDays">Days</label>
</td>
<td class="td1" style="width: 100px;height: 25px;">
<html:text tabindex="10" property="displayInternalHours" styleId="displayInternalHours" styleClass="<%=displayInternal %>"/><label for="displayInternalHours">Hours</label>
</td>
<td class="td1" style="width: 100px;height: 25px;">
<html:text tabindex="11" property="displayInternalMins" styleId="displayInternalMins" styleClass="<%=displayInternal %>"/><label for="displayInternalMins">Mins</label>
</td>
<td class="td1" style="width: 20px;height: 25px;">
<img src="<%=path%>/images/question.gif" title="Please enter time interval between each display (in weeks, days, hours, mins)."/>
</td>
<td class="td1" style="width: 250px;height: 25px;">
<div id="displayInternalTxtErrDiv" style="display:none">
<img src="<%=path%>/images/message.png"/>
<html:errors bundle="error" property="errorDisplayInternal"/>
</div>
</td>
</tr>
<tr style="width: 1078px;height: 30px;">
<td class="td1" style="width: 20px;height: 25px;"></td>
<td class="td1" style="width: 150px;height: 25px;">End on click</td>
<td class="td1" style="width: 100px;height: 25px;" colspan="2">
<html:radio tabindex="12" property="endOnRadio" value="1"><label for="yesRadio">Yes</label></html:radio>
<html:radio tabindex="13" property="endOnRadio" value="0"><label for="noRadio">No</label></html:radio>
</td>
<td class="td1" style="width: 100px;height: 25px;" colspan="2"></td>
<td class="td1" style="width: 20px;height: 25px;">
<img src="<%=path%>/images/question.gif" title="Please check this option if the advertisement should no longer be displayed once it is clicked."/>
</td>
<td class="td1" style="width: 250px;height: 25px;">
<div id="displayTxtErrDiv" style="display:none">
<img src="<%=path%>/images/message.png"/>
<html:errors bundle="error" property="errorEndon"/>
</div>
</td>
</tr>
<tr valign="bottom" style="width: 1078px;height: 30px;">
<td class="td1" style="width: 20px;height: 30px;"></td>
<td class="td1" style="width: 150px;height: 25px;"> </td>
<td class="td1" style="width: 125px;height: 30px;"></td>
<td class="td1" style="width: 125px;height: 30px;">
<table border="0" cellspacing="0" cellpadding="0" >
<tr>
<td align="right">
<input tabindex="15" id="shortButton" type="button" value="Short" class="Button_Model_Light" />
</td>
<td align="left">
<input tabindex="16" id="fullButton" type="button" value="Full" class="Button_Model_Yet" /></td>
</tr>
</table>
</td>
<td class="td1" style="width: 125px;height: 30px;"></td>
<td class="td1" style="width: 125px;height: 30px;"> </td>
<td class="td1" style="width: 20px;height: 25px;"></td>
<td class="td1" style="width: 250px;height: 25px;"></td>
</tr>
<tr valign="top" style="width: 1078px;height: 30px;">
<td class="td1" style="width: 20px;height: 30px;"></td>
<td class="td1" style="width: 150px;height: 25px;">Target</td>
<td class="td1" style="width: 145px;height: 30px;">
<html:select tabindex="14" property="targetLineUpCheckBox" styleId="targetLineUpCheckBox" multiple="ture">
<html:optionsCollection property="optionsLineUpArr" label="label" value="value"/>
</html:select>
</td>
<td class="td1" style="width: 145px;height: 30px;">
<html:select tabindex="17" property="targetModelsCheckBox" styleId="targetModelsCheckBox" multiple="ture" disabled="true">
<html:optionsCollection property="optionsModelsArr" label="label" value="value"/>
</html:select>
</td>
<td class="td1" style="width: 145px;height: 30px;">
<html:select tabindex="18" property="targetCountryCheckBox" styleId="targetCountryCheckBox" multiple="ture">
<html:optionsCollection property="optionsCountryArr" label="label" value="value"/>
</html:select>
</td>
<td class="td1" style="width: 145px;height: 30px;">
<html:select tabindex="19" property="targetLanguageCheckBox" styleId="targetLanguageCheckBox" multiple="ture" disabled="true">
<html:optionsCollection property="optionsLanguageArr" label="label" value="value"/>
</html:select>
</td>
<td class="td1" style="width: 20px;height: 25px;">
<img src="<%=path%>/images/question.gif" title="Select the corresponding Line Up and Models of this advertisement. Also select countries and languages please."/>
</td>
<td class="td1" style="width: 250px;height: 25px;">
<div id="targetDiv" ></div>
<div id="targetErrDiv" style="display:none">
<img src="<%=path%>/images/message.png"/>
<html:errors bundle="error" property="errorTarget"/>
</div>
</td>
</tr>
<tr style="width: 1078px;height: 30px;">
<td class="td1" style="width: 20px;height: 25px;"></td>
<td class="td1" style="width: 150px;height: 25px;"></td>
<td class="td1" style="width: 100px;height: 25px;" colspan="4">
<div id="langButtonDiv">
</div>
</td>
<td class="td1" style="width: 20px;height: 25px;">
<img src="<%=path%>/images/question.gif" title="Please choose the Ads's language."/>
</td>
<td class="td1" style="width: 250px;height: 25px;">
<div id="langDiv" ></div>
<div id="langErrDiv" style="display:none">
<img src="<%=path%>/images/message.png"/>
<html:errors bundle="error" property="errorLangButton"/>
</div>
</td>
</tr>
<tr style="width: 1078px;height: 30px;">
<td class="td1" style="width: 20px;height: 30px;"></td>
<td class="td1" style="width: 150px;height: 30px;">Title</td>
<td class="td1" style="width: 100px;height: 30px;" colspan="4">
<html:text tabindex="20" property="titleTxt1" disabled="true" styleId="titleTxt1" styleClass="Text_readonly {required:true}"/>
</td>
<td class="td1" style="width: 20px;height: 25px;">
<img src="<%=path%>/images/question.gif" title="Please fill in title in selected language."/>
</td>
<td class="td1" style="width: 250px;height: 25px;">
<div id="titleTxtDiv" ></div>
<div id="titleTxtErrDiv" style="display:none">
<img src="<%=path%>/images/message.png"/>
<html:errors bundle="error" property="errorTitle1"/>
</div>
</td>
</tr>
<tr style="width: 1078px;height: 30px;">
<td class="td1" style="width: 20px;height: 30px;"></td>
<td class="td1" style="width: 150px;height: 30px;">Message</td>
<td class="td1" style="width: 100px;height: 30px;" colspan="4">
<html:textarea tabindex="21" property="messageTxt1" styleId="messageTxt1" disabled="true" styleClass="Text_area_scroll_readonly {required:true}" />
</td>
<td class="td1" style="width: 20px;height: 25px;">
<img src="<%=path%>/images/question.gif" title="Please fill in message in selected language."/>
</td>
<td class="td1" style="width: 250px;height: 25px;">
<div id="messageTxtDiv" ></div>
<div id="messageTxtErrDiv" style="display:none">
<img src="<%=path%>/images/message.png"/>
<html:errors bundle="error" property="errorMessage1"/>
</div>
</td>
</tr>
<tr style="width: 1078px;height: 30px;" >
<td class="td1" style="width: 20px;height: 30px;"></td>
<td class="td1" style="width: 150px;height: 30px;">Picture</td>
<td class="td1" style="width: 100px;height: 30px;vertical-align:middle;" colspan="4">
<table width="100%">
<tr>
<td width="155px" style="vertical-align:middle;">
<input type="text" name="uploadpictureShow" onkeydown= "javascript:return false; " id="uploadpictureShow" class="Text_short_browse_readonly" readonly="true"/>
</td>
<td width="95px" style="vertical-align:middle;">
<input tabindex="22" type="button" name="uploadpicture" value="Browse" class="delbotton" style="display: none" disabled="disabled" id="uploadpicture" />
</td>
<td style="vertical-align:middle;"><div id="deldiv"></div> </td>
<td width="39px" align="center" ></td>
</tr>
</table>
</td>
<td class="td1" style="width: 20px;height: 25px;">
<img src="<%=path%>/images/question.gif" title="Please upload a picture which is corresponding to the selected language."/>
</td>
<td class="td1" style="width: 250px;height: 25px;">
<div id="pictureTxtDiv" >
</div>
<div id="pictureTxtErrDiv" style="display:none">
<img src="<%=path%>/images/message.png"/>
<html:errors bundle="error" property="errorPicture1"/>
</div>
</td>
</tr>
<tr style="width: 1078px;height: 30px;">
<td class="td1" style="width: 20px;height: 30px;"></td>
<td class="td1" style="width: 150px;height: 30px;">Action</td>
<td class="td1" style="width: 100px;height: 30px;vertical-align:middle;" colspan="4">
<html:text tabindex="23" property="actionTxt1" styleId="actionTxt1" disabled="true" styleClass="Text_short_readonly {required:true}" /> <input tabindex="24" id="advancedBtn" type="button" value="Advanced" class="Button_advanced" disabled="disabled" style="cursor: pointer; background-color: #9f9f9f; border: 1px solid #666; width: 103px; height: 19px; border: none;" />
</td>
<td class="td1" style="width: 20px;height: 25px;">
<img src="<%=path%>/images/question.gif" title="Action of this advertisement."/>
</td>
<td class="td1" style="width: 250px;height: 25px;">
<div id="actionTxtDiv" > </div>
<div id="actionTxtErrDiv" style="display:none">
<html:errors bundle="error" property="errorAction1"/>
</div>
</td>
</tr>
</table>
<table id = "advancedTog" border=0 style="display:none">
<tr style="width: 1078px;height: 30px;">
<td class="td1" style="width: 17px;height: 30px;"></td>
<td width="145px" height="24">Target Operations</td>
<td width="120" height="24">
<html:select tabindex="25" property="targetOperationCheckBox" styleId="targetOperationCheckBox">
<html:optionsCollection property="optionsOperationArr" label="label" value="value"/>
</html:select>
</td>
</tr>
<tr style="width: 1078px;height: 30px;">
<td class="td1" style="width: 17px;height: 30px;"></td>
<td height="24" width="145px">Target Parameters</td>
<td width="250px" >
<html:text tabindex="26" property="targetParameters" styleId="targetParameters" styleClass="Text_box" style="width: 200px;" />
</td>
</tr>
<tr style="width: 1078px;height: 30px;">
<td class="td1" style="width: 17px;height: 30px;"></td>
<td height="24" width="145px" >Target Directory</td>
<td>
<html:text tabindex="27" property="targetDirectory" styleId="targetDirectory" styleClass="Text_box" style="width: 200px;" />
</td>
</tr>
<tr style="width: 1078px;height: 30px;">
<td class="td1" style="width: 17px;height: 30px;"></td>
<td height="24" width="145px">Target Display</td>
<td>
<html:select tabindex="28" property="targetDisplayCheckBox" styleId="targetDisplayCheckBox">
<html:optionsCollection property="optionsDisplayArr" label="label" value="value"/>
</html:select>
</td>
</tr>
<tr style="width: 1078px;height: 30px;">
<td class="td1" style="width: 17px;height: 30px;"></td>
<td height="24" width="145px">DisplayCondition</td>
<td>
<html:text tabindex="29" property="regKeyDisplay" styleId="regKeyDisplay" styleClass="Text_box" style="width: 200px;" />
</td>
</tr>
<tr style="width: 1078px;height: 30px;">
<td class="td1" style="width: 17px;height: 30px;"></td>
<td height="24" width="145px">NotDisplayCondition</td>
<td>
<html:text tabindex="30" property="regKeyDoNotDisplay" styleId="regKeyDoNotDisplay" styleClass="Text_box" style="width: 200px;" />
</td>
</tr>
</table>
<table>
<tr style="width: 1078px;height: 30px;" >
<td class="td1" style="width: 50px;height: 25px;"></td>
<td class="td1" style="width: 120px;height: 25px;"></td>
<td class="td1" style="width: 125px;height: 25px;">
<div id="buttons">
<input tabindex="31" id="submitBotton" type="button" value="Submit" class="Button_submit"/>
</div>
</td>
<td class="td1" style="width: 125px;height: 25px;">
<div id="buttons">
<input tabindex="32" id="saveBotton" type="button" value="Save" class="Button_submit" />
</div>
</td>
<td class="td1" style="width: 125px;height: 25px;">
<div id="buttons">
<input tabindex="33" id="previewBotton" type="button" value="Preview" class="Button_submit" />
</div>
</td>
<td class="td1" style="width: 125px;height: 25px;">
<div id="buttons">
<input tabindex="34" id="cancelBotton" type="button" value="Cancel" class="Confirm" />
</div>
</td>
<td class="td1" style="width: 100px;height: 25px;"></td>
<td class="td1" style="width: 100px;height: 25px;"></td>
<td class="td1" style="width: 100px;height: 25px;">
</td>
</tr>
<tr style="width: 1078px;height: 30px;" >
<td class="td1" style="width: 100px;height: 25px;" colspan="9">
<input name="languageStr" id = "languageStr" value="<bean:write name='editActionForm' property='languageStr'/>" type="hidden" />
<input name="modelStr" id = "modelStr" value="<bean:write name='editActionForm' property='modelStr'/>" type="hidden" />
<input name="modelType" id = "modelType" value="<bean:write name='editActionForm' property='modelType'/>" type="hidden" />
<input name="pageInfo" id = "pageInfo" value="<bean:write name='editActionForm' property='pageInfo'/>" type="hidden" />
<input name="menuchildFlg" id = "menuchildFlg" value="<bean:write name='editActionForm' property='menuchildFlg'/>" type="hidden" />
<input name="adverStatus" id = "adverStatus" type="hidden" />
<div id="hiddenshow">
<logic:iterate name="editActionForm" property="contentBeanList" id="content">
<input type="hidden" value="<bean:write name='content' property='title'/>" name="<bean:write name='content' property='language'/>_title" id="<bean:write name='content' property='language'/>_title" />
<input type="hidden" value="<bean:write name='content' property='message'/>" name="<bean:write name='content' property='language'/>_message" id="<bean:write name='content' property='language'/>_message" />
<input type="hidden" value="<bean:write name='content' property='picture'/>" name="<bean:write name='content' property='language'/>_picture" id="<bean:write name='content' property='language'/>_picture" />
<input type="hidden" value="<bean:write name='content' property='pictureU'/>" name="<bean:write name='content' property='language'/>_pictureshow" id="<bean:write name='content' property='language'/>_pictureshow" />
<input type="hidden" value="<bean:write name='content' property='action'/>" name="<bean:write name='content' property='language'/>_action" id="<bean:write name='content' property='language'/>_action" />
<input type="hidden" value="<bean:write name='content' property='targetOperation'/>" name="<bean:write name='content' property='language'/>_targetOperations" id="<bean:write name='content' property='language'/>_targetOperations" />
<input type="hidden" value="<bean:write name='content' property='targetParameters'/>" name="<bean:write name='content' property='language'/>_targetParameters" id="<bean:write name='content' property='language'/>_targetParameters" />
<input type="hidden" value="<bean:write name='content' property='targetDirectory'/>" name="<bean:write name='content' property='language'/>_targetDirectory" id="<bean:write name='content' property='language'/>_targetDirectory" />
<input type="hidden" value="<bean:write name='content' property='targetDisplay'/>" name="<bean:write name='content' property='language'/>_targetDisplay" id="<bean:write name='content' property='language'/>_targetDisplay" />
<input type="hidden" value="<bean:write name='content' property='regKeyDisplay'/>" name="<bean:write name='content' property='language'/>_regKeyDisplay" id="<bean:write name='content' property='language'/>_regKeyDisplay" />
<input type="hidden" value="<bean:write name='content' property='regKeyDoNotDisplay'/>" name="<bean:write name='content' property='language'/>_regKeyDoNotDisplay" id="<bean:write name='content' property='language'/>_regKeyDoNotDisplay" />
</logic:iterate>
</div>
</td>
</tr>
</table>
<html:hidden name="editActionForm" property="adverID" />
<html:hidden name="editActionForm" property="baseAdverID" />
<input type="hidden" value="<bean:write name='editActionForm' property='neworeditFlag'/>" name="neworeditFlag" id="neworeditFlag" />
<html:hidden name = "editActionForm" property="adverIDCopy"/>
<input type="hidden" name="accessState" id="accessState" />
<input type="hidden" value="<bean:write name='editActionForm' property='lockMsg'/>" name="lockMsg" />
<html:hidden name = "editActionForm" property="toDo" />
<!-- default -->
<input name="defaultPictureU" id = "defaultPictureU" type="hidden" />
<input name="defaultPictureS" id = "defaultPictureS" type="hidden" />
<input name="defaultAction" id = "defaultAction" type="hidden" />
<input name="defaultFlag" id = "defaultFlag" type="hidden" value="0" />
</html:form>
</div>
</body>
</html:html>