﻿/*tooltip.js*/
var OP = (navigator.userAgent.indexOf('Opera') != -1);
var IE = (navigator.userAgent.indexOf('MSIE') != -1 && !OP);
var GK = (navigator.userAgent.indexOf('Gecko') != -1);
var SA = (navigator.userAgent.indexOf('Safari') != -1);
var DOM = document.getElementById;

var tooltip = null;

function TOOLTIP() {
//----------------------------------------------------------------------------------------------------
// Configuration
//----------------------------------------------------------------------------------------------------
  this.width = 150;                     // width (pixels)
  this.bgColor = "#1f3255";             // background color
  this.textFont = "Arial";      // text font family
  this.textSize = 12;                   // text font size (pixels)
  this.textColor = "#FFFFFF";           // text color
  this.border = "1px solid #0c1b38";   // border (CSS spec: size style color, e.g. "1px solid #D00000")
  this.opacity = 80;                    // opacity (0 - 100); not supported by all browsers
  this.cursorDistance = 10;              // distance from mouse cursor (pixels)

  // don't change
  this.text = '';
  this.height = 0;
  this.obj = null;
  this.active = false;

//----------------------------------------------------------------------------------------------------
// Methods
//----------------------------------------------------------------------------------------------------
  this.create = function() {
    if(!this.obj) this.init();

    var s = (this.textFont ? 'font-family:' + this.textFont + '; ' : '') +
            (this.textSize ? 'font-size:' + this.textSize + 'px; ' : '') +
            (this.border ? 'border:' + this.border + '; ' : '') +
            ('padding:4px 4px; ') +
            (this.textColor ? 'color:' + this.textColor + '; ' : '');

    var t = '<table border=0 cellspacing=0 cellpadding=4 width=' + this.width + '><tr>' +
            '<td align=center' + (s ? ' style="' + s + '"' : '') + '>' + this.text +
            '</td></tr></table>';

    if(DOM || IE) this.obj.innerHTML = t;
    if(DOM) this.height = this.obj.offsetHeight;
    else if(IE) this.height = this.obj.style.pixelHeight;
    if(this.bgColor) this.obj.style.backgroundColor = this.bgColor;

    this.setOpacity();
    this.move();
    this.show();
  }

  this.init = function() {
    if(DOM) this.obj = document.getElementById('ToolTip');
    else if(IE) this.obj = document.all.ToolTip;
  }

  this.move = function() {
    var winX = getWinX() - (((GK && !SA) || OP) ? 17 : 0);
    var winY = getWinY() - (((GK && !SA) || OP) ? 17 : 0);
    var x = mouseX;
    var y = mouseY;

    if(x + this.width + this.cursorDistance > winX + getScrX())
      x -= this.width + this.cursorDistance;
    else x += this.cursorDistance;

    if(y + this.height + this.cursorDistance > winY + getScrY())
      y -= this.height;
    else y += this.cursorDistance;

    this.obj.style.left = x + 'px';
    this.obj.style.top = y + 'px';
  }

  this.show = function() {
    this.obj.style.zIndex = 69;
    this.active = true;
    this.obj.style.visibility = 'visible';
  }

  this.hide = function() {
    this.obj.style.zIndex = -1;
    this.active = false;
    this.obj.style.visibility = 'hidden';
  }

  this.setOpacity = function() {
    this.obj.style.opacity = this.opacity / 100;
    this.obj.style.MozOpacity = this.opacity / 100;
    this.obj.style.KhtmlOpacity = this.opacity / 100;
    this.obj.style.filter = 'alpha(opacity=' + this.opacity + ')';
  }
}

//----------------------------------------------------------------------------------------------------
// Global functions
//----------------------------------------------------------------------------------------------------
function getScrX() {
  var offset = 0;
  if(window.pageXOffset)
    offset = window.pageXOffset;
  else if(document.documentElement && document.documentElement.scrollLeft)
    offset = document.documentElement.scrollLeft;
  else if(document.body && document.body.scrollLeft)
    offset = document.body.scrollLeft;
  return offset;
}

