var DT={};var DO={};var DB={};
DO["alltbf"]="";DO["allbot"]="";
var divd = "<div class=\"sej\" style=\"width:99%;overflow:hidden;\"><div>"
var divda = "<div class=\"sej\" style=\"text-align:left; width:99%;\"><div>"
var divdr = "<div class=\"sej\" style=\"text-align:right; width:99%;\"><div>"
var dive = "</div></div>"
var hg="height:10px;";
var bdt="border-top:1px solid #000000;"
var bdl="border-left:1px solid #000000;"
var bdr="border-right:1px solid #000000;"
var bdb="border-bottom:1px solid #000000;"
var brd_all = bdt+bdl+bdr+bdb
var valg=" valign=\"middle\" "
var cab_ok="0"
var divd2 = "<div class=\"sej2\" style=\"width:99%;\"><div>"
var divd2 = "<div class=\"sej2\" style=\"text-align:left; width:99%;\"><div>"
var diva2 = "<div class=\"sej2\" style=\"text-align:right; width:99%;\"><div>"
var h_popup = parseFloat(screen.availHeight)-50
var popupvar = "height="+h_popup+",top=10,left=100,toolbar=no,resizable=yes,scrollbars=yes,status=no"

//window.moveTo(0,0);
//if (document.all){window.resizeTo(screen.availWidth,screen.availHeight);}else{window.outerHeight = screen.availHeight;window.outerWidth = screen.availWidth;}
window.focus();

function wait_mask(f1){
if(printmode!='1'){
if(f1){wm=document.getElementById('waiton');wf=document.getElementById('totPlan');if(wm && wf){wf.style.display='none';wm.style.display='';}else{};}else{wm=document.getElementById('waiton');wf=document.getElementById('totPlan');if(wm && wf){wm.style.display='none';wf.style.display='';}else{setTimeout('wait_mask()',500);};}
}else{
if(f1){wm=document.getElementById('waiton');if(wm){wm.style.display='';}else{};}else{wm=document.getElementById('waiton');if(wm){wm.style.display='none';}else{setTimeout('wait_mask()',500);};}
}
}

function reconn(){document.location.href='reconnect.asp'}
function bardat(l1) {
	var monArr = new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");
	var mb_f = new Array("a","a","c","d","e","f");
	VarDat = ''
	if(myYear==l1-1 && half_y=='a'){disp1=' style="display:none"';disp2=' style="display:"';}else{disp1=' style="display:"';disp2=' style="display:none"';}
	VarDat='<table cellpadding=0 cellspacing=0 style=\"font-size:8pt; \">';
	if(1==1){
		VarDat+='<tr><td></td><td align=center>'+pla_dat;
		if(connected_ope==1){VarDat+='&nbsp;&nbsp;-&nbsp;&nbsp;'+pla_war;};
		VarDat+='</td><td></td></tr>';
		if(connected_ope==0){VarDat+='<tr><td></td><td align=center style=\'padding-bottom:5px;\'><img src=\"images/excla.png\" border=0 align=absmiddle> '+pla_war+' <img src=\"images/excla.png\" border=0 align=absmiddle></td><td></td></tr>'}
	}else{
		VarDat+='<tr><td></td><td align=center>'+pla_dat+'</td><td></td></tr>'
	}
	VarDat+='<tr><td align=center>&nbsp;'
	VarDat+='<input type=button onclick="cd(0)" value=\"<<\" class=btl id=yprev'+disp1+' >'
	VarDat+='<input type=button value=\"<<\" class=btlo id=yprev2'+disp2+'>'
	VarDat+='&nbsp;</td><td valign=middle>'
	for(j=yb_deb;j<=yb_fin;j++){
		for(half=0;half<1;half++){
			if(myYear==j && half_y==mb_f[half]){disp='style=display:\'\'';}else{disp='style=display:none;';}
			VarDat+='<table cellpadding=0 cellspacing=0 class=ta1 '+disp+' id="year'+j+mb_f[half]+'">'
			for(k=0;k<nbl;k++){
				nb = (k*nbc) + (half*6)
				VarDat+='<tr class=t2>'
				for(i=myMois_ref-1;i<myMois_ref+11;i++){
					if(i>=12){
						toaff=(i+nb)-12;affj=''+(j+1);morstyl='style="background:#B9D2F1;"';
					}else{
						toaff=(i+nb);affj=''+j;morstyl='style="background:#DBE9FF;"';
					}
					affj = affj.substring(2)
					VarDat+='<td class=t4 colspan=2 '+morstyl+'>'+monArr[toaff]+'. '+affj+'</td>';
				}
				VarDat+='</tr><tr class=t3>'
				for(i=myMois_ref-1;i<myMois_ref+11;i++){
					if(i>=12){
						toaff = (i+nb)-12
						affj = ''+(j+1)
					}else{
						toaff = (i+nb)
						affj = ''+j
					}
					mov1=' onMouseOver="cg(this,0);"';mou1=' onMouseOut="cg(this,1);"';mov2=mov1;mou2=mou1;
					bgc1=' style="background-color:#FFFFFF; text-decoration:underline;"';bgc2=' style="background-color:#FFFFFF; text-decoration:underline;"';
					onc1=' onclick="subdat(1,'+(parseFloat(toaff)+1)+','+affj+');"';
					onc2=' onclick="subdat(15,'+(parseFloat(toaff)+1)+','+affj+');"'
					if(i+nb==myMois-1 && affj==myYear){
						if(myJour==1){
							bgc1=' style="background-color:DBE9FE; cursor:pointer;"';mov1='';mou1='';
						}else{
							bgc2=' style="background-color:DBE9FE; cursor:pointer; text-decoration:underline;"';mov2='';mou2='';
						}
					}
				VarDat+='<td'+mov1+mou1+bgc1+onc1+'>01</td><td'+mov2+mou2+bgc2+onc2+' class=t5>15</td>';
				}
				VarDat+='</tr>'
			}
		}
		VarDat+='</table>'
	}
	if(myYear==l1+5 && half_y=='a'){disp1=' style="display:none"';disp2=' style="display:"';}else{disp1=' style="display:"';disp2=' style="display:none"';}
	VarDat+='</td><td align=center>&nbsp;'
	VarDat+='<input type=button onclick="cd(1)" value=\">>\" class=btl id=ynext'+disp1+' >'
	VarDat+='<input type=button value=\">>\" class=btlo id=ynext2'+disp2+'>'
	VarDat+='&nbsp;</td></tr>'
	VarDat+='</table><input type=hidden name=half_y id=half_y value='+half_y+'>';

	
	return VarDat
}

