var urlLocation='http://softage.co.il';
var slidespeed=2000
//specify images
var slideimages=new Array("images/katalog/crop/year/24.jpg","images/katalog/crop/year/19.jpg","images/katalog/crop/year/34.jpg","images/katalog/album.jpg","images/katalog/blancet.jpg","images/katalog/25.jpg","images/katalog/crop/print/mzaim.jpg","images/katalog/tzyar.jpg","images/katalog/shirt.jpg","images/katalog/tic.JPG","images/katalog/1.jpg")

var newwindow=0 //open links in new window? 1=yes, 0=no
var imgSrc="";
var imageholder=new Array()
var ie=document.all
for (i=0;i<slideimages.length;i++){
imageholder[i]=new Image()
imageholder[i].src=slideimages[i]
}


function goTo(obj){

	if(obj) return;
	else
	document.location.href="index.htm";
}

function EnlargPic(url) {
 window.open('EnlargPic.asp?filename=http://softage.co.il/'+url,'PicWin','scrollbars=yes,location=no,status=no,height=400,width=400')
}
function gotoshow(){
if (newwindow)
window.open(slidelinks[whichlink])
else
window.location=slidelinks[whichlink]
}


function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v3.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}




var popUpWin = '';
var describeIt = '';
var picture = '';
var describeIt='';
function previewImg(obj)
{
	
	describeIt='www.softage.co.il';
	picture=obj.src;
	var tall = obj.height + 350 // adjust for spacing to border above and below picture
	var side = obj.width + 400 // adjust for spacing to border on sides of picture
	
	if (popUpWin && !popUpWin.closed) popUpWin.close();
		popUpWin = eval("window.open('doc.html','newWin','toolbar=0,scrollbars=no,statusbar=no,menubar=no,resizable=1,height="+tall+",width="+side+"')");
	if (!popUpWin.opener) popUpWin.opener = self;
	update()
}
function previewImgText(obj,text)
{
	if(text)
	describeIt=text;
	else describeIt='www.softage.co.il';
	picture=obj.src;
	var tall = obj.height + 500 // adjust for spacing to border above and below picture
	var side = obj.width + 700 // adjust for spacing to border on sides of picture
	
	if (popUpWin && !popUpWin.closed) popUpWin.close();
		popUpWin = eval("window.open('doc.html','newWin','toolbar=0,scrollbars=no,statusbar=no,menubar=no,resizable=1,height="+tall+",width="+side+"')");
	if (!popUpWin.opener) popUpWin.opener = self;
	update()
}


// **Modify this function to contain your content for the popup window.
function update() {
popUpWin.document.open();
// **content for the popup window is defined here.
popUpWin.document.write("<html lang=he ><head><title>softage view pic</title></head>");
popUpWin.document.write("<body bgColor=#005CC3 dir=rtl><center><strong><font size=+1 color=#ffffff>" + describeIt + "</strong><p>");
popUpWin.document.write("<img src=" + picture + "><br>");
popUpWin.document.write("<font size=-1 color=#ffffff>limor skital 0544258650&copy;</font><p>");
popUpWin.document.write("<a href='#' onClick='self.close()'  >");
popUpWin.document.write("close</a></center></body></html>");
popUpWin.document.close();
}


function showHide(id)
	{
		
		var oDiv = document.getElementById(id);
		oDiv.style.visibility=(oDiv.style.visibility=="visible"?"hidden":"visible");
		return;
		//alert(oDiv.style.visibility);
		if (oDiv)
		{
			if (oDiv.style.visibility  == "hidden")
			{
				oDiv.style.position  = "inline";
				oDiv.style.visibility  = "visible";
				
			}
			else
			{
				oDiv.style.visibility  = "hidden";
				oDiv.style.position  = "absolute";
			}
		}
	}
	
	var bookmarkurl="http://www.softage.co.il" 
	var bookmarktitle="softage-limor skital0544258650"
	function addbookmark(){
	if (document.all)
	window.external.AddFavorite(bookmarkurl,bookmarktitle)
	}

var results=''
var previouskey=''
var re=/(\/|\*|\+|-)/
var re2=/(\/|\*|\+|-){2}$/
var re3=/.+(\/|\*|\+|-).+/
var re4=/\d|\./
var re5=/^[^\/\*\+].+\d$/
var re6=/\./

function calculate(){
if (event.srcElement.tagName=="TD"){
if (event.srcElement.innerText.match(re4)&&previouskey=="=")
results=''
if (result.innerText.match(re3)&&event.srcElement.innerText.match(re)){
if (!results.match(re5)){
result.innerText="Error!"
return
}
results=eval(results)
if (results.toString().length>=12&&results.toString().match(re6))
results=results.toString().substring(0,12)
result.innerText=results
}

results+=event.srcElement.innerText
if (results.match(re2))
results=results.substring(0,results.length-2)+results.charAt(results.length-1)

result.innerText=results
}
}

function calculateresult(){
if (!results.match(re5)){
result.innerText="Error!"
return
}
results=eval(results)
if (results.toString().length>=12&&results.toString().match(re6))
results=results.toString().substring(0,12)
result.innerText=results
}


function pn(){
if (result.innerText.charAt(0)!='-')
result.innerText=results='-'+result.innerText
else if (result.innerText.charAt(0)=='-')
result.innerText=results=result.innerText*(-1)
}




var NS4 = (document.layers); // Which browser?
var IE4 = (document.all);

var win = window; // window to search.
var n = 0;

function findInPage(str) {

var txt, i, found;

if (str == "")
return false;

// Find next occurance of the given string on the page, wrap around to the
// start of the page if necessary.

if (NS4) {

// Look for match starting at the current point. If not found, rewind
// back to the first match.

if (!win.find(str))
while(win.find(str, false, true))
n++;
else
n++;

// If not found in either direction, give message.

if (n == 0)
alert("Not found.");
}

if (IE4) {
txt = win.document.body.createTextRange();

// Find the nth match from the top of the page.

for (i = 0; i <= n && (found = txt.findText(str)) != false; i++) {
txt.moveStart("character", 1);
txt.moveEnd("textedit");
}

// If found, mark it and scroll it into view.

if (found) {
txt.moveStart("character", -1);
txt.findText(str);
txt.select();
txt.scrollIntoView();
n++;
}

// Otherwise, start over at the top of the page and find first match.

else {
if (n > 0) {
n = 0;
findInPage(str);
}

// Not found anywhere, give message.

else
alert("Not found.");
}
}

return false;
}


function sortlist() {
var lb = document.getElementById('liste1');
arrTexts = new Array();

for(i=0; i<lb.length; i++)  {
  arrTexts[i] = lb.options[i].text+','+lb.options[i].value;
}

arrTexts.sort();

for(i=0; i<lb.length; i++)  {
  lb.options[i].text = arrTexts[i].split(',')[0];
lb.options[i].value = arrTexts[i].split(',')[1];
}
}
	