function getScrY() {
  var offset = 0;
  if(window.pageYOffset)
    offset = window.pageYOffset;
  else if(document.documentElement && document.documentElement.scrollTop)
    offset = document.documentElement.scrollTop;
  else if(document.body && document.body.scrollTop)
    offset = document.body.scrollTop;
  return offset;
}

function getWinX() {
  var size = 0;
  if(window.innerWidth)
    size = window.innerWidth;
  else if(document.documentElement && document.documentElement.clientWidth)
    size = document.documentElement.clientWidth;
  else if(document.body && document.body.clientWidth)
    size = document.body.clientWidth;
  else size = screen.width;
  return size;
}

function getWinY() {
  var size = 0;
  if(window.innerHeight)
    size = window.innerHeight;
  else if(document.documentElement && document.documentElement.clientHeight)
    size = document.documentElement.clientHeight;
  else if(document.body && document.body.clientHeight)
    size = document.body.clientHeight;
  else size = screen.height;
  return size;
}

function getMouseXY(e) {
  if(e && e.pageX != null) {
    mouseX = e.pageX;
    mouseY = e.pageY;
  }
  else if(event && event.clientX != null) {
    mouseX = event.clientX + getScrX();
    mouseY = event.clientY + getScrY();
  }
  if(mouseX < 0) mouseX = 0;
  if(mouseY < 0) mouseY = 0;
  if(tooltip && tooltip.active) tooltip.move();
}

function toolTip(text, width, opacity) {
  if(text) {
    tooltip = new TOOLTIP();
    tooltip.text = text;
    if(width) tooltip.width = width;
    if(opacity) tooltip.opacity = opacity;
    tooltip.create();
  }
  else if(tooltip) tooltip.hide();
}

//----------------------------------------------------------------------------------------------------
// Build tooltip box
//----------------------------------------------------------------------------------------------------
document.write('<div id="ToolTip" style="position:absolute; visibility:hidden"></div>');