function cg(l1,l2){if (l2==0){l1.style.backgroundColor='#DBE9FF';l1.style.cursor='pointer';}else{l1.style.backgroundColor='#FFFFFF';}}
function cd(l1){
	var monArr = new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");
	var mb_f = new Array("a","a","c","d","e","f");

	//if(half_y=='a'){half_y='a';}else{half_y='a';}
	//document.getElementById('half_y').value=half_y
	//if(l1==0 && half_y=='a'){myYear=myYear-1;}else if(l1==1 && half_y=='a'){myYear=myYear+1;};
	if(l1==0){myYear=myYear-1;}else if(l1==1){myYear=myYear+1;};
	for(i=yb_deb;i<=yb_fin;i++){
		for(half=0;half<1;half++){
			if(myYear==i && half_y==mb_f[half]){
				document.getElementById('year'+i+mb_f[half]).style.display='';
			}else{
				document.getElementById('year'+i+mb_f[half]).style.display='none';
			}
			de = document.getElementById('yprev'); de2 = document.getElementById('yprev2')
			df = document.getElementById('ynext'); df2 = document.getElementById('ynext2')
			if(myYear==yb_deb){de.style.display='none';de2.style.display='';}else{de.style.display='';de2.style.display='none';}
			if(myYear==yb_fin){df.style.display='none';df2.style.display='';}else{df.style.display='';df2.style.display='none';}
		}
	}
}

function subm(){
	wait_mask(true);
	if(connected_own==0){REcache('trDocDe2','trDocDef');}
	document.form1.submit();
}

function cleanboat(v1,v2,v3){
	f = document.form1
	f.modelboat.value='0';f.name2boat.value='0';f.type.value='0';
	subm();
}

function subdat(l1,l2,l3){
	//document.location.href='default.asp?depart_DD='+l1+'&depart_MM='+l2+'&depart_YYYY='+l3
	document.form1.DEPART_YYYY.value=l3
	document.form1.DEPART_MM.value=l2
	document.form1.DEPART_DD.value=l1
	document.form1.showplanning.value='1';
	subm();
}
/////////////    FONCTION BARRE DE DATES    /////////////

function creatalldiv(){
	document.write('<div class="popperlink" id="topdecklink" style="position:absolute; z-index:50; padding:1px; background:#DBE9FF;"></DIV>');
	document.write('<div id="barre" style="width:2px; position:absolute; background-color:#FF0000; visibility:hidden; z-index:50;"></div>');
	document.write('<div id="id_date" style="position:absolute; visibility:hidden; z-index:51;">&nbsp;</div>');
}

function REcache(l1,l2){
	if(document.all){
		cache_e = eval("document.all."+l1);cache_f = eval("document.all."+l2);
	}else{
		cache_e = document.getElementsByName(l1);cache_f = document.getElementsByName(l2);
	}
	if(connected_cli==0){if(cache_e){if(cache_e.length){for(i=0;i<cache_e.length;i++){cache_e[i].style.display='none';}}else{cache_e.style.display='none';}}}
	if(connected_cli==0){if(cache_f){if(cache_f.length){for(i=0;i<cache_f.length;i++){cache_f[i].style.display='';}}else{cache_f.style.display='';}}}
}

var bateau_en_surligne = '';

function popupdevis(){
	window.open("", "Creationdevis" ,"width=850,"+popupvar)
}

function popupproposal(){
	window.open("", "Proposal" ,"width=800,"+popupvar)
}

function trsslin(j1,j2){
	j1=j1+''+j2;
	document.getElementById('tr'+j1).className='trsouslign';
	eval("document.creadevis.boat"+j1).checked=true;

	if(j1!=bateau_en_surligne && bateau_en_surligne!=''){
		document.getElementById('tr'+bateau_en_surligne).className='';
		bateau_en_surligne = j1;
	}else if(bateau_en_surligne!=''){
		document.getElementById('tr'+bateau_en_surligne).className='';
		eval("document.creadevis.boat"+bateau_en_surligne).checked=false;
		bateau_en_surligne='';
	}else{
		bateau_en_surligne = j1;
	}

}

function trsousline(j1){
	document.getElementById('tr'+j1).className='trsouslign';
	eval("document.creadevis.boat"+j1).checked=true;

	if(j1!=bateau_en_surligne && bateau_en_surligne!=''){
		document.getElementById('tr'+bateau_en_surligne).className='';
	}else if(bateau_en_surligne!=''){
		document.getElementById('tr'+bateau_en_surligne).className='';
		eval("document.creadevis.boat"+bateau_en_surligne).checked=false;
		bateau_en_surligne='';
	}
	bateau_en_surligne = j1
}

function creatdev(){
	popupdevis();
	document.creadevis.action='creation.asp';
	document.creadevis.target='Creationdevis';
	document.creadevis.creationoption.value=0;
	document.creadevis.submit();
}
function creatdev2(){
	alert('ouech ouech')
	popupdevis();
	document.creadevis.action='../planning/lock.asp';
	document.creadevis.target='Creationdevis';
	document.creadevis.creationoption.value=0;
	document.creadevis.submit();
}

function popupdev(id_tbf1,id_boat,datestart,dateend){ //Nouveau devis cabine pour la popup des cabines
	window.open("../planning/newinvoice.asp?id_tbF1="+id_tbf1+"&id_boat="+id_boat+"&dateStart="+datestart+"&dateEnd="+dateend, "Creationdevis" ,"width=850,"+popupvar)
}

function creatprop(){
	popupproposal();
	document.creadevis.action='proposal.asp';
	document.creadevis.target='Proposal';
	document.creadevis.creationoption.value=0;
	document.creadevis.submit();
}
function killlink(){if(domok){skn.visibility="hidden";cab_ok="0";document.getElementById("topdecklink").innerHTML='';var tmp='';clearTimeout(sdntimer);}}


function cre_select(v2,v1,v3,v4){
v1=v1.split("§");
document.write('<select name="'+v2+'" style="overflow:hidden; width:150px; font-size:7.9pt;">');
if(v3=='0'){sel=' selected'}else{sel=''}
document.write('<option value="0"'+sel+'>'+v4+'</option>');
for(inc=0;inc<v1.length;inc++){
	if(v3+''==''+v1[inc]){sel=' selected'}else{sel=''}
	document.write('<option value="'+v1[inc]+'"'+sel+'>'+v1[inc]+'</option>');
}
document.write('</select>');

}

