// JavaScript Document var msg="" var dtCh= "-"; var minYear=1900; var maxYear=2100; var pendingOrders=''; $(document).ready(function() { $('.videolink .button').hover( function(){ $(this).parent().find('.tooltip').show() }, function(){ $(this).parent().find('.tooltip').hide() } ) $('.videolink2 .button2').hover( function(){ $(this).parent().find('.tooltip2').show() }, function(){ $(this).parent().find('.tooltip2').hide() } ) $('a.gbpopup').click( function () { return GB_show(this.title, this.href,610,991); return false; }); $('img.mouseover') .mouseover(function () { this.src = this.src.replace('_off', '_on'); }) .mouseout(function () { this.src = this.src.replace('_on', '_off'); }); if ($('.overlay-container').length > 0) { $('#overlay').show(); $('.overlay-container').css("margin-left","-" + $('.overlay-container').width()/2 + "px"); } $('.closebutton').click(function () { $('#overlay').hide(); $('.overlay-container').hide(); }); $('.commissionItem').click(function () { var orderId = $(this).data("orderid"); var isReturnOrder = $(this).data("isreturnorder"); var rowNumber = $(this).data("row"); if($('#trCommissionDetails_' + orderId + '_' + rowNumber).is(":visible")) { $('#trCommissionDetails_' + orderId + '_' + rowNumber).hide(); } else { var container = 'commissionDetails_' + orderId + '_' + rowNumber; var http_request = GetHttpRequest(); if(!http_request) return false; // Kan geen ajax component aanmaken. url = 'xml/getCommissionDetails.xml.asp?orderId='+ orderId + '&isReturnOrder=' + isReturnOrder http_request.onreadystatechange = function() { GetCommissionDetailsAJAXResult(http_request,container); }; http_request.open('GET', url, false); http_request.send(null); $('#trCommissionDetails_' + orderId + '_' + rowNumber).show(); } }); }) function GetCommissionDetailsAJAXResult(http_request, container){ if (http_request.readyState == 4) { if (http_request.status == 200) { var content = http_request.responseText; if(container!='') { if(document.getElementById(container)) document.getElementById(container).innerHTML = content; } } } } function isNumberKey(e) { var k; document.all ? k = e.keyCode : k = e.which; return ((k > 47 && k < 58 || k == 44 || k == 46)); } function mOn(obj) { var ext = obj.src.slice(-3) if(obj.src.indexOf('_o.'+ ext)==-1){ obj.src=obj.src.replace('.'+ ext,'_o.'+ ext) } } function mOut(obj) { var ext = obj.src.slice(-3) obj.src=obj.src.replace('_o.'+ext,'.'+ext) } function isNumberKey2(e) { var k; document.all ? k = e.keyCode : k = e.which; return ((k > 47 && k < 58 || k == 8)); } function cOn(td, color) { if(document.getElementById||(document.all && !(document.getElementById))) { td.style.backgroundColor= color; //td.style.cursor = 'pointer'; } } function cOut(td,color) { if(document.getElementById||(document.all && !(document.getElementById))) { td.style.backgroundColor= color; } } //All fields with id filled in are required fields. function checkform(obj) { if(obj== 'frmRegister'){ check_Username() } if(obj== 'frmProfile'){ check_Dealer() } var form=document.getElementById(obj); for(i=0;i "9"))) return false; } // All characters are numbers. return true; } function stripCharsInBag(s, bag){ var i; var returnString = ""; // Search through string's characters one by one. // If character is not in bag, append to returnString. for (i = 0; i < s.length; i++){ var c = s.charAt(i); if (bag.indexOf(c) == -1) returnString += c; } return returnString; } function daysInFebruary (year){ // February has 29 days in any year evenly divisible by four, // EXCEPT for centurial years which are not also divisible by 400. return (((year % 4 == 0) && ( (!(year % 100 == 0)) || (year % 400 == 0))) ? 29 : 28 ); } function DaysArray(n) { for (var i = 1; i <= n; i++) { this[i] = 31 if (i==4 || i==6 || i==9 || i==11) {this[i] = 30} if (i==2) {this[i] = 29} } return this } function isDate(dtStr){ var daysInMonth = DaysArray(12) var pos1=dtStr.indexOf(dtCh) var pos2=dtStr.indexOf(dtCh,pos1+1) var strDay=dtStr.substring(0,pos1) var strMonth=dtStr.substring(pos1+1,pos2) var strYear=dtStr.substring(pos2+1) strYr=strYear if (strDay.charAt(0)=="0" && strDay.length>1) strDay=strDay.substring(1) if (strMonth.charAt(0)=="0" && strMonth.length>1) strMonth=strMonth.substring(1) for (var i = 1; i <= 3; i++) { if (strYr.charAt(0)=="0" && strYr.length>1) strYr=strYr.substring(1) } month=parseInt(strMonth) day=parseInt(strDay) year=parseInt(strYr) if (strDay.length<1 || day<1 || day>31 || (month==2 && day>daysInFebruary(year)) || day > daysInMonth[month]){ msg = msg + '- '+ 'De door u gekozen datum is onjuist\n' //alert(msg); return false } return true } function printWishlist(id) { wleft = (screen.width - 640) / 2; wtop = (screen.height - 480) / 2; window.open("printWishlist.asp?id=" + id,null,"width=640,height=480,left="+wleft+",top="+wtop+",status=no,directories=no,toolbar=no,menubar=no,location=no,resizable=no,scrollbars=yes") } function printme() { var objOut = document.getElementById("output"); var out = objOut.innerHTML; var wh = window.open("","wh","width=660px,height=480px,scrollbars=yes"); wh.document.open(); var output = ''; output = ''+output+''+out+''; output += '<'+'script type="text/javascript">'; output += 'window.print();'; output += ''; wh.document.writeln(output); wh.document.close(); } var http_request = false; function check_Dealer() { http_request = false; var username = document.getElementById("username").value; var dealerid = document.getElementById("dealerid").value; if (window.XMLHttpRequest) { // Mozilla, Safari,... http_request = new XMLHttpRequest(); if (http_request.overrideMimeType) { http_request.overrideMimeType('text/xml'); } } else if (window.ActiveXObject) { // IE try { http_request = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { http_request = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) {} } } if (!http_request) { alert('Giving up :( Cannot create an XMLHTTP instance'); return false; } http_request.onreadystatechange = dealerUsername; http_request.open('GET', "xml/check_dealer.xml.asp?username="+username+"&dealerid="+dealerid, true); http_request.send(null); } function dealerUsername() { if (http_request.readyState == 4) { if (http_request.status == 200) { var xmldoc = http_request.responseXML; var root_node = xmldoc.getElementsByTagName('accept').item(0); if(root_node.firstChild.data==1){ alert(root_node.firstChild.data) msg= msg + "- " + "Deze gebruikersnaam is al in gebruik\n" alert(msg) document.getElementById('username').style.backgroundColor = "#FFCCCC"; document.getElementById('username').style.color = "#333333"; }else{ document.getElementById('username').style.backgroundColor = "#FFFFFF"; document.getElementById('username').style.color = "#333333"; } } else { alert('There was a problem with the request.'); } } } function submit_onclick(obj){ var msg='' var form = document.getElementById(obj) var spanObj = document.getElementById('articles') var allInputTags = spanObj.getElementsByTagName('INPUT'); var id for (var c=0; c