// JavaScript Document

/***********************************************
* Link Floatie script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

var floattext=new Array()
floattext[0]='<font color="red">Limit 2000 characters.</font> Any additional characters will be truncated. If you paste text please place cursor in textbox and hit Enter to see Limit % and submit changes.<br><div align="right"><a href="javascript:hidefloatie()">Hide Box</a></div>'
floattext[1]='<font color="red"><b>Why are keywords important?</b></font><br/> Because prospective buyer will find your listing in Google, Yahoo and MSN search engines 10 times faster.<br><br><b>Samples</b> <font color="red">(Keywords must be separated by coma):</font><br />Auto parts, used cars, used auto, cars for sale,  used trucks, auto,  automotive, auto accessories, new cars, motors, car accessories, used car for sale, sell car, buy a car,  buy used car, sell used car, autos, vehicles, make of your car, model etc.<br><div align="right"><a href="javascript:hidefloatie()">Hide Box</a></div>'
floattext[2]='Only works with YouTube. Copy Embed code from YouTube and Paste into Text Field.<br>Go to YouTube <a href="http://www.youtube.com/login?next=/" target="_blank">Click Here</a><br><div align="right"><a href="javascript:hidefloatie()">Hide Box</a></div>'
floattext[3]='Upload image(s) in 3 Steps. <br/><br/><font color="blue">First Step:</font> For each image you wish to upload, click <b>Browse</b> and locate the file from your local computer;<br/><font color="blue"> Second Step:</font> Click the <b>Upload</b> button (after you Browse all images) to start uploading your file(s);<br/> <font color="blue">Third Step:</font> Click the <b>Preview</b>button. <br/><br/>The file size limit 4 MB. If your upload does not work, try uploading a smaller picture. If you need to optimize your images <a href="http://tools.dynamicdrive.com/imageoptimizer/" target="_blank">Click Here.</a><br/><br/><font color="red"><b>NOTE:</b></font> You can upload: JPG, GIF or PNG files<br/><br/><div align="right"><a href="javascript:hidefloatie()">Hide Box</a></div>'
floattext[4]='Limit 400 characters. Any additional characters will be truncated.<br> If you paste text please place cursor in textbox and hit Enter to see Limit %.<br><div align="right"><a href="javascript:hidefloatie()">Hide Box</a></div>'
floattext[5]='In order to change image(s) you have to follow next steps. Click "Choose File" button, select the image that you would like to upload. Then click "Change" button. Repeat steps for each image that you would like to upload or replace. Finally click "Preview" button.<br/><br/><font color="red"><b>NOTE:</b></font> You can upload: JPG, GIF, TIFF, BMP or PNG files<br/><br/><div align="right"><a href="javascript:hidefloatie()">Hide Box</a></div>'

var floatiewidth="250px" //default width of floatie in px
var floatieheight="60px" //default height of floatie in px. Set to "" to let floatie content dictate height.
var floatiebgcolor="lightyellow" //default bgcolor of floatie
var fadespeed=70 //speed of fade (5 or above). Smaller=faster.

var baseopacity=0
function slowhigh(which2){
imgobj=which2
browserdetect=which2.filters? "ie" : typeof which2.style.MozOpacity=="string"? "mozilla" : ""
instantset(baseopacity)
highlighting=setInterval("gradualfade(imgobj)",fadespeed)
}

function instantset(degree){
cleartimer()
if (browserdetect=="mozilla")
imgobj.style.MozOpacity=degree/100
else if (browserdetect=="ie")
imgobj.filters.alpha.opacity=degree
}

function cleartimer(){
if (window.highlighting) clearInterval(highlighting)
}

function gradualfade(cur2){
if (browserdetect=="mozilla" && cur2.style.MozOpacity<1)
cur2.style.MozOpacity=Math.min(parseFloat(cur2.style.MozOpacity)+0.1, 0.99)
else if (browserdetect=="ie" && cur2.filters.alpha.opacity<100)
cur2.filters.alpha.opacity+=10
else if (window.highlighting)
clearInterval(highlighting)
}

function ietruebody(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function paramexists(what){
return(typeof what!="undefined" && what!="")
}

function showfloatie(thetext, e, optbgColor, optWidth, optHeight){
var dsocx=(window.pageXOffset)? pageXOffset: ietruebody().scrollLeft;
var dsocy=(window.pageYOffset)? pageYOffset : ietruebody().scrollTop;
var floatobj=document.getElementById("dhtmlfloatie")
floatobj.style.left="-900px"
floatobj.style.display="block"
floatobj.style.backgroundColor=paramexists(optbgColor)? optbgColor : floatiebgcolor
floatobj.style.width=paramexists(optWidth)? optWidth+"px" : floatiewidth
floatobj.style.height=paramexists(optHeight)? optHeight+"px" : floatieheight!=""? floatieheight : ""
floatobj.innerHTML=thetext
var floatWidth=floatobj.offsetWidth>0? floatobj.offsetWidth : floatobj.style.width
var floatHeight=floatobj.offsetHeight>0? floatobj.offsetHeight : floatobj.style.width
var winWidth=document.all&&!window.opera? ietruebody().clientWidth : window.innerWidth-20
var winHeight=document.all&&!window.opera? ietruebody().clientHeight : window.innerHeight
e=window.event? window.event : e
floatobj.style.left=dsocx+winWidth-floatWidth-5+"px"
if (e.clientX>winWidth-floatWidth && e.clientY+20>winHeight-floatHeight)
floatobj.style.top=dsocy+5+"px"
else
floatobj.style.top=dsocy+winHeight-floatHeight-5+"px"
slowhigh(floatobj)
}

function hidefloatie(){
var floatobj=document.getElementById("dhtmlfloatie")
floatobj.style.display="none"
}