function get_mouse(e){
	var typbox	= document.getElementById('typbox');
	var x = (navigator.appName.substring(0,3) == "Net") ? parseFloat(e.pageX) : parseFloat(event.x);
	var y = (navigator.appName.substring(0,3) == "Net") ? parseFloat(e.pageY) : parseFloat(event.y+document.body.scrollTop);
	var_mou_x=x; var_mou_y=y;
	var_box_x=skn.left; var_box_y=skn.top;
	var_bod_x=screen.width; var_bod_y=screen.Height;
	
	/*	
		var div_mou_x = document.getElementById('x1_txt');	var div_mou_y = document.getElementById('y1_txt');
		var div_box_x	= document.getElementById('x2_txt');	var div_box_y	= document.getElementById('y2_txt');
		var div_bod_x	= document.getElementById('x3_txt');	var div_bod_y	= document.getElementById('y3_txt');
		var div_oth_x	= document.getElementById('x4_txt');	var div_oth_y	= document.getElementById('y4_txt');
		var div_bx2_x	= document.getElementById('x5_txt');	var div_bx2_y	= document.getElementById('y5_txt');
		div_mou_x.value=var_mou_x;div_mou_y.value=var_mou_y;
		div_box_x.value=var_box_x;div_box_y.value=var_box_y;
		div_bod_x.value=var_bod_x;div_bod_y.value=var_bod_y;
		div_bx2_x.value=skn.width;div_bx2_y.value=skn.Height;
		div_oth_x.value = var_mou_x>var_bod_x
	*/
	skbarre.left=var_mou_x+5+'px';
	if(document.getElementById('commentaires')){typbox.value='dc';}
	if(skn.visibility=="visible"){
		//if(x>1000){skn.left=x-260+'px';}else{skn.left=x+15+'px';};
		if(typbox){
			if(typbox.value=='b'){
				x_mor=200;
			}else if(typbox.value=='dc'){
				x_mor=530;
			}else if(typbox.value=='d'){
				x_mor=290;
			}else{
				x_mor=290;
			}
		}else{
			x_mor=200;
		}
		if(var_mou_x>var_bod_x-x_mor){skn.left=var_mou_x-(x_mor-15)+'px';}else{skn.left=x+15+'px';};
		if(cab_ok=="1"){if(connected_agt==1){skn.top = y-60+'px';}else{skn.top = y-150+'px';}}else{skn.top = y-100+'px';}
	}else{//skn.top = '0px';
		}
	if(connected_ope==1){if(document.all){skbarre.top=225+'px';}else{skbarre.top=225+'px';}}else{if(document.all){skbarre.top=225+'px';}else{skbarre.top=225+'px';}}
}

function affiche_bar(){skbarre.visibility='visible'}


function GetInfo(idc,ds,de,idb,typb,typc,idos) {
	var xhr_object = null;var tmp='';
	if(window.XMLHttpRequest)
		xhr_object = new XMLHttpRequest();
	else if(window.ActiveXObject)
		xhr_object = new ActiveXObject("Microsoft.XMLHTTP");
	else {
		alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest...");
		return;
	}
	if(typc=='tbf1'){
		var foo = document.getElementById(typb);
		var method   = "POST"
		var filename = "../planning_s/weekprices.asp";
		var data     = null;
		if(idc != "")data = "idt="+idc;
		if(ds != "")data+= "&ds="+ds;
		if(de != "")data+= "&de="+de;
		if(idb != "")data+= "&idb="+idb;
		if(idos && idos!="")data+="&idos="+idos
		if(method == "GET" && data != null) {fileName += "?"+data;data = null;}
		xhr_object.open(method, filename, true);
		xhr_object.onreadystatechange = function anonymous() {
			foo.innerHTML= '<table style="font-size:9pt;color:#FFFFFF; background-color:#CC4444;" cellpadding=0 cellspacing=0><tr><td nowrap=\"nowrap\">&nbsp;&nbsp;&nbsp;Loading details...&nbsp;&nbsp;&nbsp;</td></tr></table>'
			if(xhr_object.readyState == 4) {
				var tmp  = xhr_object.responseText;
				if(tmp){
					cb="tbfprx"+typb;DB[cb]=tmp;
					foo.innerHTML=tmp;var tmp='';}
			}else{
				document.getElementById("topdecklink").innerHTML= '<table style="font-size:9pt;color:#ffffff; background-color:#CC4444;" cellpadding=0 cellspacing=0><tr><td nowrap=\"nowrap\">&nbsp;&nbsp;&nbsp;Loading details...&nbsp;&nbsp;&nbsp;</td></tr></table>'
			}
		}
		xhr_object.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		xhr_object.send(data);
	}else{
		var tc = 'ope';var foo = document.getElementById('foo'+idc);
		var method   = "POST"
		var filename = "../planning_s/r_infos_req.asp";
		var s1       = idc
		var s2       = ds
		var s3       = de
		var s4       = idb
		var data     = null;
		if(s1 != "")data = "s1="+s1;
		if(s2 != "")data+= "&ds="+s2;
		if(s3 != "")data+= "&de="+s3;
		if(s4 != "")data+= "&idb="+s4;
		if(tc != "")data+= "&tc="+tc;
		if(method == "GET" && data != null) {fileName += "?"+data;data = null;}
		xhr_object.open(method, filename, true);
		xhr_object.onreadystatechange = function anonymous() {
			document.getElementById("topdecklink").innerHTML= '<table style="font-size:9pt;color:#FFFFFF; background-color:#CC4444;" cellpadding=0 cellspacing=0><tr><td nowrap=\"nowrap\">&nbsp;&nbsp;&nbsp;Loading details...&nbsp;&nbsp;&nbsp;</td></tr></table>'
			if(xhr_object.readyState == 4) {
				var tmp  = xhr_object.responseText;
				if(tmp){
					if(tmp=='sessionout'){
						reconn();
					}else{
						popinfo_f(tmp,idc,ds,de,idb,typb);
					}
					var tmp='';
				}
			}else{
				document.getElementById("topdecklink").innerHTML= '<table style="font-size:9pt;color:#ffffff; background-color:#CC4444;" cellpadding=0 cellspacing=0><tr><td nowrap=\"nowrap\">&nbsp;&nbsp;&nbsp;Loading details...&nbsp;&nbsp;&nbsp;</td></tr></table>'
			}
		}
		xhr_object.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		xhr_object.send(data);
	}
}

