if(typeof addinto_auto_close=='undefined' || addinto_auto_close=='1') var addinto_auto_close = ' onmouseout="addinto_start_timer();"';
else if(addinto_auto_close=='0') var addinto_auto_close = '';

document.write('<div id="addintoDropDown"'+addinto_auto_close+' onmouseover="addinto_stop_timer();" style="z-index: 9999999; position: absolute; background-color: #ffffff; border: 5px solid #999999; display: none;"><div style="margin: 0px; padding: 0px;" id="addintoContentF"></div></div>');

if(typeof oldEvt=='undefined')
{
var oldEvt=window.onload;
window.onload=function()
{
if(oldEvt) oldEvt();
newEvt();
};
function newEvt()
{
document.body.appendChild(document.getElementById('addintoDropDown'));
}
if(!oldEvt)
{
oldEvt='';
}
}

function addinto_show(a, addinto_title, addinto_url)
{
button_image = a.getElementsByTagName("img");
button_src = button_image[0].getAttribute('src');
button_url = button_src.substring(button_src.indexOf('&url=')+5, button_src.indexOf('&type='));

if(button_image && button_image[0])
{
a = button_image[0];
}

if(typeof addinto_url=='undefined' || addinto_url=='') var addinto_url = encodeURIComponent(window.location.href);
if(typeof addinto_title=='undefined' || addinto_title=='') var addinto_title = encodeURIComponent(document.title);
if(typeof addinto_type=='undefined' || addinto_type=='') addinto_type = 'item';
if(typeof addinto_lg=='undefined' || addinto_lg=='') addinto_lg_1 = ''; else addinto_lg_1 = '&lg='+addinto_lg;
if(typeof addinto_lng=='undefined' || addinto_lng=='') addinto_lng_1 = ''; else addinto_lng_1 = '&lng='+addinto_lng;


var r=addinto_getAbsolutePosition(a);
if((r.y+230)>(addinto_getViewportHeight()+addinto_getScrollTop()))
{
document.getElementById("addintoDropDown").style.top=(r.y-220)+'px';
}
else
{
document.getElementById("addintoDropDown").style.top=(r.y+20)+'px';
}
if((r.x+390)>(addinto_getViewportWidth()+addinto_getScrollLeft()))
{
document.getElementById("addintoDropDown").style.left=(addinto_getViewportWidth()+addinto_getScrollLeft()-390)+'px';
}
else
{
document.getElementById("addintoDropDown").style.left=r.x+'px';
}
if(document.getElementById('addintoDropDown').style.display=='none')
{
if(typeof ai_hide_f!='undefined' && ai_hide_f == '1') showHideF('embed','hidden');
document.getElementById("addintoContentF").innerHTML='<a href="#" onclick="addinto_close_menu(); return false;"><img src="http://www.addinto.com/imgs/close.gif" style="border:0; float:right; position:absolute; top:0; right:0; margin:0; padding:0;" /></a><iframe src="http://www.addinto.com/add?url='+addinto_url+'&title='+addinto_title+'&type='+addinto_type+addinto_lg_1+addinto_lng_1+'&dropdown=yes" name="addinto_iframe" id="addinto_iframe" scrolling="no" frameborder="0" width="350" height="210" frameBorder="0"></iframe>';
document.getElementById("addintoDropDown").style.display="block";
addinto_stop_timer();
} else {
if(typeof ai_hide_f!='undefined' && ai_hide_f == '1') showHideF('embed','hidden');
addinto_stop_timer();
}

document.onLoad = function() {
document.getElementById('addintoDropDown').onClick = addinto_pop_win(addinto_url, addinto_title);
}
}

function addinto_pop_win(addinto_title, addinto_url)
{
if(typeof addinto_url=='undefined' || addinto_url=='') var addinto_url = encodeURIComponent(window.location.href);
if(typeof addinto_title=='undefined' || addinto_title=='') var addinto_title = encodeURIComponent(document.title);
if(typeof addinto_type=='undefined' || addinto_type=='') addinto_type = 'item';
if(typeof addinto_lg=='undefined' || addinto_lg=='') addinto_lg_1 = ''; else addinto_lg_1 = '&lg='+addinto_lg;
if(typeof addinto_lng=='undefined' || addinto_lng=='') addinto_lng_1 = ''; else addinto_lng_1 = '&lng='+addinto_lng;

url='http://www.addinto.com/add?url='+addinto_url+'&title='+addinto_title+'&type='+addinto_type+addinto_lg_1+addinto_lng_1;
window.open(url, "AddInto", "location=no, resizable=yes, scrollbars=yes, toolbar=no, menubar=no, status=no, width=533, height=335, left="+(screen.width-530)/2+", top="+(screen.height-340)/2);
return false;
}