//----------------------------------------------------------------------------------------------------
// Event handlers
//----------------------------------------------------------------------------------------------------
var mouseX = mouseY = 0;
document.onmousemove = getMouseXY;
//----------------------------------------------------------------------------------------------------
/*pfl.js*/
var aPflinks = new Array(33);
aPflinks[0] = new Object;
aPflinks[0].sLink = "www.tie-rack.co.uk";
aPflinks[0].sID= "120";
aPflinks[1] = new Object;
aPflinks[1].sLink = "www.labelsprint.com";
aPflinks[1].sID= "122";
aPflinks[2] = new Object;
aPflinks[2].sLink = "www.orion-waste.co.uk";
aPflinks[2].sID= "108";
aPflinks[3] = new Object;
aPflinks[3].sLink = "www.gskdirect.co.uk";
aPflinks[3].sID= "121";
aPflinks[4] = new Object;
aPflinks[4].sLink = "www.lucozadeshop.com";
aPflinks[4].sID= "110";
aPflinks[5] = new Object;
aPflinks[5].sLink = "www.barloworldstore.co.uk";
aPflinks[5].sID= "114";
aPflinks[6] = new Object;
aPflinks[6].sLink = "www.helenslittleangels.co.uk";
aPflinks[6].sID= "117";
aPflinks[7] = new Object;
aPflinks[7].sLink = "www.twostore.co.uk";
aPflinks[7].sID= "119";
aPflinks[8] = new Object;
aPflinks[8].sLink = "www.omega-training.co.uk";
aPflinks[8].sID= "16";
aPflinks[9] = new Object;
aPflinks[9].sLink = "www.barefacedbeauty.co.uk";
aPflinks[9].sID= "45";
aPflinks[10] = new Object;
aPflinks[10].sLink = "www.flavourbarevents.com";
aPflinks[10].sID= "84";
aPflinks[11] = new Object;
aPflinks[11].sLink = "www.callingnow.co.uk";
aPflinks[11].sID= "116";
aPflinks[12] = new Object;
aPflinks[12].sLink = "www.hiccupgifts.co.uk";
aPflinks[12].sID= "44";
aPflinks[13] = new Object;
aPflinks[13].sLink = "www.yakult.co.uk";
aPflinks[13].sID= "74";
aPflinks[14] = new Object;
aPflinks[14].sLink = "www.hawkinsandscott.co.uk";
aPflinks[14].sID= "115";
aPflinks[15] = new Object;
aPflinks[15].sLink = "www.petersroofing.co.uk";
aPflinks[15].sID= "26";
aPflinks[16] = new Object;
aPflinks[16].sLink = "www.classiccarsglobal.com";
aPflinks[16].sID= "88";
aPflinks[17] = new Object;
aPflinks[17].sLink = "www.labelsfirst.com";
aPflinks[17].sID= "25";
aPflinks[18] = new Object;
aPflinks[18].sLink = "www.easyrentals.co.uk";
aPflinks[18].sID= "75";
aPflinks[19] = new Object;
aPflinks[19].sLink = "www.seojunkies.com";
aPflinks[19].sID= "14";
aPflinks[20] = new Object;
aPflinks[20].sLink = "www.serendipitydiamonds.co.uk";
aPflinks[20].sID= "33";
aPflinks[21] = new Object;
aPflinks[21].sLink = "www.withlove.com";
aPflinks[21].sID= "38";
aPflinks[22] = new Object;
aPflinks[22].sLink = "www.ppcjunkies.co.uk";
aPflinks[22].sID= "86";
aPflinks[23] = new Object;
aPflinks[23].sLink = "www.rax2go.com";
aPflinks[23].sID= "65";
aPflinks[24] = new Object;
aPflinks[24].sLink = "www.smsjunkies.co.uk";
aPflinks[24].sID= "80";
aPflinks[25] = new Object;
aPflinks[25].sLink = "www.emailjunkies.co.uk";
aPflinks[25].sID= "79";
aPflinks[26] = new Object;
aPflinks[26].sLink = "www.prskconsulting.co.uk";
aPflinks[26].sID= "76";
aPflinks[27] = new Object;
aPflinks[27].sLink = "www.speckledfrogtoys.co.uk";
aPflinks[27].sID= "73";
aPflinks[28] = new Object;
aPflinks[28].sLink = "www.wi5.com";
aPflinks[28].sID= "43";
aPflinks[29] = new Object;
aPflinks[29].sLink = "www.skiphireuk.co.uk";
aPflinks[29].sID= "34";
aPflinks[30] = new Object;
aPflinks[30].sLink = "www.homexchangevacation.com";
aPflinks[30].sID= "55";
aPflinks[31] = new Object;
aPflinks[31].sLink = "www.petaldolls.com";
aPflinks[31].sID= "40";
aPflinks[32] = new Object;
aPflinks[32].sLink = "www.sinkstapsandbeyond.com";
aPflinks[32].sID= "107";
/*misc.js*/
function change_to(xValue) {
  if (xValue != 0) {
	location.href = xValue;
  }
}