//var sdntimer = '';
var sdntimer;
function popinfo_s2(dv,idc,dateStart,DateEnd,id_boat,idos){
	boxt = document.getElementById(dv);
	var content='';
	if(DB["tbfprx"+dv] && DB["tbfprx"+dv]!=''){content=DB["tbfprx"+dv];}
	if(content!=''){
		boxt.innerHTML=content;
	}else{
		sdntimer =  setTimeout(function () {
		  				GetInfo(idc,dateStart,DateEnd,id_boat,dv,'tbf1',idos)
					},500);

	}
}


function popinfo_s(idc,dateStart,DateEnd,id_boat){
	var tmp='';
	if(idc=='0' && dateStart!=''){cab_ok="1"}else{cab_ok="0"}
	var content ="<table border=0 cellpadding=0 cellspacing=0><tr><td id=\"foo"+idc+"\">&nbsp;</td></tr></table>";

	if(domok){document.getElementById("topdecklink").innerHTML=content;skn.visibility="visible";}
	boxt = document.getElementById("typbox");
	content='';
	if(idc=='0' && dateStart=='' && DateEnd==''){
		var_box='b';
		if(DB["Bot"+id_boat] && DB["Bot"+id_boat]!=''){content=DB["Bot"+id_boat];}
	}else if (idc=='0' && dateStart!='' && DateEnd!=''){
		var_box='c';
		cb="Cab"+dateStart+DateEnd+id_boat;
		if(DB[cb] && DB[cb]!=''){content=DB[cb];}
	}else if (idc!='0') {
		var_box='d';
		if(DB["Com"+idc] && DB["Com"+idc]!=''){content=DB["Com"+idc];}
	}
	boxt.value = var_box;
	if(content!='' && idc!='134484'){
		var foo = document.getElementById("topdecklink");
		foo.innerHTML=content;
	}else{
		sdntimer =  setTimeout(function () {
		  				GetInfo(idc,dateStart,DateEnd,id_boat,var_box)
					},500);
		
	}
}

function planning_date(sDate){    //    Convertie une date du format JJ/MM/AAAA en date JavaScript
    var iDay = sDate.substring(0,2)
    var iMonth = sDate.substring(3,5)
    var iYear = sDate.substring(6)
    iDay = iDay*1
    iMonth = (iMonth*1)-1
    iYear = iYear*1
    var rDate = new Date(iYear,iMonth,iDay,0,0)
    return(rDate)
}
function IsDate(sDate){    //    retourne true si c'est une date valide
if (sDate.length < 8){return false}
    var iDay = sDate.substring(0,2)
    var iMonth = sDate.substring(3,5)
    var iYear = sDate.substring(6)
    iDay = iDay*1
    iMonth = (iMonth*1)-1
    iYear = iYear*1
    var rDate = new Date(iYear,iMonth,iDay,0,0)
    if(rDate.toString() == "NaN"){return false}
    return true
}

function valid_sej_sur_OS_new(idB,inc){
	c1="B9D2F1";c2="DBE9FF";c3=c1;cs=color_OS;
	tst1="BN"+idB;tst2="BT"+idB;tst0=idB+"t";addj1=0;addj2=0;
	if(DT[tst1]){BoatName=DT[tst1]}else{BoatName=''}
	if(DT[tst2]){BoatType=DT[tst2]}else{BoatType=''}
	//alert(d_dat+'/'+m_dat+'/'+y_dat)
	var cal_DateStart = new Date(y_dat, m_dat-1, d_dat,0,0);
	var cal_dateend 	= new Date(y_dat, m_dat-1, d_dat,0,0);
	if(DT["BJ"+idB]=="7"){
		cal_DateStart.setTime(cal_DateStart.getTime()+(24*60*60*1000) )
		cal_dateend.setTime(cal_dateend.getTime()+(24*60*60*1000) )
	}
	//alert(cal_DateStart)
	var ddate = new Date();
	document.write('<tr style="font-size:1px; height:3px;" id="tros" t="WKP'+DT["TB"+idB]+'">');
	for(i=0;i<inc;i++){
		if(i==0){pp=1}else if(i==inc-1){pp=3}else{pp=2}
		tst_tb=idB+"tb"+i;	tst_vd=idB+"vd"+i;	tst3=idB+"nbj"+i;	tst_so=idB+"os"+i;
		tst4=idB+"os"+i;		tst5=idB+"dtx"+i;		tst6=idB+"ddb"+i;	tst7=idB+"dfn"+i;
		if(DO[tst3]){tst3=DO[tst3]}else{tst3=14}
		if(tst3==13){tst3=14}
		if(DO[tst_tb]){tst_tb=DO[tst_tb]}else{tst_tb='0'}
		addj2=(tst3/2)
		cal_DateStart.setTime(cal_DateStart.getTime()+(24*60*60*1000*(addj1)) )
		cal_dateend.setTime(cal_dateend.getTime()+((24*60*60*1000)*(addj2)))
		annee = cal_DateStart.getFullYear();mois = cal_DateStart.getMonth();jour = cal_DateStart.getDate();	d1=''+jour+'/'+(mois+1)+'/'+annee
		annee = cal_dateend.getFullYear();	mois = cal_dateend.getMonth();	jour = cal_dateend.getDate();		d2=''+jour+'/'+(mois+1)+'/'+annee
		addj1 = addj2
		if(DO[tst_vd]){
			OSsej_vide(tst3,'FFFFFF',BoatName,BoatType,'',pp,tst_tb,i);
		}else if(DO[tst_so] && DO[tst5] && DO[tst5].search("#")!=-1){
			if(DO[tst4]){tst4=DO[tst4]}else{tst4=''}
			if(DO[tst5]){tst5=DO[tst5]}else{tst5=''}
			if(DO[tst6]){tst6=DO[tst6]}else{tst6=''}
			if(DO[tst7]){tst7=DO[tst7]}else{tst7=''}
			valid_OS(tst3,cs,d1,d2,DO[tst_so],tst5,tst6,tst7,idB,tst_tb,tst5,tst6,tst7,pp,i);
		}else{
			if(c3==c2){c3=c1}else{c3=c2}
			if(DO[tst4]){tst4=cs}else{tst4=c3}
			if(DO[tst5]){tst5=DO[tst5]}else{tst5=''}
			if(DO[tst6]){tst6=DO[tst6]}else{tst6=''}
			if(DO[tst7]){tst7=DO[tst7]}else{tst7=''}
			valid_sej_sur_OS(tst3,tst4,d1,d2,'','','','',idB,tst_tb,tst5,tst6,tst7,pp,i);
		}
	}
	DT["osnmb"]=inc;
	document.write('</tr>');
}