function addinto_close_menu()
{
//document.getElementById('addintoDropDown').style.left = -screen.width*100+'px';
document.getElementById('addintoDropDown').style.display = 'none';
if(typeof ai_hide_f!='undefined' && ai_hide_f == '1') showHideF('embed','visible');
if(typeof ctime!='undefined')
{
clearTimeout(ctime);
}
}

function addinto_start_timer()
{
ctime=setTimeout('addinto_close_menu()',500);
}

function addinto_stop_timer()
{
if(typeof ctime!='undefined')
{
clearTimeout(ctime);
}
}

function addinto_getAbsolutePosition(a)
{
var b={x:a.offsetLeft,y:a.offsetTop};
if(a.offsetParent)
{
var c=addinto_getAbsolutePosition(a.offsetParent);
b.x+=c.x;
b.y+=c.y;
}
return b;
}

function addinto_getViewportWidth()
{
if(typeof(window.innerWidth)=="number")
{
return window.innerWidth;
}
else
{
if(document.documentElement&&document.documentElement.clientWidth)
{
return document.documentElement.clientWidth;
}
else
{
if(document.body&&document.body.clientWidth)
{
return document.body.clientWidth;
}
else
{
return 0;
}
}
}
}

function addinto_getViewportHeight()
{
if(typeof(window.innerHeight)=="number")
{
return window.innerHeight;
}
else
{
if(document.documentElement&&document.documentElement.clientHeight)
{
return document.documentElement.clientHeight;
}
else
{
if(document.body&&document.body.clientHeight)
{
return document.body.clientHeight;
}
else
{
return 0;
}
}
}
}

function addinto_getScrollTop()
{
if(typeof(window.pageYOffset)=="number")
{
return window.pageYOffset;
}
else
{
if(document.body&&document.body.scrollTop)
{
return document.body.scrollTop;
}
else
{
if(document.documentElement&&document.documentElement.scrollTop)
{
return document.documentElement.scrollTop;
}
else
{
return 0;
}
}
}
}

function addinto_getScrollLeft()
{
if(typeof(window.pageXOffset)=="number")
{
return window.pageXOffset;
}
else
{
if(document.body&&document.body.scrollLeft)
{
return document.body.scrollLeft;
}
else
{
if(document.documentElement&&document.documentElement.scrollLeft)
{
return document.documentElement.scrollLeft;
}
else
{
return 0;
}
}
}
}

function showHideF(tagName,dispType)
{
var elements = document.getElementsByTagName(tagName);
var i = 0;
while (i < elements.length)
{
elements[i].style.visibility = dispType;
i++;
}
}if(typeof addinto_auto_close=='undefined' || addinto_auto_close=='1') var addinto_auto_close = ' onmouseout="addinto_start_timer();"';
else if(addinto_auto_close=='0') var addinto_auto_close = '';

document.write('<div id="addintoDropDown"'+addinto_auto_close+' onmouseover="addinto_stop_timer();" style="z-index: 9999999; position: absolute; background-color: #ffffff; border: 5px solid #999999; display: none;"><div style="margin: 0px; padding: 0px;" id="addintoContentF"></div></div>');

if(typeof oldEvt=='undefined')
{
var oldEvt=window.onload;
window.onload=function()
{
if(oldEvt) oldEvt();
newEvt();
};
function newEvt()
{
document.body.appendChild(document.getElementById('addintoDropDown'));
}
if(!oldEvt)
{
oldEvt='';
}
}

function addinto_show(a, addinto_title, addinto_url)
{
button_image = a.getElementsByTagName("img");
button_src = button_image[0].getAttribute('src');
button_url = button_src.substring(button_src.indexOf('&url=')+5, button_src.indexOf('&type='));

if(button_image && button_image[0])
{
a = button_image[0];
}

if(typeof addinto_url=='undefined' || addinto_url=='') var addinto_url = encodeURIComponent(window.location.href);
if(typeof addinto_title=='undefined' || addinto_title=='') var addinto_title = encodeURIComponent(document.title);
if(typeof addinto_type=='undefined' || addinto_type=='') addinto_type = 'item';
if(typeof addinto_lg=='undefined' || addinto_lg=='') addinto_lg_1 = ''; else addinto_lg_1 = '&lg='+addinto_lg;
if(typeof addinto_lng=='undefined' || addinto_lng=='') addinto_lng_1 = ''; else addinto_lng_1 = '&lng='+addinto_lng;


var r=addinto_getAbsolutePosition(a);
if((r.y+230)>(addinto_getViewportHeight()+addinto_getScrollTop()))
{
document.getElementById("addintoDropDown").style.top=(r.y-220)+'px';
}
else
{
document.getElementById("addintoDropDown").style.top=(r.y+20)+'px';
}
if((r.x+390)>(addinto_getViewportWidth()+addinto_getScrollLeft()))
{
document.getElementById("addintoDropDown").style.left=(addinto_getViewportWidth()+addinto_getScrollLeft()-390)+'px';
}
else
{
document.getElementById("addintoDropDown").style.left=r.x+'px';
}
if(document.getElementById('addintoDropDown').style.display=='none')
{
if(typeof ai_hide_f!='undefined' && ai_hide_f == '1') showHideF('embed','hidden');
document.getElementById("addintoContentF").innerHTML='<a href="#" onclick="addinto_close_menu(); return false;"><img src="http://www.addinto.com/imgs/close.gif" style="border:0; float:right; position:absolute; top:0; right:0; margin:0; padding:0;" /></a><iframe src="http://www.addinto.com/add?url='+addinto_url+'&title='+addinto_title+'&type='+addinto_type+addinto_lg_1+addinto_lng_1+'&dropdown=yes" name="addinto_iframe" id="addinto_iframe" scrolling="no" frameborder="0" width="350" height="210" frameBorder="0"></iframe>';
document.getElementById("addintoDropDown").style.display="block";
addinto_stop_timer();
} else {
if(typeof ai_hide_f!='undefined' && ai_hide_f == '1') showHideF('embed','hidden');
addinto_stop_timer();
}

document.onLoad = function() {
document.getElementById('addintoDropDown').onClick = addinto_pop_win(addinto_url, addinto_title);
}
}

