﻿
function ByggloLinkText() 
{
    document.write('<table cellpadding="0" cellspacing="0" border="0" style="margin:0px; padding:0px;">');
    document.write('<tr><td><a href="http://www.bygglo.se/" style="font-family:Verdana;text-decoration:none;color:#25417e;font-weight:bold;font-size:14px;line-height:16px;">Sök i Bygglo!</a></td></tr>');
    document.write('<tr><td><a href="http://www.bygglo.se/" style="font-family:Verdana;text-decoration:none;color:#000;font-weight:normal;font-size:8px;line-height:12px;">SÖKMOTORN FÖR BYGGSVERIGE</a></td></tr>');
    document.write('</table>');
}

function ByggloLinkImage() 
{
    document.write('<a href="http://www.bygglo.se/"><img src="http://www.bygglo.se/Images/Layout/ByggloOnYourSite1.gif" width="130" height="40" border="0" /></a>');    
}


function ByggloSearchFull(name) 
{
    if (name == null)
        name = '';

    document.write('<form action="http://www.bygglo.se/Search/" id="bygglo" method="get" style="padding:0px;margin:0px;">');
    document.write('<table cellpadding="0" cellspacing="0" style="padding:0px;margin:0px;border-bottom:1px solid #0066ff; background-color:#52c5eb">');
    document.write('<tr>');
    document.write('<td colspan="2"><a href="http://www.bygglo.se"><img src="http://www.bygglo.se/Images/Layout/byglloOnYourSite.gif" width="200" height="60" alt="Bygglo - Sökmotorn för byggsverige" border="0" /></a></td>');
    document.write('</tr>');
    document.write('<tr>');
    document.write('<td style="border-left:1px solid #0066ff;padding:5px 0px 5px 0px;margin:0px;" align="right"><input type="text" id="querystring" name="querystring" value="' + name + '" style="font-size:11px;color:#000000;font-family:verdana, helvetica, arial, sans-serif; width:140px;border:1px solid #000000; height:18px" /></td>');
    document.write('<td style="border-right:1px solid #0066ff;padding-right:5px;margin:0px;" align="left"><input type="image" value="Sök" id="" src="http://www.bygglo.se/Images/Layout/searchButtonOnYourSite.gif"  /></td>');
    document.write('</tr>');
    document.write('</table>');
    document.write('<input type="hidden" id="searchtype" name="searchtype" value="web" />');
    document.write('</form>');

}


function ByggloSearchSmall(name) 
{
    if (name == null)
        name = '';

    document.write('<form action="http://www.bygglo.se/Search/" id="bygglo" method="get" style="padding:0px;margin:0px;">');
    document.write('<table cellpadding="2" cellspacing="0" style="padding:0px;margin:0px;">');
    document.write('<tr>');
    document.write('<td>Sök på Bygglo:&nbsp;</td>');
    document.write('<td><input type="text" id="querystring" name="querystring" value="' + name + '" /></td>');
    document.write('<td><input type="submit" value="Sök" id="" /></td>');
    document.write('</tr>');
    document.write('</table>');
    document.write('<input type="hidden" id="searchtype" name="searchtype" value="web" />');
    document.write('</form>');

}



function ByggloSearchAdv(width, name, url) 
{
    if (width != null) 
    {
        if (typeof(width)=='number' && /^\d*$/.test(width.toString(10)))
        {
            //alert('ok');
        }
        else
        {
            width = 200;
        }
    } else {
        width = 200;
    }
    

    if (width <= 150)
    {
        image = 'byglloOnYourSiteWidth148';
        widthimage = 148;
        widthinput = 100;
        width = 148;
    }
    if (width <= 200)
    {
        image = 'byglloOnYourSiteWidth148';
        widthimage = 148;
        widthinput = width - 50;
    }
    else if (width > 500)
    {
        width = 500;
        widthinput = 450;
        image = 'byglloOnYourSiteWidth198';
        widthimage = 198;
    }
    else
    {
        widthinput = width - 50;
        image = 'byglloOnYourSiteWidth198';
        widthimage = 198;
    }
        
    if (name == null)
        name = '';
        
    if (url == null)
        url = '';        

    document.write('<form action="http://www.bygglo.se/Search/" id="bygglo" method="get" style="padding:0px;margin:0px;" target="_blank">');
    document.write('<table cellpadding="0" border="0" cellspacing="0" style="padding:0px;margin:0px;border:1px solid #0066ff; background-color:#52c5eb;width:' + width + 'px;overflow:hidden;">');
    document.write('<tr>');
    document.write('<td><a href="http://www.bygglo.se"><img src="http://www.bygglo.se/Images/Layout/' + image + '.gif" width="' + widthimage + '" height="60" alt="Bygglo - Sökmotorn för byggsverige" border="0" /></a></td>');
    document.write('</tr>');
    document.write('<tr>');
    
    document.write('<td><table cellpadding="0" cellspacing="0" border="0" style="padding:0px;margin:0px;border:0px;"><tr>')
        document.write('<td style="padding:5px 0px 5px 5px;margin:0px;" align="right"><input type="text" id="querystring" name="querystring" value="' + name + '" style="font-size:11px;color:#000000;font-family:verdana, helvetica, arial, sans-serif; width:' + widthinput + 'px;border:1px solid #000000; height:18px" /></td>');
        document.write('<td style="padding-right:5px;margin:0px;width:35px;" align="left"><input type="image" value="Sök" id="" src="http://www.bygglo.se/Images/Layout/searchButtonOnYourSite.gif"  /></td>');
    document.write('</td></tr></table></td>');
    
    document.write('</tr>');
    
    if (url != '')
    {
        document.write('<tr>');
        document.write('<td><table cellpadding="0" cellspacing="0" border="0" style="padding:0px;margin:0px 0px 5px 0px;border:0px;"><tr>')
            document.write('<td valign="top"><input type="radio" id="exsite" name="exsite" value="" checked /></td>');
            document.write('<td><span style="color:#ffffff;font-size:10px;font-family:verdana;">Hela Bygglo</span></td>');
            document.write('<td valign="top"><input type="radio" id="exsite" name="exsite" value="' + url + '" /></td>');
            document.write('<td><span style="color:#ffffff;font-size:10px;font-family:verdana;">Den här sajten</span></td>');
        document.write('</tr></table></td>');  
        document.write('</tr>');
    }
    
    document.write('</table>');
    document.write('<input type="hidden" id="searchtype" name="searchtype" value="web" />');
    document.write('</form>');

}