$(document).ready(function(){
	if (document.getElementById("bottBtm")){
		$("div#bottBtm a").click( function () {
			if ($(this).text().indexOf('Espandi') > -1) {
				$(this).text('\253 Nascondi');
				$(this).attr('title','\253 Nascondi');
				$('div.bottHidden').slideToggle('normal');
			} else {
				$(this).text('Espandi \273');
				$(this).attr('title','Espandi \273');
				$('div.bottHidden').slideToggle('normal');
			}
			return false;
		});
	}
	equalHeight($(".cntclmn"));

	var slideShow = $('.slideShow').slideShow({
		interval: 6
	});
	// now add logic to play/pause button
	$('.slideShow a.togglePlayback').click(function() {
		if (slideShow.isPlaying()) {
			$(this).css('backgroundPosition', '-44px -34px');
		} else {
			$(this).css('backgroundPosition', '-25px -34px');
		}
		slideShow.togglePlayback();
	});

    $(function() {
		if (document.getElementById("corpidenttbl")){
			$('#corpidenttbl a').lightBox();
		}
    });
	if (document.getElementById("clientslide")){
		$('#clientslide').cycle({
			fx: 'fade'
		});
	}
	
	//CONTENT STUFF
	$('.pdfbtn').hover(
	function () {
		$(this).attr("src","/images/design/multichannelpdf.gif"); 
	}, 
	function () {
		$(this).attr("src","/images/design/multichannelpdfactv.gif"); 
	}
	);

	if (document.getElementById("qckcallback")){

		$("#qckcallback .qckname").click( function () {
			if ($(this).val() == 'nome*') {
				$(this).val('');
			}
			return false;
		});
		$("#qckcallback .qckemail").click( function () {
			if ($(this).val() == 'email*') {
				$(this).val('');
			}
			return false;
		});
		$("#qckcallback .qckphone").click( function () {
			if ($(this).val() == 'phone*') {
				$(this).val('');
			}
			return false;
		});
		$("#qckcallback .qckenquiry").click( function () {
			if ($(this).val() == 'messaggio') {
				$(this).val('');
			}
			return false;
		});
		$("#qckcallback .qckcaptcha").click( function () {
			if ($(this).val() == 'codice*') {
				$(this).val('');
			}
			return false;
		});
	}
	
	
	var ojectas = document.getElementById("PortfolioCategoryID");
		if (ojectas != null) {
		filterportfolios(ojectas);
		}
	
});

function sdopen(img,id){
	var tmpel =  document.getElementById(id);
	if (tmpel.style.display=="none" || tmpel.style.display == ""){
		img.src = "/images/design/sidebarminus.gif"
		$("#"+id).animate({height: "toggle"}, 500);
	}else{
		img.src = "/images/design/sidebarplus.gif"
		$("#"+id).animate({height: "toggle"}, 500)			
	}
}
	
function equalHeight(group) {
   tallest = 0;
   group.each(function() {
      thisHeight = $(this).height();
      if(thisHeight > tallest) {
         tallest = thisHeight;
      }
   });
   group.height(tallest);
}


function openpfl (id){
for (i=0;i<aPflinks.length;i++){
	if (aPflinks[i].sID == id){
	window.open('http://'+aPflinks[i].sLink,'_blank')
	}
} 
}

function clrenquiry(txt){
	if (txt.innerHTML == "e.g. ecommerce solution"){
		txt.innerHTML = ""
	}
}

function ValidateCallback(form){
if (form.name.value=='') {alert('Per favore inserite il vostro nome'); form.name.focus(); return false}
if (form.phone.value=='') {alert('Per favore inserite il vostro numero di telefono'); form.phone.focus(); return false}
if (form.email.value=='') {alert('Per favore inserite l’indirizzo email'); form.email.focus(); return false}
if (!CheckEmail(form.email.value)) {alert('L’indirizzo email non è corretto'); form.email.focus(); return false}
if (form.enquiry.value=='') {alert('Per favore inserite la vostra richiesta'); form.enquiry.focus(); return false}
if (form.captcha.value=='') {alert('Per favore inserite il codice di sicurezza'); form.captcha.focus(); return false}
}

function ValidateQuickCallback(form){
	if (form.name.value=='' || form.name.value=='nome*') {alert('Per favore inserite il vostro nome'); form.name.focus(); return false}
	if (form.email.value=='' || form.email.value=='email*') {alert('Per favore inserite l’indirizzo email'); form.email.focus(); return false}
	if (!CheckEmail(form.email.value)) {alert('L’indirizzo email non è corretto'); form.email.focus(); return false}
	if (form.phone.value=='' || form.phone.value=='phone*') {alert('Per favore inserite il vostro numero di telefono'); form.phone.focus(); return false}
	if (form.enquiry.value=='' || form.enquiry.value=='messaggio') {alert('Per favore inserite la vostra richiesta'); form.enquiry.focus(); return false}
	if (form.captcha.value=='' || form.captcha.value=='codice*') {alert('Per favore inserite il codice di sicurezza'); form.captcha.focus(); return false}
}