function addinto_pop_win(addinto_title, addinto_url)
{
if(typeof addinto_url=='undefined' || addinto_url=='') var addinto_url = encodeURIComponent(window.location.href);
if(typeof addinto_title=='undefined' || addinto_title=='') var addinto_title = encodeURIComponent(document.title);
if(typeof addinto_type=='undefined' || addinto_type=='') addinto_type = 'item';
if(typeof addinto_lg=='undefined' || addinto_lg=='') addinto_lg_1 = ''; else addinto_lg_1 = '&lg='+addinto_lg;
if(typeof addinto_lng=='undefined' || addinto_lng=='') addinto_lng_1 = ''; else addinto_lng_1 = '&lng='+addinto_lng;

url='http://www.addinto.com/add?url='+addinto_url+'&title='+addinto_title+'&type='+addinto_type+addinto_lg_1+addinto_lng_1;
window.open(url, "AddInto", "location=no, resizable=yes, scrollbars=yes, toolbar=no, menubar=no, status=no, width=533, height=335, left="+(screen.width-530)/2+", top="+(screen.height-340)/2);
return false;
}

function addinto_close_menu()
{
//document.getElementById('addintoDropDown').style.left = -screen.width*100+'px';
document.getElementById('addintoDropDown').style.display = 'none';
if(typeof ai_hide_f!='undefined' && ai_hide_f == '1') showHideF('embed','visible');
if(typeof ctime!='undefined')
{
clearTimeout(ctime);
}
}

function addinto_start_timer()
{
ctime=setTimeout('addinto_close_menu()',500);
}

function addinto_stop_timer()
{
if(typeof ctime!='undefined')
{
clearTimeout(ctime);
}
}

function addinto_getAbsolutePosition(a)
{
var b={x:a.offsetLeft,y:a.offsetTop};
if(a.offsetParent)
{
var c=addinto_getAbsolutePosition(a.offsetParent);
b.x+=c.x;
b.y+=c.y;
}
return b;
}

function addinto_getViewportWidth()
{
if(typeof(window.innerWidth)=="number")
{
return window.innerWidth;
}
else
{
if(document.documentElement&&document.documentElement.clientWidth)
{
return document.documentElement.clientWidth;
}
else
{
if(document.body&&document.body.clientWidth)
{
return document.body.clientWidth;
}
else
{
return 0;
}
}
}
}

function addinto_getViewportHeight()
{
if(typeof(window.innerHeight)=="number")
{
return window.innerHeight;
}
else
{
if(document.documentElement&&document.documentElement.clientHeight)
{
return document.documentElement.clientHeight;
}
else
{
if(document.body&&document.body.clientHeight)
{
return document.body.clientHeight;
}
else
{
return 0;
}
}
}
}

function addinto_getScrollTop()
{
if(typeof(window.pageYOffset)=="number")
{
return window.pageYOffset;
}
else
{
if(document.body&&document.body.scrollTop)
{
return document.body.scrollTop;
}
else
{
if(document.documentElement&&document.documentElement.scrollTop)
{
return document.documentElement.scrollTop;
}
else
{
return 0;
}
}
}
}

function addinto_getScrollLeft()
{
if(typeof(window.pageXOffset)=="number")
{
return window.pageXOffset;
}
else
{
if(document.body&&document.body.scrollLeft)
{
return document.body.scrollLeft;
}
else
{
if(document.documentElement&&document.documentElement.scrollLeft)
{
return document.documentElement.scrollLeft;
}
else
{
return 0;
}
}
}
}

function showHideF(tagName,dispType)
{
var elements = document.getElementsByTagName(tagName);
var i = 0;
while (i < elements.length)
{
elements[i].style.visibility = dispType;
i++;
}
}
