
if(typeof deconcept=="undefined"){var deconcept=new Object();}if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a){if(!document.getElementById){return;}this.DETECT_KEY=_a?_a:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(_1){this.setAttribute("swf",_1);}if(id){this.setAttribute("id",id);}if(w){this.setAttribute("width",w);}if(h){this.setAttribute("height",h);}if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true;}if(c){this.addParam("bgcolor",c);}var q=_7?_7:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var _c=(_8)?_8:window.location;this.setAttribute("xiRedirectUrl",_c);this.setAttribute("redirectUrl","");if(_9){this.setAttribute("redirectUrl",_9);}};deconcept.SWFObject.prototype={useExpressInstall:function(_d){this.xiSWFPath=!_d?"expressinstall.swf":_d;this.setAttribute("useExpressInstall",true);},setAttribute:function(_e,_f){this.attributes[_e]=_f;},getAttribute:function(_10){return this.attributes[_10];},addParam:function(_11,_12){this.params[_11]=_12;},getParams:function(){return this.params;},addVariable:function(_13,_14){this.variables[_13]=_14;},getVariable:function(_15){return this.variables[_15];},getVariables:function(){return this.variables;},getVariablePairs:function(){var _16=new Array();var key;var _18=this.getVariables();for(key in _18){_16[_16.length]=key+"="+_18[key];}return _16;},getSWFHTML:function(){var _19="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath);}_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\"";_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";var _1a=this.getParams();for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}var _1c=this.getVariablePairs().join("&");if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath);}_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\">";_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";var _1d=this.getParams();for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}var _1f=this.getVariablePairs().join("&");if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}_19+="</object>";}return _19;},write:function(_20){if(this.getAttribute("useExpressInstall")){var _21=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var n=(typeof _20=="string")?document.getElementById(_20):_20;n.innerHTML=this.getSWFHTML();return true;}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var _23=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var _26=3;while(axo){try{_26++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_26);_23=new deconcept.PlayerVersion([_26,0,0]);}catch(e){axo=null;}}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}}return _23;};deconcept.PlayerVersion=function(_29){this.major=_29[0]!=null?parseInt(_29[0]):0;this.minor=_29[1]!=null?parseInt(_29[1]):0;this.rev=_29[2]!=null?parseInt(_29[2]):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.major<fv.major){return false;}if(this.major>fv.major){return true;}if(this.minor<fv.minor){return false;}if(this.minor>fv.minor){return true;}if(this.rev<fv.rev){return false;}return true;};deconcept.util={getRequestParameter:function(_2b){var q=document.location.search||document.location.hash;if(_2b==null){return q;}if(q){var _2d=q.substring(1).split("&");for(var i=0;i<_2d.length;i++){if(_2d[i].substring(0,_2d[i].indexOf("="))==_2b){return _2d[i].substring((_2d[i].indexOf("=")+1));}}}return"";}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var _2f=document.getElementsByTagName("OBJECT");for(var i=_2f.length-1;i>=0;i--){_2f[i].style.display="none";for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[i][x]=function(){};}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true;}}if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id];};}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;var strMp3="";var strMp3Status="init";var strMp3Id="";function initMP3Play(strSWF,w,h){var divCont=document.getElementById('container');if(w<2&&divCont&&divCont.style.width&&divCont.style.width){w=parseInt(divCont.style.width);if(w<1)w=1;}
var soMp3Play=new SWFObject(strSWF,'jstest',w,h,'8');soMp3Play.addParam('allowscriptaccess','sameDomain');soMp3Play.addParam('allowfullscreen','false');soMp3Play.addVariable('width',w);soMp3Play.addVariable('height','1');soMp3Play.addVariable('javascriptid','jstest');soMp3Play.addVariable('enablejs','true');soMp3Play.write('container');}
function sendEvent(swf,typ,prm){thisMovie(swf).sendEvent(typ,prm);};function getUpdate(typ,pr1,pr2,swf){};function thisMovie(swf){if(navigator.appName.indexOf("Microsoft")!=-1){return window[swf];}else{return document[swf];}};function loadFile(swf,obj){thisMovie(swf).loadFile(obj);};function ebyMp3Play(x){sendEvent('jstest','playpause');strMp3Status='playing';strMp3Id=x;document.getElementById(x).innerHTML='<img src="'+tradebitURL('')+'/layout-graphics/play-stop.gif" alt="playing" title="playing" width="74" height="19" border="0">';}
function ebyMp3Stop(x){sendEvent('jstest','stop');strMp3Status='stop';document.getElementById(strMp3Id).innerHTML='<img src="'+tradebitURL('')+'/layout-graphics/play-start.gif" alt="play" title="play" width="74" height="19" border="0">';}
function ebyMp3(strFile,x){try{var divDebug=document.getElementById("debuglineLog");if(strFile!=strMp3){if(strMp3Status=='playing')ebyMp3Stop(x);loadFile('jstest',{file:strFile});strMp3=strFile;ebyMp3Play(x);}else{if(strMp3Status=='playing')ebyMp3Stop(x);else ebyMp3Play(x);}}catch(e){if(divDebug)alert(e);}}
function ebyMp3ActivateThePlayButtonsOnPage(strCartTxt){var arrPlayB=document.getElementsByTagName("img");var str="";for(var i=arrPlayB.length-1;i>=0;i--){if(arrPlayB[i].alt=="play button"){var aParent=arrPlayB[i].parentNode;aParent.style.visibility='visible';var arrRec=aParent.title.split(",");if(arrRec.length==3||arrRec.length==4){var idvVid=arrRec[0];var tagId=arrRec[1];var strUrl=arrRec[2];var nShowCart=arrRec.length==4?arrRec[3]:1;var strHtml="";if(strUrl.length>0){strHtml="\n<a href=\"javascript:ebyMp3('"+strUrl+"','"+tagId+"')\"><span id=\""+tagId+"\">"
+aParent.innerHTML
+"</span></a>\n";}else{strHtml="\n<span id=\""+tagId+"\" style=\"font-size: 14px; color: #020A02;\">"
+aParent.innerHTML.replace(/<img.*>/gi,'+')
+"</span>\n";}
if(strCartTxt&&nShowCart==1){var flyId=''+i+idvVid;strHtml="<a href=\"javascript:addToBasket('"+flyId+"','"+idvVid+"')\" id=\"slidingProduct"+flyId+"\" style=\"display: none; position: relative; left: 0px; top: -5px; background-color: #eeeeee;\" title=\"add single item into shopping cart\">["+strCartTxt+"]</a>"+strHtml;aParent.onmouseover=new Function('document.getElementById("slidingProduct'+flyId+'").style.display="inline"');aParent.onmouseout=new Function('document.getElementById("slidingProduct'+flyId+'").style.display="none"');}
aParent.innerHTML=strHtml;aParent.title='';}}}}
var nAjaxTransfers=0;var arrDivUrls=new Array();function ajaxLoad(strDiv,strQuery,strJSFunction){ajaxLoad(strDiv,strQuery,strJSFunction,false);}
function ajaxLoad(strDiv,strQuery,strJSFunction,showErrMsg){try{var divDebug=document.getElementById("debuglineLog");var req=(window.XMLHttpRequest)?new XMLHttpRequest():((window.ActiveXObject)?new ActiveXObject("Microsoft.XMLHTTP"):false);arrDivUrls[strDiv]=strQuery;strTradebitURL=tradebitURL();echo("ajaxLoad URL: "+strTradebitURL+"<a href=\""+strTradebitURL+"/ajax.php?"+strQuery+"\">/ajax.php</a>");echo("ajaxLoad("+strDiv+","+(strQuery.length<250?strQuery:strQuery.substr(0,250)+"...")+")");req.open("POST",strTradebitURL+"/ajax.php",true);req.setRequestHeader("Content-type","application/x-www-form-urlencoded;charset=UTF-8");req.setRequestHeader("Content-length",strQuery.length);req.setRequestHeader("Connection","close");req.onreadystatechange=function(){if(req.readyState==4){if(req.status==200||req.statusText=="OK"){if(document.getElementById(strDiv)&&document.getElementById(strDiv).innerHTML!=null){var nDebugPos=req.responseText.indexOf("<div name='ajaxDebug'>");var nErrPos=req.responseText.indexOf("<div name='ajaxError'>");try{document.getElementById(strDiv).ajaxErr=nErrPos>0?req.responseText.substr(nErrPos):'';}catch(e){;}
if(nDebugPos>0){echo(req.responseText.substr(nDebugPos));document.getElementById(strDiv).innerHTML=req.responseText.substr(0,nDebugPos);if(divDebug&&nErrPos>0)alert(req.responseText.substr(nErrPos));}else document.getElementById(strDiv).innerHTML=req.responseText;}else{if(showErrMsg)alert("bad div "+strDiv);}
nAjaxTransfers-=1;if(nAjaxTransfers==0)document.getElementById("div_transfergif").style.visibility="hidden";if(strJSFunction){setTimeout(strJSFunction,10);}}else{if(showErrMsg)alert("error "+req.statusText);}}}
req.send(strQuery);nAjaxTransfers+=1;if(nAjaxTransfers==1)document.getElementById("div_transfergif").style.visibility="visible";}catch(e){alert("ajaxLoad:"+e);}}
function echo(txt){var divDebug=document.getElementById("debuglineLog");if(divDebug){divDebug.innerHTML+=txt+"<BR />";};}
function setServerPath(str){document.serverPath=str;}
function tradebitURL(){if(document.serverPath)return document.serverPath;var strPosiblePathPart="/tradebit.com";var str=window.location.pathname;var pos=str.indexOf(strPosiblePathPart);if(pos>=0)str=str.substr(0,pos+strPosiblePathPart.length);else str="";if(window.location.port==80||window.location.port==443)strPort=':80';else strPort='';fSslBecauseOfPwd=false;return(fSslBecauseOfPwd?'https:':window.location.protocol)+"//"+window.location.host+strPort+str;}
function selBoxValues(el,fOnlySelected){if(fOnlySelected==null)fOnlySelected=true;if(typeof(el)=="string"){var arr=document.getElementsByName(el);if(arr&&arr.length==1){elObj=arr[0];}
else{elObj=document.getElementById(el);if(!elObj)alert(el+" not found");}}else elObj=el;if(elObj==null)return alert("wrong selBoxValues(el="+el+", "+elObj+")");var r="";var l=elObj.options.length;for(i=0;i<l;i++){if(!fOnlySelected||elObj.options[i].selected){r+=(r!=""?",":"")+elObj.options[i].value;}}
return r;}
function addOrReplaceQueryParam(strUrlParams,strParamName,strParamValue){var nPos=(strUrlParams.indexOf(strParamName+'=')==0)?0:(strUrlParams.indexOf('&'+strParamName+'=')>-1?strUrlParams.indexOf('&'+strParamName+'=')+1:0);if(nPos>-1){var strRight=strUrlParams.substr(nPos+1);var strLeft=nPos==0?"":strUrlParams.substr(0,nPos-1);var nPos2=strRight.indexOf('&');if(nPos2>0)strRight=strRight.substr(nPos2);strUrlParams=strLeft+(nPos2>0?strRight:'');}
return strUrlParams
+(strUrlParams.lastIndexOf("&")!=strUrlParams.length-1?"&":"")
+strParamName+"="+encodeURIComponent(strParamValue)+"&";}
function connectDivElement(el,divId,strDivParamName){var query=arrDivUrls[divId];if(!query){alert("Old div '"+divId+"' URL string not defined. Was div not loaded by ajaxLoad?")
return;}
var ids=selBoxValues(el);if(!ids||ids=="")return;var arrParamReplace=new Array();arrParamReplace[strDivParamName]=ids;arrParamReplace["preselection"]="";refreshElement(divId,arrParamReplace);}
function connectFormWithSpan(formId,divId){var formElement=document.getElementById(formId);var arrParamReplace=new Array();var v;for(var i=0;i<formElement.length;i++){var e=formElement.elements[i];if(e.name&&e.name!=""&&!e.disabled){v=null;if("hidden/text".indexOf(e.type)!=-1)v=e.value;else if("hidden/password".indexOf(e.type)!=-1)v=e.value;else if("textarea".indexOf(e.type)!=-1)v=e.value;else if("select-one".indexOf(e.type)!=-1)v=selBoxValues(e);else if("checkbox".indexOf(e.type)!=-1)v=e.checked?e.value:"";else if("radio".indexOf(e.type)!=-1&&e.checked)v=e.value;else if("file".indexOf(e.type)!=-1)v=e.value?e.value:"";if(v!=null)arrParamReplace[e.name]=v;}}
var query=arrDivUrls[divId];if(!query){alert("Old div '"+divId+"' URL string not defined. Was div not loaded by ajaxLoad?")
return;}
refreshElement(divId,arrParamReplace);}
function refreshElement(elementId,arrParams){var query=arrDivUrls[elementId];if(!query){alert("refreshElement('"+elementId+"'): Element was not filled by ajaxLoad()!")
return;}
newquery=query;if(arrParams){for(var strParamName in arrParams){newquery=addOrReplaceQueryParam(newquery,strParamName,arrParams[strParamName]);}}
var el=document.getElementById(elementId);for(var i=0;i<el.childNodes.length;i++){var t=el.childNodes[i].type;if(t&&t.indexOf("select")!=-1){try{el.childNodes[i].options[0]=new Option("loading...","",false,false);el.childNodes[i].length=1;}catch(a){;}
break;}}
if(newquery!=""){ajaxLoad(elementId,newquery);}else alert("refreshElement("+elementId+" bad parameter.");}
function buildQuery(formElement){var q="";for(var i=0;i<formElement.length;i++){var e=formElement.elements[i];if(e.name&&e.name!=""&&!e.disabled){var v="";if("hidden/text".indexOf(e.type)!=-1)v=e.value;else if("hidden/password".indexOf(e.type)!=-1)v=e.value;else if("textarea".indexOf(e.type)!=-1)v=e.value;else if("select-one".indexOf(e.type)!=-1)v=selBoxValues(e);else if("checkbox".indexOf(e.type)!=-1)v=e.checked?e.value:"";else if("radio".indexOf(e.type)!=-1&&e.checked)v=e.value;else if("file".indexOf(e.type)!=-1)v=e.value?e.value:"";if(v!="")q+=(q!=""?"&":"")+e.name+"="+encodeURIComponent(v);}}
if(q!="")q+="&umlaut="+encodeURIComponent("äüß");return q;}
function fgrpFolder(id)
{var el=document.getElementById('side_'+id);var pl=document.getElementById('submenu_'+id);if(!el)return alert('side_'+id);if(!pl)return alert("submenu_"+id);if(el.style.display=="none"){el.style.display="block";pl.className='show';if((typeof ajaxLoad=='function')&&(el.innerHTML.search(/li/i)<0)){el.innerHTML='<li><a href="#">loading</a></li>';ajaxLoad('side_'+id,"ajaxtask=catnavSubfilegroups&parentId="+id,"",true)}}else{el.style.display="none";pl.className='ul';}}
function requestParamFailedMark(arrNames,strStyleAttr,strStyleValue){var arrForms=document.getElementsByTagName('form');var f,j,i,b,e,fFirst=true;for(i=0;i<arrForms.length;i++){f=arrForms[i];for(j=0;j<f.elements.length;j++){e=f.elements[j];if(e.name&&e.name!=""&&!e.disabled&&e.type!="hidden"){for(b=0;b<arrNames.length;b++){if(e.name==arrNames[b]){e.style[strStyleAttr]=strStyleValue;if(fFirst){try{e.focus();}catch(e){;};fFirst=false;}}}}}}}
function w(a){document.write(a);};function a(a,b){w("<a h"+"re"+"f=\""+a+"\" "+b+">");};function ac(){w("<"+"/a"+">");}
function addPost(elementA,str){if(!document.getElementById('formAddPost')){return document.getElementById("debuglineLog")?alert('form with id=formAddPost missing'):true;}
if(!elementA.hrefOrg){elementA.hrefOrg=elementA.href;elementA.href='javascript:;';}
document.getElementById('formAddPost').action=elementA.hrefOrg;document.getElementById('inputPostData').value=str;document.getElementById('formAddPost').submit();}
function submitSrch(formEl){try{var fgrpId=("select-one".indexOf(formEl.filtercat.type)!=-1)?selBoxValues(formEl.filtercat):formEl.filtercat.value;var str=formEl.elements['keywords'].value;str=encodeURI(str.toLowerCase().replace(/[\#\?\/\&\\\'\'*+\%,._;:\(\)\[\$\]=]/g,' ')).replace(/[%]2[02]/g,' ').replace(/[ ][ ]*/g,'+').replace(/[\+]$/g,'');var e=tradebitURL()+'/filesharing.php/search/0/'
+str
+(fgrpId?'/0/'+formEl.filtercat.value:'');window.location.href=e;}catch(e){alert("ajaxLoad:"+e);}
return false;}
greyboxMyShow=function(caption,url,height,width,callback_fn){var options={caption:caption,height:height||500,width:width||500,fullscreen:false,overlay_click_close:true,show_loading:false,center_win:true,callback_fn:callback_fn};var win=new GB_Window(options);return win.show(url);}
function sack(file){this.xmlhttp=null;this.resetData=function(){this.method="POST";this.queryStringSeparator="?";this.argumentSeparator="&";this.URLString="";this.encodeURIString=true;this.execute=false;this.element=null;this.elementObj=null;this.requestFile=file;this.vars=new Object();this.responseStatus=new Array(2);};this.resetFunctions=function(){this.onLoading=function(){};this.onLoaded=function(){};this.onInteractive=function(){};this.onCompletion=function(){};this.onError=function(){};this.onFail=function(){};};this.reset=function(){this.resetFunctions();this.resetData();};this.createAJAX=function(){try{this.xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");}catch(e1){try{this.xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");}catch(e2){this.xmlhttp=null;}}
if(!this.xmlhttp){if(typeof XMLHttpRequest!="undefined"){this.xmlhttp=new XMLHttpRequest();}else{this.failed=true;}}};this.setVar=function(name,value){this.vars[name]=Array(value,false);};this.encVar=function(name,value,returnvars){if(true==returnvars){return Array(encodeURIComponent(name),encodeURIComponent(value));}else{this.vars[encodeURIComponent(name)]=Array(encodeURIComponent(value),true);}}
this.processURLString=function(string,encode){encoded=encodeURIComponent(this.argumentSeparator);regexp=new RegExp(this.argumentSeparator+"|"+encoded);varArray=string.split(regexp);for(i=0;i<varArray.length;i++){urlVars=varArray[i].split("=");if(true==encode){this.encVar(urlVars[0],urlVars[1]);}else{this.setVar(urlVars[0],urlVars[1]);}}}
this.createURLString=function(urlstring){if(this.encodeURIString&&this.URLString.length){this.processURLString(this.URLString,true);}
if(urlstring){if(this.URLString.length){this.URLString+=this.argumentSeparator+urlstring;}else{this.URLString=urlstring;}}
this.setVar("rndval",new Date().getTime());urlstringtemp=new Array();for(key in this.vars){if(false==this.vars[key][1]&&true==this.encodeURIString){encoded=this.encVar(key,this.vars[key][0],true);delete this.vars[key];this.vars[encoded[0]]=Array(encoded[1],true);key=encoded[0];}
urlstringtemp[urlstringtemp.length]=key+"="+this.vars[key][0];}
if(urlstring){this.URLString+=this.argumentSeparator+urlstringtemp.join(this.argumentSeparator);}else{this.URLString+=urlstringtemp.join(this.argumentSeparator);}}
this.runResponse=function(){eval(this.response);}
this.runAJAX=function(urlstring){if(this.failed){this.onFail();}else{this.createURLString(urlstring);if(this.element){this.elementObj=document.getElementById(this.element);}
if(this.xmlhttp){var self=this;if(this.method=="GET"){totalurlstring=this.requestFile+this.queryStringSeparator+this.URLString;this.xmlhttp.open(this.method,totalurlstring,true);}else{this.xmlhttp.open(this.method,this.requestFile,true);try{this.xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded")}catch(e){}}
this.xmlhttp.onreadystatechange=function(){switch(self.xmlhttp.readyState){case 1:self.onLoading();break;case 2:self.onLoaded();break;case 3:self.onInteractive();break;case 4:self.response=self.xmlhttp.responseText;self.responseXML=self.xmlhttp.responseXML;self.responseStatus[0]=self.xmlhttp.status;self.responseStatus[1]=self.xmlhttp.statusText;if(self.execute){self.runResponse();}
if(self.elementObj){elemNodeName=self.elementObj.nodeName;elemNodeName.toLowerCase();if(elemNodeName=="input"||elemNodeName=="select"||elemNodeName=="option"||elemNodeName=="textarea"){self.elementObj.value=self.response;}else{self.elementObj.innerHTML=self.response;}}
if(self.responseStatus[0]=="200"){self.onCompletion();}else{self.onError();}
self.URLString="";break;}};this.xmlhttp.send(this.URLString);}}};this.reset();this.createAJAX();}
var flyingSpeed=40;var url_addProductToBasket='snippets/addProduct.php';var url_removeProductFromBasket='removeProduct.php';var txt_totalPrice='Total: ';var shopping_cart_div=false;var flyingDiv=false;var currentProductDiv=false;var shopping_cart_x=false;var shopping_cart_y=false;var slide_xFactor=false;var slide_yFactor=false;var diffX=false;var diffY=false;var currentXPos=false;var currentYPos=false;var ajaxObjects=new Array();function shoppingCart_getTopPos(inputObj)
{var returnValue=inputObj.offsetTop;while((inputObj=inputObj.offsetParent)!=null){if(inputObj.tagName!='HTML')returnValue+=inputObj.offsetTop;}
return returnValue;}
function shoppingCart_getLeftPos(inputObj)
{var returnValue=inputObj.offsetLeft;while((inputObj=inputObj.offsetParent)!=null){if(inputObj.tagName!='HTML')returnValue+=inputObj.offsetLeft;}
return returnValue;}
function addToBasket(slideP,productId)
{if(!shopping_cart_div)shopping_cart_div=document.getElementById('shopping_cart');if(!flyingDiv){flyingDiv=document.createElement('DIV');flyingDiv.style.position='absolute';document.body.appendChild(flyingDiv);}
ajaxAddProduct(productId);shopping_cart_x=shoppingCart_getLeftPos(shopping_cart_div);shopping_cart_y=shoppingCart_getTopPos(shopping_cart_div);currentProductDiv=document.getElementById('slidingProduct'+slideP);currentXPos=shoppingCart_getLeftPos(currentProductDiv);currentYPos=shoppingCart_getTopPos(currentProductDiv);diffX=shopping_cart_x-currentXPos;diffY=shopping_cart_y-currentYPos;var shoppingContentCopy=currentProductDiv.cloneNode(true);shoppingContentCopy.id='';flyingDiv.innerHTML='';flyingDiv.style.left=currentXPos+'px';flyingDiv.style.top=currentYPos+'px';flyingDiv.appendChild(shoppingContentCopy);flyingDiv.style.display='block';flyingDiv.style.width=currentProductDiv.offsetWidth+'px';flyToBasket(productId);}
function flyToBasket(productId)
{var maxDiff=Math.max(Math.abs(diffX),Math.abs(diffY));var moveX=(diffX/maxDiff)*flyingSpeed;;var moveY=(diffY/maxDiff)*flyingSpeed;currentXPos=currentXPos+moveX;currentYPos=currentYPos+moveY;flyingDiv.style.left=Math.round(currentXPos)+'px';flyingDiv.style.top=Math.round(currentYPos)+'px';if(moveX>0&&currentXPos>shopping_cart_x){flyingDiv.style.display='none';}
if(moveX<0&&currentXPos<shopping_cart_x){flyingDiv.style.display='none';}
if(flyingDiv.style.display=='block')setTimeout('flyToBasket("'+productId+'")',5);}
function showAjaxBasketContent(ajaxIndex)
{var productItems=ajaxObjects[ajaxIndex].response.split('|||');var cartHtml=productItems[0]
document.getElementById('shopping_cart').innerHTML=cartHtml;ajaxObjects[ajaxIndex]=false;}
function updateTotalPrice()
{var itemBox=document.getElementById('shopping_cart_items');var totalPrice=0;if(document.getElementById('shopping_cart_totalprice')){for(var no=1;no<itemBox.rows.length;no++){totalPrice=totalPrice+(itemBox.rows[no].cells[0].innerHTML.replace(/[^0-9]/g)*itemBox.rows[no].cells[2].innerHTML);}
document.getElementById('shopping_cart_totalprice').innerHTML=txt_totalPrice+totalPrice.toFixed(2);}}
function removeProductFromBasket(productId)
{var productRow=document.getElementById('shopping_cart_items_product'+productId);var numberOfItemCell=productRow.cells[0];if(numberOfItemCell.innerHTML=='1'){productRow.parentNode.removeChild(productRow);}else{numberOfItemCell.innerHTML=numberOfItemCell.innerHTML/1-1;}
updateTotalPrice();ajaxRemoveProduct(productId);}
function ajaxValidateRemovedProduct(ajaxIndex)
{if(ajaxObjects[ajaxIndex].response!='OK')alert('Error while removing product from the database');}
function ajaxRemoveProduct(productId)
{var ajaxIndex=ajaxObjects.length;ajaxObjects[ajaxIndex]=new sack();ajaxObjects[ajaxIndex].requestFile=url_removeProductFromBasket+'?productIdToRemove='+productId;ajaxObjects[ajaxIndex].onCompletion=function(){ajaxValidateRemovedProduct(ajaxIndex);};ajaxObjects[ajaxIndex].runAJAX();}
function ajaxAddProduct(productId)
{var ajaxIndex=ajaxObjects.length;ajaxObjects[ajaxIndex]=new sack();ajaxObjects[ajaxIndex].requestFile=url_addProductToBasket+'?productId='+productId;ajaxObjects[ajaxIndex].onCompletion=function(){showAjaxBasketContent(ajaxIndex);};ajaxObjects[ajaxIndex].runAJAX();}