function DicAdd(idB,idT,v1,v2,v3,v4,v5,v6){
	//v0=idT.split("§");
	v0=idT;
	if(v1){v1=v1.split("§");}if(v2){v2=v2.split("§");}if(v3){v3=v3.split("§");}if(v4){v4=v4.split("§");}if(v5){v5=v5.split("§");}if(v6){v6=v6.split("§");}
	for(inc=0;inc<v1.length;inc++){
		//if(v0[inc]!=''){DO[idB+"tb"+inc]  = v0[inc]}
		if(v0!=''){DO[idB+"tb"+inc]  = v0}
		if(v1[inc]!=''){DO[idB+"vd"+inc]  = v1[inc]}
		if(v2[inc]!=''){DO[idB+"nbj"+inc] = v2[inc]}
		if(v3[inc]!=''){DO[idB+"os"+inc]  = v3[inc]}
		if(v4[inc]!=''){DO[idB+"dtx"+inc] = v4[inc]}
		if(v5[inc]!=''){DO[idB+"ddb"+inc] = v5[inc]}
		if(v6[inc]!=''){DO[idB+"dfn"+inc] = v6[inc]}
	};
	DO["alltbf"]+=","+idT;DO["allbot"]+=","+idB;
	valid_sej_sur_OS_new(idB,(v2.length));
}

function popupproposal(){window.open("", "Proposal" ,"width=800,"+popupvar)}

var sk_idc='0'
function popupaff(id_command,dateStart,DateEnd,id_boat,force){
	var skippermode = document.getElementById('skippermode')
	var openup = 'ok'
	if(skippermode){
		if(skippermode.value=='1'){
			skdv=document.getElementById('skipper_mode')
			if(sk_idc=='0'){
				skdv.style.display='';
				ChkSkip("sk_com_sumup",id_command,"","ajx_skp_sum_up.asp")
				ChkSkip("sk_to_add",id_command,"","ajx_sk_to_add.asp")
				return sk_idc=id_command ;
			}else if(sk_idc!=id_command){
				ChkSkip("sk_com_sumup",id_command,"","ajx_skp_sum_up.asp")
				ChkSkip("sk_to_add",id_command,"","ajx_sk_to_add.asp")
				return sk_idc=id_command ;
			}else{
			 	skdv.style.display='none';
			 	return sk_idc='0' 
			}
			openup='';
		}
	}
	
	if(openup=='ok' || force=='ok'){
		if (id_command=='0') {
				popupaffCab(dateStart,DateEnd,id_boat)
		}else{
				window.open("../site/Menufiche.asp?from_planning=ok&typ_command=ope&Type=Sejour&id_command="+id_command, "Affichagedevis"+id_command,"width=850,"+popupvar)
		}
	}
	
}


function popupaffBlock(id_command){
	window.open("../planning/DRAS.asp?id_command="+id_command, "AffichageBlock"+id_command,"width=850,"+popupvar)
}
function popupaffSignature(id_command){
	window.open("../planning_s/transit.asp?id_command="+id_command, "transit"+id_command,"width=850,"+popupvar)
}
function popupaffCab(dateStart,DateEnd,id_boat){
if(connected_ope==1){
		var testchkproposal=false;
		if (document.creadevis.direct_proposal.value!=''){testchkproposal = true ;}
		if(testchkproposal==true){
			document.creadevis.id_boatP.value=id_boat;
			document.creadevis.cabP.value=true;
			document.creadevis.SelDateP.value=dateStart+', '+DateEnd;
			popupproposal();
			document.creadevis.action='proposal.asp';
			document.creadevis.target='Proposal';
			document.creadevis.submit();
			document.creadevis.cabP.value='';
		}else{
			window.open("../Planning/newinvoice.asp?from_planning=ok&dateEnd="+DateEnd+"&dateStart="+dateStart+"&id_boat="+id_boat, "AffichagedevisCab","width=800,"+popupvar)
		}
}else if(connected_agt==1){
		window.open("../Planning/newinvoice.asp?dateEnd="+DateEnd+"&dateStart="+dateStart+"&id_boat="+id_boat, "AffichagedevisCab"+id_os,"width=800,"+popupvar)
}
}													

function popupaffOS(id_os,dateStart,DateEnd,id_boat,id_tbF1){
	var testchkproposal=false;
	if (document.creadevis.direct_proposal.value!=''){testchkproposal = true ;}
	if(testchkproposal==true){
		document.creadevis.id_boatP.value=id_boat;
		document.creadevis.SelDateP.value=dateStart+', '+DateEnd;
		popupproposal();
		document.creadevis.action='proposal.asp';
		document.creadevis.target='Proposal';
		document.creadevis.submit();
	}else{
		window.open("../Planning/newinvoice.asp?id_tbF1="+id_tbF1+"&id_os="+id_os+"&dateEnd="+DateEnd+"&dateStart="+dateStart+"&id_boat="+id_boat, "Affichagedevis"+id_os,"width=800,"+popupvar)
	}
}
function ligneNomOpe(nom,nbcols){document.write("<tr><td class=\"nom_ope\" align=center valign=middle>"+nom+"</td><td class=\"nom_ope\" colspan="+nbcols+"></td></tr>");}
function ligneNomPays(nom,nbcols,jour){if(jour){}else{jour=''};document.write("<tr><td class=\"nom_ope\" style=\"border-top:1px none; border-right:1px none;\" align=center valign=middle colspan=2>"+nom+"</td><td class=\"nom_ope\" style=\"border-top:1px none; border-bottom:1px solid #000000; border-left:1px none; border-right:1px none;color:red;\" colspan="+nbcols+">&nbsp;"+jour+"</td></tr>");}
function ligneNomBase(nom,nbcols){document.write("<tr><td class=\"nom_ope\" align=center valign=middle>"+nom+"</td><td class=\"nom_ope\" colspan="+nbcols+"></td></tr>");}
function ligneNomTypeBateau(nom,nbcols){document.write("<tr><td class=\"type_bateau\" align=center valign=middle>"+nom+"</td>");}
function affiche2(aff){document.write(aff);}

