/**
 * @author Marian Pocan
 */




var kartika = { src: 'http://localhost/silensec/flash/testg.swf'
      ,ratios: [6, 1.41, 9, 1.35, 15, 1.29, 21, 1.25, 22, 1.22, 27, 1.24, 29, 1.21, 34, 1.22, 41, 1.21, 45, 1.2, 46, 1.21, 59, 1.2, 68, 1.19, 69, 1.2, 96, 1.19, 97, 1.18, 102, 1.19, 103, 1.18, 107, 1.19, 108, 1.18, 112, 1.19, 114, 1.18, 116, 1.19, 120, 1.18, 121, 1.19, 1.18]
 };

sIFR.activate(kartika);

sIFR.replace(kartika, {
  selector: '.menutext',
  onRelease: function() { var x=this.getAncestor();//alert($(x).attr("id"));
   },
  onRollOver :function() { var x=this.getAncestor();//alert("am intrat pe"+$(x).attr("id"));
   },
  onRollOut  :function() { var x=this.getAncestor();//alert("am iesit de pe"+$(x).attr("id"));
   },
  fitExactly :true,
  tuneWidth :'20',
  css: ['.sIFR-root { color: #000000;font-weight: bold;}'        
  ,'a { text-decoration: none; }'
        ,'a:link { color: #000000; }'
        ,'a:hover { color: #001343; }'],
  selectable: false
});

sIFR.replace(kartika, {
  selector: '.pictitle1',
  transparent:true, 
  tuneWidth :'20',
  opaque :true,
  css: ['.sIFR-root { color: #ffffff;font-weight: normal;font-style: normal;}','em { font-style: normal; color: #ff0000;font-weight: normal; }'],     
  selectable: false
});
sIFR.replace(kartika, {
  selector: '.pictitle2',
  transparent:true, 
  tuneWidth :'20',
  opaque :true,
  css: ['.sIFR-root { color: #ffffff;font-weight: normal;font-style: normal;}'],     
  selectable: false
});
sIFR.replace(kartika, {
  selector: '.pictitle3',
  transparent:true, 
  tuneWidth :'40',
  opaque :true,
  css: ['.sIFR-root { color: #ffffff;font-weight: normal;font-style: normal;text-indent:30;leading:-5;}','em { font-style: normal; color: #ffffff;font-weight: normal;margin-left:10px;}'],     
  selectable: false
});
sIFR.replace(kartika, {
  selector: '.pictitle4',
  transparent:true, 
  tuneWidth :'40',
  opaque :true,
  css: ['.sIFR-root { color: #ffffff;font-weight: normal;font-style: normal;text-indent:30;leading:-5;}','em { font-style: normal; color: #ffffff;font-weight: normal;margin-left:20px;}'],     
  selectable: false
});





$(document).ready(function(){
	
	

	$(".pic-container").hover(
      function (event) {
        $(this).find(".pic-content").stop().animate({marginTop: '0px',height:'318px'}, 300);
		return false;
      }, 
      function (event) {
        $(this).find(".pic-content").stop().animate({marginTop: '258px',height:'252px'}, 300);
		return false;
      }
    );


 })

 function URLEncode (clearString) {
  var output = '';
  var x = 0;
  clearString = clearString.toString();
  var regex = /(^[a-zA-Z0-9_.]*)/;
  while (x < clearString.length) {
    var match = regex.exec(clearString.substr(x));
    if (match != null && match.length > 1 && match[1] != '') {
    	output += match[1];
      x += match[1].length;
    } else {
      if (clearString[x] == ' ')
        output += '+';
      else {
        var charCode = clearString.charCodeAt(x);
        var hexVal = charCode.toString(16);
        output += '%' + ( hexVal.length < 2 ? '0' : '' ) + hexVal.toUpperCase();
      }
      x++;
    }
  }
  return output;
}


function URLDecode (encodedString) {
  var output = encodedString;
  var binVal, thisString;
  var myregexp = /(%[^%]{2})/;
  while ((match = myregexp.exec(output)) != null
             && match.length > 1
             && match[1] != '') {
    binVal = parseInt(match[1].substr(1),16);
    thisString = String.fromCharCode(binVal);
    output = output.replace(match[1], thisString);
  }
  return output;
} 