function ByggloSearchAdv2(width, name) 
{
    if (width != null) 
    {
        if (typeof(width)=='number' && /^\d*$/.test(width.toString(10)))
        {
            //alert('ok');
        }
        else
            width = 200;
    } 
    else 
        width = 200;
    

    if (width <= 175)
    {
        widthinput = 150;
        width = 175;
    }
    
    if (width <= 200)
        widthinput = width - 50;
    else 
        widthinput = width - 50;

    if (name == null)
        name = '';

    document.write('<form action="http://www.bygglo.se/Search/" id="bygglo" method="get" style="padding:0px;margin:0px;" target="_blank">');
    document.write('<table cellpadding="0" border="0" cellspacing="0" style="padding:0px;margin:0px;border:0px;background-color:#ffffff;width:' + width + 'px;overflow:hidden;">');
    document.write('<tr>');
    document.write('<td><a href="http://www.bygglo.se"><img src="http://www.bygglo.se/Images/Layout/ByggloOnYourSite3.gif" width="158" height="47" alt="Bygglo - Sökmotorn för byggsverige" border="0" style="margin:0px 5px 0px 5px;padding:0px;" /></a></td>');
    document.write('</tr>');
    
    document.write('<tr>');
    document.write('<td><table cellpadding="0" cellspacing="0" border="0" style="padding:0px;margin:0px;border:0px;"><tr>')
        document.write('<td style="padding:2px 0px 5px 5px;margin:0px;" align="right"><input type="text" id="querystring" name="querystring" value="' + name + '" style="font-size:11px;color:#000000;font-family:verdana, helvetica, arial, sans-serif; width:' + widthinput + 'px;border:1px solid #000000; height:18px" /></td>');
        document.write('<td style="padding:2px 5px 5px 0px;margin:0px;width:35px;" align="left"><input type="image" value="Sök" id="" src="http://www.bygglo.se/Images/Layout/searchButtonOnYourSite.gif" style="padding:0px;margin:0px;" /></td>');
    document.write('</td></tr></table></td>');
    document.write('</tr>');
    
    document.write('</table>');
    document.write('<input type="hidden" id="searchtype" name="searchtype" value="web" />');
    document.write('</form>');

}


function ByggloSearchAdv3(width, name) 
{
    if (width != null) 
    {
        if (typeof(width)=='number' && /^\d*$/.test(width.toString(10)))
        {
            //alert('ok');
        }
        else
            width = 200;
    } 
    else 
        width = 200;
    

    if (width <= 175)
    {
        widthinput = 150;
        width = 175;
    }
    
    if (width <= 200)
        widthinput = width - 50;
    else 
        widthinput = width - 50;

    if (name == null)
        name = '';

    document.write('<form action="http://www.bygglo.se/Search/" id="bygglo" method="get" style="padding:0px;margin:0px;" target="_blank">');
    document.write('<table cellpadding="0" border="0" cellspacing="0" style="padding:0px;margin:0px;border:0px;background-color:#ffffff;width:' + width + 'px;overflow:hidden;">');
    document.write('<tr>');
    document.write('<td><a href="http://www.bygglo.se"><img src="http://www.bygglo.se/Images/Layout/ByggloOnYourSite2.gif" width="165" height="24" alt="Bygglo - Sökmotorn för byggsverige" border="0" style="margin:0px 5px 0px 5px;padding:0px;" /></a></td>');
    document.write('</tr>');
   
    document.write('<tr>');
    document.write('<td><table cellpadding="0" cellspacing="0" border="0" style="padding:0px;margin:0px;border:0px;"><tr>')
        document.write('<td style="padding:1px 0px 5px 5px;margin:0px;" align="right"><input type="text" id="querystring" name="querystring" value="' + name + '" style="font-size:11px;color:#000000;font-family:verdana, helvetica, arial, sans-serif; width:' + widthinput + 'px;border:1px solid #000000; height:18px" /></td>');
        document.write('<td style="padding:1px 5px 5px 0px;margin:0px;width:35px;" align="left"><input type="image" value="Sök" id="" src="http://www.bygglo.se/Images/Layout/searchButtonOnYourSite.gif" style="padding:0px;margin:0px;" /></td>');
    document.write('</td></tr></table></td>');
    document.write('</tr>');
    
    document.write('</table>');
    document.write('<input type="hidden" id="searchtype" name="searchtype" value="web" />');
    document.write('</form>');

}