function TdBt(idt,idb,v2,bdtfn,CC,dlfn,dbm,dbY,dbN,bop,dbW,cab,idop,dbP,dPr,idbo){
	
	var onclk='';var point='';var tdbtt='';
	if(printmode!='1'){
		onclk = ' onClick=\'trsslin("'+v2+'","'+idt+'");\' '
		point = 'cursor:pointer; ';
	}
	var tmp_aff = dbN;
	var onmo = 'javascript:popinfo_s(\'0\',\'\',\'\','+idb+');'
	var dlf = 'javascript:popupboat(\''+idb+'\',\''+dlfn+'\');'
	tdbtt+='<TD class="tdBt" style="'+point+bdtfn+'" rowspan="'+row_nb+'"  onMouseOver="'+onmo+'" onMouseOut="killlink();" '+onclk+'>';

	if(printmode!='1'){
		if(dPr=='1'){CbN='b_Opr'}else{CbN=''};
		if(connected_agt==1 || connected_own==1 || connected_cli==1){
			tdbtt+='<table class="b_A" cellpadding="0" cellspacing="0"><tr><td class="b_O_td2">';
			tdbtt+='<table border="0" cellpadding="0" cellspacing="0"><tr><td class="b_O_td1">';
			tdbtt+='<input type="radio" id="boat'+v2+idt+'" name="id_boat" value="'+v2+'|'+idt+'" onFocus="this.blur();" class="radio"';
			if(connected_own==1 || connected_cli==1){tdbtt+='style="display:none;"';}
			tdbtt+='>';
			tdbtt+='</td><td class="b_O_td1_p"><div class="'+CC+'" onClick="'+dlf+'">'+dbm+'</div></td>';
			if (dbY!='') {
				tmp_aff = dbY
				if (dbN!='') {tmp_aff = tmp_aff+'-'+dbN}
			};
			tdbtt+='<td width="85" class="'+CbN+'"><div class="b_O_dv1_p">'+tmp_aff+'</div></td>';
			if(connected_ope==1 || 1){
				tdbtt+='<td class="b_O_td2_p"><a style="color:#F90;" target="base'+idbo+'" href="../dest/basedisp.asp?t=base&id='+idbo+'">'+bop+'</a></td>';
			}
			tdbtt+='</tr></table></td></tr></table>';
		}else{
			if(dbP=='1'){cls='b_Oav'}else{cls='b_O'};
			tdbtt+='<table cellpadding=0 cellspacing=0 class="'+cls+'"><tr><td class="b_O_td1">';
			tdbtt+='<input type="radio" id="boat'+v2+idt+'" name="id_boat" value="'+v2+'|'+idt+'" onFocus="this.blur();" class="radio">';
			tdbtt+='</td><td class="b_O_td2"><table width="200" border="0" cellpadding="0" cellspacing="0"><tr>';
			tdbtt+='<td width="100"><div class="'+CC+'" onClick="'+dlf+'">'+dbm+'</div></td>';
			tdbtt+='<td width="100" class="'+CbN+'">'+dbN+'</td></tr>';
			if(connected_ope==1){
					tdbtt+='<tr><td><div class="b_O_dv2">';
					if(idop=='161'){tdbtt+=''+cab+'Cab - ';}
					tdbtt+='<span class="'+CbN+'">'+dbY+'</span> - ';
					tdbtt+=''+dbW;
					tdbtt+='</div></td>';
					tdbtt+='<td><div class="b_O_dv2">'
					if(bop!=''){tdbtt+='Homeport: <font color="#FF9900">'+bop+'</font>';}else{tdbtt+='&nbsp;'}
					tdbtt+='</div></td></tr>'
					
			}
			tdbtt+='</table></td></tr></table>';
		}
	}else{
		tdbtt+='<table border="0" height="20" cellpadding="0" cellspacing="0"><tr><td nowrap style="text-decoration:none; " align=left valign="middle">';
		tdbtt+='<table border="0" cellpadding="0" cellspacing="0"><tr>';
		tdbtt+='<td class="b_O_td1_p"><div class="b_O_dv1_p">'+dbm+'</div></td>';
		//tdbtt+='<td class="b_O_td1_p"><div class="b_O_dv1_p">('+dbW+' - '+dbY+')</div></td>';
		tdbtt+='<td class="b_O_td1_p"><div class="b_O_dv1_p">'+dbN+'</div></td>';
		if(connected_ope==1){
			tdbtt+='<td class="b_O_td2_p">'+bop+'</td>';
		}
		tdbtt+='</tr></table></td></tr></table>';
	}
	tdbtt+='</TD>';
	document.write(tdbtt);
}
function popupboat(l1,l2){window.open("../Boat/"+l2+".asp?id_boat="+l1,"Boat"+l1,"top=0,left=0,height=690,width=800,toolbar=no,menubar=no,scrollbars=yes,resizable=yes,directories=no,location=no,status=no,titlebar=no");}
function DisplayGrid(l1){
	k1 = document.getElementById("trViewGrid")
	k2 = document.getElementById("trHideGrid")
	k3 = document.getElementById("divGrid")
	k4 = document.form1.viewgrid
	if(l1==0){k1.style.display='none';k2.style.display='';k3.style.display='';k4.value='1';}
	if(l1==1){k1.style.display='';k2.style.display='none';k3.style.display='none';k4.value='0';}
}
function AffMois(k1,k2,k3,k4){
	if(k4){k4='border-top:1px none; font-size:7pt;'}else{k4='border-top:1px solid #000000; font-size:8pt;'}
	if(k2==1){k4+=" border-left:1px none #000000 "}else if(k2==2){k4+=" border-left:1px none #000000; border-right:1px none #000000; "}
	document.write('<td colspan='+k1+' style=" border-right:1px dotted #000000; background-color:#DBE9FF;'+k4+'" valign=middle align=center><strong>'+k3+'</strong></td>');
}
var bgcolor1="DBE9FF";
var bgcolor2="B9D2F1";
var bgcolor3=bgcolor1;
function chgcolor(){
	if(bgcolor3==bgcolor1){bgcolor3=bgcolor2}else{bgcolor3=bgcolor1}
	return bgcolor3
}
function loopWeek(v7,lgweek){
	ds='text-align:center;font-size:7pt;';
	document.write ('</tr><tr><td style="'+ds+'background-color:#'+chgcolor()+';border-top:1px dotted #000000;"></td>');
	v7 = v7.split('§')
	for(inc=0;inc<v7.length-1;inc++){
		if(inc==v7.length-1){ds+='border-right:1px none;';}else{ds+='border-right:1px dotted #000000;';}
		document.write ('<td colspan=14 style="'+ds+'background-color:#'+chgcolor()+';border-top:1px dotted #000000;">'+lgweek+' #'+(v7[inc])+'</td>');
	}
	document.write ('<td style="background-color:#'+chgcolor()+';text-align:center;border-top:1px dotted #000000;"></td>');
}
function loopCal3(v1,v2,v6,v7){
	ds='';v2=v2.split("§");a='';d='';m='';v3='';
	for(inc=0;inc<v2.length;inc++){
		v4=v2[inc];
		v3=v4.split("/");
		a = v3[2];m=v3[1];d=v3[0];
		var calendrier = "";
		ds='background-color:#DBE9FF;';
		switch (v6)
		{
			case 1:jour = j_0;ds='background-color:#B9D2F1;';break;
			case 2:jour = j_1;break;
			case 3:jour = j_2;break;
			case 4:jour = j_3;break;
			case 5:jour = j_4;break;
			case 6:jour = j_5;break;
			case 7:jour = j_6;ds='background-color:#B9D2F1;';break;
			default:jour = "?";break;
		} 
		if(inc==(dis_numDays-1)){ds+='border-right:1px none;';}else{ds+='border-right:1px solid #000000;';}
		document.write ("<TD valign=middle width=\""+date_width+"px\" class=classtd style=\""+ds+"border-top:1px dotted #000000;\" align=center colspan=2>");
		if(v6==7){v6=1;}else{v6=parseInt(v6)+1;}
		calendrier += Cal(jour, d, m, a, '', '', inc);
		document.write(calendrier);
		document.write ("</TD>");
	}
}