function ValidateContact(form){
if (form.name.value=='') {alert('Per favore inserite il vostro nome'); form.name.focus(); return false}
if (form.companyname.value=='') {alert('Per favore inserite il nome della vostra azienda'); form.companyname.focus(); return false}
if (form.email.value=='') {alert('Per favore inserite l’indirizzo email'); form.email.focus(); return false}
if (!CheckEmail(form.email.value)) {alert('L’indirizzo email non è corretto'); form.email.focus(); return false}
if (form.telephone.value=='') {alert('Per favore inserite il vostro numero di telefono'); form.telephone.focus(); return false}
if (form.business.value=='') {alert('Per favore selezionate il tipo di attività'); form.business.focus(); return false}
if (form.howheard.value=='') {alert('Come ci avete trovato?'); form.howheard.focus(); return false}
if (form.ecommerce.checked == false && form.webdevelopment.checked == false && form.website.checked == false && form.multichannelecommerce.checked == false && form.ebaystoredesign.checked == false && form.webfulfilment.checked == false && form.other.checked == false && form.mcommerce.checked == false && form.internetmarketing.checked == false ) {alert('Per favore selezionate i servizi di vostro interesse?'); form.ecommerce.focus(); return false}
if (form.message.value=='') {alert('Per favore inserite un messaggio'); form.message.focus(); return false}
if (form.captcha.value=='') {alert('Per favore inserite il codice di sicurezza'); form.captcha.focus(); return false}
}

function articefrml(form){
if (form.firstname.value=='') {alert('Per favore inserite il vostro nome'); form.firstname.focus(); return false}
if (form.lastname.value=='') {alert('Per favore inserite il vostro nome'); form.lastname.focus(); return false}
if (form.email.value=='') {alert('Per favore inserite l’indirizzo email'); form.email.focus(); return false}
if (!CheckEmail(form.email.value)) {alert('L’indirizzo email non è corretto'); form.email.focus(); return false}
}

function CheckEmail(address) {
	if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(address)){
		return (true)
	}
		return (false)
}

function submitsearch(){
	document.fsearch.action='/search.asp?sq='+document.getElementById('search').value;
	document.fsearch.submit();
}

