function deleteCookie( sName, sDomain, sPath, bExpires ) {
if (getCookie( sName )) {
document.cookie = sName + '=' +
((sPath) ? '; path=' + sPath : '') +
((sDomain) ? '; domain=' + sDomain : '') +
((bExpires) ? '; expires=Thu, 01-Jan-70 00:00:01 GMT' : '');
}
}
function getCookie( sName ) {
var sSearch = sName + '=';
if (document.cookie.length) {
nOffset = document.cookie.indexOf( sSearch );
if (nOffset != -1) { 
nOffset += sSearch.length;
nEnd = document.cookie.indexOf( ';', nOffset ); 
if (nEnd == -1) { 
nEnd = document.cookie.length;
}
return unescape( document.cookie.substring( nOffset, nEnd ) );
} 
}
}
function whichElement(e, pointer) {
var targ;
if (!e) {
var e = window.event;
}
if (e.target) {
targ = e.target;
}
else if (e.srcElement) {
targ = e.srcElement;
}
if (targ.nodeType == 3) { // defeat Safari bug
targ = targ.parentNode;
}
var tname;
tname=targ.tagName;
if (targ.id == "wrapper") {
window.location = whitelabel;
}
if (targ.id == "bodywhitelabel") {
window.location = whitelabel;
}
}
function colorLabel( oInput ) {
if (oInput == null) { oInput = this; }
if (document.getElementById( 'label_' + oInput.id ) != null) {
if (oInput.type == 'checkbox') {
document.getElementById( 'label_' + oInput.id ).style.color = (oInput.checked) ? '#008000' : '';
} else if (oInput.type == 'radio') {
for (var i = 0; i < eval( 'oInput.form.' + oInput.name + '.length' ); i++) {
if (document.getElementById( 'label_' + eval( 'oInput.form.' + oInput.name + '[' + i + '].id' ) ) != null) {
document.getElementById( 'label_' + eval( 'oInput.form.' + oInput.name + '[' + i + '].id' ) ).style.color = '';
}
}
document.getElementById( 'label_' + oInput.id ).style.color = '#008000';
}
}
}
function displayFlash( sDivId, sImage, sLeft, sRight, sKeyword, sQuery ) {
var nWidth = 0, nHeight = 0;
if (sImage.search( /ntk_header_/ ) != -1) { nWidth = 755; nHeight = 100; }
if (sImage.search( /ntk_footer_/ ) != -1) { nWidth = 755; nHeight = 160; }
if (sImage == 'ntk_logo_default.swf')     { nWidth = 240; nHeight = 50; }
if (sImage == 'ntk_footer_1.swf') { nHeight = 100; }
if (sImage == 'wmr_signup.swf')   { nWidth = 500; nHeight = 40; }
var sURL  = 'http://fr.wedoo.com/images/swf/common/' + sImage;
var so = new SWFObject(sURL, sDivId, nWidth, nHeight, "8");
so.addParam("quality", "high");
so.addParam("menu", "false");
so.addParam("allowScriptAccess", "always");
so.addVariable("headerUrl", "document.location");
if( sLeft != null && sLeft != '' ){
so.addVariable("msgLeft", sLeft.replace( /&/g, '%26' ));
}
if( sRight != null && sRight != '' ){
so.addVariable("msgRight", sRight );
}
if( sKeyword != null && sKeyword != '' ){
so.addVariable("txtKeyword", sKeyword);
}
if( sQuery != null && sQuery != '' ){
so.addVariable("query", sQuery.replace( /&/g, '%26' ));
}
so.addVariable("lang", 'fr' );
so.write(sDivId);
}
function displaySidebar( sDivId, sFileXML, nHeight, nIndexID, sQuery ) {
var sURL  = 'http://fr.wedoo.com/images/swf/common/ntk_sidebar.swf';
var so = new SWFObject(sURL, sDivId, 139, nHeight, "8");
so.addParam("quality", "high");
so.addParam("scale", "noscale");
so.addParam("menu", "false");
so.addParam("allowScriptAccess", "always");
so.addVariable("fileXML", 'http://fr.wedoo.com/' + sFileXML );
if( nIndexID != null ){
so.addVariable("idxOpen", nIndexID);
}
if( sQuery != null && sQuery != '' ){
so.addVariable("query", sQuery.replace( /&/g, '%26' ) );
}
so.addVariable("ntkPath", 'http://fr.wedoo.com/' )
so.write(sDivId);
}
function openBid( sKeyword ) {
var sWinURL    = 'http://uv.bidtool.overture.com/d/search/tools/bidtool/?Keywords=' + sKeyword + '&mkt=fr&lang=fr_FR';
var sWinHandle = 'winBid';
var sWinAttr   = 'scrollbars,resizable,width=350,height=600,left=300,top=150';
var winNew = window.open( sWinURL, sWinHandle, sWinAttr );
winNew.focus();
}
function openHelp( nHelpID, sPathOffset, sLanguage ) {
var sURLBase = (sLanguage == null) ? '../../cgi-bin/' : 'http://' + sLanguage + '.wedoo.com/cgi-bin/';
if (nHelpID != null) {
var sWinURL    = ((sPathOffset != null) ? sPathOffset : '') + sURLBase + 'user/user_help.cgi?helpid=' + nHelpID;
var sWinHandle = 'winHelp';
var sWinAttr   = 'width=250,height=180,left=275,top=200';
if (nHelpID == 12) { sWinAttr = 'width=620,height=640,left=350,top=150'; }
if (nHelpID == 13) { sWinAttr = 'width=580,height=180,left=350,top=150'; }
var winNew = window.open( sWinURL, sWinHandle, sWinAttr );
winNew.focus();
}
}
function openStats( nOriginID, nSiteID, sPathOffset ) {
var sWinURL    = ((sPathOffset != null) ? sPathOffset : '') + '../../cgi-bin/surfer/surfer_sitestats.cgi?originid=' + nOriginID + '&siteid=' + nSiteID;
var sWinHandle = 'winStats';
var sWinAttr   = 'width=435,height=240,left=200,top=150'; 
var winNew = window.open( sWinURL, sWinHandle, sWinAttr );
winNew.focus();
}
function openSurfer( sMode, sPathOffset ) {
if (document.frmSurferEmail.txtEmail.value == '' ||
document.frmSurferEmail.txtEmail.value == null ||
document.frmSurferEmail.txtEmail.value.length > 60 ||
document.frmSurferEmail.txtEmail.value.search( /^[\w\.\-]+@[\w\.\-]+\.[\w\.\-]+$/ ) == -1) {
alert( 'Veuillez\x20S\x2EV\x2EP\x2E\x20choisisser\x20un\x20destinataire\x2E' );
document.frmSurferEmail.txtEmail.focus();
rc = false;
} else {
var sWinURL    = ((sPathOffset != null) ? sPathOffset : '') + '../../cgi-bin/surfer/surfer_profile.cgi?sbtProfile=insert&txtEmail=' + document.frmSurferEmail.txtEmail.value; 
var sWinHandle = 'winSurfer';
var winNew = window.open( sWinURL, sWinHandle );
winNew.focus();
}
if (sMode == 'enter') { return false; }
}
function openTerms() {
var sWinURL    = '../../cgi-bin/webmaster/webmaster_terms.cgi';
var sWinHandle = 'winTerms';
var sWinAttr   = 'scrollbars,resizable,width=800,height=400,left=100,top=100'; 
var winNew = window.open( sWinURL, sWinHandle, sWinAttr );
winNew.focus();
}
function search( sMode, frmThis, sPathOffset ) {
var rc = true;
if (frmThis.txtKeyword.value == '' ||
frmThis.txtKeyword.value == null ||
frmThis.txtKeyword.value.search( /^ *$/ ) != -1) {
alert( '' );
frmThis.txtKeyword.value = '';
frmThis.txtKeyword.focus();
rc = false;
}
frmThis.action = ((sPathOffset != null) ? sPathOffset : '') + '../../cgi-bin/surfer/surfer_search.cgi?txtKeyword=' + frmThis.txtKeyword.value;
frmThis.method = 'get';
if (sMode == 'enter') { return rc; }
if (sMode == 'click' && rc == true) { frmThis.submit(); }
}