//   Fonctions de conversions standards DEC <-> HEX
function DecToHex(dec){ return ((hex=dec.toString(16).toUpperCase()).length<2)?"0"+hex:hex; }
function HexToDec(hex){ return parseInt(hex,16); }

function blowInit(e,col){

	initCol(col);

	elementKey = document.getElementById(e);
	elementKey.redLevel   = beginColorRed;
	elementKey.greenLevel = beginColorGreen;
	elementKey.blueLevel  = beginColorBlue;
	elementKey.blowStep   = 0; 

	for(incStep=0;incStep<5;incStep++){
		v1 = ((incStep+1)*(700))
		v2 = ((incStep+1)*(700)+350)
		setTimeout('blow2("'+e+'",true,"'+col+'");',v1);
		setTimeout('blow2("'+e+'",false,"'+col+'");',v2);
	}
	v2 = ((incStep+1)*(700)+350)
	setTimeout('elementKey.style.backgroundColor="#'+col+'";',v2);
}

function initCol(col){
		beginColorHex   = col+''
		beginColorRed   = parseFloat(HexToDec(beginColorHex.substr(1,2)));
		beginColorGreen = parseFloat(HexToDec(beginColorHex.substr(3,2))); 
		beginColorBlue  = parseFloat(HexToDec(beginColorHex.substr(5,2))); 
		endColorHex   = "995599"
		endColorRed   = parseFloat(HexToDec(endColorHex.substr(1,2)));
		endColorGreen = parseFloat(HexToDec(endColorHex.substr(3,2))); 
		endColorBlue  = parseFloat(HexToDec(endColorHex.substr(5,2))); 
		speed = 20;
		stepColorRed   = (endColorRed-beginColorRed)/speed;
		stepColorGreen = (endColorGreen-beginColorGreen)/speed;
		stepColorBlue  = (endColorBlue-beginColorBlue)/speed;
		
		return
}

function blow2(e,blowing,col){
	initCol(col);
	elementKey = document.getElementById(e)
	if (blowing)
	{
		if (elementKey.blowStep < speed)
		{
			elementKey.blowStep++;
			elementKey.redLevel = beginColorRed + (stepColorRed * elementKey.blowStep);
			elementKey.greenLevel = beginColorGreen + (stepColorGreen * elementKey.blowStep);
			elementKey.blueLevel = beginColorBlue + (stepColorBlue * elementKey.blowStep);
			setTimeout('blow2("'+e+'",true,"'+col+'")', 1);
		}
	}
	else
	{
		if (elementKey.blowStep > 0)
		{
			elementKey.blowStep--;
			
			elementKey.redLevel = beginColorRed + (stepColorRed * elementKey.blowStep);
			elementKey.greenLevel = beginColorGreen + (stepColorGreen * elementKey.blowStep);
			elementKey.blueLevel = beginColorBlue + (stepColorBlue * elementKey.blowStep);
			
			setTimeout('blow2("'+e+'",false,"'+col+'")', 1);
		}
	}
	elementKey.style.backgroundColor = 'rgb('+Math.floor(elementKey.redLevel)+','+Math.floor(elementKey.greenLevel)+','+Math.floor(elementKey.blueLevel)+')';
}

function btSkip(v1){
	if(v1.className.search('_hover')!=-1){
		v1.className = v1.className.replace('_hover','');
		document.getElementById('skippermode').value='0';
		document.getElementById('skipper_mode').style.display='none'
		addskip(1);
		return sk_idc='0' ;
	}else{
		document.getElementById('skippermode').value='1';
		v1.className+= '_hover';
		addskip();
	}
}

function addskip(v2){
	var v1 = sk_id
	if(v1){
		v1 = v1.split(",");
		for(inc=0;inc<v1.length;inc++){
			if(v1[inc]!=''){
				njd = parseInt(DB["NJD"+v1[inc]]);
				njc = parseInt(DB["NJC"+v1[inc]]);
				njr = parseInt(DB["NJR"+v1[inc]]);
				
				addplus = ((njc+njd+njr)/2)
				if(document.all){addplus+=((njc+njd+njr)/3)+1}else{addplus+=-2}
				
				dep = document.getElementById('d'+v1[inc])
				cht = document.getElementById('c'+v1[inc])
				ret = document.getElementById('r'+v1[inc])
				if(v1[inc].search('2')!=-1){
					img_cap = "<img src=\"../skipper/img/icon/captain.gif\">"
				}else{
					img_cap = "<img src=\"../skipper/img/icon/captain_off.gif\">"
				}
				
				img_cap="<img src=\"images/loader.gif\" width=16 height=16>"
				
				if(cht){
					var_inner = '<div class=skipper_div2 style="width:'+(((njc+njd+njr)*(date_width/2))+addplus)+'px;"></div>'
					var_inner+= '<div class=skipper_div  style="width:'+(((njc+njd+njr)*(date_width/2))+addplus)+'px;">'
					var_inner+= '<table cellpadding=1 cellspacing=0 width=100% ><tr>'
					if(njd!=0){var_inner+= '<td align=left style="padding-left:2pt;" id="skd'+v1[inc]+'">'+img_cap+'</td>';}
					var_inner+= '<td align=center id="skc'+v1[inc]+'">'+img_cap+'</td>';
					if(njr!=0){var_inner+= '<td align=right id="skr'+v1[inc]+'">'+img_cap+'</td>';}
					var_inner+= '</tr></table>';
					var_inner+= '</div>';
					if(v2){
						cht.innerHTML=DO["inner"+v1[inc]];
					}else{
						if(DO["inner"+v1[inc]]){}else{DO["inner"+v1[inc]]=cht.innerHTML}
						cht.innerHTML=var_inner+cht.innerHTML;
						if(njd!=0){ChkSkip("skd"+v1[inc],v1[inc],"d")}
						ChkSkip("skc"+v1[inc],v1[inc],"c")
						if(njr!=0){ChkSkip("skr"+v1[inc],v1[inc],"r")}
					}
				}
			}
		}
	}
}