function searchOnSubmit(frm){
	var tmpstr = document.getElementById('search').value;
	tmpstr = tmpstr.replace(" ","_");
	frm.action = '/search.asp?sq='+tmpstr;
}
/*ajax.js*/
			var DivId;
			var status = true;
			var time = 0;
			var DepIDbefore = 0;
			var TabIDbefore = 1;
			var FirstGo = true;
			//var objektai = new Array();
			
			var tmpDivIds = new Array();
			
			function XmlHttp( ){
                this.CreateXmlHttpObject = CreateXmlHttpObject;
                this.GetUrlContent              = GetUrlContent;
                this.GetResponseText          = GetResponseText;
                this.GetReadyState              = GetReadyState;           
                this.HttpMethod = 'POST'; // default
                this.objXmlHttp = this.CreateXmlHttpObject();
            }

            // Initialize XMLHttpObject
            function CreateXmlHttpObject(){
                var xmlhttp=false;
                try {
                    xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
                } catch (e) {
                try {
                    xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
                } catch (E) {
                    xmlhttp = false;
                }
            }
       

            if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
                xmlhttp = new XMLHttpRequest();
            }
                return xmlhttp;
            }
            var objXMLHttp =  new XmlHttp();
                   
            function GetReadyState( ){
				return this.objXmlHttp.readyState;
            }
 
            function GetResponseText( ){
                return this.objXmlHttp.responseText;
            }

			function GetResponse(){
				if (objXMLHttp!=null && objXMLHttp.GetReadyState()==4) {
				var objDivIds = new Array();
					if (objXMLHttp.GetResponseText( )!=''){
						var i = 0;
						objDivIds = objXMLHttp.GetResponseText( ).split('||');
						
						for(i=0;i<objDivIds.length;i++) {
							document.getElementById(tmpDivIds[i]).innerHTML = objDivIds[i];
							if ((i>3)&&(i<8)) {
								if (objDivIds[i] != "0") {
									document.getElementById(tmpDivIds[i]).parentNode.style.display="block";
								} else {
									document.getElementById(tmpDivIds[i]).parentNode.style.display="none";
								}
							}
							if (i>7) {
								if (objDivIds[i].length > 0) {
									//child node 5 is question mark image. please change if html is modified
									if (document.getElementById(tmpDivIds[i]).parentNode.childNodes[5]){
									document.getElementById(tmpDivIds[i]).parentNode.childNodes[5].style.display="block";}
								} else {
									//child node 5 is question mark  image. please change if html is modified
									if (document.getElementById(tmpDivIds[i]).parentNode.childNodes[5]){
									document.getElementById(tmpDivIds[i]).parentNode.childNodes[5].style.display="none";
								}
								}
							}
						}
					}
				}		
			}					
 
            // Function performs Get request to absolute url(strUrl)
            // using XmlHttp object (asynchroni)
            // Response returned into objResult element using innerHTML.
            // When state of XmlHttp object is changed - objOnReadyStateChangeFunction called
			
			function GetUrlContent( strUrl, toSend ,objOnReadyStateChangeFunction,filename){
				if (objXMLHttp.HttpMethod == "GET") {
					this.objXmlHttp.open(this.HttpMethod, strUrl, true);
	                this.objXmlHttp.setRequestHeader('Content-Type', 'text/xml; charset=UTF-8');
				} else {
					this.objXmlHttp.open(this.HttpMethod, filename, true);
	                this.objXmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	                this.objXmlHttp.setRequestHeader("Content-length", strUrl.length);
	                this.objXmlHttp.setRequestHeader("Connection", "close");
	            }
				
				if(objOnReadyStateChangeFunction){
					this.objXmlHttp.onreadystatechange=function(){
						objOnReadyStateChangeFunction();
					}
				}
				this.objXmlHttp.send(strUrl);
				status = true;
			}
           
            //This function is called when we get the data back from the server.       
            function UpdateDiv(DivId, Page, filename, method ) {
				objXMLHttp.HttpMethod = method;
				if (FirstGo==false && objXMLHttp.GetReadyState()!=4){
					UpdateDivByTimeOut(DivId, Page, filename, method);
				} else {
					FirstGo = false;
					status = false;
						tmpDivIds = DivId.split(',');
						if( Page !='' ) {
							objXMLHttp.GetUrlContent( Page, null ,GetResponse, filename);							
						}
				}
				return true;
            }			
			
			function UpdateDivByTimeOut(a, b, c, d){
				if (FirstGo == true){
				UpdateDiv(a, b, c, d);
				} else {
					if(objXMLHttp.GetReadyState()!=4 && time<2001){
					//alert(time);
					time++;				
						if (time==2001){ alert("server is not answering, please try later");}
						setTimeout('UpdateDivByTimeOut("'+a+'", "'+b+'")', 100);
					}
					if(objXMLHttp.GetReadyState()==4 && time<2001){
						UpdateDiv(a, b, c, d);
					}
				}
			}
/*portfolio.js*/
var tabObjId = "ecommerce_tab";

function doOnLoad()
{
	var cookieValue = getCookie("tabCookie");
	if (cookieValue != "" || cookieValue != null)
	{
		if (cookieValue == "1")
			toggleTab(document.getElementById("ecommerce_tab"));
		if (cookieValue == "2")
			toggleTab(document.getElementById("website_design_tab"));
		if (cookieValue == "3")
			toggleTab(document.getElementById("ebay_store_tab"));
	}
}


function toggleTab(obj)
{
	tabObjId = obj.id;
	ecommerce = document.getElementById("ecommerce_design_portfolio");
	webDesign = document.getElementById("website_design_portfolio");
	ebayStore = document.getElementById("ebay_store_design");
	
	ecommerceTab = document.getElementById("ecommerce_tab");
	webdesignTab = document.getElementById("website_design_tab");
	ebaystoreTab = document.getElementById("ebay_store_tab");
	
	if (obj.id == "ecommerce_tab")
	{
		ecommerce.style.display = "block"
		webDesign.style.display = "none"
		ebayStore.style.display = "none"
		setCookie("tabCookie", 1)		
	}
	
	if (obj.id == "website_design_tab")
	{
	
		ecommerce.style.display = "none"
		webDesign.style.display = "block"
		ebayStore.style.display = "none"
		setCookie("tabCookie", 2)
	}
	
	if (obj.id == "ebay_store_tab")
	{
		ecommerce.style.display = "none"
		webDesign.style.display = "none"
		ebayStore.style.display = "block"
		setCookie("tabCookie", 3)
	}	
	
	var portfolioTabArray = getElementsByClassName("portfolio_tab_button")

	for (i = 0; i < portfolioTabArray.length; i++)
	{
		if (obj == portfolioTabArray[i])
		{
			portfolioTabArray[i].style.color = "#ffffff";
			portfolioTabArray[i].style.background = "url(/images/design/buttons/portfolio_hover.png) no-repeat";
		} else {
			portfolioTabArray[i].style.color = "#0f1d31";
			portfolioTabArray[i].style.background = "url(/images/design/buttons/portfolio.png) no-repeat";
		}
	}
}

function tabHover(obj) 
{
	if (obj.id != tabObjId)
	{
		obj.style.background = "url(/images/design/buttons/portfolio_hover.png) no-repeat";
		obj.style.color = "#ffffff"
	}
}

function tabOut(obj) 
{
	if (obj.id != tabObjId)
	{		
		obj.style.color = "#0f1d31"
		obj.style.background = "url(/images/design/buttons/portfolio.png) no-repeat";
	}
}

function getElementsByClassName(classname, node)  
{
    if(!node) node = document.getElementsByTagName("body")[0];
    var a = [];
    var re = new RegExp('\\b' + classname + '\\b');
    var els = node.getElementsByTagName("*");
    for(var i=0,j=els.length; i<j; i++)
        if(re.test(els[i].className))a.push(els[i]);
    return a;
}

function filterportfolios(sel) 
{
	
	var category;
	var divs = [];
	var cats, isCat;
	var Taitl;
	if(sel.options.selectedIndex == 0){
      //alert('Please choose an option');
      return false;
   }
   else{
	category = sel.options[sel.selectedIndex].value;
      
      divs = getElementsByClassName("portfoliosngl", document.getElementById("ebay_store_design"));
	  
	  for(var i=0; i<divs.length; i++)
        {
		Taitl = divs[i].title;
		cats = Taitl.split(",");
		isCat = false;
		for(var j=0; j<cats.length; j++)
			{
			if(category==cats[j]) {
				isCat = true;
			}
			}
		if(isCat) {
			divs[i].style.display = "";	
		}
		else {
			divs[i].style.display = "none";	
		}
		}
      
   } 
	return false;
}

function setCookie(c_name,value,exdays)
{
var exdate=new Date();
exdate.setTime(exdate.getTime()+(15*60*1000));
var c_value=escape(value) + "; expires="+exdate.toUTCString();
document.cookie=c_name + "=" + c_value;
}

function getCookie(c_name)
{
var i,x,y,ARRcookies=document.cookie.split(";");
for (i=0;i<ARRcookies.length;i++)
{
  x=ARRcookies[i].substr(0,ARRcookies[i].indexOf("="));
  y=ARRcookies[i].substr(ARRcookies[i].indexOf("=")+1);
  x=x.replace(/^\s+|\s+$/g,"");
  if (x==c_name)
    {
    return unescape(y);
    }
  }
}