function ChkSkip(div,idc,loc,ajx,idsk) {
	action_plus=''
	if(ajx=='ajx_skp_delete.asp'){
		ajx="ajx_skp_update.asp";
		action_plus="delete";
	}else if(ajx){
	}else{
		ajx="ajx_skp.asp"
	}
	//div:id, idc:idcommand   |   loc:depart/charter/retour
	var skfoo = document.getElementById(div);
	var ajxload = "<img src=\"images/loader.gif\" width=16 height=16>"
	skfoo.innerHTML = ajxload;
	var xhr_object_skp = null; var tmp='';
	if(window.XMLHttpRequest)
		xhr_object_skp = new XMLHttpRequest();
	else if(window.ActiveXObject)
		xhr_object_skp = new ActiveXObject("Microsoft.XMLHTTP");
	else {
		alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest...");return;
	}
	var method   = "POST";
	var filename = ajx;
	var data     = null;
	if(idc!="")data ="idc="+idc;
	if(loc!="")data+="&loc="+loc;
	if(idsk+""!="")data+="&idsk="+idsk;
	if(action_plus+""!="")data+="&act="+action_plus;
	if(method == "GET" && data != null) {fileName += "?"+data;data = null;}
	xhr_object_skp.open(method, filename, true);
	xhr_object_skp.onreadystatechange = function anonymous() {
		if(xhr_object_skp.readyState == 4) {
			var tmp  = xhr_object_skp.responseText;
			document.getElementById('sk_error').innerHTML=tmp;
			//alert(tmp)
			if(ajx=='ajx_skp_sum_up.asp'){
				if(tmp.search('AaA')!=-1){
					tmp = tmp.split("AaA")
					var lst = '<table width=100% cellpadding="0" cellspacing="0"><tr><td id="skipper_title" width=1% ><img src="../skipper/img/icon/captain.gif"></td><td><table width=100% cellpadding="0" cellspacing="0">';
					var title_arr = new Array(sk_tit01+' (D)',sk_tit02+' (C)',sk_tit03+' (R)')
					for(inc=0;inc<tmp.length;inc++){
						//alert(tmp[inc]);
						if(tmp[inc]=="ok"){
							lst+= '<tr><td nowrap id="skipper_title">'+title_arr[inc]+'</td></tr>';
							lst+= '<tr id="skipper_contenu"><td nowrap>'+sk_nodefined+'</td></tr>';
						}else if(tmp[inc].search('DdD')!=-1){
							lst+= '<tr><td nowrap id="skipper_title">'+title_arr[inc]+'</td></tr>';
							tmp2 = tmp[inc].split("DdD")[1].split("CcC")
							lst+= '<tr id="skipper_contenu"><td>';
							for(inc2=0;inc2<tmp2.length;inc2++){
								tmp3 = tmp2[inc2].split("BbB")
								onclkc = 'onClick="javascript:ChkSkip(\'sk_com_sumup\','+idc+',\'c\',\'ajx_skp_delete.asp\','+tmp3[1]+');"'
								lst+= '<a href="#" '+onclkc+'">'+tmp3[0]+'</a>, '
							}
							lst+= '</td></tr>';
						}
					}
					lst+= '</table></td></tr></table>'
					skfoo.innerHTML = lst;
					
				}else{
					
				}
			}else if(ajx=='ajx_sk_to_add.asp'){
				if(tmp.search('AaA')!=-1){
					tmp = tmp.split("AaA")
				  var lst = '<table cellpadding="1" cellspacing="1" border="0">'
					lst+= '<tr id="skipper_title">'
					lst+= '<td width="97%">'+sk_tit00+'</td>'
					lst+= '<td width="1%">(D)</td><td width="1%">(C)</td><td width="1%">(R)</td></tr>'
					
					for(inc=0;inc<tmp.length;inc++){
						tmp2 = tmp[inc].split("BbB");
						lst+= '<tr id="skipper_contenu">'
						lst+= '<td style="border-top:1px solid #666; ">'+tmp2[0]+'</td>';
						lst+= '<td align="center" valign="middle" style="border-top:1px solid #666; "><img src="images/bullet_add.gif"></td>';
						onclkc = 'onClick="javascript:ChkSkip(\'sk_com_sumup\','+idc+',\'c\',\'ajx_skp_update.asp\','+tmp2[1]+');"'
						lst+= '<td align="center" valign="middle" style="border-top:1px solid #666; cursor:pointer; " '+onclkc+'><img src="images/bullet_add.gif"></td>';
						lst+= '<td align="center" valign="middle" style="border-top:1px solid #666; "><img src="images/bullet_add.gif"></td>';
						lst+= '</tr>'
					}

					lst+= '</table>'
					skfoo.innerHTML = lst;
					
				}else if(tmp=='noskipper'){
					skfoo.innerHTML = sk_nodefined+'';
				}else{
					skfoo.innerHTML = tmp;
				}
			}else if(ajx=='ajx_skp_update.asp'){
				ChkSkip("sk_com_sumup",idc,"","ajx_skp_sum_up.asp")
				ChkSkip("sk_to_add",idc,"","ajx_sk_to_add.asp")
				ChkSkip("skc"+idc,idc,"c")
			}else if(ajx=='ajx_skp.asp'){
				if(tmp!='0'){
					skfoo.innerHTML = "<img src=\"../skipper/img/icon/captain.gif\">";
				}else{
					skfoo.innerHTML = "<img src=\"../skipper/img/icon/captain_off.gif\">";
				}
			}
		}
	}
	xhr_object_skp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	xhr_object_skp.send(data);
}

(function( $ ){ $.fn.serializeJSON=function(){ var json = {}; jQuery.map($(this).serializeArray(), function(n, i){ json[n['name']] = n['value']; }); return json;};})( jQuery );

